Home > Articles > Programming > .NET and Windows Programming >

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Close WindowDavid Chisnall

David Chisnall

Learn more…

Writing Insecure C, Part 1
Oct 10, 2008
iRex iLiad e-Reader: Linux's Answer to the Kindle?
Aug 29, 2008
How It Works: Filesystems
Jun 13, 2008
How the LLVM Compiler Infrastructure Works
May 23, 2008
How It Works: Virtual Memory
May 21, 2008
What Is C For?
May 16, 2008
The Future of eBooks
Apr 25, 2008
Imagining an Open Network
Apr 18, 2008
Understanding How Xen Approaches Device Drivers
Mar 21, 2008
Examining the Legendary HURD Kernel
Mar 14, 2008
Competition Among Open Source Compilers
Feb 1, 2008
Inside Your OS: What is a Process Scheduler, and How Does it Work?
Jan 25, 2008
Bad UI of the Week: Read This (OK/Cancel)
Jan 18, 2008
The End of the Desktop Era
Jan 11, 2008
The What and Why of Open IM
Dec 28, 2007
A Look at the Modern X Server
Dec 21, 2007
The Future of Digital Media
Dec 14, 2007
The Future of Identity
Dec 7, 2007
Bad UI of the Week: Ask Forgiveness, Not Permission
Nov 21, 2007
Copyright Versus Free Software
Nov 16, 2007
Is Computer Science Dying?
Nov 9, 2007
A Brief History of Programming, Part 2
Nov 2, 2007
A Brief History of Programming, Part 1
Oct 26, 2007
The 700MHz Question: Will the Wireless Spectrum Auction Lead to Innovation or More of the Same?
Sep 28, 2007
Bad UI of the Week: The Menu Bar
Aug 24, 2007
The Dark Corners of x86
Aug 17, 2007
Bad UI of the Week: The Cross-Platform User Interface
Aug 17, 2007
Bad UI of the Week: The Mythical "is Like" Operator
Aug 10, 2007
Bad UI of the Week: Don't Make Me Tell You Twice...
Aug 3, 2007
Bad UI of the Week: Kettles and Washing Machines
Jul 27, 2007
The BBC iPlayer Controversy Explained
Jul 20, 2007
Bad UI of the Week: The Mitten Mouse
Jul 20, 2007
Bad User Interface of the Week: File It Under “Bad”
Jul 13, 2007
Bad User Interface of the Week: The DVD
Jul 6, 2007
A Roundup of Free Operating Systems
Jun 22, 2007
DragonFly BSD: UNIX for Clusters?
Jun 15, 2007
CPU Wars, Part 3: Put Your Left ARM In
May 18, 2007
CPU Wars, Part 2: POWER to the People
May 11, 2007
CPU Wars, Part 1: When the Chips Are Down
May 4, 2007
ZFS Uncovered
Apr 6, 2007
Vector Programming with GCC
Mar 30, 2007
Free Software Versus Open Source Software
Mar 16, 2007
What Programming Languages Should You Know?
Mar 9, 2007
Standardizing UNIX
Feb 2, 2007
Prolog: Logic Programming for Rapid Development
Jan 26, 2007
POSIX Parallel Programming, Part 3: Threads
Jan 19, 2007
POSIX Parallel Programming, Part 2: Message Passing
Jan 12, 2007
POSIX Parallel Programming, Part 1
Jan 5, 2007
The Nokia 770 Revisited
Dec 29, 2006
The Open Source Desktop Myth
Dec 22, 2006
Separating Style and Content: LaTeX and Typesetting
Dec 1, 2006
GNUstep: A Free Software alternative to OpenStep
Nov 10, 2006
Behind the Scenes of Objective-C 2.0
Nov 3, 2006
The Future of CPUs: What's After Multi-Core?
Oct 27, 2006
What Makes a Good Programming Language?
Oct 20, 2006
Emulation: Role-Playing for Computers
Oct 13, 2006
NetBSD: Not Just for Toasters
Oct 6, 2006
POSIX Asynchronous I/O
Sep 22, 2006
Breaking Down GPL Version 3
Aug 18, 2006
The Role of Binary Drivers in a Free OS
Aug 4, 2006
Security Is a UI Problem
Jul 28, 2006
Debunking the Myth of High-level Languages
Jul 14, 2006
A Taste of Erlang, a Dynamic, Asynchronous Message-Passing Language
Jun 30, 2006
Alternatives to LAMP
Jun 2, 2006
BSD Packaging Systems
May 26, 2006
DRM: Digital Rights or Digital Restrictions?
May 4, 2006
Introducing OpenBSD 3.9
Apr 28, 2006
The Need for Virtualization and Xen
Mar 31, 2006
Making Effective Software TCO Calculations
Mar 24, 2006
10 Things I Hate About U(NIX) Revisited: Readers Speak
Mar 17, 2006
Comparing Open Source Licenses: GPL vs. BSDL
Feb 3, 2006
BSD: The Other Free UNIX Family
Jan 20, 2006
Measuring the Effectiveness of Application Security Policies
Jan 13, 2006
The Cost of Free Software
Dec 9, 2005
Nokia 770 Internet Tablet Week-long Test Drive
Nov 18, 2005
10 Things I Hate About (U)NIX
Nov 4, 2005
The Lure of Open Source Software: Why Consider It for Your Business?
Oct 14, 2005

Sorry, this author hasn't posted any blogs.

David Chisnall posits that the more programming languages you know, the better. The point is not to stuff your head with language rules. Rather, he explains how being able to read multiple languages, even if you never code in them, can help you to select the best possible tool for each coding need — and understand the limitations of the tools you're using.

Learning foreign languages helps to broaden your mind because some concepts are much better expressed in one language than another. German, for example, really has no word for "fluffy," although it does have words for "furry" and "fuzzy." Similarly, English has no elegant way of expressing the difference between libre and gratis in Spanish. Natural languages adopt concepts from each other over the years and tend toward the same expressive abilities.

Programming languages are different. A programming language may be defined by a specification, but is always limited by the abilities of the compilers and interpreters that execute it. If a particular language doesn’t support a given feature, you can’t just steal a few words from another language and use them, as you might with a natural language. While you can combine languages in a single project, you typically have to do this across well-defined interfaces, rather than by just stealing some syntax from one language and using it in another.

This kind of thing isn’t just an abstract problem. If you’re writing code that queries a database, you’re probably going to be using at least two languages. Because most general-purpose languages don’t have semantics that map clearly onto a database, you’ll need to embed something like SQL or XPath. Now, imagine that you want to express a transitive closure in your query. SQL isn’t expressive enough to implement a transitive closure (although some vendor-specific extensions permit this), so you might have to implement it by using a stored procedure in a third language.

The ability to use different languages when they suit the task at hand is a sign of a good coder. The more languages you learn, the easier it is to pick up a new one. Eventually, you start thinking of every new language as just a set of modifications to a language you know already. So what languages should you learn that will help you to quickly build up the set of basic concepts and let you pick up other languages easily? The rest of this article contains my answer to this question. Note that I’m not necessarily advocating using any of these languages for a real project, but I believe that learning them will make you a better programmer in whatever language you do use.

C: Portable Assembly

Whatever language you choose for writing code, eventually that code will be turned into a set of very simple machine instructions. These instructions will be executed more or less sequentially (superscalar architectures notwithstanding). A good programmer needs to be able to think at multiple levels of abstraction simultaneously, and the best way of accomplishing this goal for the lower levels is to use a language that closely mimics processor operation.

A decade or two ago, the most sensible way of achieving this objective would be by learning assembly language. These days, however, few processors actually execute machine language instructions directly, so a language like C isn’t much different in terms of abstractions. A modern x86 CPU, for example, typically has some hidden registers used for storing items on the stack, so the items that an assembly language programmer believes are stored in registers are not quite the same as those that the CPU actually stores.

Being one layer of abstraction higher than an assembly language, C has the advantage that it’s not tied to a particular CPU architecture. This faculty has helped C to gain widespread use; even if you never write a line of C code, you undoubtedly will have to read C code at some point or other.

On VMS, there was a well-defined ABI for all procedural languages, so it was trivial to call one from another. Microsoft Windows had COM, which allowed all languages to deal easily with objects from other languages (as long as both languages were C++), and now we have .NET, which does the same thing (as long as both languages are C#). In the UNIX world, the standard way of exporting an interface to a library is via C, irrespective of which language you’re using. For a program in language A, calling a function in a library written in language B almost always involves going via C.

  • Share ThisShare This
  • Your Account

Discussions

About the choices
Posted May 13, 2008 03:07 PM by dcsobral
0 Replies
Forth
Posted May 2, 2008 12:36 PM by locket
0 Replies

Make a New Comment

You must log in in order to post a comment.

Related Resources

Super Smelly Code
By Michael Galpin on October 5, 2008 No Comments

Spotting code that needs refactoring is half the battle ... or maybe a third. Martin Fowler's Refactoring gives a nice list of things to look (smell) for. One smells that was particularly familiar to me was Parallel Inheritance Hierarchies.

Who Shoud Refactor
By Michael Galpin on October 4, 2008 No Comments
Martin Fowler's Refactoring points out that framework builders often find themselves refactoring. Framework builders are surely the minority of programmers, even in Java. However, they are definitely not the only people who need to be refactoring. Pretty much everybody needs to refactor as a matter of course.

Refactoring and Performance
By Michael Galpin on October 4, 2008 No Comments
Refactoring is a book I've wanted to read for a long time, but never got around to until recently. I thought that I probably already knew the gist of everything I would read, thus it was not a priority. However, it did not take long for the text to surprise me and make me re-think some things that I have taken for granted.

See All Related Blogs

Informit Network