# What programming language would most likely be used these days?

**URL:** <https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156>\
**Category:** Factual Questions\
**Created:** [June 8, 2009, 11:01pm UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156 "2009-06-08T23:01:10Z")\
**Posts on this page:** 13\
**Page:** 5

<div class="post-metadata">

**Author:** ![leahcim](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@leahcim](https://boards.straightdope.com/u/leahcim)\
**Post date:** [July 9, 2014, 8:42pm UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/83 "2014-07-09T20:42:52Z")

</div>

> [@ftg](#):
>
> Bad programmers are always going to do bad things. So what if a bad programmer might use “+” for matrix subtraction? The idjit could label the matrix subtraction routine “PolynomialDivision” just as easily. How do you go about preventing that?

I think the issue is that, even in C++, operator overloading isn’t a natural part of the language – it’s something they would have had to put time into working on, and if it’s not going to be used often, and when it is used, frequently not used well, why do it? Most Java classes are not algebraic entities, so wouldn’t benefit greatly from operator overloading anyway, so why complicate the language to support it?

_(My point about Scala is that something equivalent to most of operator overloading flows naturally from the standard rules of the language, so it is more sensibly supported.)_

> [@](#):
>
> Note that Gosling himself loved operator overloading. E.g., “+” for string concatenation.

“Used” is not quite the same thing as “loved”, though. And arguably using “+” for a non-commutative operation is itself an abuse.

---

<div class="post-metadata">

**Author:** ![filmore](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@filmore](https://boards.straightdope.com/u/filmore)\
**Post date:** [July 9, 2014, 9:17pm UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/84 "2014-07-09T21:17:32Z")

</div>

> [@ftg](#):
>
> Re: Banning operator overloading in Java.
> 
> I always thought this was one of many classic idiocies in Java.
> 
> Bad programmers are always going to do bad things. So what if a bad programmer might use “+” for matrix subtraction? The idjit could label the matrix subtraction routine “PolynomialDivision” just as easily. How do you go about preventing that?

The problem with things like operator overloading is that it makes maintenance harder. Often in business, you end up having to debug code written by other people. When I’m looking at some generic code like:

object1 + object2

I don’t have any intrinsic idea of what ‘+’ means in that context. I have to go look up the source and see what it does. But if the code was:

object1.append(object2)

Then I get an idea of what the method is supposed to do. I can more easily read through unfamiliar code and get an idea of what it’s supposed to be doing so I can hone in on where the bug is.

I find it hard to debug Python for similar reasons. For example, method parameters aren’t typed, so I waste a lot of time trying to figure out what is getting passed into the methods.

Often when I hear a language is ‘powerful’, I take it to mean that there are lots of tricks and nuances which make maintenance more difficult. Also, it will be harder to find accomplished programmers since there is more to learn.

Unless you have a very good reason to use a niche language or a loosely typed language, it’s better in the long-run to use a language which is common, simple to understand, strongly typed, and compiled. You’ll have fewer bugs and it will be easier to maintain.

---

<div class="post-metadata">

**Author:** ![Stealth\_Potato](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Stealth\_Potato](https://boards.straightdope.com/u/Stealth_Potato)\
**Post date:** [July 10, 2014, 12:50am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/85 "2014-07-10T00:50:58Z")

</div>

> [@TimeWinder](#):
>
> Assuming this isn’t a whoosh, the Java specification was released in 1995. The Lisp specification was released in 1958–it’s almost the oldest language still in common use.

Yeah, the bit about LISP was kind of a joke – but a semi-serious joke. My point was that the foundations of language design are very old. Many beautiful, expressive, and useful high-level abstractions were discovered long before Java came on the scene, and Java benefited from almost none of them – it just regurgitated a wordier, albeit better structured, C.

> [@leahcim](#):
>
> _(My point about Scala is that something equivalent to most of operator overloading flows naturally from the standard rules of the language, so it is more sensibly supported.)_

Haskell supports “operator overloading” with similar elegance, even allowing you to define binding power for infix functions. It’s one of my favorite features of the language. 🙂

---

<div class="post-metadata">

**Author:** ![Rick\_Kitchen](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/rick_kitchen/32/522_2.png) [@Rick\_Kitchen](https://boards.straightdope.com/u/Rick_Kitchen)\
**Post date:** [July 10, 2014, 1:29am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/86 "2014-07-10T01:29:42Z")

</div>

The software company I was working for (admittedly three years ago) was using Visual Basic.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [July 10, 2014, 1:38am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/87 "2014-07-10T01:38:39Z")

</div>

Is there any language on Earth that _doesn’t_ overload the plus sign operator? Adding two floats together is a different operation than adding two integers together, but I’ve yet to see the language that used anything other than “+” for both.

> [@](#):
>
> Quoth **Washoe** :
> 
> Hewlett Packard calculators use a proprietary language called RPL—Reverse Polish LISP.

Huh, maybe I ought to learn LISP. I’ve programmed HP calculators, and while I found it terribly idiosyncratic (HP engineers seem to love re-inventing the wheel), it also had some very handy features.

---

<div class="post-metadata">

**Author:** ![Little\_Pig](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Little\_Pig](https://boards.straightdope.com/u/Little_Pig)\
**Post date:** [July 10, 2014, 2:21am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/88 "2014-07-10T02:21:17Z")

</div>

> [@Stealth\_Potato](#):
>
> Yeah, the bit about LISP was kind of a joke – but a semi-serious joke. My point was that the foundations of language design are very old. Many beautiful, expressive, and useful high-level abstractions were discovered long before Java came on the scene, and Java benefited from almost none of them – it just regurgitated a wordier, albeit better structured, C.

Hey Stealth Potato. LISP be cool. Let me throw a log on the fire. [FORTH.](http://en.wikipedia.org/wiki/Forth_(programming_language))Yeah baby…

---

<div class="post-metadata">

**Author:** ![Little\_Pig](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Little\_Pig](https://boards.straightdope.com/u/Little_Pig)\
**Post date:** [July 10, 2014, 7:10am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/89 "2014-07-10T07:10:09Z")

</div>

> [@Jragon](#):
>
> [Here](http://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html) is the article I was thinking of when I described how Go came about. It’s called “Less is Exponentially More”. It really shows the minimalist stance they take (sometimes for worse). I don’t agree with his analysis of type hierarchies, though. I mean, it would make sense if he was making a language that uses untyped lambda calculus, but Go is one of the strictest languages I’ve seen about types. You can’t even add an int and a uint without an explicit type conversion.
> 
> It’s a lot like Dijkstra’s quote on PL/I

Jragon. Are you aware of any GO forums that talk about using GO with any of the Internet of Things protocols?

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [July 10, 2014, 7:42am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/90 "2014-07-10T07:42:33Z")

</div>

> [@Chronos](#):
>
> Is there any language on Earth that _doesn’t_ overload the plus sign operator? Adding two floats together is a different operation than adding two integers together, but I’ve yet to see the language that used anything other than “+” for both.

Yes. I can’t remember what language it was, maybe Prolog, but I used one once where to add floats you had to explicitly use the +. operator. Same with other operations, multiplying floats was \*. and so on.

---

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [July 10, 2014, 8:38am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/91 "2014-07-10T08:38:15Z")

</div>

> [@Chronos](#):
>
> Is there any language on Earth that _doesn’t_ overload the plus sign operator? Adding two floats together is a different operation than adding two integers together, but I’ve yet to see the language that used anything other than “+” for both.

OCaml. (+) is integer addition, (.+) is float addition.

> [@Stealth Potato](#):
>
> Haskell supports “operator overloading” with similar elegance, even allowing you to define binding power for infix functions. It’s one of my favorite features of the language.

Haskell’s type classes also solve the problems with ad hoc polymorphism that **filmore** was complaining about. When I see the Haskell code:

```auto

  foo :: Monoid a => a -> a
  foo x = x `mappend` mempty

```

I _know_ quite a bit about what the overloaded mappend function and overloaded mempty value are doing due to the [Monoid type class](https://hackage.haskell.org/package/base-4.7.0.0/docs/Data-Monoid.html) having a set of algebraic laws associated with it. I know, for instance, straight from the definition of Monoid, that foo is equivalent to:

```auto

  foo' :: Monoid a => a -> a
  foo' x = x

```

which in turn is just a type-restricted identity function:

```auto

  foo'' :: Monoid a => a -> a
  foo'' = id

```

The same holds for most type classes in Haskell. You identify a repeated pattern in code, you abstract it into a type class, and you associate algebraic laws with the type class which should be satisfied by all instances. You can even tell the Haskell compiler to optimise code using those rules, by informing it of the laws with [rewrite rules](https://www.haskell.org/ghc/docs/7.0.1/html/users_guide/rewrite-rules.html).

---

<div class="post-metadata">

**Author:** ![leahcim](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@leahcim](https://boards.straightdope.com/u/leahcim)\
**Post date:** [July 10, 2014, 1:45pm UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/92 "2014-07-10T13:45:15Z")

</div>

> [@Stealth\_Potato](#):
>
> Yeah, the bit about LISP was kind of a joke – but a semi-serious joke. My point was that the foundations of language design are very old. Many beautiful, expressive, and useful high-level abstractions were discovered long before Java came on the scene, and Java benefited from almost none of them – it just regurgitated a wordier, albeit better structured, C.

And introduced garbage collection to algol-style languages. And created the first mass-market virtual machine. And enabled object-oriented programming in the C++ style without the overhead of C++.

I won’t be too full-throated in my defense of Java, but I don’t see the point of all the Java hate. It does what it does, and what it does is something a lot of people want to do.

> [@](#):
>
> Haskell supports “operator overloading” with similar elegance, even allowing you to define binding power for infix functions. It’s one of my favorite features of the language. 🙂

No doubt the connection is that Scala’s purpose is to be able to Haskell-like things in a Java-like language.

---

<div class="post-metadata">

**Author:** ![leahcim](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@leahcim](https://boards.straightdope.com/u/leahcim)\
**Post date:** [July 10, 2014, 1:49pm UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/93 "2014-07-10T13:49:22Z")

</div>

> [@filmore](#):
>
> I find it hard to debug Python for similar reasons. For example, method parameters aren’t typed, so I waste a lot of time trying to figure out what is getting passed into the methods.

There was a recent [article](http://techblog.realestate.com.au/the-abject-failure-of-weak-typing/) on the topic of the failure of weak typing.

Relevant Part:

> [@](#):
>
> Let’s look at a function:
> 
> **def findAddress(userId: String): String**
> 
> What does it do? Are you sure?
> 
> Now lets look at another:
> 
> **def blah(foo: UserId): Address**
> 
> Which one tells you more about its purpose — the one with the businessy names, or the one with the types?

---

<div class="post-metadata">

**Author:** ![Stealth\_Potato](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Stealth\_Potato](https://boards.straightdope.com/u/Stealth_Potato)\
**Post date:** [July 10, 2014, 9:29pm UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/94 "2014-07-10T21:29:17Z")

</div>

> [@leahcim](#):
>
> And introduced garbage collection to algol-style languages. And created the first mass-market virtual machine. And enabled object-oriented programming in the C++ style without the overhead of C++.
> 
> I won’t be too full-throated in my defense of Java, but I don’t see the point of all the Java hate. It does what it does, and what it does is something a lot of people want to do.

No, you’re right – all those things are to Java’s credit. The main reasons I dislike Java are its clunky and uninspired syntax and its abject lack of high level abstractions. Also its standard library is quite poor, owing perhaps to the lack of abstraction in the language.

---

<div class="post-metadata">

**Author:** ![Little\_Pig](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Little\_Pig](https://boards.straightdope.com/u/Little_Pig)\
**Post date:** [July 14, 2014, 4:25am UTC](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156/95 "2014-07-14T04:25:36Z")

</div>

Agreed. I’m going with [Go.](http://golang.org/)

[Previous page](https://boards.straightdope.com/t/what-programming-language-would-most-likely-be-used-these-days/499156.md?page=4)
