Tough love: the programmer love-hate relationship with her languages

The Design and Evolution of C++For the first time since the wedding I was away from my husband, we were both visiting our family for Easter. He wasn’t there to “brainwash” me about his project, but convinced me a few days before leaving to read The Design and Evolution of C++ by Bjarne Stroustrup.

The motivations behind C++

I’m just starting chapter 2 (which is the third one, the first being chapter 0 of course). I found out that the motivations to create C++ were founded on this love-hate relationship he had with Simula, BCPL and others. Even though he doesn’t want to compare his creation to other modern languages, he doesn’t hesitate to criticize vigorously those he used before. Here are some excerpts: Pascal gets no love, but it isn’t clear about the others.

“I had found Pascal’s type system to be worse than useless – a straitjacket that caused more problems than it solve by forcing me to warp my design to suit an implementation-oriented artifact.
The feature of Simula were almost ideal for the purpose, and I was particularly impressed by the way the concepts of the language helped me think about the problems in my application
The implementation of Simula, however, did not scale the same way. As a result, the project came close to a disaster. My conclusion at that time was that the Simula implementation (…) was inherently unsuitable for larger programs. Link time for seperatly compiled classes was abysmal (…).

BCPL makes C look like a very high-level language and provide absolutely no type checking or run-type support.
I swore never again to attack a problem with tools as unsuitable as those I had suffered (…).”

Different state of mind, different languages

Some languages, like lisp, are creation of design and purity. These are interesting for the intellectual stimulation, but rare are the people that use them in real life (or happy to do so). Like a nice, but small, canvas in which you can only express a part of yourself. After all, lisp was design to express mathematical concepts and not to communicate with a machine.

There are also the “design by comity” languages. Composed by a team of designer, based on compromise, the result is a hybrid between different style. Having keyword for mostly anything is a big sign of design by comity because it is easy solution for a group of people to agree on. Usually the result can do a wide range of things but doesn’t perform well in any of it. COBOL and ADA are two examples, I don’t know anyone who have a really positive opinion about those.

I have the feeling that real life experiences forge language design oriented toward well… real life. When you have to face a wide variety of problems, went to the limits of your favorite languages, you develop a devoted love for the good things, and a growing frustration for those itches, especially if you have an idea on how to fix them. Programming language designers that falls in this category tend to create stuff people are more inclined to use (or love using).toughlove

My own love story

Under my last post, my friend Michel‘s comment was right. I am very harsh against garbage collection, and virtually everything counter performing. This is probably a professional deformation. After a few years coding with performance as a priority, it’s hard to quit. In fact I don’t want to quit, this has made me a better programmer.

My first serious experience with code was with C++. It wasn’t an easy gal, took a while to master the basic concepts. What really hook me up was the wide range of possibilities. I had frustration with the sometime non-intuitive ambiguous syntax, with the compiler’s bugs and performance, with ugly Microsoft stuff like MFC or COM; but I never felt limited in anyway. Controls, physic simulation, graphic, AI, photo processing; I went deep down many of those and the only limitation was the time I had to code. Would it have been easier to use, I would probably spend more time thinking, less time coding. But I still prefer flexibility and control over ease of use.

I loved my experience with Java when I was at university, easy to learn, quick to make simple stuff. But when I got into more serious programming, it couldn’t match my needs. I had outgrown the language. Mostly the problem was performance and control. But I also had some design interrogation, for example: why do I have to make a class even when it’s not the right design?

I always had a passion for assembly and down to the metal languages. You totally have the right to judge me crazy on this. I’m not sure why I love them so much. I agree with their reputation, hard to master and it takes a lot of time to do something with it, no matter how simple. They are extremely non-portable, hence I learned a few: x86, Motorola 680×0, but my favourite was VHDL. Programming directly the controller behaviour, managing directly the electric current, how much closer can a programmer get to the machine? You know you are low level when you have to manage the impact of the laws of physics on your program. While doing this slow pace programming, I developed an unconditionals love for the machine and its complexity. I now must reassure you, my husband is not as crazy as I am!

Impact on the C3 design

My huband programmer love story with C++ went a lot farther than me, metaprogramming with templates and stuff like that. The C3 design doesn’t compromise on performance for the exact same reasons that Stroustrup had when building C++. Similar background, similar conclusions.

Having multiple paradigms is probably the only way to allow programmers to fully express themselves. Like he said, each paradigm has its part to play, but it is their combination that really make thing lift off. Supporting a wide range of styles doesn’t have to make programming difficult. Nice design, behavior that default the correct way (that can get overridden should you need), simple and clean syntax: many elements that can give birth to something as easy as java to use (even easier), but as powerful as C++. Although, easy on the user side doesn’t mean easy in the compiler implementation.

Easy for me to say all this, nothing of this truly exists yet. But when we talk about it (everyday, even in bed before sleeping), I feel he thought of everything, now polishing on aspects I wouldn’t have imagined. I’m not usually easy to impress, I challenge him on every aspect I learn about. I hope this will help improve things. Unlimited passion… all this because we love and hate our programming languages. I feel my relation with C3 is going to be a wild one!

7 thoughts on “Tough love: the programmer love-hate relationship with her languages

  1. One of my college teachers had a saying about COBOL and i’ve expanded on it over the years:

    COBOL is like poetry because:
    – It looks easy to write but actually isn’t.
    – Everyone think they know what a few particular lines mean but they don’t.

    Same teacher taught me to reconstruct files by reading the FAT table using only to push ASM instructions into memory.

    Who would argue with a guy like that? 🙂

  2. When you speak about performance, it seems you’re always thinking about realtime-like performance. There are other aspects to performance though.

    Sometime you want to be realtime by minimizing interruptions. At other times you want maximum average throughput (long calculations, or non-realtime simulation) where you don’t care about interruptions as long as they’re helping you get the final result faster. Or you may search for maximum peak throughput (a web server replying to a request, or the handling of a user interface event), in which case it may be advantageous to delay some cleanup work to after the event has been handled.

  3. @c3friend I would really like to meet that men! Seems like a clever one!

    @Michel Fortin: I don’t think I have specified a type of performance anywhere. Performance is mostly a thing of control because you need different behaviour for different situations. Like you said, there is different ways to manage performance, you may even want to combine some of those methods inside the same application. In C3 he wants to make everything possible, with a default behavior to be optimal for most applications. My main problem with java is not the quality of the garbage collector, it’s that you cannot choose to do something else.

  4. You’re right c3wife. I probably inferred something I shouldn’t about your post and made my comment a little too confrontational. Sorry about that.

    About having the choice between various memory management techniques, that’s a good idea. And apparently you’re not alone to think so: Andrei Alexandrescu is pushing for the next version of the D programming language to go in a similar direction for its next version too. (Here’s where this discussion started.) Perhaps something to follow.

  5. @Michel There is absolutely no problem reacting this way, in some way it proves my point. Programming language is a very sensible thing, and when I argument against them, I am bound to hurt someone’s feeling (because of the love part of the deal!)

    My Husband has been interested in Andrei Alexandrescu’s work for a long time, long before he join the D effort. I guess he will read that with great interest.

Leave a Reply to Michel Fortin Cancel reply

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