Live data from Hacker News

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

news.ycombinator.com

61–67 of 67 posts

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

#61
I've been doing this for 20 years and professionally used all the major languages and all the major paradigms.

C.

C is high level assembler and manipulating assembly is the foundation of computer science.

What C provides over assembly is...type safety. Why is type safety useful and important? Bad assembly.

Why is a compiler useful and how do you use a compiler to prevent bugs? C compilers make understandable and idiomatic assembly and strong types make it easy to prevent lots of defects that are caused by imprecision and ambiguity.

From an employment perspective, data structures and many algorithms are easiest to grok and express with pointers. Most of the major programming companies will ask whiteboard questions in interviews and many of those questions test for proficiency with pointers.

Much of the key open source systems works are implemented in...C.

The other languages may give you a temporary advantage but I think only C gives a coder the foundational work for a long and successful programming career.

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

#62

I would strongly recommend C. You will learn a lot about computers, rather than computer science. If you want to stay in the computer science realm, I would recommend C#, C++, or Go. All three have the critical mass to be dominant languages in the next decade.

I'm not sure what CS means in this context but my experience has been that C is the language of choice when doing "real CS" - which I'd define as the analysis, use and invention of data structures and algorithms on Turing machines.

If you mean the engineering practice of turning specifications into machines then there are definitely better languages for that.

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

#64
post #17
post #5

What are you trying to achieve? Change the way you think about programming problems: Haskell Enterprise Development: Java. Maybe Scala? Apple Ecosystem: Swift (and actually, it seems like a kind-of pleasant language for general server-side use). Low-level: C++. Or maybe Rust (although not yet given that a serious whirl) Edit: oh, if you're broadly happy with JS, Typescript is worth a look and might (depending on your…

C# is definitely more prevalent than Scala in Enterprise environment. In my experience even between Java and C# it's close to a 55/45 split in Java's favor. Most of the OG Enterprise jobs that people think of like banking will be Java, most of the rest will be C#.

Plus, since 1 or 2 more won't hurt, you can give F# a try for the ML goodness. This may help a progression towards Haskell - found it much easier to grok once I had a bit more playtime with other functional languages.

I personally think, given Node and PHP proficiency, a static functional language may provide more growth in skill. It's a new paradigm as well as typing discipline.

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

#65
post #31

Earlier quoted context omitted.

> 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!"

A monad is a mathematical abstraction. There's nothing special about Haskell that makes it work with monads. They work great in Javascript, C, Python... the syntax of those languages don't make it terribly easy to work with them but it's still available. You have to be disciplined since you don't have the type system checking your work for you but you still get the benefits of the abstraction. I'm presently trying to…

The syntactic sugar is perhaps what's special. Code without that isn't so pretty. I do find it impressive, however, because it's based on an abstract, wide-ranging and extremely useful concept that can actually be expressed in the language without it. It follows the pattern that much syntactic sugar we take for granted has followed e.g a while loop is sugar on top of jumps and branching.

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

#66
post #64
post #17

Earlier quoted context omitted.

C# is definitely more prevalent than Scala in Enterprise environment. In my experience even between Java and C# it's close to a 55/45 split in Java's favor. Most of the OG Enterprise jobs that people think of like banking will be Java, most of the rest will be C#.

Plus, since 1 or 2 more won't hurt, you can give F# a try for the ML goodness. This may help a progression towards Haskell - found it much easier to grok once I had a bit more playtime with other functional languages. I personally think, given Node and PHP proficiency, a static functional language may provide more growth in skill. It's a new paradigm as well as typing discipline.

I haven't had a need for it yet professionally but there are a good number of blog posts I've seen extolling the virtues of doing your unit tests in F# (even for a C# application).

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

#67
post #21

Earlier quoted context omitted.

Honest question, why would you rather choose Java over C#?

C# is a much better language and has better stewardship but Java has extremely broad usage. Plus, speaking from personal experience, learning Java first and then learning C# is probably going to be a positive experience, whereas doing it the other way around feels like going back ten years in time.

I personally learned Java before C#, and totally agree with that sentiment :D
Post reply on HN