Python overtakes JavaScript as most questioned language on StackOverflow
41–50 of 166 posts
Re: Python overtakes JavaScript as most questioned language on StackOverflow
#42Is it happening because of Python getting more popular or getting more complicated to use?
15 years of Python here, started in 2.4. Day to day Python is not more complicated to use. It's actually easier due to many bugs fixes, quality of life features and better error messages. However, Python does provide more tools to do more complicated things (async, type hints, etc), but that's not what most people use. They actually don't even know about it, and don't have to care. So it's not the questions you see o…
Re: Python overtakes JavaScript as most questioned language on StackOverflow
#43Earlier quoted context omitted.
Another thing I've noticed is that the Python community in StackOverflow is very nice and considerate most of the time compared to the JavaScript crowd. (Being a part of both). If anyone is interested in engaging by the way: https://sopython.com/
This seems true of the Python community in general. I've yet to meet anyone that's not nice and really supportive (there are bound to be some, but I've not knowingly interacted with them). I think it's a great measure of a programming language's ecosystem when taking part in the community is such a pleasure.
Re: Python overtakes JavaScript as most questioned language on StackOverflow
#44Earlier quoted context omitted.
There is a bit more insight to be found by reversing that - Python is simpler than other programming languages and achieves that by sacrificing a little power. Compare it to C, which it has displaced as an introductory language. Python and C are superficially interchangeable to a beginner, but to learn C you have to invest time into pointers and memory management. Python sacrifices the efficiency of direct memory man…
> can't even use a dict as a dict key Curious, is this actually something you want to do often? While there is no hashable+immutable frozendict ala frozenset, you could throw one together or even define a hash function on a subclass and "swim at your own risk" not to mutate it later. I've encountered this enough with lists and the obvious solution is to cast them to tuples. Can't say I've found the same with dicts th…
Give them a string, they return a table or function. Give them the table or function, they return a string.
It’s a useful technique that you can only apply if your hashmap can map anything to anything.
Re: Python overtakes JavaScript as most questioned language on StackOverflow
#45Earlier quoted context omitted.
15 years of Python here, started in 2.4. Day to day Python is not more complicated to use. It's actually easier due to many bugs fixes, quality of life features and better error messages. However, Python does provide more tools to do more complicated things (async, type hints, etc), but that's not what most people use. They actually don't even know about it, and don't have to care. So it's not the questions you see o…
I mostly agree with you, but still think that Python could be way simpler and equally powerful. I'd love to see a language similar to Python, but with named structs instead of classes, for instance.
That is one thing about Python that has always been interesting. For new programmers, it's such an attractive language because it's very simple to get up to speed and pump out usable code.
But to really start leveraging Python for more serious projects it's extremely useful to use Classes. And that's actually an appreciable bump in difficulty for inexperienced devs. I've seen go to great lengths to avoid it.
Maybe named structs would be a simpler way for them to level up complexity, especially if they're coming from a C background.
Re: Python overtakes JavaScript as most questioned language on StackOverflow
#46Earlier quoted context omitted.
That's a fair point. In this particular case the documentation was significantly worse than most new JavaScript libraries I'm used to and pretty similar to most Python libraries I'm used to. Sometimes parameters were missing, what values you can pass in were missing and there was a general lack of documentation on how to do things (sans a few tutorials). I can name a bunch of examples. Here is a very simple one: what…
Hmm, this has not been my experience with Python libraries (I can't speak for JS ones). The vast majority are well-enough documented that I've never had a problem, and I strive to document my important libs at least this well: https://yeelight.readthedocs.io/
To be clear, I think you’ve done an absolutely great job writing the prose — I just don’t get the cultural conventions around Readthedocs :p
(There’s still wild differences in quality between those four. It seems like documentation UX would be more of a solved problem by now.)
[1]: https://docs.rs/reqwest/0.9.15/reqwest/#structs [2]: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_... [3]: https://developer.apple.com/documentation/corevideo [4]: https://doc.qt.io/qt-5/qtwebengine-index.html
Re: Python overtakes JavaScript as most questioned language on StackOverflow
#47Earlier quoted context omitted.
Not often , but when you do want to do it, it’s frustrating (and unusual for Python) that the natural and obvious way doesn’t work.
When I read this my first thought was "you should use a FrozenDict", but looking into it, it seems that it doesn't exist; I assumed so because of FrozenSets (hashable sets). You can still create a hashable key from a dict with FrozenSet(mydict.items()).
tuple(d.items())
Re: Python overtakes JavaScript as most questioned language on StackOverflow
#48Earlier quoted context omitted.
When I read this my first thought was "you should use a FrozenDict", but looking into it, it seems that it doesn't exist; I assumed so because of FrozenSets (hashable sets). You can still create a hashable key from a dict with FrozenSet(mydict.items()).
You don't really need a FrozenSet if you're already willing to iterate over this dictionary. You can just use a tuple, which is also hashable. tuple(d.items())
>>> tuple({1:2,3:4}.items()) == tuple({3:4,1:2}.items())
False
>>> frozenset({1:2,3:4}.items()) == frozenset({3:4,1:2}.items())
TrueRe: Python overtakes JavaScript as most questioned language on StackOverflow
#49Seems like the most difficult programming is no longer cache invalidation and naming things. Its now about strings, and to duplicate arrays ... The stats are skewed because hordes of beginners. Mainly driven by what schools teaches and what languages has the most hype. That said Python is huge . Damn you significant white space.