Live data from Hacker News

Python overtakes JavaScript as most questioned language on StackOverflow

globalapptesting.com

141–150 of 166 posts

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#141

Earlier quoted context omitted.

> and there is seemingly no other way to discover what that is Yes there is, it's called reading a goddamn book. > Knowing the right thing to do requires you be informed about the history of Python language design Bullshit, it requires you knowing the language. Perhaps by reading a book. Knowing the history is of little value. > sifting through the massive corpous of documentation and historical knowledge required to…

This seems odd. I've known no one who learns programming by reading books. Reading books help, but most people get proficient by working on projects.

Hmm, you're right, I agree, but you need to understand a language before working on a project (OK, maybe that's my style, maybe others interlace working + reading).

But the original poster claimed info was just so hard to get and I said it wasn't.

Horses for courses, ok. In reality it's books + SO + lots of online info + your local expert (there's usually one at least, though expertise is relative) + transferable skills from other languages.

All I'm saying is you need that info, and it's there, one way or another. There's so much info now out there compared to when I started programming. It's there, use it.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#142

Earlier quoted context omitted.

1990 is calling and wants you back... But seriously, many of us simply don't remember that sort of book learning. If it comes to you naturally, fine, just realise that people are different and have different skills, memorization techniques and care about different things. Some programmers are like you (a tiny minority afaik) and can read a dry spec or a book and remember all the intricacies and gotchas. It takes a ce…

> many of us simply don't remember that sort of book learning. You mean you haven't heard of books, or can't read, or can't be bothered? Presumably none of these so what are you saying? > just realise that people are different and have different skills, memorization techniques Fine, I agree totally, use those! But here's what the original poster said "generally accepted best way to perform this operation that leverag…

Sorry, phrased that badly, I meant that being able to reel off tech specs wasn't an indicator of being a good programmer. For example, one guy was pretty good, but another was literally terrible, couldn't actually program, just able to talk about it.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#143
post #80

Earlier quoted context omitted.

Good information, and well put. A small quibble: you should probably almost never use tuple(), even on recent Python: >>> tuple(dict(a=1, b=2).items()) (('a', 1), ('b', 2)) >>> tuple(dict(b=2, a=1).items()) (('b', 2), ('a', 1)) Of course, if you can absolutely guarantee how the dictionary has been constructed, it is possible. No rules are absolute. But in my experience, frozenset() is probably better: >>> frozenset(d…

Well. Now that dictionaries remember their order in newer Python versions, there is a case to be made that dict(a=1, b=2) is not the same dictionary as dict(b=2, a1). So they should be different dict keys, if they could be dict keys.

    dict(a=1,b=2) == dict(b=2,a=1)
is True (on 3.7.3). I'm not too keen on introducing a third type of equality on the same type, even if it makes some theoretical sense.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#144

Earlier quoted context omitted.

id(dictionary) is the key you want: immutable, reliable, cheap.

That value will not change when the contents of the dict are updated. You’re keying on the dict itself rather than the hashed contents. That’s what you want in some situations, but it’s not what the parent post is looking for.

It's also not reliable, since the same address can be reused if the dict is GCed. This is actually really easy to induce in Python, since it uses immediate refcounting. In my REPL (3.7.3):

    >>> a = {}
    >>> x = id(a)
    >>> del a
    >>> a = {}
    >>> y = id(a)
    >>> x == y
    True

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#145

Earlier quoted context omitted.

It's not actually. You never call dunder methods directly, you use them through the built-in function or operator. So it can be neither myvar.len() nor myvar.__len__

Well, x.__len__() is the same as len(x). You’re just supposed to remember not to use it (makes you wonder why they chose len(x) instead of x.len())

or x.length, since length should be a property like it is in Ruby and JS.

In Pandas, a DataFrame's shape is a property and not a function or method.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#146
post #120

And yet there isn't a proper Python to JavaScript transpiler, like ClojureScript is to Clojure. I wonder why.

Yes, that always puzzled me. Same with Jython which has a much smaller following than JRuby. I think with Clojurescript it's a case of really adding value whereas Python to JS is largely syntactic sugar.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#147
post #59
post #35

Earlier quoted context omitted.

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.

Do people really use StackOverflow for answering job-related programming questions? The only time I found the questions on there useful was when I was a first year student learning programming. Maybe I am just bad at searching / asking.

I graduated 5 years ago and I still use it daily.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#148

I like Python and it's my main language currently after years of C++ and Java. My main problem with Python is that it's really easy to create really messy code that no one can follow. And I see it often because everyone is using Python these days. For example, you have an undocumented function with 6 arguments and have no idea what these are (having bad names also doesn't help, but that's not a Python specific issue)…

Agree. And as someone that is guilty of writing really messy code and then later Karma had its revenge as I had to clean up and professionalize someone else's tangle of python scripts, I think this is common for scripting languages. A lot of times things start out as one-off scripts, which then become personal scripts, which then become shared scripts, which then become critical to back end automation. Especially in the infrastructure/automation space, you'd be amazed at the horror stories of ducktape holding things up behind the scenes. Even in fancy places like big banks, or fortune 100 businesses. Things emerge organically, and most automation doesn't go through a formal specification/design/test/acceptance process.

Few people set out to intentionally write messy code. If I had to do it all over again, my earlier code would have been much cleaner.

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#149

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.

Some python documentation conventions are weird, to be sure. But I’d rather have an eternity of Sphinx build toolchains than the hell that is making POD/Perldoc work for medium-to-large projects (or small ones, for that matter).

> the hell that is making POD/Perldoc work for medium-to-large projects

Such as?

Re: Python overtakes JavaScript as most questioned language on StackOverflow

#150
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.

I actually use Stack Overflow to look for idiomatic ways to do things in languages that I don't have a lot of experience with. So I literally search for things like how to duplicate arrays, even though I'm quite capable of achieving the required output myself. In fact, I use SO almost exclusively for "Is this a bug with a common workaround" and "Is there a more idiomatic way to do this" questions.
Post reply on HN