Leaving Python for JavaScript
51–60 of 112 posts
Re: Leaving Python for JavaScript
#52So a person who writes web apps prefers JS over Python. Cool. Pick the right tool for the job. If your job is writing client-side-heavy web apps that share code between the client and server, then JS might be a better choice than Python. Look, writing programs that respond to HTTP requests with HTML is not rocket science. You can do it in JS, Python or Ruby and be very productive. If you hate yourself, you can do it…
As for boredom, though, it's true, but every now and then something special emerges out of boredom, as was the case for Vue.js and most recently, Nuxt.js for me.
I hate the amount of JS frameworks and libraries available like everybody else and if anything, this article is also a short reference for myself in disguise on _how to get started_. I'll say though, knowing your way around a Node.js project can be painful, but with a little experience can become really reassuring. Code runs fast, it's easy to write (easy idioms to memorize like Python) and is generally very predictable.
Re: Leaving Python for JavaScript
#53In language that pythonistas would grok:
Arrow functions: multiline lambda definitions
method shorthand definition syntax: class defined with only classmethods, or in other words a namespace
the spread operator: *args in functions
destructuring assignments: tuple unpacking... But also for creation of instances
all functional Array methods and async functions: functools and async... Plus a bit more
While most of this is good to know, I'd still stick with python for readability and maintainability purposes.
Re: Leaving Python for JavaScript
#54Just 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…
I do admit that Javascript's object and array destructuring is extremely nice. The combination of destructuring and the spread operator makes working with heavily nested JSON much more enjoyable than in Python.
Re: Leaving Python for JavaScript
#55Vue is a great language but php can offer more in the backend
Re: Leaving Python for JavaScript
#56Re: Leaving Python for JavaScript
#57Just 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…
Python has lambda but they are one liners. There is no way to do write this in Python: someFunc( _ => { // this is // a function // with multiple lines }) Having to define a named function to use it as a callback is a pain in the ass. Python has an excellent standard library but the language itself is pretty mediocre IMHO. Classes are an afterthought thus verboses, as so is "functional programming" in Python. JS bigg…
Typing
someFunc( _ => {
// this is
// a function
// with multiple lines
})
Is only one line shorter than def foo ():
// this is
// a function
// with multiple lines
someFunc(foo)
There is a case to be made that the second version is more legible and that exposing the function foo makes unit testing it possible. I can understand why people might slightly prefer one or the other, but I honestly can't understand the intensity of opinion around this seemingly very minor syntactic difference.I'm curious what you find verbose about Python classes as:
class FooBar():
text = "Hello World!"
def hello(self):
return self.text
feels fairly terse to me.Re: Leaving Python for JavaScript
#58 @connect(...)
function StateLessComponent(props) {
}Re: Leaving Python for JavaScript
#59Why is all the actual content on the far right side of the page? Even more interesting given that you specialize in UI/UX.
I find it refreshingly different.
Re: Leaving Python for JavaScript
#60I started programming in JS then moved to Python. It seems like JS has become very, very complicated. I look at his post and I am lost... I remember Knockout.js and Node in the v0.8 days. I mean look at this: dotenv (lets you load the environment from an .env file), axios (HTTP client library), cheerio (HTML parsing library), bcrypt (password hashing), co-body (HTTP body parser), co-busboy (HTTP multipart parser), js…
I have been in your position about a year ago. The approached that helped me, was to not worry about all this. Just start somewhere; and in a month or two, you would mostly know which libraries you need to add to your project. The best way to go about it, is to check a few popular open source projects; what libraries they typically use. > I am also asking if any of those libraries will be around in a year? You can ch…
A materials engineer simply cannot afford to pick concrete unless she knows the specific load and weathering characteristics of it. The same should be true for software projects. You shouldn't use cheerio because everyone uses it in their project, but because you've looked through the source and considered all your options for need it fills.
Sorry for the rant, but I think it's important to encourage software developers to think before they code.