from Hacker News

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

by gtt on 6/23/20, 11:41 PM with 19 comments

It all depends on what I what to achieve and I think I want is just a safer and faster python.
  • by tmoaad on 6/24/20, 2:04 AM

    I might go against the grain here, but if I've had nothing but pure bliss working in Java.

    If you're just starting out, Head First Java is the way to go. Then expand your knowledge, look at things like Lombok, or go for one of the languages built on the JVM (Kotlin/Scala). Want insane performance out of the box? Look at Vert.X. There's a library for everything as the language has been around since '95.

  • by cercatrova on 6/25/20, 4:18 AM

    If you want a safer and faster Python, use Nim. That's literally what it was made for.

    If you want to learn functional programming, learn Rust or Haskell. Rust is more pragmatic and is used more than Haskell, but Haskell has more FP features.

    I recommend against Go because it's not really FP, and it has a lot of language inconsistencies compared to Rust for example.

  • by sloaken on 6/24/20, 10:51 AM

    My go to plan is based on debuggers. So whichever language you can find a GREAT debugger in is the one to go with.

    Second criteria would be a language which I knew an expert in. There are plenty of good languages, but when you are stuck or need advise, there is nothing like being able to call up your brother and 'discuss' how you plan to do things.

    Portability is a nice feature, but with all the available virtual environments, it is less important. Although I must say to be able to occasionally program on my phone, during a boring meeting, would be nice.

  • by yagodragon on 6/25/20, 1:30 PM

    Go is probably the best candidate for a safer and faster python. However, if i had to choose only one statically typed language to learn that would be Java. The language is super popular, the tooling is great. There are tons of learning resources and books. It's used by big tech companies(amazon, google etc) for some serious engineering work. It opens up the door to the jvm world where you can also explore languages like kotlin, scala and clojure.
  • by auslegung on 6/24/20, 1:46 AM

    If you’re just wanting a safer and faster Python you probably want Go or Rust. I’m very biased towards Haskell and love it so I’m going to recommend you at least read about its pros/cons (don’t get bogged down with syntax or monads yet, just read about what problems it solves).
  • by photawe on 6/24/20, 9:59 PM

    I would recommend C#. It's really really amazing, you can do both OOP and FP, and Visual Studio is quite well at handling really large projects.

    Debugging is also a bliss.

  • by ttymck on 6/24/20, 1:34 AM

        answer, err := GetAnswer()
        if (err != nil) {
          return "Rust"
        }
    
    (but yes, you probably want Go)
  • by verdverm on 6/24/20, 12:41 AM

    Go

    There is a poll HN feature if you are curious

  • by JS2Java on 6/24/20, 12:28 AM

    Go or Nim.
  • by bjourne on 6/25/20, 10:37 AM

    Learn C or Java. Those languages will be around forever.
  • by smlckz on 6/25/20, 11:23 AM

    Why no one talking about OCaml?
  • by k0t0n0 on 6/25/20, 10:27 AM

    > safer and faster python.

    ohh, f# or Haskell

  • by mikecoles on 6/24/20, 12:44 AM

    Go for Go.
  • by docflabby on 6/25/20, 6:36 PM

    C++