Live data from Hacker News

How to Pick a Language

web.mac.com

61–70 of 73 posts

Re: How to Pick a Language

#61

PHP?

I don't know PHP, so didn't comment on it. Would it get its own category, or fit into one of the ones I gave?

Probably a new category, templating languages, along with things like jsp, struts, etc. Python, Ruby, Perl are really general purpose languages.

Re: How to Pick a Language

#62
post #58

Fun and relatively comprehensive list, but where is Prolog? Admittedly it is not often practical, but when it is, it make some problem-domains so much easier to grasp.

Have you ever used Prolog for a practical problem? (This is a sincere question.)

Re: How to Pick a Language

#63
post #30

Earlier quoted context omitted.

Well, no because there is one factor that dwarfs all others: what are my friends or the people in my field using? If everyone you know (personally or professionally) is using language X then there will be collective experience you can tap, documentation, mailing lists and howtos, lots of code already written, etc. It doesn't matter if you have a "better" language if there's no-one you can talk to or whose code you ca…

[This refers to Gaius's comment at http://news.ycombinator.com/item?id=446136 . I note this because I've seen "threads" broken because some comments in the middle rise to the top]. Why was this comment downmodded to zero? (I've upmodded it to one). It is well written, thoughtful and makes a good point. I understand people disagreeing with it, but downmodding it to zero is just insane. I've seen this phenomenon increa…

I totally agree on the downmodding (although I disagree with the comment you refer to). Apparently some people find the use of words challenging.

There is a big difference between the use of voting for filtering large amounts of content and using it as a way to express opinion. The former is serverd perfectly well by upvoting. The latter is unworthy of intelligent beings in my view.

Re: How to Pick a Language

#64

PHP?

I don't know PHP, so didn't comment on it. Would it get its own category, or fit into one of the ones I gave?

Php is, in my opinion, a "templating" language (yes, I know it's not just a templating language). Closer to "scripting" than the other categories.

Re: How to Pick a Language

#65
post #7

Nice and thorough. I only have two qualms: 1. Reading through the Matz book on Ruby ( http://oreilly.com/catalog/9780596516178/index.html ), there's a very good explanation as to why Ruby/Python/Perl are "scripting" languages as opposed to "programming" languages: no main! That is, whichever file is fed to the interpreter is run (with some exceptions) in order. So these are, and probably always will be, scripting lan…

Interesting way to define "scripting" languages. I didn't mean to underestimate JavaScript, which is why I gave it its own section. Perhaps I was too brief? Implication that its only useful in the browser?

Javascript is a bit of an enigma. Usually, bad languages are made better (or at least tolerable) by the existence of good libraries (see C++, Perl). In the case of Javascript, it's a really elegant language made worse by being so often so dependent on the DOM and all of it's obscurities.

I admire Javascript because it covers so many paradigms, and yet is, at the core, very simple and straightforward. Much as Lisp is to lists, Javascript is to hashes. Also, there are some really interesting projects in early stages that are taking Javascript out of the browser. For example, when Google released the code for v8, Marc-André Cournoyer from the Ruby community slapped together a project that translated Ruby to JS and ran it through v8 (http://macournoyer.wordpress.com/2008/09/02/ruby-on-v8/).

Finally, I think it's worth noting that if you believe the "cloud" is the future, then Javascript is the de facto machine code of the "cloud"...

Re: How to Pick a Language

#66
post #29
post #7

Nice and thorough. I only have two qualms: 1. Reading through the Matz book on Ruby ( http://oreilly.com/catalog/9780596516178/index.html ), there's a very good explanation as to why Ruby/Python/Perl are "scripting" languages as opposed to "programming" languages: no main! That is, whichever file is fed to the interpreter is run (with some exceptions) in order. So these are, and probably always will be, scripting lan…

So if you can just put the main program statements into the file without wrapping it in a function or anything, it's a "scripting language", but if you have to wrap it in a main() function or something, it's not? That's a definition of "scripting language" that includes x86 assembly for MS-DOS .COM files as a "scripting language", but excludes VBScript macros for Microsoft Word, I think. Now, I don't know what you th…

Yes, but then people are conflating notions of type-system/runtime/vm/etc. with the notion of script vs. program. The key distinction is this: In a programming language you can only have one entry point (the "main()" function), regardless of how the individual files are linked. In a scripting language the entry point depends on which file the interpreter starts with, and the execution model can change depending on how the script is invoked.

For example, the Ruby community uses this trick quite often so that one file can be a library if included by another source file, but can be an executable if invoked by the interpreter directly. See: http://gist.github.com/51337. If you run "ruby a.rb" you'll get something different than if your run "ruby b.rb", even though both are the result of "linking" a.rb and b.rb together.

...let's see you do that with C! ;-)

Re: How to Pick a Language

#67
post #29

Earlier quoted context omitted.

So if you can just put the main program statements into the file without wrapping it in a function or anything, it's a "scripting language", but if you have to wrap it in a main() function or something, it's not? That's a definition of "scripting language" that includes x86 assembly for MS-DOS .COM files as a "scripting language", but excludes VBScript macros for Microsoft Word, I think. Now, I don't know what you th…

Yes, but then people are conflating notions of type-system/runtime/vm/etc. with the notion of script vs. program. The key distinction is this: In a programming language you can only have one entry point (the "main()" function), regardless of how the individual files are linked. In a scripting language the entry point depends on which file the interpreter starts with, and the execution model can change depending on ho…

If I am understanding you correctly, I believe that it is possible in C, using macros. If you include the following in each file:

#ifndef MAIN_ALREADY_DEFINED__

#define MAIN_ALREADY_DEFINED__

int main(){

/* file specific stuff */

}

#endif

Disclaimer: I wouldn't actually do this in practice...

Re: How to Pick a Language

#68
post #29

Earlier quoted context omitted.

So if you can just put the main program statements into the file without wrapping it in a function or anything, it's a "scripting language", but if you have to wrap it in a main() function or something, it's not? That's a definition of "scripting language" that includes x86 assembly for MS-DOS .COM files as a "scripting language", but excludes VBScript macros for Microsoft Word, I think. Now, I don't know what you th…

Yes, but then people are conflating notions of type-system/runtime/vm/etc. with the notion of script vs. program. The key distinction is this: In a programming language you can only have one entry point (the "main()" function), regardless of how the individual files are linked. In a scripting language the entry point depends on which file the interpreter starts with, and the execution model can change depending on ho…

This is a different distinction than the one the other poster reported that Matz proposes, but it's not useful either. You can do it in C, even without using the preprocessor; see http://gist.github.com/51416, which does it with weak symbols. Worse, whether C is a "scripting language" or not depends only on the presence or absence of such trivial features.

Your distinction would make Java a "scripting language," because every class can have its own main function, and still leaves x86 assembly as a "scripting language", and now it makes GNU C a "scripting language" too; and given the nondeterministic invocation order of the constructors of static objects, it makes any particular C++ implementation a "scripting language" too.

Re: How to Pick a Language

#69

Pick Arc if: You want a 100 year language and you’re willing to wait that long. I know it was a cheap shot but I couldn't help but laugh when I got to that point in the article. The relative lack of activity on http://arclanguage.org/forum makes me think the best reason to choose Arc at this point is to run news.arc.

I'm doing a presentation today where I say that Arc is a failure and I always feel guilty about that. But the thing is, I think the real reason for the fail is in the book "Art and Fear." If you focus on quality, you end up with inferior quality compared to people who focus on quantity. You have a much better chance of creating a 100-year language if you create a 100 languages in a year. Remember, Lisp is at least a…

If you focus on quality, you end up with inferior quality compared to people who focus on quantity

That sounds a bit simple. What about that other great bearded wonder, Leonardo? He only made about 30 paintings.

http://en.wikipedia.org/wiki/List_of_paintings_by_Leonardo_d...

Re: How to Pick a Language

#70
post #30

It's opinionated, but this article serves as a good FAQ for people who might be asking what language should they learn.

Well, no because there is one factor that dwarfs all others: what are my friends or the people in my field using? If everyone you know (personally or professionally) is using language X then there will be collective experience you can tap, documentation, mailing lists and howtos, lots of code already written, etc. It doesn't matter if you have a "better" language if there's no-one you can talk to or whose code you ca…

That's a good point, but I'll address both points.

- What are my friends using?

Each of these languages has online communities that are ready to help. Some more than others, but they all minimize the need to have real life friends who use the given language. Physical groups can be beneficial, but thanks to the internet they are no longer strictly necessary. Also, in most cities there are usergroups if you'd like to interact in person with the community.

- What are the people in my field using?

There are advantages associated with using a language or DSL/framework that's popular within your field - there is no denying that. But you shouldn't underestimate the competitive advantage that a more obscure language that's better suited for the task can give you over your competitors. PG used Common Lisp without a relational database for Viaweb. Yet in part that was the secret to his success. I suspect that using Lisp or Haskell in places where everyone else still use C++ or Java, may be a major competitive advantage thanks to the increased productivity and more robust code you can write with them.

Post reply on HN