from Hacker News

Python or JavaScript

by SStanley on 7/14/20, 9:49 PM with 10 comments

If you already code in python or javascript, which one is your favorite ? And why ?
  • by factorialboy on 7/16/20, 3:46 AM

    I use both everyday as well. Python is beautiful. Especially if you wrap it with a decent dependency manager like Pipenv.

    I have a high level of comfort with JavaScript as well. While I don't keep up with the ecosystem (because it literally changes every few months) I think it's a powerful language to master.

    I'm at this age where I don't have favorites. I pick the language suitable for the task.

  • by poletopole on 7/16/20, 7:32 PM

    If I have to choice Python hands down because it can be async but is synchronous by default. But theses days there's Typescript so the choice is harder. I'm actually learning Ruby at the moment and I'm surprised how my perception of it was so wrong, so what I'm saying is it's easy to get the wrong idea at first, but once you dig in, you'll find a bunch of hidden gems in a language no one talks about. These little gems are what collectively makes a language good or not--it's not just one major feature, it comes down to the attention to detail.
  • by uberman on 7/14/20, 10:24 PM

    I code in both almost every day.

    While I absolutely hate the look of python (and any language where spacing is significant), I feel like it is easier to get real work done in it.

    While I LOVE the look of languages with blocks based on curly braces I find that any significant javascript implementation tends to result in me having to spend a lot of time tending to promises.

    So given a 3rd choice I would pick my "GO"-to language one not based on spacing being significant and one where I had more control over when and how I leveraged concurrency.

    So in the end, I reluctantly prefer python to javascript.

  • by siquick on 7/17/20, 1:57 AM

    They both do different things but complement each other well. It's the libraries, frameworks, and tools that mostly affect the quality of the language for my use cases.

    Django and REST Framework are two of the best frameworks I've used in any language, and React (especially now with Functional Components and Hooks)and Vue combined with Tailwind have allowed me to build some really nice interfaces.

  • by speedmagnet on 7/14/20, 10:45 PM

    I personally prefer javascript even with it's downsides. It's very fast for me to spin up a nodejs express server with sessions/crud API, and I primarily use the async/await style to simplify promise handling. I work with .NET Core apps at my day job but for personal projects I always choose nodejs due to simplicity.
  • by SStanley on 7/14/20, 11:08 PM

    I feel like you, using both..

    For python I like blocks, using semi-colons ':', the fact that i don't have to use parentheses for loops and using print

    But I love promises, or the fact that i can use it or not. I like npm and all the packages I can found... etc