Wednesday, April 11, 2007

Programming: Where to Start as a Beginning Programmer

I was reading this article on OSNews and it got me thinking, where does a beginner go to start programming. There were lots of suggestions that I liked, such as Eifle, Python and a few others. However, I have a different path in mind.

I started programming in Pascal. I prefer Pascal as a starter language for a number of reasons. The biggest of which is its forced structure. Pascal forces you to declare variables before their use, it uses a more English like syntax than other languages such as C/C++ and Java, where a lot of symbols are used. Thats just a preference.

So what should a programmer study? What makes the foundation for a good programmer? Thats a fairly straight forward answer. I like to use SADO as a shorthand to describe this. SO what does that stand for?

S: Structure - under standing proper programming structure, and structured programming techniques. Understanding basic variables types would go here. Maybe introducing pointers as well would come a little later. Where variables are declared and how they are used. Good psuedo coding practices are also encouraged at this state.

A: Algorithms - Understanding basic algorithms and how to put them togeteher. Using programming constructus such as conditional logic, for loops, while loops, and moving on to more advanced algorithms such as sorts, searches, and so forth.

D: Data Structures - Understanding basic data structure techniques, like building records, linked lists, maps, arrays, vectors, and so forth are vital. This is combined with Algorithms.

O: Object Oriented Programming - I like to leave this as a last topic to cover in programming since a fundemental understanding in the previous 3 topics since objects are, in a way, an advanced data structure with functional components.

At some point after these basic principles are in place, moving on to lower level programming is highly recommended. What do I mean by that? Well, either working with languages that allow much lower level access to hardware, such as C/C++, or working directly with assembly or inline assembly. This gives a great introduction to how the internals of the modern PC work. (For this very reason, I really do miss the older DOS systems, which allowed direct access to hardware).

Once a programmer can visualize how to solve problems in their head, everything else is just syntax.

At this point in a programmers development, learning tools to assist development is highly recommended. With so much programming knowledge behind them, the first answer for everything is to write a program, often times forgetting that there are a lot of tools already out there. Need a budget, don't write a budget program, use a spreadsheet. Need to keep track of contacts, don't write a program, use a PIM, or a small desktop database. It is also highly recommended to learn some 3rd gen languages, scripting languages, and SQL. Learn command line scripting tools can assist you. Often times, a quick script and a some piping can solve problems more efficiently than a full blown program. I remember one programming challenge one time where the participant needed to make a socket request to a site, get the number that the site would respond with, and figure out some really complicated math operation, and respond with the answer within 3 seconds. Reading the newsgroups for this, people were trying to figure out how to use sockets. My solution was a little easier, a small C program to do the math, some pipes, and Netcat to handle the network connection. Its not that I couldn't do the socket, its just that there was already something out there that handled it for me.

And finally, keep reading. Lots and lots of reading.

I had tons of programming logic and design books that I started out with (unfourtuntly, most of which have since passed on, so their names escape me). These books were all in Pascal, then I moved on to C, C++, Asm, Java, and Visual Basic.

2 comments:

Anonymous said...

Hrmm, I'd disagree with your choie of initial programming language. I'd say a good initial language is ANY language that gets a persons interest ;) I've met many people who've learned a number of languages, but never had the interest in computers other than for money - I usually tell them to go do something else.

For me, I started with QBASIC during the DOS/Windows 3.X era. (Well, Apple IIgs earlier, but didn't do much with it). I still remember struggling with understanding how things worked, how a few lines could do things like the fibbonaci sequence or similar. Of course Pascal works well for beginnings as well (but qbasic was free and came with dos) Pascal was my first "official" language and worked ok for basic structure. I've seen beginning courses though in Java or other high level languages, which I disagree with. Java with it's memory management and entire system using OO methods, well, it doesn't allow you to explain concepts, learn memory management practices (yay malloc), etc.

One thing I'm curious about though - at what point do you start using an IDE? I've been programming many years, and I'm still a gnome-terminal, gvim, ant, and command line programmer. I've found that IDE's are often so over blown with things that I don't need or use, and the "editors" are often more hassle than they're worth. SO, at what point, do you need to use and learn an IDE? What are the advantages, etc?

Unknown said...

Hi,
I am Programmer with Chessboss.com. Chessboss.com is absolutely FREE chess server where you can play chess,create your own tournament with players online. No Gambling and explicit talk. This website is purely meant to increase the fan-base of chess and for entertainment. I Need your help to promote the FREE chess server around the world. I would like to be on your blog as i found it a useful and informative resource. By adding chessboss.com you will recognized and added as a top resource on our chess server. I really believe in FREE flow of information. I have included the code and title.

Please email me back with subject line of your URL for the featured resource code. This is to avoid spam and to make sure you get the award.

I hope you understand and co-operate with us.

Thank you,
Sophie Vierra
Programmer
www.chessboss.com.