Live data from Hacker News

Leaving Python for JavaScript

hire.jonasgalvez.com.br

101–110 of 112 posts

Re: Leaving Python for JavaScript

#101
post #78

With async/await now landing in mainstream engines, Koa instead of Express, the new Turbofan+Ignition optimization pipeline "evening out" V8's performance characteristics, and ES6 enjoying reasonably broad support, I feel like JS is now crossing a threshold into being not a completely sucky programming experience, which is a sentiment this article echoes. I'm probably being overly optimistic, but I look forward to a…

I'm split on it myself. I like being able to go Right Click -> View Source and poke around but with more modern sites, you're given nothing but a single JS file. You can scroll through the DOM in developer tools but it's not as neat as text :(

Re: Leaving Python for JavaScript

#102
post #18

> there's no acceptable way to pass a function body to another in Python. There are sentences which are telling a huge incompetence about the person using these. This sounds the same story to me as "We used tech X, but X is shit/can't do something so we switched to Y, and Y is awesome and fast." Where the person switching was just incompetent with X but it would have been perfectly solvable and they just do a totally…

This guy does sound incompetent. Sounds like he likes js because it's easier to use callback hell with multiline anonymous functions. You can pass a function as a callback or something else in python. You just give the function a name then pass it. No function literals. Also he's talking about async/await in koa... does this fool realize that async/await is built into python? I'm proficient in both python and js and…

> Sounds like he likes js because it's easier to use callback hell with multiline anonymous functions.

Sounds like you're more pissed off at the article because it contradicts your views than anything else. Sounds like you didn't even pay full attention to it.

Yes, those who assumed I meant you can't pass an anonymous multi-line function to another were obviously right -- it dazzles me people spent so much time arguing over this point. There's not much else to it.

I'll just say: that's definitely NOT the sole reason -- I point out several other factors that weighed in my decision in making JS my #1 choice. Above all, after seeing a few successful large projects deployed (and no issues in production), I just came to trust the Node.js stability and ecosystem.

Re: Leaving Python for JavaScript

#103
> There are sentences which are telling a huge incompetence about the person using these.

Having "worked" with Jonas Galvez, I can tell you that he is hugely incompetent in all sorts of other ways as well. From skipping conference calls to writing completely broken code, he single-handedly drove down the productivity of our entire team. We paid him, but we learned to never trust anybody that's willing to work for free.[1]

[1] https://news.ycombinator.com/item?id=7326682

Re: Leaving Python for JavaScript

#104
post #42

Just in case the author is present in the thread: Your blog is extremely difficult to read on wide screen monitors. The entire left 50% is basically just blank space. My suggestion is to make the left side maybe 20% width on desktop or less. Also, regarding the article content: There really aren't any good reasons presented here about why you moved from Python to Javascript for back-end web development. It seems that…

> Your blog is extremely difficult to read on wide screen monitors. The entire left 50% is basically just blank space. My suggestion is to make the left side maybe 20% width on desktop or less. Thanks, I'll take a look when I have a chance. I myself don't own a widescreen monitor, the site looks fine on my MacBook and several other computers. It's not a paid job, not a lot of effort went into it ;) > but the title is…

> Hm, actually, it's not. I'm surprised by this comment. I point out precisely the JavaScript features that weighed the most in my decision: "So with JavaScript you've got arrow functions, the method shorthand definition syntax, the spread operator, destructuring assignments, all functional Array methods and async functions. Combined with Vue's minimal patterns and Nuxt's conventions, I can't think of a better language to write web applications in."

I saw that. I guess I just expected you to go into detail about why you believe things like that are better. I use JS a lot in my day-to-day work for the front end of my web application. I also use Django and Python for my back-end. I'm well aware of the differences between Python and Javascript as they are the two languages I work with the most. I would not consider either language "better" than the other except at specific tasks. i.e. I can't really use python to build an SPA and it would be a pain to use Javascript for anything involving heavy number manipulation. I guess what I'm saying is that you should always choose the right tool for the job; sometimes that will Python and sometimes it will be JS. Other times, it might be something else. I'm always a little confused when someone decides that they're going to start writing everything in a particular language even when other languages are more suitable for the task.

> Exactly that, a "function body", "closure", "inline function", whatever you wanna call it. In Python there are lambdas, but they're limited and not even encouraged anymore. We're left with passing function references, and that's where JavaScript comes out the winner IMHO.

To each their own I guess. I feel like programmers these days automatically assume that more functional == more good. There are cases where using FP techniques is definitely advantageous. However, there are also circumstances where OOP is a better choice. I find that Python is equally capable of both paradigms. The idea of anonymous callbacks is good from a productivity standpoint, but readability suffers. Anonymous functions in general cause cryptic error messages and are difficult to debug. I've found that the over use of anonymous functions can also lead to a lot of duplicate code. There are many cases when an anonymous callback would be better if refactored into a named function. I believe that having more named functions aids in creating an efficient program compostion, even when using the FP paradigm. There is one use case where Javscript is much better suited than Python: web applications front ends. This comes as no surprise as JS was designed for exactly that purpose. Asynchronous callbacks and promises cannot be beat when dealing with fetching data from an API.

Re: Leaving Python for JavaScript

#105
post #42

Earlier quoted context omitted.

> Your blog is extremely difficult to read on wide screen monitors. The entire left 50% is basically just blank space. My suggestion is to make the left side maybe 20% width on desktop or less. Thanks, I'll take a look when I have a chance. I myself don't own a widescreen monitor, the site looks fine on my MacBook and several other computers. It's not a paid job, not a lot of effort went into it ;) > but the title is…

"Anonymous function" is the term you're looking for. Lambdas are still encouraged for trivial functions; the only thing that's changed is that comprehensions have replaced many uses of map and filter. Python just requires you to name non-trivial functions. IMHO, complex/nested anonymous functions are usually bad for maintainability, so I'd rather have a language that doesn't allow them (Python) than a community that…

I couldn't agree with you more. I think that Python's lack of complex anonymous functions actually forces the programmer to compose their code in a more efficient manner.

Re: Leaving Python for JavaScript

#106

> There are sentences which are telling a huge incompetence about the person using these. Having "worked" with Jonas Galvez, I can tell you that he is hugely incompetent in all sorts of other ways as well. From skipping conference calls to writing completely broken code, he single-handedly drove down the productivity of our entire team. We paid him, but we learned to never trust anybody that's willing to work for fre…

Like any other developer out there, I collected some bad experiences in my growth. In my 14-year career, 2015-2016 were spectacularly bad years for me, definitely the worst. It has to do with focus and productivity, not competence.

I must say I didn't think it was so bad as to leave this kind of sentiment behind. If you worked with me in that period, perhaps you'll be pleased to read this:

http://hire.jonasgalvez.com.br/2017/Jul/16/My-Approach-to-Re...

Since then I'm confident all my current employers will wholeheartedly vouch for the quality and persistence of my work, as you can easily peak from my GitHub graph.

http://github.com/galvez

I flagged your post nonetheless.

I believe HN is no place for ad hominem attacks.

Re: Leaving Python for JavaScript

#107

> There are sentences which are telling a huge incompetence about the person using these. Having "worked" with Jonas Galvez, I can tell you that he is hugely incompetent in all sorts of other ways as well. From skipping conference calls to writing completely broken code, he single-handedly drove down the productivity of our entire team. We paid him, but we learned to never trust anybody that's willing to work for fre…

Like any other developer out there, I collected some bad experiences in my growth. In my 14-year career, 2015-2016 were spectacularly bad years for me, definitely the worst. It has to do with focus and productivity, not competence. I must say I didn't think it was so bad as to leave this kind of sentiment behind. If you worked with me in that period, perhaps you'll be pleased to read this: http://hire.jonasgalvez.com…

I don't know how to say it without you taking it as a personal attack, but I think it's important to say so you can take the opportunity and learn or at least think about it; If you say things like that I quoted, you are incompetent and you have to learn a lot. I feel I have to say this because you send the wrong message to a wider audience which I really hate.

Also I skimmed your library httplib2 and it's at least terrible to read.

Again, you can take this as a personal attack, flag this comment also, be mad or whatever, or buy Clean Code and start reading, also start learning more about Python idioms from people who are really good at it, e.g. Raymond Hettinger, Armin Ronacher

Re: Leaving Python for JavaScript

#108

Earlier quoted context omitted.

Like any other developer out there, I collected some bad experiences in my growth. In my 14-year career, 2015-2016 were spectacularly bad years for me, definitely the worst. It has to do with focus and productivity, not competence. I must say I didn't think it was so bad as to leave this kind of sentiment behind. If you worked with me in that period, perhaps you'll be pleased to read this: http://hire.jonasgalvez.com…

I don't know how to say it without you taking it as a personal attack, but I think it's important to say so you can take the opportunity and learn or at least think about it; If you say things like that I quoted, you are incompetent and you have to learn a lot. I feel I have to say this because you send the wrong message to a wider audience which I really hate. Also I skimmed your library httplib2 and it's at least t…

httplib2 isn't my library, it's Joe Gregorio's, one of the best developers you'll ever read about.

As for the "if you say X, you're incompetent" line of arguing, seriously? If I say I prefer a language because it makes me write functional code faster (in my perception) and disagree that Python is better than JavaScript then I'm incompetent? Seriously, guys?

BTW, I dig Armin Ronacher's work too. His Python code, how beautiful it may look, doesn't diminish any of the points I raised about JavaScript nor my love for it.

I'm done paying attention to this thread.

Re: Leaving Python for JavaScript

#109

> There are sentences which are telling a huge incompetence about the person using these. Having "worked" with Jonas Galvez, I can tell you that he is hugely incompetent in all sorts of other ways as well. From skipping conference calls to writing completely broken code, he single-handedly drove down the productivity of our entire team. We paid him, but we learned to never trust anybody that's willing to work for fre…

That's a personal attack and we've banned the account.

We detached this subthread from https://news.ycombinator.com/item?id=15099679 and marked it off-topic.

Re: Leaving Python for JavaScript

#110

Earlier quoted context omitted.

the problem is callbacks as a pattern if you have a multiline function it should be named and unit-tested instead of just stuffed anonymously into some pyramid of doom

> if you have a multiline function it should be named and unit-tested instead of just stuffed anonymously into some pyramid of doom It's like saying all data should be declared as variable, in the functional programming paradigm, functions are data. That's why closures are useful. And it has absolutely nothing to do with unit-testing, that's beside the point. Javascript is not harder to unit test because it has fully…

what does functional programming have to do with it? you still unit test functions in functional programming surely?

> It's like saying all data should be declared as variable, in the functional programming paradigm, functions are data. That's why closures are useful.

I don't think you understand what you're talking about. We were already talking about using 'functions as data', and closures and anonymous functions aren't the same thing.

But anyway, how do you unit test an anonymous function?

I assume you mean that you don't, you just test the bigger context around it. But that was my point, once your anonymous function starts becoming much bigger than a one-liner it ought to be tested itself.

Post reply on HN