One thing that I keep being surprised at is the number of basic programming articles I keep seeing available. I would have thought that if someone has not yet gotten the message that global variables are naughty, they never will. Likewise for SQL injection attacks, cross site scripting vulnerabilities, validating user input, following a variable naming scheme (not even which one, just "follow one!"), and so on. I would almost think that these writers are just looking to milk this dead horse for hits or filler content, except that in the Real World I see "experienced programmers" making these types of Mickey Mouse mistakes all of the type (not to disparage the character or Mickey Mouse by comparing him to unvalidated user input).
What I find interesting about the whole situation is that these articles are almost always in a particular context. An article about writing Web applications in ASP.NET might mention that it is best to always use parameters in a SQL query to prevent SQL injection attacks. Or an article about Perl might just mention the problems with global variables. And so on.
I cannot recall ever once seeing a "basic programming theory" book on the shelf of a bookstore. I found a few on Amazon that did not seem related to a particular language. Oh, sure, you will see tons of "learn to program" books that get your feet wet in a particular language. Some of these are aimed at developers who just want to start learning a new language, and others are oriented towards teaching someone the basics of programming, using a particular language. But where does the still "potential" programmer go from there? Alternatively, what prepared them for that?
Code Complete by Steve McConnell probably has more language neutral fundamentals in it than any other collection of writings that I have read. But it is hardly suitable for a new programmer. For one thing, the examples are in a variety of different languages; while the point is obvious to an experienced coder, it is a bit too much for a newcomer to programming. It also refers to way too many things that new programmers do not know anything about.
Ironically enough, many of the items I listed in the first paragraph are not really "language neutral," but they are issues in 99% of the languages in common usage. Sure, SQL injection applies only to applications that use a SQL backend, but that sure is a lot of applications! But as a rule, a book that simply takes the reader through basic fundamentals in a language neutral way, either as a preparation for learning a first language or as a follow up to learning the first language, just does not seem to exist, at least in a mass market format. I think it should! Where is the O'Reilly or Wrox Press Basic Programming book (the O'Reilly one could have a larva on the cover).
Granted, such a book might be too short to be an actual book; it might be better for it to be a Web site. But still, where are the "back to the basics" sources for new programmers? I think maybe some better education in the early years, months, weeks, and days will go a long way towards providing a better crop of programmers in the future. I am not even looking for in-depth, hard Computer Science. I just want to see something with basic, "best practices." I want to see something so universal that it could practically function as a checklist that a good compiler plus a good code reviewer will catch.
The world of programming is getting more and more complex. Just try to figure out where to start if you want to learn Java if you do not believe me. I could not imagine learning to program by being handed a copy of Visual Studio Express or Eclipse; just learning to use the tools takes an experience programmer some time. When I learned to program, the only tool I needed were the BASIC interpreter command, vi, and three basic vi commands (open, save, exit). Modern applications are much more complex, not less complex. To combat the complexity, the programmer learns a million and one frameworks and libraries, each one promising to resolve the problems that the COBOL and C programmers twenty years ago just did not have. Batch processing a fixed width text file and generating a new fixed width text file as output is a far cry from a modern Web app, where a simple "Open link in new window" can cause a massive problem in the backend.
As a result, the fundamentals are more and more ignored as schools and books race to cram everything someone needs to be a programmer into 400 pages or 8 short semesters — and the quality is suffering as a result. If anyone knows of such a book, I would love to hear about it.
Justin James is an OutSystems MVP, architect, and developer with expertise in SaaS applications and enterprise applications.