I want to learn another programming language now that I’ve been using Python for over 2 years now. I am kind of leaning on learning JS so that I can use it for the backend and also for the frontend. But the syntax is kind of weird. I heard Go is pretty good for the backend and also is compiled. What do y’all say? I also welcome other language recommendations.

  • karlhungus@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Personally i prefer go, but these are pretty standard languages; so learning the in’s and out’s really isn’t all that time consuming (you aren’t going to have to change how you think about programming like say rego). Since you have python experience these should be no big deal, but maybe worth playing with a bit if you are trying to get a job in either language and need to cross off that bullet.

    As for expanding your learning, i’d try something like functional programming (haskell), or query language like rego above. Neither of these will be great for your resume though.

  • A_Dude@lemmy.ninja
    link
    fedilink
    English
    arrow-up
    9
    ·
    1 year ago

    Go has a much cleaner syntax, and is better suited to its specific niche which is (relatively) low-level BE development. If you are attracted to that niche then Go is an excellent option. Also, Go is almost a default for developing for K8S, which might be another plus.

    On the other hand, JS is a more general-use language. It has a very loosey-goosey syntax and lots of weird behaviors. It is applicable on both FE and BE but be aware that in each of those, knowing JS is just a first step, since (for example) for FE development you will also need to know at least one of the major frameworks (React, Vue, Angular etc) as well as the page object model and a ton of other stuff.

    Bottom line- usually the language is the tool, not the objective. Figure out what you want to develop, then choose the optimal language to do it with.

  • sarjalim@lemm.ee
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    1 year ago

    As someone else already said, don’t overthink the language choice aspect in general. If you learn almost any imperative language with C-like syntax (Go, JS/TS, C#, Java etc), picking up another one in the same “family” to a usable degree will be a very minor hiccup done within a very short time (hours). Sure, there are quirks and special syntax and different collections of built-in features for each one, but as a developer you will likely switch between several anyway and need to look up syntax from time to time - you know that something can be done, but the details how are a bit fuzzy.

    For instance, I code mostly in C# and JS/TS, but we have legacy applications written in VB.NET so I often google VB syntax for things that I know how to write in C#. I also occasionally code in C, have dabbled in Fortran, Python and PHP and I’m sure I’m forgetting one or two. SQL and LINQ syntax too of course. What you learn on your developer journey is that something can be done, but remembering the specific implementation in a specific language might be a job better suited for your search engine. That said, of course it’s good to start with one language that you know pretty well, but it seems like you’re already there with Python.

    The real challenge is learning the methodology of building applications, philosophy of OOP, patterns and program/application architecture and frameworks. Language choice is very much secondary to those areas of expertise imo.

    Personally though, I am partial to JS/TS as I’ve used those the longest, they are extremely versatile and frontend development is my favorite area.

  • colonial@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    1 year ago

    I’m not a fan of Go from a language design perspective, but it does have plenty of technical merit (cheap coroutines, compiled) compared to using a scripting language for your backend.

    Some pointers on other languages:

    • Don’t sleep on Java/Kotlin or C# for your backend. They’re good languages with powerful, well-developed ecosystems. Kotlin even compiles to JS!
    • TypeScript is saner JS. Highly recommended.
    • If your backend is CPU-bound, Rust will let you squeeze out every ounce of performance at the cost of a relatively steep learning curve.
  • MotoAsh@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    1 year ago

    JS will be far more versatile if you learn it well. It’s in so many dang things.

    The biggest annoyances about JS are some things that exist in Python, so you’ll already be familiar with loosely typed systems and mutatable objects (dictionaries/hashes or what ever Python calls 'em).

    Other than that, it’s mostly that there are a million ways to get the same things done, even something like, “define a class with static and instance-bound functions and properties”. Older JS techniques only use scope and the prototype and look like a gross hack. Modern JS has actual class syntax.

    It all stems from the constant enhancement of the language. Many, many nice features like proper class syntax and first class modules (no more third party module syntax) came in ES2015, and a sadly small number of front end devs to this day really don’t know them well.

    Many web dev tutorials use older style techniques just because they’ve been around ages. If you learn how the new features are mostly syntax sugar on old styles, you’ll be a JS pro in no time.

    • clif@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      1 year ago

      This is a great answer. Bumping it as someone who got forced to move into Node/JS around 8 years ago and came to love it (after the ES2015 changes :). It’s primarily what I work in and I teach community classes on it these days.

      I’ve been dabbling in Go lately for lower level server side stuff and, while I don’t dislike it, it’s a big shift in thinking. There are a lot of niceties to the Go ecosystem.

  • spacedogroy@feddit.uk
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    If you wanted to do both front and backend development TypeScript + JS/Node would make the most sense, no? I say this as someone who works with and enjoys working with Go almost every day, but there’s only so much time to learn new stuff.

  • starman@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    You can try C# and see if you like it. You can do frontend in it as well, but C# isn’t as popular on frontend as JS, so it will be harder to get a job as frontend dev. But on the backend C#/.NET is the best choice for me.

  • tuto@lemmy.world
    link
    fedilink
    brezhoneg
    arrow-up
    1
    ·
    1 year ago

    I personally don’t like anything JS related. I would simply recommend Go, but even that is not really my go-to. I found learning Nim quite entertaining, and it’s middle -ground between Pyhton and Go, which can also target JS, if you want to.

  • QT1@feddit.de
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I‘d say it depends on your motivation and your reasons for learning another language. Do you want to build something in particular? In that case, pick the right tool for the job, as the others have suggested. However, if you want to broaden your horizon, I would suggest to try a language based on another paradigm, e.g. a functional language such as Haskell, ML, or OCaml. Want to see some „pure“ object-oriented language? Then maybe have a look at Smalltalk. The languages I have listed may not be the most widely used in practice, but in my experience, knowing several different programming paradigms makes you a better developer overall.

  • somegeek@programming.dev
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    1 year ago

    Syntax wise, JS, specially TS has a great syntax and go is much weirder. I don’t care what the haters say. JS syntax is very understandable. And you can see why Rust has borrowed a lot of syntax from TS and JS. And I think knowing js is much more useful,but if you want to build big backends with good performance, go is better.