Core S2 Software Solutions

The Importance of Learning the Correct First Language

Older article from Lost in Dev; originally written by Jeremy Bridon.

Computer Science is being taught at a higher rate in American Public High Schools. What is great is that this once rare subject is now becoming relatively common – yet many still struggle with certain basic programming concepts, even at higher levels of education. Why is it that, even with an earlier exposer to programming, many people still struggle with the basics of program flow and design? Apart from the fact some people might be predisposed to think in a way that helps programming (as with any other subjects – I’m sure you know a friend who is naturally good at math or music), I believe it has more to do with the first language you learn, which imprints certain patterns into your mind, rather than many other factors!

The most common programming languages taught in schools before college seems to be either Java or Visual Basic. Both are great it terms of teaching you basic logic control logic such as if/else statements and loops. The fact is I rarely see people struggle with these kind of constructs, apart from correct syntax (a non-issue resolved by more practice). What people seem to struggle with is pointers and memory allocation concepts. The idea of real-time allocation or variable/array addresses is completely hidden in Java as well as in Visual Basic. This can be a blessing to many professional developers who focus on business logic, yet if this is your first programming language you are learning – It might be the greatest curse of your educational process!

I believe standard C is the perfect balance between common logical programming language concepts as well as advanced low-level ideas – Thus learning C as your first language is more beneficial than any other language. Instead of hiding these difficult ideas, they should be embraced, at least before another language teaches you higher-level topics. Java and VB will not teach you bad habits, as their power is in the fact they hide such low-level features, but as a first language it is important to get your feet wet. If you learn those languages first, and then become introduced to the idea of memory management, you might not be able to understand both the power of such access as well as the benefits since the idea of managed memory seems much more ‘natural’. Ultimately, the idea of learning C first is to teach you the pros and cons of managed and unmanaged languages, as well as how a program works at a low-level.

The idea here is to realize learning how an engine works first is more important than choosing off-the-shelf pieces and throwing them together. There is nothing wrong with the later, but it can become challenging when the day comes where you must learn how things actually work. How do you think the VB and Java work? They clearly have some kind of real-time C-base code.

The only problem with teaching C first is that you may disappoint the student, showing that many lines of code are needed to do simple functions. There is no easy way to write a video game, or draw lines, or even play music in C. Java, on the other hand, can do this list in less than 100 lines of code. Teach and learn pure C first, if only for a few hours, to imprint on new programmers the basics of functions, language structure, data structures, memory management, what compiling and running a process means, and more. Only then should other languages be picked up, even if the concept of pointers doesn’t exist, to keep new programmers interested in programming.

This entry was posted in News & Updates. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Sites map