Search This Blog

Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Monday, July 23, 2012

Reading in CODE

I have mentioned before things that will make you a better coder and this is just another tip on what you can do to improve your coding abilities.

There are many websites out there that have some really advanced coding, stuff that can make you feel like you have no idea what you are getting yourself into (trust me I know the feeling) and half the time when you view the source for the site you get lost and end up convincing yourself that you suck.

Recently I have noticed that coding and performing things that is unusual is actually not that hard. Reading the source code can be difficult sometimes but there is a reason why it is difficult and here are some of those possible reasons.

  1. You don't know the language they are using
  2. It looks so cluttered it frightens you away
  3. There are multiple sources
  4. Finally, there are hundreds of classes, ID's, NAMES, Tags, functions, variables, etc.
I'm going to take you step by step and hopefully help you guys out so you can read these source codes and learn a bit more about coding.

1. You don't know the language they are using
This one is simple but not easy or fun but if you really want to understand what they are doing with this mysterious language you must first learn what the language is by just Google searching one of the tag names or something you see commonly used in the source. 
Second you must become familiar with the Syntax in order to understand anything that is going on. This one may be the hardest only because it's a whole new language that you have to master in order to perform something you like on the website


2. It looks so cluttered it frightens you away.
When I first saw Javascript it looked like this 

Which nearly scared me away thinking "How the hell am I going to ever be able to understand this!?" Well the truth is that I really had to concentrate on the code itself and not the code as a whole. It would take hours to understand but if you go through it you can see little things that link together and it makes complete sense after a while. You still need to know the Syntax first!

What you can do to make it easier for you is to copy the code into a text pad like Notepad++ , set the language to Javascript (or whatever language you are having trouble with) and it will highlight and color the text differently which will make it easier to see what connects with what.

3. There are multiple sources.
Honestly I hate going through sources and seeing there are 20 different Javascript files, and 10 different Style Sheets, not to mention the 4 ASP and PHP files! It can really drive a guy mad... Now I'm not saying it's not useful when making a website just a pain in the butt when reading the source. 

The best way to get through it is to copy the codes into Notepad++ and connect the files together yourself, this way you see which files are being used where and why. I know it will take forever but no one said programming and developing was easy. Another thing you can do is open all the sources and read them, when you see something called from another source just read where it's calling from and what it's supposed to be doing. This has got to be the most tedious thing about learning new things in programming.

4.Finally, there are hundreds of classes, ID's, NAMES, Tags, functions, variables, etc.
Even though it's not always necessary people prefer to have a class just for the height of a div to be 200px and another class for it's width, another for it's position, and so on.

This really sucks for the reader because you have to go back and read what each class is doing for each element, however, although this is very difficult to read I do find it easier to code through classes rather than through individual ID's and when using Variables it's easier to have a variable for every aspect of the element or function than to rewrite everything. 
Again, using Notepad++ to read each class, element, tag, variable, function, etc. 

---------------------------------------------------------------------------------------
Open Source is the not only the best way to go but the only way! I know there are a lot of people out there that want to steal the code and gain profit from it for themselves but that's why you use different sources for one code, you have multiple classes, variable, tags, etc, and that's why make the entire thing cluttered which makes it hard for those thieves to steal the code. This makes it hard to everyone but is still considered open source. 

Thanks for all the love guys don't forget to subscribe, check out the Youtube, Facebook, and Twitter @DLCSpencer

Love you guys check back soon for more updates and videos!

Monday, July 16, 2012

Best Coding Languages to Know

Languages both for programming and for web development are all necessary and are at the same time awesome. But which ones are the ones you should learn first? What order should you learn them to effectively become an awesome developer? Well here we go this list will help everyone know which language to learn when.


1. HTML (Hyper Text Markup Language)
This is the very first language you should learn in order to build websites and it the most common and most demanded. If you go into an interview for building websites but you don't know HTML you will never get the job. With the creation of HTML5 we are seeing things like Canvas which can be used to draw images using code.


2. CSS (Cascading Style Sheet)
This is the best way to style your websites to give the specific flare required to make a website look awesome and keep your viewers interested. It can also add hover effects and is now able to create animations with CSS3 this will make any website look much more professional.



3. PHP (Hypertext Preprocessor)
Originally made for building websites but can be used for gathering info from the user, generating dynamic content, and sending/receiving cookies. (I personally am learning this still but haven't needed it enough to get the entire language memorized.) This will be useful for everyone who wants to have a user based website or wants to have form information received and stored into the server


4. Javascript
An amazing language that is used for dynamic content. I suggest learning this language before any programming language because it's a nice introduction to the programming side of coding. Containing variables, functions, if/else statements, while statements, and more, Javascript makes nearly anything possible with web development. 


5. Java
After learning Javascript you learn quickly the syntax needed to create Java programs. Java and Javascript are two different languages but have similar syntax which means you will learn quickly. Java is a powerful programming language that could be used for created nearly any type of program and is one of the most requested languages for programmers, why? because it can be used on nearly every single device so long as it jas Java downloaded onto it.


6. C++
This is another programming language that is used solely on it's own. This language can do anything you need it to so long as you understand the syntax. One of the most powerful languages you will ever learn. It is an update to C which is also very powerful. Learning both is smart but C++ is much more commonly used not to mention it's very fast.


7. Actionscript (used in Adobe Flash)
I know that most people learn this language earlier on and the only reason I'm putting it last is because you have to pay for it and it is much less practical to the common programmer just starting out without the ability to pay for a powerful program such as flash.
However with that aside this language is very powerful and can create some of the coolest effects you will see in coding because it is rooted into Flash.


Thanks for reading guys be sure to check back every week for new blogs and videos if you have anything you think I should go over feel free to post it in the comments.

Saturday, June 23, 2012

Text Based Games

So lately I have been trying to master Javascript which a lot of people would say is not a hard language to master which is true I've been working on this language for about six months stop and go but the last couple of weeks have been nonstop which is good because I am working on making my first Text Based Game through Javascript and CSS


The game is a zombie game but I don't have a website that I could upload it to. I would like to create a bunch of games eventually and maybe host some from other creators but I really need a website so that I may host it. So go hit those shirts guys click that donate button all the cool kids are doing it! 




Anyway about the game, I have seen some text based games where you choose an option A or B and one will lead you to victory and the other will lead to death, my game on the other hand will be much more complicated because you can die but not just by choosing an option but you actually have a health bar, you have weapons to choose from, bandages to heal yourself when needed, and loads of zombies to fight that have different classes. 
There will be many routes in the story to choose from and they all lead to the epic ending but who you are and how you got there will all depend on the choices you made.
It is a turn based game which means you decide if you are going to heal yourself this turn or attack this turn, you will need a strategy. 


This game is not going to come out for a while but if you guys donate I could make this game even better and have much better features because right now I am limited on what I can do with this game, I can't have a user login, save game, or even post scores at the end. These are all things I would love to add to the game but right now it's just not practical.


I'm open for ideas so let me know what you guys think and maybe post some tips on how I could do certain things for the game.


Remember if you donate or buy a shirt it will really help with the production of this game =]

Friday, June 8, 2012

CSS - Making Links Stand Out

CSS is an amazing language and is mostly used for changing the style of content, mixing design with coding to create an easy way to make things look pleasing to your viewers.

In this case I am using CSS to change the style of my links.

The link below is an example of what we will be doing which is very simple, having the dashed border at the bottom become solid while hovering with the mouse.
HOVER HERE

First we use a style sheet by writing out

<style type="text/css">

and closing it using

</style>

In between the style tags is where we will put our code for this project.

First we need to design on a class name for the link. The Class of the link is what connects the link to the CSS in the stylesheet.

It can be any name you like, some say you can use numbers for the class name but what I have found personally is that using letters always works while numbers work on some browsers in some cases but are not reliable. I decided to give this class name something simple and easy to remember.

"foo"

so to use this class name we write out

a.foo

This tells the style sheet that it is a link and gives the class name "foo" Now you can write the style you want within it.

a.foo{font-family:arial; text-decoration:none; border-bottom:1px dashed #000000;}

This gives our link the style before you hover the mouse over it so now its time for the hover factor which is very simple

a.foo:hover{font-family:arial; text-decoration:none; border-bottom:1px solid #000000;}

Just ad this code right after the first code and your link should work perfectly. If you are having trouble I often find that it's best to remember the basics and to check your brackets, always make sure your tags are closed or nothing will work.

This is great and all but what about something more advanced? Something that really says "Hey look at me!"

Unfortunately because I am using Blogger I am not able to show you more in depth of what you can do with CSS links using images as of now.

If you want to help out click the donate button to send even a few cents I don't mind how much but anything helps. Once I reach $100 I can have a website of my own to build from and create so be sure to donate when you can if you can it will be greatly appreciated! =]