Live data from Hacker News

Python overtakes JavaScript as most questioned language on StackOverflow

globalapptesting.com

31–40 of 166 posts

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#31
post #26

Earlier quoted context omitted.

I looked at it last a month ago. It was terrible. > setting up a new documentation is very easy with Sphinx As per my original comment, the idea that documentation should require some kind of external markdown static site generator is bizarro land.

How would you want this to work? The alternatives to Sphinx I've used (Javadoc, Doxygen) more or less work the same way.

I think there's a big difference.

Sphinx starts from the point of view that you're going to write your documentation as if you were writing a book, then on top of that it has some optional features for pulling in information from source files.

Most of the others start from the view that you're autogenerating documentation from source-code comments, and on top of that there are some optional features for pulling in some extra content from documentation-specific files.

I think the Sphinx way tends to produce better documentation in the long run, but it takes more effort to get to something just-about-adequate.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#32
I’ve used python for a while but mainly for small scripts. I’m often googling answers. (Is it myvar.len() or len(myvar) or myvar.__len__.?) do I use conda or pip or... 2.7 or 3.?. Oddly I’ll use books for other languages (Perl/JavaScript).

It’s a fine language and easy to get running but it seems harder to memorize things in it vs others (if I was 100% of my time using it, it probably would easier).

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#33
post #31
post #26

Earlier quoted context omitted.

How would you want this to work? The alternatives to Sphinx I've used (Javadoc, Doxygen) more or less work the same way.

I think there's a big difference. Sphinx starts from the point of view that you're going to write your documentation as if you were writing a book, then on top of that it has some optional features for pulling in information from source files. Most of the others start from the view that you're autogenerating documentation from source-code comments, and on top of that there are some optional features for pulling in so…

I understand your point, and Go is probably better in this regard, but it's pretty easy to get started with Sphinx with autogenerating documentation from code. You don't have to manually write anything.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#34
post #21
post #20

I think a big part of it is how much canonical documentation and resources has improved in JavaScript vs. how much people are struggling with it in Python (as someone who does more Python than JS but does both). Python libraries tend to have less documentation and their documentation tends to be less live whereas JavaScript has been more stable lately (something I didn't think I'd ever write). Funnily enough the last…

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

#35
post #3

Seems 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.

protip: you can also increase your StackOverflow clout by merely asking or answering the most generic basic questions.

You'll look like a community expert and thought leader in no time.

Helps the resume inhalers that weigh these arbitrary things.

More complex questions about specific frameworks or how that might work with your ORM and memory cache just don't get the attention.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#36

Earlier quoted context omitted.

> 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…

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()).

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#37
post #36

Earlier 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()).

Ah nice. Yes that last suggestion is probably a more simple and elegant approach than anything I'd mentioned / thought about

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#38

I’ve used python for a while but mainly for small scripts. I’m often googling answers. (Is it myvar.len() or len(myvar) or myvar.__len__.?) do I use conda or pip or... 2.7 or 3.?. Oddly I’ll use books for other languages (Perl/JavaScript). It’s a fine language and easy to get running but it seems harder to memorize things in it vs others (if I was 100% of my time using it, it probably would easier).

> ...it seems harder to memorize things in it vs others

This x10. I love Python, and use it for small scripts when I get the chance (just used it to test some probabilities last night even), but it seems like I constantly have to look things up all the time in it and can't seem to remember even common, basic syntax in it, despite having used it quite a bit. I really don't know why. I can leave and come back to other languages and not have anywhere near as much difficulty.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#39

Earlier quoted context omitted.

Coming from Perl, Python library documentation makes me want to tear my eyes out. No I don’t want a cutesy fucking module homepage, I want reference documentation with some examples. Authoring PyDoc was the worst experience too. No I don’t want to install and configure a static site generator in order to have rich text documentation.

It's strange to see this is your experience, because I had the exact opposite: Python documentations are usually very comprehensive, nicely formatted. Important projects have very good documentations and setting up a new documentation is very easy with Sphinx. Maybe you should try it again, it might have changed a lot since you looked it.

Having just had the pleasure of using Sphinx for the first time, I can only underline what you wrote.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#40
post #17

Earlier 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…

Absolutely. For me it is a 50-50 chance whether I have data in a dict that needs to be mapped to something or have data in a list/tuple that needs mapping.

Many major programming languages undersell how natural key-value data structures are; usually by providing unwieldy mapping data types. Clojure has spoiled me.

> you could throw one together

Yeah, I do. Most Python programmers wouldn't see a need for that, but that can be attributed to Python not having the capability by default and so they've just internalised not to use dict for anything that needs to be a key. World's mildest form of learned helplessness, I suppose.

Post reply on HN