“But why do I have to learn Python?” She wailed, “I like Scratch!”
“I know,” I said, “But there are different programming languages for different sorts of tasks.”
“That’s stupid” she said
I can empathize with the little girl in Terence Eden’s story. In high school, I got super into Turbo Pascal. I felt like I could do a lot of stuff in it. Then I went to college. The first course I took was Java and the second was Assembly. I remember feeling so resentful. Why couldn’t I just program in the language I already felt comfortable with? I spent four years feeling that way and then changed majors. I’m a little more adventurous now with my language galavanting, but not terribly.
The answer to why we have different programming languages is because they do different things to some degree. There are indeed cases where something could have written the same way in multiple languages, and you picked the one that you prefer.
The real answer is that some programming nerd (in the most endearing way) thought they could make a better language that (likely) reflects modern needs and styles. So they did and convinced a bunch of other nerds that it was a good idea, allowing the language to gain steam. It’s a miracle of sorts.
We don’t see it on the client-side web because it would probably be easier to colonize Mars than get all the major browsers to ship an entirely new language. The web sees innovation through slow evolution and at the framework level.
The answer was surprisingly simple & true. One lang I taught several decades ago was Logo that was designed by a child psychologist specifically your ‘child’ programmers.
A revolutionary concept it introduced was the programmable ‘turtle’. It encourages the use of functions with parameters.
Thanks for the explanation. It was simple and concise. The answer may lie on why do we have different human languages.
I’m going to say because they do things SIGNIFICANTLY differently at many levels. C++ allows for complete control over your resources, be it source code or memory locations. It is extremely powerful if you need this, and extremely annoying if you don’t. Python doesn’t care about a bunch of this stuff, so it can be used much more freely, allowing you to write usable code much faster… But if you NEED control over your memory locations, forget it. VBA is extremely powerful and it’s presence in Microsoft Office allows you to expand these tools almost endlessly (I once wrote a genetic algorithm in Excel) while using already well tested features of the main software. Script languages like PML and AutoLisp allow common user to expand highly expensive proprietary wares. Etc.
Why do we have different food dishes?
Why do we also have different recipes for the same dish?
Both questions have many fairly obvious answers that are very similar to (or exactly the same as) the answers to why we have multiple programming languages, and multiple bits of software or hardware that basically accomplish the same thing.
“it would probably be easier to colonize Mars than get all the major browsers to ship an entirely new language.”
WebAssembly changes this picture completely, because we’re not going to have to persuade the browser makers to add new languages.
We now have to persuade language compiler writers to compile for WebAssembly – and it looks as if they are going to be falling over themselves to do so.
I also thought “WebAssembly!”, and a second later “but IE…”
This is exactly like why we have different languages to speak in the world?
To be fair human languages were never “created” by one person, but organically evolved from their previous forms through isolation and time.
There is only one language, Machine language with assembly being its first abstraction. All other languages are just further abstractions.
I think you’ll just have to ask yourself:
“Why do we have different
programminglanguages?”and you’ll pretty much get the answer.
There are actually many cases where something could have been written the same way in multiple languages. I have created a technology called progsbase for programming in many languages at once. There is also a large collection of libraries available in 13 languages, and it works quite well.
The need for multiple languages is probably overestimated.
Thanks for the explanation.
Using different languages to tell thesame machine different things is not funny anyway.
“Wake up” in English
“Good morning” in French
“Breakfast is ready” in German
I’d say because of ego of those nerds :). IMO we haven’t changed our view to compilers and still work for them. The major differences are in the frameworks and the runtime. Why style is important? Think about how much time does it take to explain someone what is your design and then implement it on some specific language? Don’t you wish many times to have specific runtime package you familiar from different language be available? And why these strict syntax per language to phrase the same stuff, I vote for free gramma, mixed runtimes and IDE that shows everything by user’s personal style :)
Similar trajectory for me. I was in junior high school and took college classes on BASIC and Turbo Pascal. My high school wasn’t going to graduate me because I didn’t have any “computer/typing” classes on my transcript, so I took a self-study class teaching myself Turbo C so that I could graduate.
With three languages under my belt and already a pretty good handle on Assembler, I was not going to study Computer Science in college, because I didn’t want to spend the next 4 years learning yet another language. I went with EE and Computer Engineering instead and still had to learn Fortran.
In hindsight and considering my career, there are probably things I could have learned by studying Computer Science after all, but that’s sort of a weird aspect of the major. If you already are highly skilled in computers, the major seems incredibly behind what you have probably learned already. I believe this is because most descriptions are written for someone who has very little knowledge already whereas it would sound like complete jargon if it emphasised why it was important for someone already knowledgeable.
Similar path… BASIC FORTRAN, dropped Pascal but I could not take any computer courses in high school without typing. Amazing how the stories are kinda similar.
This reminds me of a letter written by a high school student who almost gave up on computer science. She started out in elementary school with a class in BASIC and busywork, and hated the focus on history when the kids were supposed to be having fun experimenting with computers.
Later, she decided she’d have another go at computer science, this time deciding to skip BASIC and go straight to Pascal — and she found she hated the stupid arbitrary syntax rules. By pure luck, she stumbled onto Scheme, and she wonders: why aren’t we using that in school?
Over the years I have explored a lot of languages — indeed, this is something I enjoy doing — but I have found that my most favorite languages have three things in common: little to no syntax, dead simple (often almost nonexistent) precedence rules, and amazing abilities in abstraction and metaprogramming. Lisp and Scheme, Forth, J, and Smalltalk are all examples of such languages. Pretty much anything descended from ALGOL, however, is rigid; the languages might have well been carved out of stone.
My question isn’t so much “why do we have so many languages?” as it is “when we know the miracles that can be done with flexible languages, why do we put up with so many rigid, difficult-to-use ones?”