by nathandelane on Thu Jan 08, 2009 9:58 am
([msg=15742]see Re: Who Wants To Learn How To Program?[/msg])
Thank you all for your comments. I can see that there are many here who want to be more than just script kiddies. Of late, I have been made my company's newest Junior Programmer (junior because I have never programmed in a programmer position professionally), and I have been given the opportunity to study programmer at an even higher level, and to a higher degree than I ever have in the past. I am learning new things about programming that I sort of knew, but didn't know well enough that I knew it was more than good advice. For example, what is the object of programming in general? The object of programming is to simplify complex routines. For example, we write an operating system to simplify the way a computer works. In fact an operating system properly abstracts the underlying electronics and mechanical structures such that we don't even need to worry about how they work or what they do. All we must do is understand how the operating system works. Programming languages successfully abstract the need to know machine language. Because of programming languages, we don't need to study the opcodes for each and every processor out there, rather the programming language takes care of that for us. So when you're programming, or learning to program, keep in mind that you are trying to simplify a complex problem. If you are looking for a problem to solve, think about that as well. What is something that you could simplify by programming?
All other topics in programming are ancillary or point towards simplification. So if you write a program, and it is long and complicated, for example a program that runs everything out of the main method, then try to break it out into smaller routines and simplify them. If you have deep if-nesting, try to rearrange the if-statements such that deep nesting is not required. If you have recursion, make sure that you really need recursion, because recursion is one of the most likely places to be erroneous. If you have a large boolean statement in a single conditional, see if you can factor it out into a boolean function and call the function instead. Decreasing complexity or simplifying also should result in better readability of your program from a human standpoint. You should always strive for the best readability and the best maintainability.
These are a few of the many great things I have learned from programmers who are better than I am most recently. Many of them I learned from our software architect before he left, and in fact I enjoy conversing with software architects because of the insight that they seem to have in the realm of software engineering. I have also learned a lot from a book, that I am now going to plug, named [u]Code Complete[u] by Steve McConnell. I started out reading the first edition that I borrowed from the library, and then our lead software engineer gave me the second edition to borrow. It's basically the same book, the second edition is just updated for modern languages like Java, C# and Visual Basic .NET. If any of you are serious about learning how to program, then my advice would be to get this book, either from the library or your major bookseller. I know that Barnes and Noble and Borders both carry this book. Steve McConnell is one of the most celebrated programmers and teachers of programming at Microsoft, and don't let that turn you off, because if you do, then you don't understand software. After all Microsoft made it possible for us to use an OS on hundreds of different computers.