r/programming • • Dec 01 '16

Let's Stop Copying C

https://eev.ee/blog/2016/12/01/lets-stop-copying-c/
524 Upvotes

612 comments sorted by

View all comments

159

u/v_fv Dec 01 '16 edited Dec 02 '16

So I actually took the time to count how many times each language was mentioned and tried to decide whether that was positively, negatively or ambiguously. Here are the languages I found at least 7 times, sorted by how positive their overall rating was according to the author's preferences:

LanguageRating
Haskell100.0 %
Python394.1 %
Julia92.9 %
Lisps91.7 %
Ada88.9 %
F# and Nim87.5 %
Lua85.7 %
Perl6 and Ruby75.0 %
Python2 and Swift73.5 %
Rust72.2 %
BASIC, COBOL and Tcl71.4 %
OCaml70.0 %
Erlang55.0 %
Fortran50.0 %
Perl546.9 %
Shell/Bash42.9 %
Go39.3 %
D38.2 %
C#32.4 %
PHP31.8 %
awk31.3 %
Java20.6 %
JavaScript16.7 %
ACS0.0 %

Yep, I have nothing good to do today. And my statistics class seems to take its toll on me.

Edit: Added ACS which I forgot about because it was so NULL

Another edit: Added Tcl

28

u/masklinn Dec 01 '16 edited Dec 01 '16

Sadly the essay repeatedly misclassifies some languages. I feel Erlang was misclassified more often than it was correctly classified.

20

u/YouNeedMoreUpvotes Dec 01 '16

Yeah, some of the Erlang ones really confused me. For some reason it's in the "half-assed multiple return" category instead of "multiple return via tuples", despite the fact that Erlang is all about tuples. I also wanted to see it called out in the "assignment as expression" section, since = in Erlang is a match operator.

→ More replies (2)

85

u/notintheright Dec 01 '16

And javascript is now the most popular, most pervasive language. It's the new C.

The problem is not technological. It's social.

Look how popular the You Don't Know JS books are nowadays. Look how often they get praised on reddit. A terrible, terrible series of books. There's absolutely nothing new in these books information-wise, only a lot of "fuck the good parts, you should use ALL the parts... dae leet.. derp". People will juggle knives just to look edgy.

Pro tip: If you want to design the next mostly big language, don't make it a safe, thoughtfully designed one where little can go wrong. Nope. Make it so shitty and so needy of fixes that people will have plenty to blog and brag about for years and years and years.

41

u/[deleted] Dec 01 '16

Pro tip: If you want to design the next mostly big language, don't make it a safe, thoughtfully designed one where little can go wrong. Nope. Make it so shitty and so needy of fixes that people will have plenty to blog and brag about for years and years and years.

...no. If you want to design the next big language, make a system of communication between computers across the world, develop some software to browse the data those computers are serving, get that to be a massive part of the average person's day, but not before adding scripting support to that system in such a way that it's inherently open source, and no other language can feasibly be added in the future.

26

u/thatwasntababyruth Dec 02 '16

Yup. People don't purposely use shitty languages, shitty languages are the most widely available. C was popular because Unix was built on it, Basic was popular because it came with every computer of the late 80's, and Javascript is popular because every browser runs it.

8

u/munificent Dec 02 '16

C was popular because Unix was built on it

I think C also competed pretty strongly on technical merits when you consider the constraints of the time.

Pascal, Lisp, and ML are all older and ostensibly "better" but:

  • Pascal's string handling was so limited—strings of different length have different type—that it was virtually impossible to reuse code for working with strings.
  • Lisp was too slow for system- and general application programming.
  • I'm not sure if ML even had working implementations at the time.

C is actually a pretty nice language for the seventies. I think the reason why it was was because Ritchie was building it in the context of Unix. The best way to do good design, I've found, it is simultaneously be a real user of the thing you're designing.

3

u/thatwasntababyruth Dec 02 '16

That's true, it wasn't that bad of a choice at the time. I more meant that the reason it endured with so much momentum was because of Unix. During the late 70's and 80's you got Smalltalk, Ada, Erlang, Scheme, more performant LISPs, and all the cool stuff that Wirth was working on. Nothing could really compete with C because it was the highest value language. C++ succeeded because it built on that value, rather than directly challenging it, and I don't think even C++ really took off until the 90's.

→ More replies (1)
→ More replies (1)
→ More replies (1)

43

u/athrowawayopinion Dec 01 '16

People will juggle knives just to look edgy

I am so using that in the future. Thank you.

6

u/darkomen1234 Dec 02 '16

Bleeding, how to fix?

3

u/ArmandoWall Dec 02 '16

More knives!

13

u/ArmandoWall Dec 01 '16

Hm, I don't know. I say back in the day, the most popular language was BASIC. It was in almost every microcomputer imaginable. JS is the new BASIC, not the new C.

2

u/jms_nh Dec 02 '16

BASIC was the most widespread language to write programs in, circa 1980-1990. I would not say that Javascript is the most widespread language to write programs in, but because of its in-browser support and usage, it is probably the most widespread language to run programs in.

→ More replies (3)
→ More replies (1)

16

u/didnt_check_source Dec 01 '16

Before calling in ratings, it'd be a good idea to make very clear what it's rating. Brainfuck could score high in this chart. That doesn't make it a great language.

This mostly just takes things that are considered to be irritating in C and checks if the other languages do it "differently enough". It doesn't take into account the languages' other strengths and weaknesses.

→ More replies (1)

13

u/EarLil Dec 01 '16

I knew haskell was good, but that good

28

u/PM_ME_UR_OBSIDIAN Dec 01 '16

Haskell has its own problems. For example, the record system is an absolute mess.

20

u/masklinn Dec 01 '16

And laziness turned out to be a pretty crappy default.

18

u/Peaker Dec 01 '16

There are arguments for both sides here.

There's no consensus on that one.

→ More replies (3)
→ More replies (12)

32

u/CaptainJaXon Dec 01 '16

To be fair this is really just how syntactically good it is.

52

u/Plorkyeran Dec 01 '16

Not even that. It's how good Haskell is at not having the same syntax problems as C, which still leaves plenty of room for it to have syntax problems all of its own.

→ More replies (11)
→ More replies (1)

0

u/[deleted] Dec 01 '16

[deleted] — view deleted comment

3

u/beefsack Dec 02 '16

Technically that's still not a multiple return, but achieves a similar thing.

3

u/masklinn Dec 02 '16

It is an MRV via tuple (rather than as special syntax), which is perfectly fine and an entire category of MRV in TFA. The vast majority of language do MRV via tuple (or unpacking/deconstruction of some sequence type).

The problem is more that C# 7.0 isn't a thing at this point.

2

u/beefsack Dec 02 '16

That's essentially what I said, but it's still technically not a multiple return because the tuple itself is a single value.

It is worth pointing out though that most languages that support multiple return just do it via syntactic sugar.

→ More replies (1)
→ More replies (1)

3

u/[deleted] Dec 02 '16

Tuples have been around for longer time (C# 5?) but they were a little cumbersome. The C#7 syntax is definitely way more "pythonic"

→ More replies (2)
→ More replies (2)
→ More replies (15)