r/programming • u/yogthos • Dec 23 '12
What Languages Fix
http://www.paulgraham.com/fix.html51
Dec 23 '12
With some more depth: hammerprinciple.com/therighttool -- pick a language and see what it is most dissimilar too, or compare two arbitrary ones.
For example Fortran vs Assembly
11
u/climbeer Dec 23 '12
The top items of FORTRAN vs. C are kind of funny, kind of sad.
10
u/m42a Dec 23 '12
This language is likely to be a passing fad
Who the hell picked C or Fortran for this?
7
u/climbeer Dec 23 '12
A silly question in this context, but I guess it's the "less wrong" answer, as FORTRAN is 15 years older and still actively used in some domains.
0
Dec 23 '12
[deleted]
2
u/climbeer Dec 23 '12
Why did you assume I don't mean F{95,03,08}? PGI makes a Fortran 2003 compiler for CUDA - still older than C11.
The age comparison was based on the "Appeared in" field in Wikipedia's infoboxen in relevant articles.→ More replies (1)2
u/seruus Dec 25 '12
I wish people would just let FORTRAN 77 die, even LAPACK finally moved to Fortran 90! Maybe in 2030 we'll be able to use C++11 and Fortran 2008 (DO CONCURRENT!) without fear.
→ More replies (1)7
u/lucygucy Dec 23 '12
Many of the issues with the data seem to be attributable to the data collection method being bad. It encourages ranking things in a list, even when the statement doesn't make sense for the choice of languages:
Consider Fortran, C and a scripting language: 'I would use this language as a scripting language embedded inside a larger application'. That's what the scripting language is for, so it wins by default. C's probably slightly ahead of Fortran, but I'd implement a DSL before using C or Fortran for this task.
Add clustering of languages to that - eg., only people who know shell scripting are likely to know AWK - and it's unsurprising that there are a lot of weird results.
7
u/Leechifer Dec 23 '12
I always wondered why there's an entire O'Reilly book specifically on "Sed and Awk" when I started working with Unix. Then I read the book.
4
Dec 23 '12 edited Jun 25 '23
edit: Leave reddit for a better alternative and remember to suck fpez
→ More replies (1)0
Dec 23 '12
[deleted]
4
u/BufferUnderpants Dec 23 '12
Looks accurate to me. Though that kind of comparison is the least interesting feature of the website, as the comparisons are not done directly, but rather how high they were ranked in a list of all languages known by the participant in relation to the other.
15
2
2
u/SupersonicSpitfire Dec 28 '12
The results are only a reflection of the opinion of the users of that site, though.
→ More replies (2)4
Dec 23 '12
The items for PHP are hilarious.
3
1
u/AceBacker Dec 23 '12
I like the one that said PHP makes it easy to shoot yourself in the foot. I can see that one.
0
52
u/Rhomboid Dec 23 '12
Brainfuck: Forth is too easy to use.
Malbolge: Brainfuck doesn't have enough sadomasochism.
27
u/climbeer Dec 23 '12
INTERCAL: GOTO considered harmful.
2
u/ais523 Dec 23 '12
Seriously, modern INTERCAL's control flow model would be quite nice if it had a goto to complete the orthogonality in addition to the other three (come from, next, next from). (Although you can synthesize a come from out of a next from, it's a bit inelegant to have to do so.)
It might be a vaguely interesting rather than frustrating language to write in if it had a decent expression syntax and some sort of vaguely sane string handling.
18
u/ours Dec 23 '12
This Malbolge program displays "Hello World!", with both words capitalized and exclamation mark at the end: ('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
CB]V?Tx<uVtTRpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>Dear mother of unreadable code.
→ More replies (1)17
8
Dec 23 '12
Actually, the real problem that Brainfuck solves is "The False compiler is too big".
(The False compiler was 1020 bytes, Brainfuck was 240.)
→ More replies (2)2
u/FlukeHawkins Dec 23 '12
So stop me if I'm misinterpreting something, but is Malbolge just directly writing encrypted assembly?
13
u/seventeenletters Dec 23 '12
encrypted trinary coded assembly, where every operation done changes the encryption (so programs are not composable as modules, every operation changes what all the instructions in the vm do)
0
Dec 23 '12
[deleted]
21
u/ichrvk Dec 23 '12
Malbolge: Writing a “99 bottles of beer” program shouldn't takes less than couple of years of concentrated effort.
0
Dec 23 '12
[deleted]
24
19
u/anvsdt Dec 23 '12
Whitespace: Python isn't Pythonic enough.
32
u/skocznymroczny Dec 23 '12
Whitespace:
18
u/climbeer Dec 23 '12
Expected whitespace code in comment source. Disappoint.
4
u/Tuna-Fish2 Dec 23 '12
It'd be there, but reddit strips extra whitespace.
→ More replies (1)4
u/dmwit Dec 23 '12
in comment source
(edit: which is available, among other means, by clicking "permalink" and adding ".json" to the end of the URL)
→ More replies (3)4
22
u/Flueworks Dec 23 '12
Common Lisp: There are too many dialects of Lisp.
And color me ignorant, but what does "Microsoft is going to crush us" mean (in the Java paragraph)? Does it mean that Microsoft were going to take over C++, or drive Sun out of business?
19
u/Rhomboid Dec 24 '12
It wasn't about languages, but about platforms. In the mid-1990s Microsoft was in beast mode -- they were using every dirty trick that they could come up with to crush the competition. In the consumer desktop space, Apple was years away from releasing OS X and had a pile of technology issues, Linux had edges that were far too rough for the general public, and mobile platforms were virtually non-existent. That left Microsoft as the dominant player, a position that they achieved with all sorts of underhand deals, such as forcing OEMs to ship Windows with every machine as part of the licensing terms such that it was all but impossible to even buy a PC without Windows.
That dominance meant that anyone who wanted to write a mass-market application or game would be targeting Windows on x86, further cementing the status quo. Anyone wanting to make a dent in the situation faced a very frightening uphill battle convincing all of those developers to pay attention to their different and incompatible platform that had a fraction of a percent of market share. Microsoft didn't have to embrace and extend C++ or any other language to achieve this, although I'm sure they would have if they thought it would have helped.
That's why Netscape scared the living shit out of Microsoft. Redmond had been very slow to even recognize and acknowledge that the web was even worth paying attention to, all while Netscape had been busy adding more and more features to the early versions of their browser. Features like inline images, animated gifs, and color and font control meant you could start making pages that weren't boring, and cookies meant you could build interactive and dynamic sites that you could actually interact with through server side scripting. The writing was on the wall -- if the frantic pace that features were being added to the browser continued, soon you might be able to replace real applications with web applications, and that was terrifying to Microsoft because you could use those applications from any platform as long as it had a web browser.
Sun had a similar line of attack in mind in that they wanted to invent a language that would be its own platform. I'm sure you've heard the marketing slogans of write once, run everywhere. In an ideal Sun world, hardware vendors would compete on a level playing field as it didn't matter what architecture or operating system you were selling as long as you had a JVM. This made them natural allies with Netscape, and the announcement that Netscape would release a version of their browser with a Java plug-in that was capable of creating rich desktop-app-like user interfaces (as well as a more light-weight scripting language with a name chosen to placate Sun that was integrated into the ordinary page markup) sent Microsoft into fits of rage. They responded with a full-on browser war, leveraging their status as a monopoly in operating systems to eventually dominate in the browser market. Additionally, they added Windows-only APIs to their implementation of Java that gave preferential access to certain system features in an attempt to entice applet developers to specifically target them. Both of these actions resulted in long lawsuits that Microsoft would lose.
→ More replies (1)4
Dec 24 '12
Except in that regard CL was wildly successful. Common Lisp did unify the strand of the Lisp family from which it descended. Have you heard of Maclisp or Interlisp or Lisp Machine Lisp or ZetaLisp or Franz Lisp lately?
2
2
u/seruus Dec 25 '12
Did CL end the balkanization of the Lisp community because it was better, because it was the first/only Lisp on the "newer" platforms (like x86) or because the community diminished in size? I've never read much about the history of Lisp during late eighties-nineties, so this really intrigues me.
2
Dec 25 '12 edited Dec 25 '12
I haven't either, so don't take my word for it, but I think it was largely because the major Lisp vendors were on board with the standardization efforts. "Design by committee" is often maligned, but this is its greatest strength: different parties all had input in the standardization process and were able to compromise on something they could all agree to implement. Not that CL wasn't a better lisp (it totally was!) but CL just had a lot of mindshare at that time; all the major players had their interests in it.
I don't think it had much to do with being on newer platforms either because at that time Lisp Machines were still a dominant player and the standardization effort had them in mind as it was working. Symbolics ported most of Genera to CL. Franz had dropped Franz Lisp. Things were definitely going that way. I suspect that, like you said, the crash of the Lisp ecosystem probably wiped out most of the places were older Lisps might have otherwise held on.
Ahh, really /u/lispm or /u/asciilifeform should be the ones to field questions about Lisp's history...
1
Dec 25 '12
My experience with lisp "Common Lisp is ugly, cruft-filled, the best implementations aren't portable, and it's married to emacs. Scheme has no libraries. Fuck this, I'll use ruby. It's inferior but I don't have to implemnt everything myself.
Besides isn't Clojure about as popular as CL these days?
1
Dec 28 '12
CL has the bigger base of established users and code; but Clojure is very pleasant, yea fun to program in, and that's drawing a lot of people in. Also, there's the fact that Clojure inherits the entirety of the Java library universe.
11
15
u/marcoil Dec 23 '12
My 0.02€:
Clojure: Concurrency is hard, mainstream syntax is too difficult to extend.
20
Dec 23 '12
ML/SML/Ocaml: Lisp isn't pure enough.
Miranda/Haskell: ML isn't lazy.
Agda: Haskell is lazy.
23
u/Aninhumer Dec 23 '12
Agda: Haskell doesn't have dependent types. (However much it pretends).
Surely?
3
Dec 23 '12
Of course! But after all, this list is kind of a joke. To have dependent types in the first place, you either have to make a distinction between inductive and co-inductive types to your system, or get rid of laziness and require everything to be inductive.
2
u/tel Dec 23 '12
I thought totality makes the distinction go away? If you turn off the termination checker and try to normalize an application of (const () . absurd) does it terminate?
I guess in light of strong normalization and library level features implementing conductive types I feel like your distinction isn't so critical to dep types, but I'm probably missing the point.
3
11
u/dons Dec 23 '12
Your ML historical motivations are wrong. ML exists to give us types and type inference. SML gives us a formal language standard. OCaml adds an object system.
3
6
u/solidsnack9000 Dec 23 '12
Agda is actually implemented by way of compiling to Haskell (still, I think). It offers a much more expressive type system than Haskell.
There is a "non-lazy" Haskell, part of the HASP project.
One difference between Haskell and the ML family is that in Haskell, a much greater effort is made to model side-effects within the bounds of typed functional programming. The difference in type signature between OCaml's
timeand Haskell'sepochTimeis instructive.val time : unit -> float epochTime :: IO EpochTime10
u/ba-cawk Dec 23 '12
sorry to be "that guy", but Haskell's argument is more accurately the ML argument against Lisp just with s/Lisp/ML/
39
u/meteorMatador Dec 23 '12 edited Dec 23 '12
...But that was the only one he got right!
EDIT: I might as well explain.
The first step away from LISP was when this wacky guy declared himself the savior of functional programming and invented a language called ISWIM (which was never implemented). The only problem that solved was "LISP has awful syntax" and the solution he proposed was significant whitespace sensitive to particular keywords.
(I am capitalizing "LISP" because this happened in the 60s.)
A whole bunch of languages showed up in the late 60s and early 70s using slight variations on canonical ISWIM syntax. Pretty much all of them were dynamically typed (because LISP was dynamically typed) and nobody remembers or cares about 99% of them. The big exception was ML, which was a metalanguage for writing macros and stuff in a thing Robin Milner was working on at the time. The problem ML solved is "statically typed languages can't figure out their own type signatures." As far as I know this was just an itch Milner wanted to scratch and he just sat down and implemented it without realizing the enormity of what he had done.
Soon enough the ML family exploded into a bajillion different research languages that didn't really solve actual problems so much as pick fights with basic assumptions of programmer productivity. Out of this chaos and madness arose a number of lazy languages, which were actually interesting and cool to work with instead of just being weird. Haskell is sort of the Captain Planet of those, combining all the fun stuff and extending the ML type system in frighteningly powerful ways. (Miranda was its immediate precursor.)
This is where it gets truly goofy. Haskell started out causing itself all kinds of dumb problems, but the nature of the type system meant that the solutions could be implemented as libraries instead of entirely new languages. So people complain "we can't do IO in a purely functional language" and in no time there are a dozen different ways to do IO in Haskell. (Monads won because they're the most flexible and useful for other stuff besides IO.) That's still happening today, too: Someone says "we can't do X in Haskell" and ten minutes later someone else comes crashing down through the skylight, bellowing "OR CAN WE?"
11
u/Aninhumer Dec 23 '12
Haskell is sort of the Captain Planet of those, combining all the fun stuff and extending the ML type system in frighteningly powerful ways.
I just thought I should add that Haskell was designed by a committee of academics specifically to pull together all the ideas that were floating around and implement them in a unified way.
7
u/pipocaQuemada Dec 23 '12 edited Dec 24 '12
If anyone's interested in the full story, check out A history of Haskell: Being lazy with class (pdf).
Edit: Haskell was originally a fairly conservative language, designed to unify the half-dozen or so lazy functional languages that had popped up. The only new feature was typeclasses. It's one of the few times that "There's 14 competing standards; lets make an all encompassing one" lead to there only being 1 standard. It's probably because most of the authors of the assorted competing standards were on the Haskell committee, and the few that didn't join them (e.g. Miranda & Clean) were essentially out-competed in terms of mindshare.
So, in actuality: Haskell: there are too many lazy functional languages, we need to consolidate.
1
u/Olathe Dec 28 '12
Speaking of planets and Miranda, isn't Miranda the planet that the Reavers come from?
2
u/meteorMatador Dec 28 '12
I doubt there's a connection. The programming language is much older than the show (1985 vs. 2002) and I don't recall Joss Whedon being a programmer.
3
u/sepp2k Dec 23 '12
I don't think that's accurate. It is my understanding that Haskell is purely functional to support its laziness not for the sake of being pure.
I don't think going from mostly functional to purely functional is an improvement just by itself, but going from strict to lazy is (which isn't to say there aren't downsides to that either).
3
u/mcguire Dec 23 '12
I believe that is the contention of SPJ in "Wearing the hair shirt".
And I suppose he'd know.
2
u/chrisdoner Dec 24 '12
He said the laziness "kept us pure" (unlike other languages that buckled under the pressure and are imperative), but also later said "the next version of Haskell will be strict" (due to all the difficulties of laziness). One project like that is Disciple a strict dialect of Haskell.
1
u/ithika Dec 23 '12
No, it was pure "first" but the fact that it was also lazy meant they couldn't back away from that decision when things got difficult.
18
u/henk53 Dec 23 '12
Scala: Java is too complex and doesn't have closures
Groovy: Java doesn't have a syntax for properties and has the wrong defaults (public class { private int something; }), and Java doesn't have closures
Kotlin: Scala is too complex, and Java doesn't have closures
Extend: Scala and Kotlin are too complex, and Java doesn't have closures
Ceylon: Scala, Kotlin and Extend are too complex, and Java doesn't have closures
Fantom: Scala doesn't run on the CLR and C# doesn't run on the JRE, and Java doesn't have closures
9
16
u/mcguire Dec 23 '12
I thought Scala's selling point was that Java was too simple. And doesn't have closures.
8
Dec 23 '12
I guess Java 8 will finally be substantially more complex than Scala while remaining to be magnitudes less expressive.
It was debatable before Java 8, although it was already pretty clear back then that Scala is spending it's complexity budget on useful abstractions and Java on kludgey ad-hoc hacks.
→ More replies (5)1
u/henk53 Dec 23 '12
I thought Scala's selling point was that Java was too simple.
At the end of the day, most every serious language wants things to be as simple as possible of course. None of the real languages (jokes like Whitespace and brainfuck aside) wants to be explicitly difficult, just for the sake of being difficult or complex.
Another way to describe it could be that according to the Scala guys, Java is too tedious, takes too much code, to do the same thing that Scala does with say one operator.
4
4
u/Ukonu Dec 23 '12
Java does have closures. They're just overly verbose and de-powered (i.e. the variables in the extra scope the closure gives access to have to be declared "final")
You probably mean higher-order and anonymous functions. Those terms seem to have become synonymous with closures just because they typically enable easier usage of closures.
1
u/henk53 Dec 24 '12
Yes, that is technically correct.
However, the mainstream terminology is saying that "Java doesn't have closures" and that "Java 8 will bring closures", so I adhered to that, even though as you mention that's not entirely correct.
1
Dec 24 '12
I thought anonymous inner classes didn't fully satisfy the definition of closures? Or was it lambdas? Or both?
→ More replies (5)
5
u/asampson Dec 23 '12
Lisp: Turing Machines are an awkward way to describe computation.
I laughed far too hard at this one.
2
u/Smallpaul Dec 26 '12
I guess that imperative languages solve that "Lambda Calculus is an awkward way to describe computation."
26
u/SirClueless Dec 23 '12
Another interesting family of languages:
JavaScript: Netscape is boring.
CoffeeScript: JavaScript is a kludge.
Dart: JavaScript is a kludge, and it's slow.
And a recent trend in programming languages:
Go: C++ is a kludge, and it takes forever to compile.
Rust: C++ is a kludge, and it's not safe to use.
59
u/boa13 Dec 23 '12
JavaScript: Netscape is boring.
This does not make sense. Especially since JavaScript was invented at Netscape by Netscape for Netscape, at a time when Netscape was leading the way.
I suggest:
JavaScript: We need a scripting language for web pages. Hurry, now.
28
u/flying-sheep Dec 23 '12
Having read its creator's explanation of how it went, it was exactly that, combined with “oh, and make sure it kinda looks like Java”
7
u/chwilliam Dec 23 '12
Where's the "kinda" here? It's not even close. I always assumed they called it JavaScript just to latch onto the Java hype train.
→ More replies (1)7
u/munificent Dec 23 '12
Where's the "kinda" here? It's not even close.
Eich originally wanted to make a Scheme. Given that, JS syntax is a hell of a lot like Java. It has almost the exact same expression syntax, same operators, same precedence. Same statement/expression distinction, semicolons as terminators, same control flow structures.
4
Dec 23 '12
JavaScript was rather:
If you keep using Scheme for web scripting, we'll fucking kill you.
Netscape has initially had a scheme dialect for scripting, but had to change to to something more "java like" after Sun applied significant pressure on them to jump on their newly started Java bandwagon. The pressure was so large, that they made Netscape not only change the syntax, but to even brainlessly squeeze the name Java into it.
The early JavaScript versons were BTW written in Common Lisp and are still available from Mozillas repositories.
5
u/MachaHack Dec 23 '12
AFAIK, the name Javascript was actually Netscape management trying to cash in on Java's popularity at the time. Not pressure from Sun.
1
Dec 24 '12
The early JavaScript versons were BTW written in Common Lisp...
Wow, so ClojureScript isn't as outlandish an idea as it sounds?
12
u/cogman10 Dec 23 '12
Typescript: JavaScript is scary, let's make it less so by adding classes
7
Dec 23 '12
And modules. Let’s not forget that.
<script type="application/ecmascript" charset="UTF-8" src="in.js"></script> <script type="application/ecmascript" charset="UTF-8" src="the.js"></script> <script type="application/ecmascript" charset="UTF-8" src="right.js"></script> <script type="application/ecmascript" charset="UTF-8" src="order.js"></script>7
6
u/dysoco Dec 24 '12
I'd say something more of:
Go: C++ failed to improve C.
And maybe:
D: C++ needs more template stuff.
5
u/ThisIsDave Dec 23 '12
Doesn't JavaScript have shockingly good compilers for most tasks these days?
21
u/smog_alado Dec 23 '12
The compilers are very good but only because lotst of people spent lots of time on it. Javascript is still very complex and hard for optimize.
To give an idea, the JIT compiler for Lua has comparable performance to the Javascript JITs but its developed by one guy.
5
u/gsnedders Dec 23 '12
Only for short-lived scripts where compilation time is a luxury you cannot afford. There's a lot more that could be done for longer-lived scripts.
→ More replies (7)2
u/tonygoold Dec 23 '12
Google's Closure Compiler makes it possible to write large-scale applications in Javascript, if you don't mind annotating everything with JSDoc comments. It doesn't just verify and minify your code, it actually compiles it into more efficient Javascript.
3
2
1
u/A_for_Anonymous Dec 24 '12
Rust: C++ is a kludge, and it's not safe to use, and Dart is a toy for Java programmers.
3
u/cogman10 Dec 24 '12
Rust and Dart really aren't competing languages. Rust is looking to be a new systems language while dart is looking to be a new web language.
0
Dec 23 '12
[deleted]
1
u/cogman10 Dec 23 '12
I think the popularity of dart will be surprising to you. Already dart vm is 2x faster than v8 (impressive for such a young language) and my bet is that once their crosscompiled javascript gets fast enough, it will become quite a popular language.
0
Dec 23 '12
[deleted]
3
u/cogman10 Dec 23 '12
The dartVM is chrome only (well, chromium only really). However, dart itself cross compiles to javascript. So as long as the browser supports javascript, you can work in dart and run in javascript.
There are even some benefits to doing this. Dart supports some pretty nifty and advanced dead code elimination. That means you can go ahead and include huge libraries in your project and be assured that you only send over what you use. It also means that making an expansive library in dart could still result in applications with small download footprints.
2
u/x-skeww Dec 23 '12
They don't need to convince anyone. Dart already runs fine in every modern browser (ES5+) thanks to dart2js. Currently, even Chrome doesn't support Dart natively.
So, in the browser, you don't get the better performance and the faster startup yet. However, you do get all the benefits of using a saner language which scales much better and which also offers vastly superior tooling.
22
u/check3streets Dec 23 '12 edited Dec 23 '12
So many Blub wars on reddit disparaging language X vs language Y ignore what motivated language X's development in the first place. Almost all successful languages owed their adoption to how well they addressed a gap or limitation in the existing language landscape.
Java's a great example. C++ was the poster-boy of the software crisis. Java's design was really a super conservative point-by-point answer to the C++ FQA. C# acknowledged the need and designed a language from the best parts of Java plus some currently missing niceties, but mainly succeeded because of much deeper MS ecosystem interoperability.
It's also why adoption of an "even more beautiful" language is so difficult. Lua just doesn't fix enough of our problems.
19
9
Dec 23 '12
I'm not sure why you would mention Lua, as it solves some extremely relevant problems, and as a result is massively successful.
11
u/maskull Dec 23 '12
Esp. since Lua isn't intended to be a general purpose language. It's niche is that it makes it easy to give a syntax to the internals of whatever you're plugging it into.
3
u/check3streets Dec 23 '12
It was not intended as a dig against Lua. I believe the language is the most elegant popularly known scripting language today.
In an ideal world, a language meritocracy, Lua should replace JavaScript in the browser and displace a certain amount of Python or Ruby on the server.
Instead, there are lengthy Lua threads on why it isn't more widely used: http://lua-users.org/lists/lua-l/2012-01/msg00721.html
3
Dec 23 '12
The point was, Lua is very widely used, more widely than most languages. And it is used exactly because of its merits.
1
u/sockpuppetzero Dec 24 '12
I'm not so sure that Lua should replace JavaScript, especially because the backwards- and forwards- compatibility issues that arise with JavaScript's code distribution model is very different than how Lua has approached the evolution of the language.
Nah, in a language meritocracy, PHP wouldn't exist, instead somebody would have taken the effort to write the code to adapt Lua to filling that niche.
2
u/mangodrunk Dec 23 '12
Care to expand on the problems it solves and how?
11
Dec 23 '12
Mainly, "existing programming languages are hard to embed, too large, and hard to use for non-programmers".
It is meant to be embedded in other applications, especially games, and to be usable by those who design content for those. In this, it mostly succeeds, and it is in very wide use. It wouldn't surprise me at all if it were in the top ten language with the widest deployed bases.
As a bonus, LuaJIT also solves the problem of being slow.
→ More replies (2)4
u/smog_alado Dec 23 '12 edited Dec 23 '12
I think Lua's own about page explains better than I do :) Basically, its has a very fast and lightweight implementation while also being very expressive and having many useful features.
3
u/reddit_clone Dec 23 '12
Also Lua is one of the only two languages that I know of that can handle being embedded in a multi-threaded C/C++ application well.
ECL is the other one.
0
Dec 23 '12
[deleted]
1
u/smog_alado Dec 24 '12
Lua is older then Javascript, I'd say its Javascript that didn't learn the lesson :) Anyway, in Lua's case you can use an __index hook or a bytecode analiser to turn setting an undeclared global into a runtime or compile time error. Anoying but better then nothing.
12
u/sftrabbit Dec 23 '12
I think C++ should really be "C doesn't provide enough abstraction for the programmer". It's really just as close to the metal as C is.
11
Dec 23 '12 edited Dec 24 '12
As a superset of C, C++ is equally as close to the metal at its lowest point but it also extends further from the metal at its highest point.
Edit: Okay, fine, it’s not a perfect superset, but you know what I mean.
5
u/sftrabbit Dec 23 '12
C++ provides its abstractions at (usually) zero runtime cost. What I meant is that the compiled executable is as close to the metal as the equivalent would be in C.
2
→ More replies (1)1
u/bstamour Dec 23 '12
C++ is not a superset of C. It was in the 80's, but they've since diverged considerably.
9
8
u/berkes Dec 23 '12
Also note, how PHP is absent from that list...
53
u/you_lose_THE_GAME Dec 23 '12
Not unexpected, as PHP doesn't fix anything.
58
18
u/DevestatingAttack Dec 23 '12
For all of its faults (and by this, I mean PHP is 100 percent made up of faults), the one thing PHP excels in is setting up the environment.
I'll go ahead and make up some statistic that says that given the choice between the correct decision that has difficult-ish setup and the wrong decision with trivial setup, 78 percent of the time people will follow the path of least resistance.
The tragedy is that people take the path of least resistance until they can go no further, and by that time, it's too late. Their webserver offers whatever PHP interface, and people think "What the hell, Facebook uses it" and by the time they wrote their code, it's too late.
If PHP were difficult to set up, it would've been in the trash of history a decade ago. But for some fucking reason the one thing that Rasmus decided to get right is the one thing that apparently matters when people make a web programming choice.
9
u/tonygoold Dec 23 '12
I'd say the biggest point in favour of PHP is that it was written specifically as a CGI language, and anyone who knows HTML can get a dynamically rendered page going in minutes. In other words, it's got a very short time to Hello World metric given the nature of its Hello World.
4
u/cogman10 Dec 23 '12
IMO, PHP is around because of legacy. At the time of its inception, Perl and C/(and C++? I don't know how popular it was) were dominate web languages. Both were somewhat of a mess to work with. C, at the time, had horrendous string manipulation (it still isn't great, but it has gotten better). And perl is, well, perl. The weird bastard programming language that started out as a document rendering DSL.
PHP was somewhat of a breath of fresh air (shocking I know). It had decent string manipulation. It was fast enough. Functions in PHP didn't look like cat puke. And as you said, it integrated well with common servers (apache).
Don't get me wrong, the language has shockingly bad semantics. However, that was outweighed by the fact that it attacked the problem of dynamic webpages better than C or perl did. It was purpose built for the task and it does an OK job at it.
7
u/cfreak2399 Dec 23 '12
Perl has brilliant string manipulation and PHP ruined it with the whole "we don't care about types except when we do" problem it has.
Also "Throw in ALL the functions!" is the definition of cat puke. Say what you want about perl's use of symbols but having a simple set of functions with option when you want to do similar (but not entirely different) things makes more sense than yet_another_array_function_in_the_default_namespace(). And don't get me started on the functions that do similar things but reverse the parameters for whatever reason.
The one thing PHP got right was how it works with apache. If mod_perl had worked in shared hosting environments we wouldn't be talking about PHP today.
→ More replies (2)2
u/handschuhfach Dec 29 '12
I don't think the integration with Apache was the only thing PHP did right. When I first looked into server side scripting, I was actually only looking for a replacement for frames. I wanted to include some common page elements (menu, logo) in all pages. That's the only thing I was looking for.
With PHP, the only thing I needed to do, was add "<?php include('filename'); ?>" and I was done.
In Perl, just to send my plain old HTML, I had to add a shebang, include some modules, send the HTTP content-type header, and then I had to output the html as a string. To include the other html file, I had to copy/paste 5 lines of code that I didn't understand at all to open the file and print it. Back then that all seemed like black magic to me.
The barrier to entry for people who only have a HTML background is much lower with PHP. In that regard, it's only really competing with e.g. JSP and ASP, which are more complex to set up - and hosting is way more costly, too.
→ More replies (1)22
Dec 23 '12
PHP: I don’t get Perl so I’ll create a language that pointlessly differs from it in stupid ways.
9
u/fakehalo Dec 23 '12
If i recall, PHP was originally written in perl/perl scripts before being recoded in C. So, I submit a more reasonable one.
PHP: Serving webpages in perl is too complex.
6
u/cfreak2399 Dec 23 '12 edited Dec 23 '12
And as of version 5 "I don't understand java so I'll bolt in classes and say it's just as powerful"
Edit: fixed a typo
2
1
u/lonnyk Dec 23 '12
Multi-platform support out of the box?
8
u/abw Dec 23 '12
How it that any different to all the other languages that are multi-platform out of the box? In fact, the only languages I can think of that aren't multi-platform are the Microsoft ones: C#, whatever.net and so on.
→ More replies (2)2
u/jerenept Dec 23 '12
C# and dotnet are implemented by Mono. Which is pretty damn awesome.
2
u/abw Dec 23 '12
Good point, although that only reinforces what I'm saying: most, if not all languages are multi-platform. The fact that PHP is as well is unremarkable.
5
1
u/cfreak2399 Dec 23 '12
PHP: the worst ideas in Perl, C and Java thrown together and called a language.
6
u/jyper Dec 23 '12
Ruby: Perl is a kludge, and Lisp syntax is scary.
I don't get it python doesn't have lisp syntax and ruby is more a descendent of smalltalk then of lisp.
Something like "smalltalk doesn't have files" would have been better.
4
u/Peaker Dec 23 '12
Python doesn't try to be Lispy, Ruby supposedly does.
0
Dec 23 '12
[deleted]
14
u/Peaker Dec 23 '12
In the Python world, being "Perly" is not a positive thing :)
0
Dec 23 '12
[deleted]
5
u/Peaker Dec 23 '12
I've moved on from Python to Haskell, but I have still retained some of my strong dislike of Perl.
I'll start with one thing I like about Perl: Explicit, static variable scoping. That one is good.
However, I do think Perl is perfectly capable of hosting great code, but I still believe it does have too much unnecessary room for bad things in code:
Too much syntax (e.g: regexps should be a library)
Without strict/all-warning mode, it silents horrible type errors, which is horrible
The convention and syntax for passing arguments to functions is cumbersome and makes interactive help/documentation about functions harder
Multiple syntactic constructs that say the same thing (complicating human parsing of code)
Too many concrete operators, rather than polymorphic operators (This is also a problem with many Haskell libraries, by the way)
A global mutable context variable
Silly inconsistencies like special variable names that behave differently (I don't recall the exact details of this)
Personally, I also really dislike the whole division of the world into scalar/array/hash/reference. Things that can be trivial (in e.g: Python) like embedding dictionaries in dictionaries become less trivial for no good benefit.
→ More replies (12)6
u/maskull Dec 23 '12
... (e.g: regexps should be a library)
Given that Perl's target domain is text processing, isn't that rather like asking for arithmetic to be a library? I know that whenever I have to work in Python it's generally not very long before I'm frustrated that a) regexes aren't "built-in" and b) consequently, they're so much more cumbersome to use.
→ More replies (1)2
u/kqr Dec 23 '12
I've always viewed Ruby as sort of what would happen if Python and Perl got a child. Ruby caters to pretty much the same kind of audience as Python, but in some places, it sacrifices simplicity for convenience in a couple of the same ways as Perl.
5
u/PrimaryPerception Dec 23 '12
I thought the consensus opinion was Perl + Smalltalk = Ruby.
2
u/kqr Dec 23 '12
Might very well be true. I have sadly no experience with Smalltalk at all. But I wasn't wrong in thinking there's at least an element of Perl to it!
→ More replies (1)3
u/chrisdoner Dec 24 '12
It's because almost everything Matz (Ruby's author) says about his inspiration for Ruby involves sideways references to Lisp, and quips that he "wasn't smart enough to understand Haskell".
6
u/grav Dec 23 '12
Objective C - C has too few square brackets!
5
u/henk53 Dec 23 '12
I once read that the reason for the square brackets was not that square brackets were really needed. The round ones used for function calls could have been used just as well.
The reason was that they wanted Object syntax to be explicitly different from function (C) syntax.
4
2
u/vulcan257 Dec 23 '12
Labview - Visual programming isn't people friendly enough.
MATLAB - MS Calc is kludge
2
3
2
Dec 23 '12
written in 1985?
5
u/ba-cawk Dec 23 '12
No, Paul Graham just didn't write his first program with the help of a MVC framework or IDE.
3
Dec 23 '12
Found this in the page source.
What was the appeal of the language to its first users?
Which is a much more accurate description of the page. From the title I expected a comparison with other languages, not merely the language's predecessors which is why it felt so dated. I don't see what someone's first program has anything to do with anything though.
47
u/ba-cawk Dec 23 '12
I don't see what someone's first program has anything to do with anything though.
Here, I'll just go with my own experiences. I've been writing code for close to 25 years now. Paul's been doing it a lot longer than that. My goal is ideally to educate you on why the history here is significant, not to show anyone up.
Ever written assembler? If so, ever written assembler that wasn't for a macro assembler?
Ever try to write a tail recursion optimized C function?
Ever try to do string processing in a C program?
Ever try to fake OOP with structs and function pointers in a C program?
Ever try to do anything advanced with perl's Object-Oriented features? (this is one of those things paul didn't accurately describe)
Ever try to do multiple inheritance, lambdas, pointer arithmetic or work with native types in a Java program? (this is one of those things Paul got plain wrong)
Ever tried to write a Java program that leveraged core unix features or was meant to be used as a command-line tool?
The fact is, for every one of these questions, someone out there is groaning, "yes, oh god, make it stop" and someone else is saying, "I'll just use this other language to solve my problem".
For younger or less experienced programmers, unless you're doing specialized stuff, chances are you haven't said this much -- largely because the tools you use today exist primarily to provide alternatives to having to do just that.
15 years ago many of these languages weren't viable. 20 years ago many of them didn't exist. Many programmers, like Paul, were expected to work with tools we would scoff at if released today -- even the versions of lisp he praises so highly.
Nobody talks about writing their enterprise SaaS solution in Turbo Pascal, but the fact is that many of the programmers around ages 35 and up were taught just that in college to start out. These days an equivalent language would be Python or Scheme. That's because Pascal for a great deal of its livelihood was somewhere between BASIC and C on the complexity scale, and touted as a great introductory language -- it could do almost everything C could, but it was easier to grasp.
But Pascal on the evolutionary scale is really important -- it's probably the purest successor to Algol and inspired tons of programming languages. begin/end as a block boundaries? := as an assignment operator instead of =? Those things come directly from that lineage and appear in tons of languages.
This establishes a few things:
New programming languages are largely the function of taking features from older programming languages and fixing perceived problems.
Users coming to said new programming languages from older languages instantly recognize this.
Users coming to said new programming languages with no prior programming experience usually don't.
For a more modern example, take something like Rust or Go -- these languages take a lot from Smalltalk, Java, C++, ML, but concurrency is a first-class feature in both of them. Honestly, there's not much else about them that's truly revolutionary, and while there's a lot to like about both systems I doubt you could find a lot of people that, if honest with themselves, would seriously consider either language at this point for applications that fall outside that scope. Plenty of other languages do everything that Rust and Go do aside from the concurrency angle -- while they may not be as slick in some ways, chances are where Rust and Go do not stand out, there are better tools on the alternatives simply because they're more mature. As time passes and Rust and Go (hopefully) mature, we will see this shift towards using them outside their advantages.
Maybe my snark was premature, but going from prior experience don't be surprised if there are a small army of arrogant 23 year old programmers a decade from now that don't understand why we need mutexes, claiming that nobody needs to learn the dining philosophers problem and how the old methods are broken, posting about it to some news aggregator with shock and awe.
That's when you get to smile, because among all those retards there's the hidden message that technology has succeeded.
8
u/tonygoold Dec 23 '12
I remember when Apple switched from Pascal to C as its designated programming language for Mac applications. In fact, being both a teenager and a novice programmer, it was the first time I gave any thought to how strings were stored. Pascal strings had a one-byte length prefix, whereas C strings were null-terminated. They introduced the
\pescape for C strings, to insert the length prefix, so you could call APIs that were originally intended for Pascal.→ More replies (1)→ More replies (1)8
1
u/Quick_A_Distraction Dec 23 '12
They forgot Lua, because every other language has too many data types.
1
u/cowardlydragon Dec 26 '12
Java: fix C portability, memory management, and slow it down
C++: neither C nor C++ have enough features (get it?)
D: C doesn't have enough features, and too many libraries
Javascript: make Java more functional and less predictable
1
u/habitmelon Dec 27 '12
Here is a graph of these languages, where the edge represents 'x fixes y': http://tobilehman.com/blog/2012/12/26/what-languages-fix-graphically/
1
1
-1
-5
u/AlyoshaV Dec 23 '12
Python: Modula-3 is scary.
Javascript: Java is scary.
Curl: Lisp syntax is scary, and XML is redundant.
Arc: Scheme has no libraries, and both could be denser.
From the HTML, commented out. Was trying to find out when this was written. Author requests suggestions in the source, by the way.
17
u/yogthos Dec 23 '12
Amusingly enough JavaScript has nothing to do with Java and was originally based off Scheme. Then some marketing person decided that the syntax should be changed to be more familiar and they should call it JavaScript because Java was popular.
→ More replies (2)5
0
Dec 23 '12
Completely missed the point for C#.
It was created because VB had a bad reputation and Java didn't have access to COM and Win32 libraries.
7
u/bstamour Dec 23 '12
Also, They ran into legal issues around J++ and J#.
1
Dec 23 '12
C# was already a work in progress with the whole Java+Events thing blew up in their face.
As for J#, I'm curious to learn the thinking behind it. Since it only had Java 1.1 compatibility, it wasn't like anyone could use it if they wanted to.
1
u/henk53 Dec 23 '12
C# was already a work in progress with the whole Java+Events thing blew up in their face.
That's one explanation...
The other is that Microsoft was left with millions of lines of code representing decades of man years in investment. They tweaked that code so that it was different enough not to be an infringement on Sun's patents and called it C#.
Notice how the early .NET beta documentation had all the examples in J++ and how similar the first version of C# was to Java, especially for the things that Microsoft had added to their Java version before (like the delegator syntax).
→ More replies (1)
0
0
Dec 23 '12
[deleted]
7
u/Brainlag Dec 23 '12
Better language, not VM.
0
Dec 23 '12
[deleted]
7
→ More replies (4)4
u/cc81 Dec 23 '12
JVM is supposedly better at performance and runs on more platforms. I'm not sure how the performance part stacks up these days as I have not read any current comparisons.
17
Dec 23 '12
[removed] — view removed comment
23
u/BufferUnderpants Dec 23 '12 edited Dec 23 '12
It was short and mindless, taking just a few seconds to read, and it opened the discussion to the programming equivalent of a drunken sports teams conversation at the bar. The fact that Paul Graham wrote it probably helps too.
Edit: proofreading if for the week.
6
u/mangodrunk Dec 23 '12
The popular articles tend to be the most accessible, not necessarily the best to some or even to most.
9
u/BufferUnderpants Dec 23 '12
And it shows, which is why you'll see submission containing a number of TIPS to become a VIM NINJA every week, or the bi-monthly typeface discussion, where everyone can wax poetry on Inconsolata and Monaco, or the mandatory editor color scheme thread, where you get to show your snazzy setup (using Solarized).
Now, these threads can be seen as a sort of space to socialize, the water cooler by the water cooler which Reddit already is, and they're valid topics of discussion, but it's still a bit disheartening to see that banal shit receive hundreds of upvotes and so many comments in contrast to more meaty submissions.
23
u/mfukar Dec 23 '12
Paul Graham wrote it, therefore it's made from pure gold, cast into exquisite forms after painfully smelted in the dark depths of PG's mind mines.
Yeah, it's fucking shit.
→ More replies (38)
158
u/btarded Dec 23 '12
The C bullet point has a hard to spot error in it. (as usual)