506 points · by chops · 13y ago · 176 comments
Does it really help our profession/hobby at all if we engage in language-elitism and snark? Even on Hacker News I've seen vitriol directed at Ruby, Python, Javascript, Haskell, to name a few recent targets. All languages have their place, even if that place is only as a lesson for future language designers.
Encouraging people to build stuff, whatever the language, whatever the library, whatever the framework; that is what we should be doing. IF someone wants suggestions, or help deciding what to use, that is fine, but criticizing someone for the language or framework they use has become all too common and a stain on the character of our community.
That's not to say honest criticism is unwelcome: All languages/libraries/frameworks/software can improve. But to belittle people for the choices they make, or to segregate ourselves into voluntary language-ghettos we are compelled to stay in by the force of public opinion...that goes against the spirit of what people like Armstrong worked hard to build. Maybe it started with "Worse is Better", maybe it started with alt.religion.emacs being taken a little too seriously, but it has been perpetuated by all of us, even Paul Graham (in Beating the Averages).
At some point, this has to stop. We, as a community, must grow to support the betterment of hacking by creating and encouraging creation; not by petty vitriol and conformism based on fashion.
Now, I've strayed pretty far from the point of the post itself, but Armstrong closed with such a salient point: If we stopped bickering so much about what is the "right language", "right framework", "right library" and instead encouraged particular protocols and documentation standards we'd all be better off for it.
https://github.com/joearms?tab=activity
He is also a regular at the Erlang mailing list:
http://www.infoq.com/presentations/ECC-Fun-Writing-Compilers
Programmers are sometimes maximizers rather than satisficers for this kind of thing. We don't want to know if something is ok and will get the job done, we want the best one.
I think people argue for their language out of some sense of the network effects involved: if I can get more people using my language, there will be more libraries, more people to ask about problems, more people to hire/to hire me, more books, and so on and so forth.
So I think there is some economic rationality to it.
(http://paulgraham.com/identity.html talks about this some, I'm sure there are other better references I can't find right now.)
The problem is one of identity. We will protect anything that we attach to our identity because we perceive any attack on it as an attack on us. To have intelligent, unemotional conversations that has to be decoupled.
In general it can lead to problems if we map our identity externally - whether to a programming language, or something else - of course this is easier to preach than to practice.
(What do programming languages, operating systems, and text editors all have in common? They're big parts of people's identities...)
Now, that said, given the choice, I'd choose coffescript. It gives many of the same benefits in a more concise format. It has its warts as well, though, reflecting its desire to stay as close to a concise-javascript as possible.
example:
(function(a, b) { return a * b; })(1) //valid javascript (NaN)
(function(a, b) return a * b end)(1) //valid lua (runtime error)To be fair, the author himself is pretty vitriolic about C++:
"I saw C++ coming and read the book - or at least tried to read the book - there's a dent in the wall behind my piano, where the book hit the wall - Improvements to C should make things easier not more complicated, I thought"
The wanna-be makers project their own failings more readily.
But do not program in COBOL if you can avoid it.
The Tao Of Programming verse 1.3
That is the TAO of COBOL - the mother of us all.
The large point is, regarding langugage/framework bashing, people put in so much time into a particular language. You almost have to buy into it. I guess some people just become zealots.
Having learned a bunch of languages myself i would recommend beginners to learn a language thoroughly before moving on. Otherwise you don't assimilate the style of a language and end up writing fortran in c, or c in c++. The qualitative differences between languages don't become obvious until you understand why their common style is what it is.
In death of the desktop, interface expert Aza Raskin mentioned that his computer has seven copies of the spellcheck program with seven slightly different implementations of the English language. Building a user interface based upon command sharing rather then bloated applications will ultimately benefit end users.
"At some point, this has to stop. We, as a community, must grow to support the betterment of hacking by creating and encouraging creation; not by petty vitriol and conformism based on fashion."
Well said
We should be encouraging people to learn stuff before they attempt building it.
I couldn't really learn Erlang, 'cos it didn't exist, so I invented itPerhaps a title change in this case wouldn't be all that bad.
Perhaps the delay is from the software waiting for a good (low load) time to fetch the page.
I think the titles are manually changed, because plenty of times descriptive titles are left intact.
In a single app, objects should talk to each other and databases and queues and junk via protocols, not by being glued to an ORM or a particular implementation of a queue or whatever. Most devs don't do this because it's more work, but you end up with a much cleaner/more testable structure to work with.
On a higher level, many/most programs aren't made to communicate with each other at all. Look at web software, it's all about communicating with a browser and that's it. The API driven movement is helping things along, but it's still a HTTP Browser driven mindset complete with holy wars about REST/Hypermedia.
Unix pipes are a great example of what is possible with standard communication protocols, but it seems like it could be taken further. What if you could pipe a stream of API's together? Yahoo's YQL and Pipes plays in this realm, but you still have to kind of glue pieces together yourself.
Imagine if you could say...
fb search --name 'John Doe' --location 'Chicago, IL' | linkedin --filter 'Ruby Programmer' | twitter tweet 'Hey check out our ruby meetup next week'
That's a somewhat contrived example, but it would be great if we could do something that simple and not just via a command line, but from any language in a similar amount of code. That would be a step forward I think.
if you want a quick fix go buy
"learn PHP in ten minutes" and spend
the next twenty years googling for
"how do I compute the length of a string"Doing multibyte string handling properly in PHP is way harder than it should have been.
He goes into some of the choices that went into Erlang, and some interesting experiences he had as the project went forward. He gives a different list that he feels the students in attendance should learn: C, JS, LLVM Assembler, one of ruby or python, and one of Erlang or Haskell.
But I've only scratched the surface. I sometimes sit and watch the #clojure channel on freenode, and I find it inspiring, interesting, entertaining, and disheartening all at once.
Inspiring because I get to see the people who write the awesome software and write the terrific books interacting, and I'll be danged, they are kind and good people!
Interesting because of the problems they are working on and discuss, asking each other for advice or just plain help.
Entertaining because they aren't just kind and good, they are also lighthearted sometimes very funny.
Disheartening because sometimes I look at the pastebin code, or the code they message to the clojurebots, and I am left scratching my head.
However, having read this "oldtimer's" post, I'm inspired to know that it's OK to not become a master in programming in 24 hours.
http://pragprog.com/book/jaerlang/programming-erlang
But yes, I agree, the book is an excellent, enjoyable read. I wish I had more opportunities to use erlang in my day job.
What would I recommend learning?
- C
- Prolog
- Erlang (I'm biased)
- Smalltalk
- Javascript
- Hakell / ML /OCaml
- LISP/Scheme/Clojure
A couple of years should be enough (PER LANGUAGE).
A 'beginner' should start by spending 14 years (minimum) learning 7 languages? I was starting to agree with him when he mentioned the paradox of choice that programming beginners face today, but that recommendation is beyond ignorant.Becoming a veteran polyglot is not the only way to break into the programming field. This is exactly the type of elitist BS that we don't need -- scaring beginners away by giving the impression that they face an insurmountable cliff from the start.
Should we also mention that they need a minimum of 3 master's and 2 doctorate degrees? I don't think I've heard of a single successful programmer with anything less. Surely no one has ever dropped out of college and acquired vast amounts of wealth at an early age by programming.
The problem with this is twofold: first, the times are always changing and yesterdays path is seldom adequate today anymore and second, progress is made by the younger generations not having to repeat the mistakes of the older ones. So, if you want good recommendations for learning, ask the people who actually teach others on a daily basis. I think 2-3 good courses in programming languages can compress a lot of the knowledge you would gain following this recommendation in a much shorter period - "Structure and Interpretation of Computer Programs", "Concepts, Techniques and Models of Computer Programming" and "Programming Language Pragmatics" are three excellent textbooks that go in this direction.
But then, if you strive for mastery, and I think that's what Dr. Joe Armstrong is interested in, it is nothing exceptional to spent 15 years learning.
Erlang was created at the CSLab by an initial team of Joe Armstrong, Mike Williams and Robert Virding.
http://www.erlang-factory.com/conference/SFBay2010/speakers/...
Sadly, there's still too much choice there as well. Even worse, many would reject the very idea.
I couldn't agree more on that one.
In an ideal world easy programming solutions can be easily explained in the right language. We're not quite there yet but doing quicksort in ML doesn't require 5 years experience.
PS: Yes, I know that not the whole discussion was about this question. Still.
I read it every day along with hn and a few other blogs.
Sarcasm doesn't translate well in a thread like this, so just in case someone really thought it could compile 100K lines in a picosecond, dream on. :-)
Sarcasm would imply he was somehow denigrating or mocking CERN and/or the CRAY1 and I didn't get that vibe at all.
Is that sad or pure genius?
However it's still an interesting and thought provoking point. It makes you wonder about other ways of plugging different objects / modules together.
You end up with every tool containing code to parse a stream of bytes into the appropriate data structures, and then probably also write them out to a stream of bytes too. The user has responsibility for a lot of data munging too. It is error prone and repetitive, at least when dealing with anything other than very simple text files containing lines of strings where you know which encoding has been used. (Re)using libraries that read and write more structured data is likely to get you flamed[1]. The history of Unix contains plenty of security problems due to people not correctly accounting for nulls or control characters or spaces etc when chaining together commands (although this is more of a problem with shells than pipes themselves). The output is often not friendly to human eyes by default (I'm thinking of things like localised date and time formats, number formats and so on) since it has to be suitable for passing to another program, unless you use more options or another tool to reformat it.
I would compare it to working with raw memory in C. It's the lowest common denominator, you can do anything, but it's also trivial to screw up and there is a high cognitive overhead. Perhaps it's just too hard to introduce anything higher level at this point.
Perhaps my opinion would change if I spent years (deeply) learning unix tools, but maybe that would just be because I had invested so much time learning a complicated system.
Granted not quite the same thing, but raw bits are often used in lower level languages. Take Windows Win32 APIs, there's a lot of instances where styles are defined by adding constants with values being exponentials of 2. Thus creating a binary array of boolean states.
Another example I used to run into was Windows' controller (joystick et al) API (again Win32). Each bit would represent a different controller button and the 'on' state was if the button was depressed. But as the value was returned as an unsigned long int (if memory serves), it was up to the developer to write their own parser to convert what would otherwise been a random number into a meaningful array of bits. (or at least I did - there is a chance I overlooked another function as this was before I made the switch to DirectX6 - so many years ago!)
Case in point: no sane person would rewrite Apache in Bash. But equally I wouldn't rewrite any of my sys admin shell scripts in C.
There's a balance that needs to be struck. Which I did also hint at in my previous post (the one you dismissed outright when arguing about 'unhealthy concentrations'). And I think what Joe actually meant by that quote was the same thing; that many developers are bad at judging that balance.
He's talking about the concept of fitting things together and refers to Unix pipes (in fact the example he gave was literally a string of piped POSIX commands ready for dumping into $SHELL).
My point was that this concept doesn't scale well.
As a productivity tool, pipes are invaluable. But you wouldn't want to write a performance critical routine using them.
At the end of the day (and as Joe said himself), it's about picking the right tool for the job.
http://theatticlight.net/posts/Why-cant-we-do-pipes-smarter/
if you want a quick fix go buy "learn PHP in ten
minutes" and spend the next twenty years googling for
"how do I compute the length of a string"
pretty much summed up the PHP experience :) If ALL applications in the world were interfaced by
(say) sockets + lisp S expressions and had the
semantics of the protocol written down in a formal
notation - then we could reuse things (more) easily.
nodejs apps are usually very close to that: small modular services interacting via sockets + events using json, protocol buffers, etc. Much like the unix pipe philosophy applied to servers.If you didn't study CS and want to improve your knowledge of algorithms, I found Coursera classes to be very good.
But that's all kind of irrelevant. The purpose that a database serves is a good replacement for other kinds of IPC. It imparts meaning to data and allows applications to communicate in a common way.
Think about it this way: every language has a different way of representing some missing value -- null, nil, undef, Nothing, None -- and all are slightly different. But the application is probably influenced by SQL NULL semantics more than any of those. (EDIT: reworded this paragraph)
Databases pretty much own everything, which is something I think that language people should spend more time focusing on. Maybe the reason that cool new language isn't 2X as productive as python is because you are still using the same database. Language designers need to focus on informed innovation in the database space if they really want to make an impact.
"including state transitions that change the acceptable messages"
That sounds an awful lot like DDL to me.
When you have seven applications written against a single database (plus a load of complex SQL that operators use for support), it becomes impractical to refactor the schema. Now your business is evolving around rotting data structures.
Companies like Oracle make their money by convincing people that they should adopt this misdesign, and then licensing expensive training, staff and technology to help manage it.
Even putting aside the management issues, databases+SQL is a synchronous communications model, so you can't stream data effectively.
Relational theory is intended to make it easier to achieve data independence, including various kinds of schema changes.
You did not offer an alternative, but I am very skeptical that whatever alternative you have in mind somehow improves matters.
"you can't stream data effectively"
If the currently available SQL products don't allow you to stream data effectively, and that's what you need to do, then use something else.
My point was what people are actually doing for IPC. And for the most part, it's using SQL databases. Even communicating between processes in a single application (e.g. related web requests served by different processes), SQL databases dominate.
> including various kinds of schema changes.
If you have several different software teams all with different apps against the same database, it's a struggle to coordinate a refactor.Often there's problems just because of subtle differences in assumptions made about data that aren't covered by the sparse type system that relational databases offer.
These are very common problems for businesses that are growing beyond their "small business" stage.
> You did not offer an alternative
Here's some:* services which offer synchronous lookups over HTTP.
* services which offer interaction by custom streaming protocol.
* pipelines of data along the lines of Drake, which was on the homepage yesterday. This is similar to the batch-processing approach that dominated the mainframe era.
Each of these have lend themselves to "grandfathering" APIs as stuff changes. So when you rely on them, your teams can be flexible in ways that aren't open to you when everyone is running against a shared schema.
Also, you can write those approaches in whatever language you like, rather than being restricted to the stored procedures combinations that your DB offer, which always have poor state handing and limited concurrency mechanisms, and generally have a quirky syntax as well.
> If the currently available SQL products don't allow
> you to stream data effectively, and that's what you
> need to do, then use something else.
Once you have people starting to use a database for message passing, you'll develop an ecosystem of platform-specific stored procedures and the like.Databasese get chosen for messaging not because they're a good solution for it, but because it's the lazy option.
Think of all the systems that start off as an access database on someone's desk, and then evolve into SQL server. And then people write several apps against them and the business is locked into the platform.
By the time you need streaming often you've already made decisions that lock you out of it.
The business can't justify a rearchitect on period-by-period accounting. So the business hits the schema harder and harder until no work is getting done. You end up with a large team of cranky database admins, testers and developers. They work hard but generate little value. Their lives are dedicated to trying to slowly shuffle the blob forward. Your infrastructure costs are now huge.
> My point was what people are actually doing for IPC
I agreed with you on that from my open. And went on to make the point that - irrespective of that - it's a bad pattern.There are things relational databases are effective solutions for. Messaging is not one of them. A schema should be owned and interacted with by one and only one codebase. Databases should not be used as ad hoc messaging systems.
However I've not tried it yet because I don't see how it is going to help me... I already know some functional programming (Scala, Haskell) and I don't work with large, distributed software or databases.
I'm afraid I'm going to learn it, not finding something useful to do with it, and then "forget" it.
I am more or less in the same boat. I picked up 'Learn You Some Erlang for Great Good'. Fun book, fun language, what other motivation does one need? ;)
This is something that resonates with me. I'm never been a 'nix person but this is a very attractive pitch for getting stuff done. It is, after all, how we build things with LEGO.
I went to a Java school so my OO indoctrination was strong by the time I graduated. Now I'm really starting to crave a development paradigm by composition rather than inheritance. My job title is no longer that of a programmer but I write utilities and library daily to help me with my 'real' job. It helps me get stuff done.
So my question - since I primarily work in the MS world, does PowerShell offer the same flexibility and utility of the Unix pipe? I'd never thought of taking the time to learn it until reading this post.
This means that Erlang can get finer time shared concurrency at the expense of speed.
Anything other differences such as syntax is relatively trivial.
Reminded me of http://norvig.com/21-days.html
("Am Anfang schaute ich mich um, konnte den Wagen von dem ich träumte, nicht finden. Also beschloss ich ihn mir selbst zu bauen.")
-- Ferdinand "Ferry" Porsche on inventing the 356
I don't like how he mixes together some precise numbers (, RAM size) with completely unrealistic (you can't do anyting in a picosecond, you can't compile 100k likes of code without noticing the time it takes the even today on any hardware.
- C
- Prolog
- Erlang
- Smalltalk
- Javascript
- Hakell / ML /OCaml
- LISP/Scheme/Clojure
Javascript?! Over Ruby or Python or Lua? What is it with people liking Javascript. I really don't get it. What can I do that is so beautiful or mindbending that I can't do in python?From my experience there is only two reasons to learn Javascript: to be able to build web applications, or to write document store queries (MongoDB or Riak, although in Riak you can also use Erlang). Otherwise I just don't see what the big deal is.
It is not about languages, it is about ideas. And the fact that you need years to master each of these languages because of ideas they are built upon, not because of such trivial things as syntax.
I strongly suspect that Joe would be equally comfortable with this list was C substituted with Go, Smalltalk substituted with Io or JavaScript substituted with Lua.
To paraphrase: "what is it with people liking or not liking JavaScript"? I know what is it with these people: they are noobs (sorry in advance, this is not intended as offensive). I have been programming for just twenty years now and I just recently, a few years ago, understood all this, so I'm not exactly surprised by your post, but still, I thought that email so well written as Joe's here would repel this kind of "Javascript is bad, use WhatEver(tm)" talk.
It seems I was overly optimistic with this one.
Syntax is not trivial. You stare at something 10 ours a day, you want it to be a good user interface.
That's kind of a silly question to ask.
For one, features are duplicated across masses of languages. If you ask, 'what is the one specific thing I can do in this language that I couldn't do in some other language?', the answer is almost certainly nothing. Languages only really start standing out from one another when you start talking about combinations of features. Javascript's combination of prototyping, closures, and first class functions isn't like any of the other languages on the list even before you get to html DOM manipulation or nosql.
But the more important point I'd like to make is, that if a whole bunch of smart people say they really like something, and you can't see why, that should be a sign to look harder.
Which is not to say, if a whole bunch of smart people like something you have to like it, too. But there's a reason smart people recommend it. And even if you eventually end up disagreeing with the reason, that doesn't mean it isn't there.
"Today there is an unhealthy concentration on language and efficiency and NOT on how things fit together and protocols - teach protocols and not languages."
Exactly. Forget the language. Use it if it works for what you need to do. Learn to program correctly, learn how things fit together, how you can use languages together and for the right purpose; learn the fundamentals, learn algorithms, and you'll build quality software in whatever language you choose.
What is it with shaming people for preferring a specific language where it is applicable?
For some reason I can like a brand of electric drill, and I can believe in using a nailgun, but I am not allowed to like a specific language without someone coming along to scold me.
If you don't ever develop opinions about tools and how to use them, are you really engaged or are you just floating along? Liking something is a good sign of engagement, being able to compare it to others in an informed way is even better. The problem is if you put other things down without knowing about them.
When you buy a drill, the main purpose is to make holes in things. When you buy a nailgun, the main purpose is to stick things together. One might do it better, one might do it faster, and yes, it's useful to know those things. But you're still building a house, not an opinion about a drill or a nailgun.
Ever notice how professionals treat their tools, versus amateurs? Photographers are a great example. Amateur photographers are all about cameras and lenses and tools. They buy gear like there was no tomorrow, and they do very little actual photography. Some of them make it past this phase and change their focus to what photography is really about (light, subject, timing) but most don't.
Professional photographers buy cameras for one purpose: because they get the shot. They buy lenses for one purpose: because they get the shot. And they buy everything else they need for one purpose: because it gets the shot. Their focus is the photograph and everything else follows. Of course there is some thought of what lens is right for what job, and what camera works best for what needs, and durability and portability especially; but mostly they use what works because they know it well and it gets the shot. And some pros use the most ridiculous gear that you'd never expect because it works so well for their particular goals.
There was an article a while back about a Iraq war journalist who used only Olympus 6MP zoom cameras made 5-6 years ago because they were workhorses, extremely portable, and held up to desert conditions. Non-pros probably thought he was crazy and dumb, but he got the shots. He shipped. You have seen his photos in the news, guaranteed. Talking about that gear out of context, it would make zero sense. But for the situation, it was perfect, because he focused on the task and not the gear.
I'm not scolding anyone, I'm not criticizing a choice of language; I'm saying, focus on the right part of your task. The tool is important, but the task is more important. That's exactly what the original article was saying, too, if you'll kindly go back and take note.
Any language is Turing complete so the big deal is a matter of style and tools and libraries and ultimately it's who you are working with and what you want to do.
Python has Twisted, and it also has a radically better async ecosystem in gevent. Javascript's async story is far worse than Python's.
Yes and no. Python may have an great async core with Twisted and gevents, but it doesn't have an great async ecosystem. Most tools and libraries aren't written with async in mind and you end up having to roll your own in many places where Node either gives it to you out of the box or with well supported third-party libraries. After having written quite a bit of Twisted code I have to say I find writing async code in Node a lot quicker and easier, despite being a much more experienced python programmer.
Python old? Not to be snarky, but I've got programs for the PDP-11 that dated Python's great-grandmother. Excitement in a language doesn't cut it, I respect productivity, environment and progress. For automation, data munging and analysis, Python is my secret weapon in a shop of MS SQL Server DBA's and C# ditto heads. Would have be nice if MS would have adapted IronPython instead of creating PowerShell...
Yes, there are oodles of crappy Turning complete programming languages, but there's definative advantages to a much smaller sub-set of decent langauges and environments.
I vastly, vastly prefer Python. But we are NOT helping Python AT ALL if we bring it up to trash Javascript every time it's mentioned, without making any argument more specific than "I used a PDP-11".
A massive 3 years older Javascript.
Most people will recommend: http://shop.oreilly.com/product/9780596517748.do
> What can I do that is so beautiful or mindbending that I can't do in python?
The most (and plainly) obvious is; write programs that run on the widest deployed platform/distribution network by several orders of magnitude. That is mindbending and beautiful. Go use Javascript for several years to figure out the rest.
Maybe learning it just as a learning exercise is not so valuable, but Ruby is fantastically useful at getting shit done in the real world with a language that's pretty good. For instance, try and do this in standard Erlang:
stdout_str, stderr_str, status = Open3.capture3(command)
You can't. I've been complaining about it since 2004, others have sent patches, and you still can't easily handle stderr and stdout as separate streams with open_port.I'd love to see a language take its backtracking feature.
The author was using Fortran on punch cards and considered himself lucky [Enter: three more Yorkshiremen ...]
Please correct me if I'm mistaken. This all comes from a cursory research on the subject.