Where to spend my limited time? Perspective on Python vs JS

I’m an utterly green coder. And I don’t know where I’,m torn between two directions. And hoping someone with more experience can give me alittle perspective.

I really enjoy coding, but it’s a past time hobby to my real job, and therefore I only have limited time. However, I’m going to lie if I one day does not hope to build something that other people will find valuable.

I have started making tailored databases in Airtable which I’ve started selling as a subscription to a few companies. I see it as form of MVP and to get training.
I started to learn Python as I thought it’d in the future help me move away from Airtable, and it’ll allow me the flexibility to explore different directions (building applications, RFID’s, machine learning).

However Airtable just launched a beta that allows me to do all sorts of exciting things with Java Script. I didn’t know any JS so I went through the introduction on Codecademy, which I found surprisingly easy (mainly because I could apply lots of the learning from Python directly to JS - at least here in the beginning)

My problem is if I should stick with Python because it’ll, in the long run, allow me to test explore what I want to do. It seems there are way more applications I’ll be interested in with Python - however it might be quite far into the future.
But on the other hand, JS seems to be something I can use right now, and get real-world experience through Airtable, and it’s very thrilling to play around with something I can get real-life feedback on from existing customers.
But I don’t know enough of either Python or JS to figure out where I should put my minimal time.

1 Like

Two thoughts:

If you want to build something that’s useful for ‘normal’ people, learning JS seems to be a good idea because it opens up the whole world of browser technologies, which, in turn, make it possible to create beautiful UIs pretty quickly (Electron comes to mind).

Also, learning a second (and then a third and a fourth…) language seems to be a crucial step because it forces you to abstract from the particular idioms of your first language and to think more generally about what you want to do and how.

How comfortable would you think you are with Python now? And what are the particular applications that you think Python will be useful for and JS won’t?

Currently I’m nowhere close to do anything with Python.
Just about to finish the first book, and getting into testing. I think thats why I feel like doing something now with JS feels so good.
But at the sametime JS seems like a shiny toy which I can get my databases to do something slightly more complicated than before.

This might be completely unjustified (Hence im asking in here).
I read somewhere that Python is for building ‘once’, Machine learning and easier to maintain whereas JS is mainly for websites and frontend?
I think it’s the heavy focus on frontend websites that makes me doubt JS as I don’t really want to make website or facebook news feeds.

Would JS be able to build applications like ruby or python?

The nice thing about JS is that you can get tangible results quickly with all the browser technology that it can interface with. Maybe that’s why you feel it’s like a shiny toy? But don’t underestimate the motivational effect of being able to see and touch what you build.

I think that’s where JS comes from, but it looks like it’s evolving fast now – faster than Python at any rate. I think you can build applications with a JS runtime like Node.js just fine. Python does feel sort of more mature, but maybe that’s just me and my limited experience.

There are a few threads here about Python vs. JS, maybe take a look at the JS category?


Just one more thought: If you don’t feel confident with Python yet, maybe focus on that for the moment. You know, finish the book, build a few things of your own. Once you’re more settled you can move on without fear to get things all muddled up.

@ktrager my tuppence worth, based on a similar decision I had to make last year when in a similar place…

TL;DR
Pick one and learn it thoroughly (700+ hours), then the choice of future learning is much easier.

Over the years, I’ve worked with a few languages; C#, Python, Ruby, Javascript and Java but only ever to the point where you are comfortable with syntax and can hack together simple programs. I’ve got quite deep into Python due to Zed’s course and the little LCLive community we had going a couple of years ago (working on similar issues with a group is really good motivation and I think @zedshaw might be launching something similar soon for JS).

However, whenever I tried to expand my programming skills into something larger than a simple script/programme, I also found the learning curve greatly increased. For example, a web app built in Python (Flask/Django) needed knowledge of:

  • HTML
  • CSS
  • SQL
  • Git
  • bash / *nix
  • Virtual environments
  • Packages and installing requirements
  • HTTP
  • Databases
  • Design patterns
  • OOP

OK, admittedly not all of these are essential, but I’ve spent too long throwing together things based on instructions on Stack Overflow or other online discussion without necessarily really understanding them.

In my view, the primary thing that has held me back, is the lack of understanding of the basics. And I mean the real basics of Computer Science. I never studied CS so even the fundamentals took a while to understand. Zed was excellent here, explaining differences between arrays and lists, the history of software development, how Ed, Sed, Vi, were developed and why, and therefore, why some code is the way it is, despite seeming illogical in today’s context. But it has been a long, continuing journey.

I recall from a course someone saying that it takes about 700 hours to really learn a language. I know @DidierCH was tracking his at one point and did 100 days of continual coding adding up to something impressive in terms of hours. So if you’ve only covered 50-100 hours, there is some way to go.

But what is most interesting is that the principles of software development are not radically different between languages. The syntax and idioms may change, but the core principles of software construction and maintenance remain very similar. So investing 700 hours to learn a language (either Python on JS) will mean you can pick up other languages much quicker. I think Zed mentioned the quick hacks in Learn More Python The Hard Way are his go to tasks when learning a new language. That way he already knows the problem/solution, and is just exploring it in a new language paradigm.

As a final comment, someone, maybe @florian, shared a site about learning computer science recently. Its become a total rabbit hole for me and answers so many basic questions I’ve not really understood (what REPL was for is an example). As a result, I’m working through the course now. Is based on Lisp, which introduces more issues installing and using the interpreter, but is not insurmountable.

The choice it ultimately yours, but I would invest the time to really understand one language, but resist the urge to become a specialist only in that language or framework. Become a generalist with deep knowledge of software development, certainly if you want to be employable.

2 Likes

First up, super cool you got some money from Airtable coding. I’d be interested in a whole thread on that if you get the time.

I think what most people wrote here is correct, but I’ll just put a slightly different spin on this JavaScript vs. Python:

Python purposefully adds features to Python 3 that make it so they don’t have to run both Python 2 and 3 at the same time (despite a foundational theory of computer science called the Church-Turing Thesis which says this is very possible). JavaScript lets you freely write and intermix code form ES4/ES5/ES6 and they’re all fairly radically different languages, and does it across multiple platforms with a lot of care into how they advance the language. The people running Python basically don’t care what you need and want to force you to do what they tell you to. The people running JavaScript (now) want you to just make stuff with JavaScript and spend a lot of time trying to improve it. Sure, it’s got warts, but c’mon so does Python.

I ran into this thing today Node-RED that basically gives you a low-code way to create software. It’s written in JavaScript and runs in the browser, desktop, Raspbery Pi and deploys the cloud.

Let’s say, it’s desktop apps or mobile. https://www.electronjs.org/ and https://neutralino.js.org/ plus countless others. Python? You have to use crusty old PyQT that’s basically 1990s coding and very difficult to release for desktop, let alone mobile.

But, sure you can make a thing with PyQT, but electron and friends just use regular old web technology. It just works. Learn web browser and you can make apps for most any platform with the same skills. Want a mobile app in Python? Oh that’s PyQT mobile or maybe some one off thing, then the website is in Django, and a whole other set of skills.

Alright you power through and you do this in PyQT, but it’s 90s tech man. I’ve been using https://svelte.dev/ and https://sapper.svelte.dev/ and it’s a revolution compared to anything PyQT does. You also have https://vuejs.org/ and https://reactjs.org/ in the same style, with this “reactive gui” concept being the absolute best most modern way to craft a gui. And, all three of those work in Electron so browser, desktop, mobile with nearly the same code base and same skills.

What about packages. PIP and PyPI are total garbage compared to npm (or yarn) and the packages available, but npm vs. yarn has an interesting point to be made. Python had a packaging system called easy_install written by this dude named Philip J Ebby and he was a Python Old Boy member of the Old Boy’s club, so for like oh 10 years anyone trying to question his terrible code was ridiculed and shot down. Pip should have been much better but it was forced to work with easy_install because the Python crew pushed easy install and used their power to enforce it as a standard while trying to act like they didn’t like it.

Yarn happily coexists with npm and people easily use either, and all pointed at the npm repository. It’s an open field, and that’s the thing about JavaScript and the community that makes it way better than Python.

Python is run in an authoritarian style. If they don’t like what you do or say they will hunt you down and exact revenge or silently kill your project off. This management style has led to Python being stuck in the 90s and not advancing that far at all.

JavaScript comes from the Internet and as such it’s all about letting people make their own things and not stopping them. People complain that there’s so much javascript code out there, but I now ask why is that a bad thing? It’s like complaining there’s too much music or art. Only a fascist hates it when there’s a lot of creative output. “Bah! These kids and their ROCK AND ROLL! Why can’t we go back to Bach?!”

Finally, when you want to get a job or make a thing for people to buy, and you look at Python vs. JavaScript, all this adds up.

JavaScript you can prototype an app with web tech and then share it out, then turn it into a desktop and mobile app with the same tech. When you’re done people will try it and be open about it, because they’re futurists into the new stuff. There’s also tons of stuff you can use if you want. Nobody makes you use anything in JavaScript.

Python you can’t really prototype anything quickly. You want to make a web app? Welp gotta spend a year learning Django. Want to turn that into a desktop app? Welp, time to totally rewrite it in PyQT (which is basically C++ bolted onto Python), so that’s another few years. Want to give it to your friends to try? Welp, gotta learn how to do a cross platform installer for all their OS. Better hope they put Python in their path and pip works for them otherwise. And if you make something that some Python Old Boy doesn’t like? Welp, he’s going to declare your project not approved and you’ll be completely ignored.

You don’t believe me? Here’s Guido van Rossum on a very popular podcast declaring that Django is the official web framework:

Why did he do that? Because a better one came out called webpy but the author of webpy made the AUDACIOUS claim that it was better, so Guido didn’t like it and decided to derail his project and play favorites. Ever since then everyone in python is against “magic” and webpy because “Guido doesn’t like it.”

To me, if you want to make money and make things and work in an ecosystem that is all about that, with hardly anyone running around trying to shut your work down like a nazi, then JavaScript is the platform.

Python these days is just for small minded little authoritarians who want to feel safe that Guido spent a year arguing about a 50 line patch to add set operators to dicts.

3 Likes

Thank you for taking the time to write it all , Zed.
Very informative post, we’ll need this pinned to get to it easier.
I’ve noticed your tweets about some stuff you talk about here, but having it all in one piece is much better, I think.
I am sure not many people know all of it, or are not aware of all the dirty laundry hiding under polished looks.
Humans are dirty and they will always be. This is one sure thing. Some will try to overcome their dark spots, some not.
I guess it’s the same everywhere. At first I thought this kind of stuff happens mostly in my country.
Then I read about same human behavior elsewhere so it must be embedded in us as species.
I really need to check webpy soon.
I think coding is very beautiful but like anything touched by humans it is cursed to wear this human print.
A programming language made by dogs would stink less, I am sure (if they could invent one) :smiley:

1 Like

JS does seem to be the way to go, but as a beginner I have an observation @zedshaw: your post lists seven different JS sources/frameworks/orgs. This is the part that worrries me… where to start? Or is it all interactable once you’ve mastered the is basics?

If so, I’m in. (Although I’m on a Lisp detour at present)

The one thing about all of them is they’re all pretty similar in how they’re structured. Let’s look at 3 code samples from 3 “web frameworks”:

Express

var express = require('express')
var app = express()

// respond with "hello world" when a GET request is made to the homepage
app.get('/', function (req, res) {
  res.send('hello world')
})

Polka

const polka = require('polka');

polka()
  .get('/', (req, res) => {
    res.end('Hello world');
  })
  .listen(3000, err => {
    if (err) throw err;
    console.log(`> Running on localhost:3000`);
  });

Koa

const Koa = require('koa');
const app = new Koa();

app.use(async ctx => {
  ctx.body = 'Hello World';
});

app.listen(3000);

Polka and Express are so similar that you can use all of the Express middleware libraries inside Polka. Koa is so close that you could easily bolt on the same features, but even still Koa is very low level, but again looks really similar.

This is what the free market model of JavaScript does in reality. Sure there’s some weird stuff, but the market (being programmers like you) decide what works and that shapes everything to be pretty close but with differing ideas about implementation.

If you take React and Vue as another example, they frequently steal ideas from each other, and Svelte just takes their ideas and makes them simpler with a different way of doing the Reactive UI.

You also have the advantage that they’re actually using this stuff in massive production systems, so it ends up being usable and adapts quick. I mean, ES6 came out and in like…a month (?) all of the transpilers could support most of it, most browsers supported it, and you could still keep running your old code.

But, the other thing is this is kind of the wrong way to look at this. People tell you just go with Python because they choose for you so you don’t have to worry your little head. Batteries included. The problem is their batteries are really terrible most of the time, and this attitude now removes your choice. Even worse, if you do try to do your own thing you have to get it sanctioned and blessed by them or they’ll do their very best to shoot it down. I know, they did it to me for years as well as many other people.

The right way to look at this is it’s an exciting open field, and it’s not like you learn Vue and then suddenly your JavaScript skills are dead because React wins. Your skills translate, and nothing is really all that wild. It’s actually really tame because programmers got tired of truly wild stuff and just want easier. JavaScript goes for easier most of the time, not weird. Better still is they make sure your skills keep working because your old code keeps working.

Python though, just decided that they won’t let you use Python 2 anymore, so if you learned that then screw you. I mean think about that. Like, who are these guys to tell you that you can’t use a language they released open source and told you to use? Why do they get to dictate to you what you can learn and what you can use?

Finally, if you learned HTML and CSS then that’s like 50% of the JavaScript web stack. After that you can learn one of React, Vue, or Svelte (I highly recommend Svelte), and be up on the latest in UI tech. Then try out Nuxt.js or Sapper to make a full site that you want to make. If you do that then you’ve learned most everything in modern JS and from there it’s literally trying things out.

5 Likes

I really need to learn Svelte, sounds yummy.
Express is really cool and I played with Electron too.
But say, if I wanted to replace the Django backend with something, what would that be?
Node? I am interested in this multi-tenancy thingie I am working with right now.
Found an interesting article: https://medium.com/@j3y/developing-multi-tenant-applications-on-node-js-and-objection-js-7b73396a0ad4
Anyway, I took the first 2 courses on MongoDB and loved it.
Thing is we are at the beginning with this app, so if I’d change the stack for something more flexible and modern, I’d rather do it now than later.

I’m glad you found the link useful, @gpkesley! If you plan on completing the book, that detour might take a while… :wink:

@zedshaw This is all very interesting. I’ve been experimenting with Flask this week. (Inspired by Graham’s success I thought I’d look into finally getting that site of mine up and running.) Yesterday I followed your hint and looked at web.py and if I was going to stick with Python I think I’d use that. But now you kind of persuaded me to get out of my comfort zone… I’ll definitely have a go with Svelte next.
Thanks for your input here! Much appreciated.

1 Like

Answering both @io_io and @florian you should try Sapper first:

https://sapper.svelte.dev/

You’ll have to learn Svelte while you learn Sapper, but it just gives you basically a full front and backend system ready to go. You basically put a .svelte file in the right place, that’s your UI in Svelte. Then put a .js in the right place, and that’s your backend code. No configuration needed.

It’s what I’ll be using in the course.

3 Likes

Can’t wait to try this!
Thank you!

Wow, that looks awesome. I’ll definitely give it a go. Thank you!

Is the course ready to go @zedshaw ?

I’m about to hit a month of coding full time now whilst I’m off work in March. If I shift to JS, which seems the right thing to do, I’d like to hit it hard.

I’ll take a look at svelte first but if you need a beta tester of the material, let me know.

@florian yes, that book / site is a mutha of a rabbit hole but I’ll try to maintain some progress in parallel to learning JS.

@gpkesley I can identify with your struggle that everything becomes easier once you understand the underlying foundation.
@gpkesley and @florian what course is this?

Thank you for bringing this out.
I think I get the picture now.
I’m not here to get a job as a coder; I’m just here to learn how to become good enough so I can tinker, prototype and test my own ideas, without involving too much money or external coding power.
But just the possibility that in the future I’ll not be allowed use Python 3 is almost enough for me to make the switch.

@zedshaw When can we start to look at this?
Codecademy is OK sofar, but if your course going to be anything like LPTHW, then I can’t wait to get started on that journey.

@zedshaw I’ll be thrilled to share whatever I’m doing with Airtable if anyone feels that’s interesting.
I’m currently using Airtable, Integromat and small custom made dashboard solution to test out if there is a market for making affordable ERP systems for garment manufacturers.
I find it’s super fast and easy to rig up customized databases to an MVP level in Airtable and then use a few other things to spice it up.
Sofar It has allowed me to experiment with selling, pricing and quickly test out what works and what doesn’t.
I currently have four companies that pay me every month to get access to the tailored solutions I’ve made for them.
However, in the long term, I’ll like to move away from Airtable it has its limitations.

See here:

2 Likes

@zedshaw
It almost sounds like it’s no longer a good idea to study Python?

Kinda like a hit in the gut. 2ish hours a night for six months. made it to chapter 40…twice. Been trying Django while doing ex 46 and 47 as well as git. and seems I may have went the wrong direction.

1 Like

Nah, don’t worry! With that kind of commitment you must have learned a lot about programming. The next language will be much easier. And this field is so vast – you won’t get very far if you know only one language anyway.

1 Like