Saturday, April 13, 2013

The C Programming Language

Should a beginning programmer learn the C programming language?  The C programming language is a great language and it is a fine choice for a first language.  But if your buddies in school are all coding in Java or Python, you might consider using the same language they are using.  If you want to join an open source project eventually, then you might pick as your first language the language used by the open source project of your choice. The open source chess playing software GNU Chess v5 was written in C, but the next version, GNU Chess v6 migrated parts of the code to C++.  The open source chess program called Fruit was written in C++.  Then you might find that many scholastic programming contests use Java for the programming contests.

I think it is best to learn C before learning C++.  So if you plan to eventually learn C++, then learning C first is an excellent idea.  C++ is used a lot in video game programming.

Many tools and programming languages are written in the C programming language.  The GTK widgit toolkit used for GUIs was written in the C programming language, as was the Linux operating system.  Parts of the Python language are written in C.  The Pidgin open source instant messaging client was written in C.  The Ruby programming language and the PHP scripting language were written in C.

Here are a couple of excellent blog posts about the C programming language:  Why I Chose to Learn C and The Unreasonable Effectiveness of C.  The former blog mentions this website for learning C:  Learn C The Hard Way.  Here is another website for learning to program in C:  http://www.cprogramming.com/.  The blog also mentions a new book on the C Programming language:  21st Century C: C Tips from the New School by Ben Klemens.  I had mentioned other books for learning C in a previous post:  Logic for Programming and Comments on C Programming.

The C programming language would be a fine language for a first language, but Python or Basic would also be fine.  Java is not my first choice for a beginners language, but I do notice it is used a lot in high school computer science classes.  I will mention that I use the C programming language to prototype algorithms and functions that eventually end up in C++ or Java projects.  Because C uses curly brackets to define a code block, functions in C can drop easily into C++ or Java because they too use curly brackets.  However, if you use Python to prototype functions, then you will have to go back through the code and add all the curly brackets because Python uses indentation to define code blocks.

I will observe that the C programming language is used now mostly by hard-core programmers writing tools.  Applications programming is done mostly in Java these days.

Robert

The previous post mentioning the C programming language is:
Logic for Programming and Comments on C Programming, October 22, 2012 (Monday)