74

Looking squarely at you js, python Devs

Comments
  • 7
    Python is slow, yes.

    But to say that makes the language useless, or to shame the language because of that completely misses the point.
  • 4
    I do DevOps. The current trend in the web world is to just throw more hardware at the problem. There was this project I supported once. It was python and it had to support 1k concurrent users. I gave it 5 EC2 c4.xlarge instances.... 5 and latency was through the roof!!!!
  • 4
    @irene it is slow. But we should argue, do we need that kind of speed for what we are making? If speed is not needed, then why increase development time? Most of the time running time of a program and development time are trade-offs. I may not like python but I definitely acknowledge how it is has removed certain complications from programming.
    One thing especially amazing is how we are making programming more and more available to the general public. This is double edged sword though. Because , imho, it's reducing the respect for programmers at the same time.
  • 4
    Such truth!

    Now we have to wait on networking and cloud based apps and memory hogs and a million umpteenth layers of abstraction ad nauseum. Simple optimization is eschewed in favor of rapid prototyping and updates of early release but very buggy software. Miss the good old days of responsive stuff and the web without the fancy animations.
  • 1
    The languages themselves are fine, it's the people using them for the wrong kind of projects. Python is an awful language to work with for large projects so it shouldn't be used for it anyway. But for small applications it's excellent!
  • 1
    Excuse me? If you want speed, use C. If you want readability, use python.

    If you want both? Well, go and build that unicorn yourself.

    Seriously, it's like people are scared to use more than one language in a project. They're just tools. You wouldn't build a house with nothing but screw driver.
  • 3
    @evilmupp3t python doesn’t have the monopoly on readable code. You can make readable in any of the popular languages without Python’s dogma.

    There is a reason why python libraries aren’t usually written in python.
  • 3
    It's not so much about the languages, it's about the habit of stacking layers of frameworks and packages, and doing things in the wrong places.

    So many application devs who embed a full web browser to show two buttons.

    So many frontend devs who just do "select * from table" on the server and filter through the data in React.

    So many product owners where feature requests always have priority over simplification and refactoring.

    Most of the products that I stopped using over the years, the reason wasn't that they were missing a feature... it was because they kept piling on features until their app was an ugly sloppy slow mess.
  • 3
    @bittersweet just throw more hardware at it till the problem “goes away”

    At a previous job, there was an issue of sql queries taking 15-20 minutes to run. DBA said that they needed to be tuned, the boss just got an nvme ssd and the queries started to return instantly....

    There’s just no incentive to write optimal code in web dev. We live in an era of launch fast and IaaS where you can config compute properties on the fly.
  • 3
    Python doesn't need to be slow (and neither does Javascript). If you do it right, there's no good reason that a page written in e. g. PHP is significantly faster.
    In most cases it's just a massive collection of frameworks (especially with js) that shows things down. But even if you're using those frameworks you don't have to run into trouble if they are done in the right way.

    FYI: Massive sites like YouTube are written in python. If it was inherently not scalable they would surely have migrated by now.
  • 2
    @theCalcaholic that’s why google invented go. Even devout python evangelists like Dropbox gave up and switched to go
  • 3
    @windlessuser Go is nice, I don't question that (worked with it myself), but it's not the one answer to all problems.
  • 2
    @theCalcaholic but does extremely well for the webdev problems you’d tackle in Node.JS - even its creator says go is better for the job- or python. If it weren’t for tensorflow and other ml libraries, go would have achieved dominance already
  • 3
    @windlessuser I don't think so. ML wouldn't prevent something from doing their web application in go (I'm doing ML myself).

    For nodejs the main advantage are isomorphic apps. But it's debatable is that's really worth it.
  • 3
    @theCalcaholic was making reference to StackOverflows top 10 languages.
  • 3
    @windlessuser Of ok. :)
    That's a different story of course.
  • 1
    If you want python to be fast, just use the PyPy implementation: There are some cases where the difference is ludicrous.
  • 1
    @disolved or just write C and bind it.
  • 1
    @evilmupp3t the original python implementation is in C, actually
  • 2
    @disolved yeeees, but executing at C speed requires you to circumvent dynamic lookup, which is done by implementing the parts that need to run fast in C and bind it with cython, for example.
  • 1
    @windlessuser I cracked up when you said python libraries aren't written in python 😂😂
  • 3
    @localghost127 yeah python libraries tend to just be facades around c/c++ stuff. Usually. More often than you’d think actually
  • 1
    @windlessuser it doesn't make any sense to say that python libraries are «facades» around c/c++. Python itself is a facade around c/c++. Even PyPy, which is a python implementation of python (google it), is ultimately translated to C before being compiled.
  • 1
    @disolved yeah pythons interpreted, but I think what @windlessuser was saying that the libraries themselves aren't written in python. A lot of it being written in c and c++. I think the difference is that interpretation will have some redundancies whereas a direct implementation won't have them and will be very efficient.
  • 2
    @localghost127 «a direct implementation wont have them and will be very efficient»: PyPy is proof of the oppside being possible. It is written in Python, yet it is much faster than the original C implementation.
  • 2
    @localghost127 sorry for being very pedantic :p
  • 2
    Yeah I’ve deployed enough python apps for people to be aware of this annoyance. Hunting for dependencies when your distros package manager doesn’t have them. Pip just assumes you have them and will just fail until you get them
    All and github pages tend to not list everything it needs...ugh.

    Deploying python is rather painful.
  • 1
    @disolved No no, it's quite welcome. This pypy fact eludes me; can you provide some readings so I can learn about this?
  • 2
    @windlessuser been there. I had a project which required the python 3 version to be installed and when I compiled the source, it only allowed python2 because for some reason my python 3 didn't have some dependancies but my python 2 did. From there it was virtual environment hell and using only pip3 to install stuff. I am not that proficient in python never having learnt it and the above worked for me, so I just rolled with it.
  • 2
    @localghost127 which fact? My claim that it is faster than CPython? This old stack overflow thread was my first google result, and it (in combo with linked sources) explains how and why fairly well I guess! https://stackoverflow.com/questions... If you google pypy vs cpython benchmarks you'll get a lot of independent sources (bloggers etc) showing you their experiments and results backing up the fact. Cython (different from CPython) beats pypy in many of these benchmarks, but Cython has its own compatibility issues as I understand it.
  • 1
    @disolved thanks for that! I initially had a misunderstanding that it was faster than c. The answer does provide a very carefully created example in which this indeed is the case.
    Learn something new everyday!
  • 1
    @localghost127 Yeah sorry, I should have written «the original C implementation of Python», the two last words there being an important detail 😅 haha
Add Comment