1

A question that gets asked a lot is "Why use low level languages if you can code in high level languages more easily (and often tersely)?". I think the answers are fairly straight forward here, being mainly efficiency concerns.

However, I pose "Why do we use high level languages in the first place?". Besides the fact that a higher level language is easier to code in and therefore less error prone, I would love to hear some opinions on why we use high level languages.

Consider especially an example of someone who is being paid to both learn a language and then develop something in it. Here they would become equally proficient in whichever language chosen (say C vs. Python). As such, why would I not favor the efficiency and power of C in said example?

8
  • 8
    Your assumption that learning C or Python from scratch would lead to equal proficiency in equal time is plainly wrong.
    – MetaFight
    Commented Jun 10, 2016 at 10:48
  • 6
    Short answer: optimizing for performance efficiency isn't always (read: rarely) what's needed nowadays. Optimizing for maintainability, on the hand, is very valuable.
    – MetaFight
    Commented Jun 10, 2016 at 10:49
  • @MetaFight That isn't necessarily an assumption here, I think your point goes without saying. I'm looking for interesting pros and cons like maintainability, so thank you for that! Commented Jun 10, 2016 at 11:15
  • @DanielWesleyPorteous: "easier to code in" means you will get more done in less time with fewer bugs and security issues. It is not just a question of being easier to learn - if you have similar levels of proficiency in C and Python, you will be much more productive in Python, unless you specifically have to develop super high performance systems.
    – JacquesB
    Commented Jun 10, 2016 at 11:58
  • 2
    "Besides the fact that a higher level language is easier to code in and therefore less error prone" -- so apart from being easier to learn, easier (and hence quicker) to write, and reducing error rates, what have the Romans ever done for us? Commented Jun 10, 2016 at 13:11

4 Answers 4

28

"Besides the fact that a higher level language is easier to code in and therefore less error prone"

I really think this is a good enough reason all by itself. If you have no compelling reason to work in a low level of abstraction (such as performance, knowledge in the team, etc), then there is no reason to do it. If all you want is a coffee, then you want to tell the barista "I want a coffee", not "I want you to take three steps to the left, stretch out your arms, pick up the beans, put the in the grinder, push the button to grind them [...]" and so on. It wouldn't make the final product any better (in fact, in some cases it'd make it worse since the barista is probably way better than you at making coffee).

High-level languages encourage you to think more about the problem domain and less about the execution platform. There is less ceremony, so you can spend more time on stuff that actually brings you value.

3
  • Marked as correct based on community response and the comment related to thinking more about the problem domain and less about the execution platform. Commented Jun 10, 2016 at 13:29
  • 1
    There is less ceremony Well... most of the time. Certain higher level languages seem to have an infatuation with ceremony and boilerplate, although even then, the consequences of not paying very close attention to that stuff are usually less severe than on lower level languages.
    – 8bittree
    Commented Jun 10, 2016 at 16:36
  • 3
    I love your barista analogy! Commented Jun 11, 2016 at 16:43
3

Money. Cheaper developers, faster development speeds, and less bugs equal more money.

Portability. Many high level languages allow you to target different platforms out of the box. Low level languages like C require significant efforts run on multiple platforms.

Training. You can train a developer in Python in a day, while something like C++ takes significantly longer.

Frameworks and Libraries Many good and useful libraries are only available for high level languages. If you don't want to write your own, you need to use a language that works with the framework.

Maintenance Fewer lines of code to maintain means fewer bugs, and faster training of new hires.

This answer assumes we're talking about the popular high level languages, where these points apply.

4
  • 4
    C runs out of the box on pretty much any platform. You might want to expand on that point a bit.
    – svick
    Commented Jun 10, 2016 at 12:21
  • 3
    @svick We seem to have very different definitions of "runs out of the box". If you have the C source code for a Windows application, and the compiled Windows binaries, there is a lot of work involved until you get compiled and bug free Linux binaries - if the codebase is large enough we are talking weeks if we're lucky. With many high level languages you copy the code or executable, write a single line in bash, and you're ready to test the program..
    – Peter
    Commented Jun 10, 2016 at 12:33
  • 1
    @svick There are compilers for pretty much any platform, but it doesn't mean the same code will easily compile (or behaves correctly!) on any platform. Commented Jun 10, 2016 at 12:39
  • 1
    @svick Things like handling file system paths in a uniform way, or unicode or 1 million other things would need explicit coding in C while are handled automatically by the virtual machine in high level languages. Sure C can be compiled everywhere but it provides almost no support for most tasks that are handled differently by different OSes.
    – Bakuriu
    Commented Jun 10, 2016 at 13:06
1

Higher lever languages are by definition easier to learn, they take away a lot of the complexities of lower level programming such as memory management. Besides that since the explosion of hardware power it is much cheaper to get a faster processor or more RAM into a machine that paying the developer hours that'd come with a more complex programming language.

9
  • 3
    Not sure I'd agree. It depends on what you mean by "learning a language". C for example, is a pretty simple language. Writing big complex programs in C is really hard though. A higher-level language like C# or haskell is more complex, because there is more syntax, more keywords, more language constructs, more magic under the hood (like garbage collection) and so on. It's arguably easier to write complex programs though (but it depends largely on the developer).
    – sara
    Commented Jun 10, 2016 at 10:50
  • 1
    Well, say harder to master if you prefer. There are a lot of gotchas on C that you won't have on a higher level languages, the coffee example you gave on your answer is quite fitting: you don't need to know how to properly roast and grind coffee to get a nice cup of coffe.
    – Zalomon
    Commented Jun 10, 2016 at 11:07
  • 1
    @kai Ease of learning isn't meant to be a factor in this discussion, consider two people who are fluent in the target language. Regardless I respect the point about the developer time spent, which even as an expert might be different between each language, even if that's not really the premise of the question :) Commented Jun 10, 2016 at 11:09
  • If we were talking about assembly I'd add that'd you also need to know how to plough the fields :)
    – Zalomon
    Commented Jun 10, 2016 at 11:09
  • If you only asking why an experienced programmer who's fluent in both a high and low level language I'd just say that is a matter of convinience, performance is not the critical point in most software right now, so better readability and faster development times are good enough reasong. Besides if you work on a project in which you need more hands, easier means that junior programmers can get more work done thus money is saved; it also means that more programmers know how to use a specific language or can get up to speed, so it's easier to find new hires.
    – Zalomon
    Commented Jun 10, 2016 at 11:18
0

A big thing to consider is that once a language is "settled" a lot of it comes set in stone. A lot of time and resources are spent making software in that language. And in a lot of cases, once software is done, it's done and only small maintenance remains to be done.

You can't sell: "hey you need to change all the software you made because we introduced modern feature x and y".

Just look at python: python 3 broke a lot of things that work in python 2. And because a lot of shops invested so heavily in python 2 they haven't made the switch. You may even consider python 3 a new language that looks a lot like python 2.

Look at the drama of backwards compatibility of visual basic, everything basically had to be rewritten, multiple times if you want to stay current.

Basically, if you want to "fix" your language of choice and, get rid of all the weak spots and introduce some strong features......your only option is to make a new language.

5
  • You mean kind of like how Sun took C and C++, and made Java?
    – user
    Commented Jun 10, 2016 at 13:27
  • @MichaelKjörling that's a good example. Basically Java is mandatory object oriented C++ programming with safeguards.
    – Pieter B
    Commented Jun 10, 2016 at 13:35
  • @MichaelKjörling: Java is based on Objective-C, not C++. Really, the only inspiration Naughton, Gosling, et al took from C++ is as a counter-example of what not to do. Java is Objective-C minus C plus types and since Objective-C is basically C plus Smalltalk, Objective-C minus C is Smalltalk, and thus Java is Smalltalk plus types. C++ doesn't enter the picture here. Gosling was also a Lisp programmer, so there are some influences there, and the JVM is based on Smalltalk VMs, Pascal P-Code, and the Burroughs B5000. Again, no C++ involved. Generics were designed by Martin Odersky and Phil … Commented Jun 12, 2016 at 11:41
  • … Wadler, two Haskell programmers, Wadler also being a co-designer of Haskell, and Odersky the designer of Pizza, Funnel, and most notably, Scala. Commented Jun 12, 2016 at 11:42
  • cs.gmu.edu/~sean/stuff/java-objc.html Commented Jun 12, 2016 at 11:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.