Live data from Hacker News

Ask HN: If I only learn one static typed language, which one should I learn?

news.ycombinator.com

31–40 of 67 posts

Re: Ask HN: If I only learn one static typed language, which one should I learn?

#31

OCaml or Haskell. They will teach you concepts you can take back into PHP or Node.js to make your code better. And in my frank, unbiased opinion: sound type systems and pure functional programming is the future of the industry. If you're a pragmatist it's still a good choice. You can bring FP concepts to C, Java, whatever later on too.

> They will teach you concepts you can take back into PHP or Node.js

Curious what these are. The only thing I retain back in dynamically-typed land is "argh I wish this was statically typed!"

Re: Ask HN: If I only learn one static typed language, which one should I learn?

#32

Earlier quoted context omitted.

If I only learn one right now will I regret choosing Golang over Java?

Golang is focused on scaling/concurrency, is very compact and fairly quick to learn. You can compile a single binary and deploy it anywhere. You can build a web server in a few lines of code. It's really strong for processing tons of requests, web API's and backend code. Java requires a whole app server which is more of a pain to setup. (generally speaking for web dev, think Tomcat, JBoss). It's way more verbose and…

Java definitely does not require an app server.

I'd also submit that few concurrency libraries are as battle-hardened as java.util.concurrent.* at this point.

Re: Ask HN: If I only learn one static typed language, which one should I learn?

#34
post #9

Practically speaking, Java or C#, purely for the job prospects. C / C++ if you're looking for something with wide applicability to learning other languages more quickly.

> C / C++ if you're looking for something with wide applicability to learning other languages more quickly.

I came here looking for this. I learned C as my first language [1]. And I learned an immense amount about how things like memory management and type casting and things like that work. It is a foundation that has helped me learn other languages much more quickly.

Although the question is for learning "only one" and I'm not sure C or C++ is a great "only" static typed language.

[1] using "Sams Teach Yourself C in 24 Hours" which I got in an actual bookstore and came with a copy of the Borland C compiler :)... ah the memories.

Re: Ask HN: If I only learn one static typed language, which one should I learn?

#35
post #31

OCaml or Haskell. They will teach you concepts you can take back into PHP or Node.js to make your code better. And in my frank, unbiased opinion: sound type systems and pure functional programming is the future of the industry. If you're a pragmatist it's still a good choice. You can bring FP concepts to C, Java, whatever later on too.

> They will teach you concepts you can take back into PHP or Node.js Curious what these are. The only thing I retain back in dynamically-typed land is "argh I wish this was statically typed!"

I've worked with functions in JavaScript that change functionality radically depending on whether you pass an integer or an object.

I thought this was the way of the world until I got deeper into typed languages, where you learn why not doing that is good. Type envy still stings though.

Re: Ask HN: If I only learn one static typed language, which one should I learn?

#37
Most useful in what context?

If you want to pick up a language as quick as possible then C# or Java. Either choice is fine.

C# has a lot of potential in the future now Microsoft are making it more open with multi-platform .NET but it is still a way off IMHO.

Java is used everywhere and while it isn't all that "cool" it does work well, is easy to write, debug and maintain. Plus I actually quite like JavaFX. It allows me to make a nice looking UI very easily. As great as C#/.NET is you can't use C# for any decent GUI stuff outside of Windows just yet.

If you want to get a job then look at what jobs in your area are using.

Re: Ask HN: If I only learn one static typed language, which one should I learn?

#38
Swift is a fantastic language with an excellent type system. It can go all the way from writing scripts to building a whole OS and it's about as performance as C/C++. Plus you have a great app ecosystem to build apps for, iOS, TVOS, etc... but it's also open source.

Re: Ask HN: If I only learn one static typed language, which one should I learn?

#39
Another vote for Typescript here. For one because it's a really nice modern type system that doesn't get in your way too much. Also because if you're already familiar with node, you'll be able to focus on the language rather than new libraries/tooling/ecosystem.
Post reply on HN