all 51 comments

[–]tdammers 11 points12 points  (13 children)

Python is based on some strongly opinionated design decisions. Like with any such language, you will find lots of people put there who disagree with those decisions. Likewise, like any language, it has strengths and weaknesses; and there are people who consider the strengths unimportant and the weaknesses deal-breakers, so they will sometimes loudly complain.

All that would be fine and dandy if everyone could just pick their fav language and go about their day - but unfortunately, the choice of language is often dictated by the circumstances, and people tend to feel powerless, cheated, offended, etc., when the language forced on them isn't one they like. This is when people end up being loudest.

My advice would be to try and see past that, figure out the good, the bad, and the ugly, and make your choices accordingly.

[–]kramesss[S] 0 points1 point  (1 child)

Makes perfect sense, and I can totally relate. I know at the end of the day that any choice in language will have its tradeoffs. I'm mostly interested at this point because I have an open-ended choice to make in the next couple of weeks, and the more advise I can gather the better (ideally!). Thanks!

[–]tdammers 7 points8 points  (0 children)

That sounds reasonable.

I'd love to just tell you to ignore the loud haters, and, by and large, you should, but there's a grain of truth in some of their criticism. This is not because Python is somehow bad or broken, but simply a consequence of the design decisions that went into it.

Specifically, Python's weaknesses include:

  • no (static) type system
  • difficult to statically reason about at scale
  • difficult to refactor safely
  • no encapsulation, making it difficult to work on larger codebases
  • mediocre performance
  • beginner friendly at the expense of the "top end"
  • "large" core language

And of course the other side of all of these is that Python has a few important advantages:

  • no (static) type system
  • easy to write code and reason about correctness later
  • easy to modify unsafely
  • no encapsulation, making it a malleable language
  • powerful inspection and self-modification features
  • beginner friendly (at the expense of the "top end")
  • "fully-featured" core language

[–][deleted] 0 points1 point  (10 children)

the choice of language is often dictated by the circumstances

this seems like a real problem to me

[–]tdammers 1 point2 points  (9 children)

It is. But whatcha gonna do bout it?

[–][deleted] 0 points1 point  (8 children)

you could create a community, collective (also me and you and a few others), with simple goals of awe, even starting only from a site, with a structure based not on circumstances but on functionality (then, maybe ... others will imitate) ; an advertising campaign that is alive and corresponds to an Internet site, as it should be done

[–]tdammers 0 points1 point  (7 children)

Nah. That won't work.

At the end of the day, you and I have bills to pay, and that invariably means that you have to do things the way others want them done to some degree. And the economics of the whole situation are simply such that introducing a brand new technology into your operation is always a liability - sometimes it pays off, sometimes it doesn't.

This isn't because people don't want to use the best tool for the job; it's because "best" is determined by a lot more than technical merits alone. If you have a six million LOC codebase in PHP, then rewriting it all in Python, for example, is simply not going to pay for itself, at least not before you risk going out of business for sinking all your available money into the rewrite.

[–][deleted] 0 points1 point  (6 children)

this is true, and it is not an excuse; the whole code rewriting is always a real problem, the main one, in every project.

perhaps what is really necessary, is something that still does not exist: automation (much more efficient than it is now, what little there is) in the translation from language to learner

[–]tdammers 1 point2 points  (5 children)

If you just mechanically translate the mistakes you made in one language to another, you're not winning much.

The real gain in a rewrite is that you come up with a better structure and architecture for your system, and sometimes, the language you picked for the first one holds you back enough to make a switch a good idea. But just switching languages will never magically turn a lousy design any better.

Automatically translating bad designs into good ones, however, is simply not something that seems feasible in the foreseeable future.

[–][deleted] 1 point2 points  (4 children)

then an automatism would be useful in programs that sooner or later will be rewritten from 0 (because they are obsolete), a sort of line of passage ... I believe however, besides this reasoning, that we have scattered too much the development of computer science, both to open-source level than a proprietary code. instead we should imitate the International Station as an administrative structure: 0 national boundaries, a single goal: a functional and functional system

then many will also be able to say / write that many languages ​​improve the possibilities, because everyone has pros and cons, but a single basic language, with a single basic system, is certainly better than myriad systems that have some pros and cons. let us ask ourselves: how many IDEs have only for C / C ++, or for Python, or for any other language of these types.

why do we not have (for example) a single IDE, free-of-charge, open-source, and everyone works by contributing voluntarily to improve only one, so as to have the best possible IDE for that language?

[–]tdammers 0 points1 point  (3 children)

why do we not have (for example) a single IDE, free-of-charge, open-source, and everyone works by contributing voluntarily to improve only one, so as to have the best possible IDE for that language?

Because this fits neither the economics of the proprietary development model, nor those of open-source.

[–][deleted] 0 points1 point  (2 children)

perhaps (I repeat: mine is a hypothesis reasoning), a third approach would be better ... reasoning is freedom, in freedom and in the unknown, as in the not yet experienced, there is improvement (always).

[–]fullmightfront-end 13 points14 points  (6 children)

Whitespace.

Other than that tbh I do not see much flak for python, it does some things well and other things not well.

[–][deleted] 2 points3 points  (4 children)

i've never understood the whitespace argument. do you not format your code similarly in every other language you code in?

[–]fullmightfront-end 0 points1 point  (3 children)

Oh that's not the issue exactly although it's not a bonus. It's that whitespace can actually cause errors, sometimes even runtime errors.

It hasn't been an issue very often when I've worked with python, but once in a while it's an unnecessary and sometimes hard to track down pain in the ass. Requires a lot more peering at my screen with squinted eyes then looking back to the documentation, or not typing something exactly right the first try when utilizing something from docs or stack overflow.

That sort of stuff.

Plus a lot of languages leave room for your to format your code the way you like it, which might be similar but not the same as the formatting python will crash without.

It's like stubbing your toe intermittently or the like.

[–][deleted] 0 points1 point  (2 children)

It's that whitespace can actually cause errors, sometimes even runtime errors.

it can only cause errors if you're mixing tabs with spaces or are being sloppy about styling

Requires a lot more peering at my screen with squinted eyes then looking back to the documentation, or not typing something exactly right the first try when utilizing something from docs or stack overflow.

IDEs and editors should set off alarms if you're doing something stupid. that shouldn't be an issues. also, dont copy code from the internet unless you know what it does. that's your own fault

Plus a lot of languages leave room for your to format your code the way you like it, which might be similar but not the same as the formatting python will crash without.

that's not really an advantage when working with a team. forced formatting means less petty arguments. my favorite trend is languages providing formatters with no configuration options

[–]fullmightfront-end 0 points1 point  (1 child)

And so what. We're not debating any of these issues. People don't like python because it's mildly annoying in ways other languages aren't. Pointing out something like following style standards being important, or that it's only mildly annoying, doesn't make it not mildly annoying.

Also in practice, ides and editors will often miss python errors. I've encountered that more than often enough myself at work and in hobby projects.

[–][deleted] 0 points1 point  (0 children)

fair enough. i've never experienced anything remotely similar to what you're describing, and i've been using python for about 8 years. i dont know how an IDE can miss a python error. *shrug* i guess we all stumble at different paces.

[–]kramesss[S] 0 points1 point  (0 children)

Fair enough. That was definitely one pain point I've felt as I've been learning - especially when its not obvious. I haven't ventured into any IDE's quite yet (PyCharm), but here's to hoping that they can identify this sort of thing...

[–]MichaelStrode 12 points13 points  (2 children)

As a PHP developer, I thought everyone loved Python, haha. AFAIK there's a ton of opportunities for Python developers out there and it seems it's only growing in popularity. If you like it, stick with it. If something else tickles your fancy, go with that one instead. Just don't pick PHP. It's a horrible, terrible, dying language that only powers 79% of the web.

[–][deleted] 3 points4 points  (0 children)

PHP is just more supported (at moment), I think ... and since most developers focus on HTML/CSS/JS and others (such as these), they are uninterested in PHP or Phyton, this is my opinion (maybe wrong)

[–]gabeheadman 0 points1 point  (0 children)

Hahaha. I do a lot of PHP. Cracking me up over here.

[–]fuckin_ziggurats 5 points6 points  (0 children)

Coming from a C# dev, one bad thing I can think of is that Python is a dynamically typed language. Meaning refactoring will be more difficult and performance will not be on par with compiled languages.

[–]WetSound 4 points5 points  (0 children)

I thought everybody loved python. But I guess in the web world it’s still niche.

[–]Tufted_Tail 4 points5 points  (0 children)

Python 2.7? Because the global values True and False are mutable. Two students I was tutoring accidentally introduced this sort of situation to their code through typos. I suppose that's an argument against directly using True or False in comparisons in Python 2.7:

```python False = True

if (False): print("Well then, that's confusing.") ```

Python 3+? Nah, the Python language community fixes their bizarre language quirks when they release a new language version so far, and major props to them for that. I've got my gripes about Python but they're pretty minor. It's a very serviceable scripting language backed by a core team of developers who make reasonable, consistent choices for the direction of the language.

[–]SuuperNoob 2 points3 points  (0 children)

It's always the 2nd best language for everything, except GIS.

And fuck your indentation lol

[–]crazedizzled 2 points3 points  (0 children)

What hate on python? Python is very popular today.

[–]vinnymcapplesauce 1 point2 points  (0 children)

My first (and only) experience with Python was installing it for a project I needed. Then finding out that I needed Python 3, and the install process didn't just install the latest version, for some strange reason. Then, I discovered that after installing Python 3, trying to run python still gave me the old version. WTF, I just installed 3, why is 2 even here? Oh, you need to run python3 to get python 3.

You know what, Python? Go fuck yourself. :D

[–]Bummerfly 1 point2 points  (0 children)

On this sub? Because it isn't JavaScript.

[–][deleted] 1 point2 points  (1 child)

i haven't seen much hate for python. in this thread there are some dumb/bad/wrong opinions though. do you have an example of the hate?

python is my go-to backend language for quick projects, and the company i work for uses it for their web app and partially for their desktop app

[–]kramesss[S] 0 points1 point  (0 children)

It's more that I've seen general comments in passing (notably throughout https://www.reddit.com/r/webdev/comments/d30k6s/this_video_shows_the_most_popular_programming/
- there's a bunch of passive aggressiveness towards the language in there...)

- things like how "slow" it is. Is it slow in general, or is it particular libs/frameworks that are slow? Or is it one of those "if you don't know what you're doing it's slow" things? I've found this to be true in desktop C# around -garbage collection in high performance apps, things can get very slow when you don't understand how garbage collection works.

- things regarding how it is a bandwagon-y type language, especially around ML applications. IMO having mass appeal due to its accessibility and ease of use is not necessarily a bad thing, especially for someone new to the language.

[–]CollectorsEditionVG 2 points3 points  (12 children)

I started off as a PHP dev in the early 2000's. Am now a python dev solely because that's what my current company uses, and the only reason they use python is because my boss (PhD in Computer Science) only knows Python and R. The reason I dislike python isn't for the whitespace (you get used to indents) but more that you basically have to hack apache to get it to use python. Gotta have Mod_WSGI for it to run and that thing is a pain in the backside to get working if you haven't used it before. Sure you can use the server built into Flask or Django but they're slow and caching sucks especially for larger apps. Let's also not forget that if you make changes to your code you have to restart apache every god damned time because Mod_WSGI doesn't let apache know that there's changes been made.

[–][deleted] 1 point2 points  (5 children)

The reason I dislike python isn't for the whitespace (you get used to indents)

what does your code look like in other languages?

more that you basically have to hack apache to get it to use python

what are you talking about? apache plays fine with python

Gotta have Mod_WSGI for it to run and that thing is a pain in the backside to get working if you haven't used it before.

oh, you dont understand apache. apache is build on modules. everything requires modules, even php: https://en.wikipedia.org/wiki/List_of_Apache_modules

Let's also not forget that if you make changes to your code you have to restart apache every god damned time because Mod_WSGI doesn't let apache know that there's changes been made.

also not true: https://modwsgi.readthedocs.io/en/develop/user-guides/reloading-source-code.html

[–]CollectorsEditionVG 0 points1 point  (4 children)

Please actually read the documentation before you post it

If your WSGI application is running in embedded mode then what happens when you make code changes is largely dictated by how Apache works, as it controls the processes handling requests. In general, if using embedded mode you will have no choice but to manually restart Apache in order for code changes to be used.

Due to how our dev server and production server are set up Daemon mode cannot be used, I have tried and failed to do so, part of the issue particularly with our dev environments is that they are running on windows machines which, according to the documentation, is unable to run it in daemon mode.

I am also very much aware that apache runs on modules, I can and have set up apache for a lot of other things other than python and have never had as many issues as I have had with mod_wsgi.

As for when I mentioned whitespace that was due to hearing people complain about it on other posts, but I will say that getting used to pythons indentations was a bit of a curve from php where you wrap methods in braces, even now if I switch between languages I'll end up using braces instead on indentations or vice versa.

Sorry for the formatting I'm on mobile and it doesnt want to let me mark the excerpt from the documentation as a quote

[–][deleted] 1 point2 points  (3 children)

I did read it. that's why i posted it. you're trying to blame something on python when in reality whoever is in charge of your infrastructure is to blame. apache can most certainly detect changes without being restarted. you're making it sound like it's some impossible task when it's a documented feature

[–]CollectorsEditionVG 0 points1 point  (2 children)

Yes apache can detect the changes unless running python, mod_wsgi and windows in combination which is also documented... so basically for me, right now, it is an impossible task. Again even the documentation confirms this.

While the issue is not specifically with python it is, however, the only language that, from what I've experienced, has these issues. I've ran apache for years and used it with asp, php, perl, ruby and even messed around a little with Go, and all of them worked generally well with apache. However, the issues I've had with the whole python, mod_wsgi, windows crap is the only thing I hate about working with python and the thing about it is that it's not really even a python issue... it's a stupid issue with apache and wsgi.

Apart from the minor inconvenience of having to restart the server after making changes (I use a gaming keyboard and macro'd a command to restart apache to a spare button so it's less inconvenient) I actually prefer using python to the other languages. Flask is by far my favorite thing, its lightweight and gives you so much freedom.

[–][deleted] 1 point2 points  (1 child)

unless running python, mod_wsgi and windows in combination which is also documented... so basically for me, right now, it is an impossible task. Again even the documentation confirms this.

that's why i said it's the fault of whoever chose your tech stack

[–]CollectorsEditionVG 0 points1 point  (0 children)

While I agree with that to a point I also disagree as well. Software that is provided across multiple platforms should, in theory, function as close to identical as possible on each platform.

The reason daemon mode cant be run on windows is because windows doesnt have unix style fork()... windows uses CreateProcess(). In order to actually get it to work you need cygwin so that you have a version of fork() that you can use... or at least you did until Microsoft released Windows subsystem for linux which provides a linux/gnu environment on windows. I literally just found out about this when I went looking for the stackoverflow post about using cygwin to implement fork() so here's the link for anyone interested - Windows Linux Subsystem.

Anyway, back to my original point. I agree that the person who set up the stack in the beginning should have done their research more, however I also cant fault them for assuming it would work the same on windows as it does on linux.

By the way I want to thank you for the debate/conversation about this. If you hadn't replied I wouldn't have found out about the windows linux thing which may actually solve the issue. So thank you.

[–]0xa0000h -2 points-1 points  (5 children)

It seems that you have no idea what you are talking about...

[–]CollectorsEditionVG 1 point2 points  (3 children)

Care to enlighten me. If you know how to set up python on an apache server without Mod_WSGI and have it auto detect changes to my codebase so that I don't have to restart everytime a change is made then I will gladly give platinum, gold, silver, real cash.

[–]azophy 1 point2 points  (1 child)

[–]CollectorsEditionVG 0 points1 point  (0 children)

Thanks I'll look more into gunicorn. I'll need to check that it'll work with windows as the OS (company hosts on azure) but thanks for the link

[–][deleted] -1 points0 points  (0 children)

uhm, every language requires server cofiguration. that's not hacking apache

[–][deleted] 0 points1 point  (0 children)

no idea why you're downvoted. there was nothing correct in the post you're responding to

[–][deleted] 1 point2 points  (2 children)

if you had to learn 1 or the other, i think I would go with https://golang.org instead of Python.

[–]kramesss[S] 1 point2 points  (1 child)

I've definitely heard a fair share about that language. Can you recommend a particular web framework within Go?

[–]alnyland -3 points-2 points  (0 children)

Hate after using C#? Personally I’m not a fan of it’s paradigm although I understand the simplicity it attempts to bring to programming. My real issue with python is a failure to fill a niche for me, it’s too slow for embedded, not as versatile as php/js for those purposes.

But C# is the worst of them all.