Mostly self-taught however books and other resources do help along the process. There are many things you can figure out on your own and play with, however there are a few things which are better to learn from other resources (not necessarily a teacher though). Certain things you almost certainly need a book/reference and can't figure out all by yourself such as instructions and what they do in assembly languages.
Originally posted by TehMerkMods
Okay my question is
If they result in the same output does it matter?
Let's say you did something to count upto a hundred
regardless how the task was completed the output was still 100 right? so in theory it doesn't matter how "garbage" the code is.
I mean for effiency sure I'd take the compact code over the long annoying shit but yeah
Originally posted by Oneup
It does matter. It makes a huge difference. If you ever have someone look at your code they will expect to be able to follow it.
I can't think of how many times I've had people on here ask me to look at their code and it's just god awful. Not to mention they either don't comment their code or the comments they have don't make any sense.
People don't name their control and their variables aren't using meaningful names. Those make a huge difference when going back to debug / updating. If you have to spend an hour trying to figure out what is going on in the code you wrote, you are doing some thing wrong.
It's even worse when you have to go through old code from a past employee and they did all of the above. You end up spending less time just re-writing it than going through the rats nest that they wrote.
If you count to 100 and it takes your code 1 minute to do it vs other code that handles it in 30 seconds, that's a huge difference.
Yep, not only does the code need to be efficient but even more-so well documented, clean, and easy to follow. To be honest I've noticed a lot (including myself a while back) create useless comments that state the how rather than what they're meant for, the why. Anyone else who may think this isn't true doesn't understand industry, they don't just want code that works they want code that can be maintained, and so should you as a programmer.
Say for example you wrote a program about a year ago and want to go back through it / work on it, you'll even probably ask yourself "what the hell did I do this for", that's why documentation and maintaining readable code is important, not just for others but also yourself.