Hacker News new | past | comments | ask | show | jobs | submit login

I started programming in python in 2010. It has been a good tool for solving a variety of problems.

I do have to wonder though. Is python popular right now because so many more people who have never programmed before are now starting to program?

I came from a biology background and my hatred for matlab following one quarter of exposure was sufficient to push me to python because that was what was offered as an alternative (taught by a gradstudent rather than the guy who funded the lead dev for the Octave project). There was no other choice. Julia didn't exist etc.

In the 8 years since I have written a lot of bad code have come to very much dislike python (though I still write it daily). The reason is not because of any of the visible failings of the language. It is due to the deep hidden inconsistencies, and unexpected and unpredictable behavior of the runtime (try using list comprehension in class scope (What is class scope you ask? Well. Python is a language for newbies... so by the time you can ask this question you are too invested to realize that you might have made a bad decision)).

Python is kludge on top of kludge without the diversity of implementations to take another path when someone calls bullshit. Python can get away with it because they have runtime hacks that let you sort of do what you want, but there will be a corner case that doesn't work because there is some unspoken and undocumented assumption that you are violating and will be duly punished for.

None of this is the language's fault. It's the runtime's. The python runtime (don't even bother with discussion about the GIL, which is a red herring and a bad case of Stockholm syndrome at the same time) is a mess. The language is fine, even great. But the fact that different scopes have radically different meaning and that expressions only work in certain scopes [0] is a complete nightmare.

My main emotional interaction with python is that if I follow the BDFL approved path, everything will work. If I stray from the fascistic predetermined happy path, good luck to me, I was on the wrong side of history TM. 99% of the code that I write that doesn't start as a class I end up rewriting as a class (probably because python doesn't have closures ...). Python lures you in with promises of easy to write easy to read, but when you get to that point where your actions are no longer approved then then pain and sadness and rage are all you have left. I won't name the language that has almost the opposite interaction that I come to vastly prefer, but the emotional experience is radically different, I get extremely frustrated because I don't understand something in that language, and eventually come to realize it is because I did not understand something simple. In python I initially think that I am the one to blame, but after months or years, I finally realize that it is actually the language that is fundamentally broken and inconsistent and I have been mislead the entire time. I get frustrated because there no possible way for me to solve my problem by increasing my knowledge, I would literally have to fix a 4+ year old problem in the language (which I'm sure I couldn't do and that I'm sure has not been done for very good technical (debt) reasons), or find a library. There are a lot of libraries, but don't be fooled. Every library is a new language. Python is just the gatekeeping runtime.

Python will thrive for a large set of use cases, but when you hit a wall in python, the problem is not because you don't understand, it is because python is broken. That is not a happy realization. It is like growing up and realizing that people are actually evil, not that you were just misunderstanding them. Or more generously, that expecting people to be on their game 100% of the time is unrealistic. The difference is that python is that attractive person that is great at first impressions, but a disaster in the long term, and if I hadn't had the good fortune to meet a language that was super awkward for the first 6 months or so, but turned out to be a keeper, I'd believe that python was the only thing there is.

Python is and abusive language, and probably exists and is successful because things like perl also exist (and because it solves a whole bunch of practical problems). I'll keep using python for a long time, and the coming of age of pypy brings me great hope for the future, but there are classes of problems where I now go elsewhere. There are problems everywhere, but in some places they seem to be rational rather than contingent.

tl;dr Don't pick a language, pick a runtime.

0. https://github.com/ipython/ipython/issues/62




>I do have to wonder though. Is python popular right now because so many more people who have never programmed before are now starting to program?

In recent years coding has become hip/cool. I'm pretty sure none of the 10,000 Bootcamps/online courses that popped up are teaching c++ at the moment, it's all the easy stuff like Python and web. This gets people to their 'aha' moments quicker and keeps them feeling like they're progressing, even though they're doing barely any thinking. I will admit though if there is one language for anybody to learn for general purpose, it's Python.


Unfortunately you have not provided a lot of examples to go along with your major complaints. I feel like at some level, every language will have its idiosyncrasies that create annoyances and issues. From what I can tell, you are describing concerns that would not void the use of Python entirely. These issues tend to increase with higher level languages as the complexity of the feature set expands and it become unreasonable to support every combination of every idea.

I don't know if you'll have better luck switching after making such a large investment in Python, but if you do find something to supplant it please document your experiences for other to learn from.


Perhaps it's time to look at Perl 6 ?


I only know about Python from what I've read and tinkered with, but IMO, Python = FoxPro (look it up): it is fairly easy to learn, immensely useful and you can do lots of cool things with it, but it a) relies very heavily on C or external libraries for any type of raw code performance, b) it's inconsistent and the inconsistencies are somewhat hidden and not obvious, and c) distribution is a nightmare, so developing anything professional that needs to be dropped on a target machine is a problem.


"a language that was super awkward for the first 6 months or so, but turned out to be a keeper"

I wonder, do you consider the language's awkwardness somehow related to its quality? Do you see it as a prerequisite to avoiding language shortcomings?


No. In this case that part of the analogy is actually not apt at all. To use another bad analogy I think my point is that the feeling awkwardness actually comes from the fact that I was doing the equivalent of holding the hammer by the head and trying to pound nails, only to later realize that I should have been holding the handle, and that there actually was a handle. In python it is like having a sledge hammer that you can't possibly hold by the head, but that no matter how hard you try you keep putting holes in the wall when you try to hang a picture.

Someone will say 'but why not use the tack hammer?' and, at that point I argue, I am no longer using python the language, but a whole new language that happens to look like python but that has a different runtime and a different set of assumptions. This even happens inside of the core language where `[d(a) for a in b if a == c]` can be valid in some scopes but not in others. The other language does the opposite, it says "you can't do that" and so I try to hold the hammer by its head and think that it is the language that is awkward because I don't know how to use it and that there is an fact a nail gun that is configurable along every dimension from nail diameter, to nail length, to insertion speed and pressure profile over the whole insertion timecourse, it is just not there in plain sight and I the first few times I used it I accidentally nailed my feet to the ground with railroad spikes.

I guess it is more that every time I learn more about python it is about what I have to NOT do in order to be safe. In the other case I learn what TO do in order to solve the problem the way I want to. Maybe the clearest example I can think of is lambda, where you have something that looks like a lambda, but that doesn't doesn't even work like the def (): that it copies due to the biases of the language designer. Honestly it would be better if Python just removed all the syntactic features that don't have generalized runtime support because that way you don't have to know which features you can use where. Sure, there is a use case for lambda in certain contexts, but if Python refuses to support lambda as a general abstraction that I can use everywhere, then it should be removed from the language, because including it leads to those hidden inconsistencies which require an enormous memory burden on the developer just to know what is not allowed. That is dead knowledge that in no way empowers and enriches the programming experience.

In essence the push for pythonic code is not just about maintainable code, it is about keeping people on the happy path without removing delimited abstractions, which is fine, except that the explicit solution to this problem would be to have `from __i_know_what_im_doing__ import lambda, comprehensions` so that the core language didn't misleadingly offer these delimited abstractions. Of course this means that many of my favourite features would be thrown out until some core technical challenges were resolved.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: