News for hackers. Stuff that matters.
Re:How often do people copy and paste from Stack Overflow? by arduinomancer on Monday April 19, 2021 @01:26PM (#26865474)
IMO its not even that we're copying people's logic, its just that stack overflow acts as a weird sort of crowd-sourced centralized documentation for programming languages.

For example if I forget the name of a function for something in a particular language I don't even go to the docs, I just google something like "python reverse list" and click the first SO link.

Re:How often do people copy and paste from Stack Overflow? by henrikeh on Monday April 19, 2021 @01:43PM (#26865760)
Is it just me or is this also a symptom of Python's documentation being really strange to navigate and generally having a massive impedance mismatch with Google?

When I search on Google for "python reverse list", not a single link is to the official Python documentation. Not even if I search for "python reverse" does the documentation page show up. Searching for "python reverse documentation" leads to the second link to the Build-in Functions page (https://docs.python.org/3/library/functions.html), which is what I "need".

Excuse the comparison, but "matlab reverse list" has the top three to the official documentation (all of them relevant, but slightly different semantics). Why can't Python be better than that?

Re:How often do people copy and paste from Stack Overflow? by jollybean on Monday April 19, 2021 @08:32PM (#26869415)
It's not you - Python docs are very comprehensive but organized in a very odd way and miss a lot of marks. If you have time to 'read everything' you're fine but it's somewhat less suited as a raw reference.

Although I don't mind the informal voice of the docs - there's clearly not much in the way of editorial oversight and pro technical writing. It makes one reconsider how much actual effort goes into putting together docs from corporate backed efforts.

That said, I don't think anyone does it perfectly well, and that we could do a lot better in terms of providing information - to the point wherein I would consider it a little bit of a failure that SE has to be consulted for smaller problems. One would hope that 'good docs' would provide clear and concise answers to such things, rather than have the crowd cobble it together and vote on it.

Re:How often do people copy and paste from Stack Overflow? by dkersten on Tuesday April 20, 2021 @12:33AM (#26870702)
I actually don’t mind the python docs, but then, I learned python from them back in 2001 when I had infrequent internet access, so I had to rely on my offline copy!
Re:How often do people copy and paste from Stack Overflow? by nurpax on Monday April 19, 2021 @06:44PM (#26868712)
It’s not just you. Python seems to suffer from Python-specific ”tutorial sites” being SEO’d above Python’s official docs. I don’t know what it is about the Python documentation that lowers its rank on Google search results. In general, not a big fan of Python docs.
Re:How often do people copy and paste from Stack Overflow? by spion on Monday April 19, 2021 @08:05PM (#26869254)
JS has / had the same problem, which is why a common tip is to add "MDN" to the keywords to get a higher quality reference style result from MDN: https://developer.mozilla.org/
Re:How often do people copy and paste from Stack Overflow? by HDMI_Cable on Monday April 19, 2021 @09:07PM (#26869672)
I wish there was an MDN for Python/Julia.
Re:How often do people copy and paste from Stack Overflow? by kevin_thibedeau on Monday April 19, 2021 @08:08PM (#26869276)
Python documentation is a static Sphinx site with no need for JS to render content. That's the easiest possible design for search engines to index. It's Google's fault that their algorithm can be gamed by low quality seo sites.
Re:How often do people copy and paste from Stack Overflow? by ziml77 on Monday April 19, 2021 @08:51PM (#26869554)
The only way it wouldn't be able to be gamed is if they kept making large changes to it for no other reason than to be a moving target. Like you can say "oh it's stupid that they prioritize X and not Y when Y is a much better indicator of meaningful content" but as soon as they switch Y to be a priority, sites will shift to maximizing the amount of Y.
Re:How often do people copy and paste from Stack Overflow? by kevin_thibedeau on Monday April 19, 2021 @09:48PM (#26869873)
Google can fix the problem. They just don't want to. They were able to kill the Wikipedia clones by demoting their rankings. They don't want to surface non-profit ad-free sites on the first page results because that cuts into revenue.
Re:How often do people copy and paste from Stack Overflow? by HDMI_Cable on Monday April 19, 2021 @09:07PM (#26869666)
With how much money Google spends on ML it's really a wonder that they haven't been able to out-compete a bunch of consultants on SEO. This really seems like a blunder on Google IMO.
Re:How often do people copy and paste from Stack Overflow? by m463 on Monday April 19, 2021 @10:49PM (#26870195)
> Is it just me

no. I stored the entire python document set locally, yet I still search online for functions.

stuff like: is it str.beginswith() or str.startswith()?

Blast, how do I convert to/from unicode again???

I think what we need is some sort of mashup of rosetta code and the docs and an index.

Re:How often do people copy and paste from Stack Overflow? by klmadfejno on Monday April 19, 2021 @05:57PM (#26868370)
> When I search on Google for "python reverse list", not a single link is to the official Python documentation. Not even if I search for "python reverse" does the documentation page show up. Searching for "python reverse documentation" leads to the second link to the Build-in Functions page (https://docs.python.org/3/library/functions.html), which is what I "need".

But what you want is probably ls[::-1]

Re:How often do people copy and paste from Stack Overflow? by ASalazarMX on Monday April 19, 2021 @01:40PM (#26865711)
It's a shame that most manuals have evolved to web pages that you can't download as PDFs or eBooks. Now you usually have to go online to find that keyword, and as you're online already, might as well google for the whole answer.

One of the most productive times in my career was programming for the IBM i in the 90s. There were manuals online, but you could also download indexed PDFs versions. IBM did a superb job with their documentation, there was hardly any need to look up anything in the Internet, whatever you needed was in the manuals, examples included.

Of course you still used the Internet at work, but mostly for mingling with your peers and having technical discussions, although too many people still blindly copied/pasted from the forums.

Re:How often do people copy and paste from Stack Overflow? by agallant on Monday April 19, 2021 @03:27PM (#26866941)
You may be interested in https://devdocs.io (offline-friendly documentation tool). And if you prefer a straight up desktop app - https://zealdocs.org
Re:How often do people copy and paste from Stack Overflow? by milkytron on Monday April 19, 2021 @05:46PM (#26868293)
I also really enjoyed Dash when it was free to use: https://kapeli.com/dash
Re:How often do people copy and paste from Stack Overflow? by jabo on Monday April 19, 2021 @06:09PM (#26868458)
Why not pay for it or get your employer to pay for it, especially if you enjoyed it?
Re:How often do people copy and paste from Stack Overflow? by ziml77 on Monday April 19, 2021 @08:57PM (#26869600)
Seriously, it's a $30 one-time purchase. In an age where companies want to charge you $30 per month for software, that's a steal.
Re:How often do people copy and paste from Stack Overflow? by milkytron on Tuesday April 20, 2021 @01:31PM (#26877682)
I was in school when they started charging for it, and then it kind of just fell off my radar until I remembered about it now.
Re:How often do people copy and paste from Stack Overflow? by ASalazarMX on Monday April 19, 2021 @06:08PM (#26868448)
Thank you. I've used it, although it adds a lot of complexity for the same features than a folder full of manuals would give.

I'm probably too set in my ways, but I prefer references that are always available offline. Devdocs.io once in a blue moon would forget about my choices, and I would hate to redownload them.

Re:How often do people copy and paste from Stack Overflow? by sammorrowdrums on Monday April 19, 2021 @10:35PM (#26870135)
I once downloaded Python docs as an iPad app and a small Python IDE - I was working on a cruise ship and so offline documentation really helped.

It taught me to get better at reading the Python docs, but more importantly to cope better without being able to just search every issue I was having online.

Re:How often do people copy and paste from Stack Overflow? by airstrike on Monday April 19, 2021 @11:28PM (#26870383)
My first programming experience was with mIRC scripting and it was ridiculously convenient to have everything in a nicely written a local, offline .hlp file

https://www.mirc.com/help/html/index.html?mirc_scripts.html

I remember spending the afternoon tinkering with it until late at night when dial-up "logic" meant I could finally go online without it costing an arm and a leg

Re:How often do people copy and paste from Stack Overflow? by ralusek on Monday April 19, 2021 @03:01PM (#26866660)
That's interesting that you say that because I actually have the opposite reaction. When I go to look for documentation and find that it's a PDF, I want to die.
Re:How often do people copy and paste from Stack Overflow? by ASalazarMX on Monday April 19, 2021 @03:17PM (#26866831)
PDFs are horrible as eBooks, but in a manual I prefer the fidelity of a PDF than the reflowing of an ePUB, or the fickleness, slowness, and potential unavailability of a web page.

A well structured and correctly indexed PDF is a godsend, because you just open the table of contents, quickly locate what you're looking for, click and there is your answer. As I said, IBM excels at writing documentation. Every language has a Language Reference manual, and a Programmer's Guide manual. The first is for reference, the second is to learn how to use it, including examples.

Don't take my word for it, you can check out, for example, the COBOL manuals here: https://www.ibm.com/docs/en/i/7.1?topic=languages-cobol

Re:How often do people copy and paste from Stack Overflow? by ghaff on Monday April 19, 2021 @06:11PM (#26868470)
I think it depends. For something well-structured like a cookbook I'd prefer PDF in most cases. But it really varies. For example I find most guidebooks do a decent job of Kindle these days and have actually switched over to a significant degree because it's really useful to have everything on my phone.
Re:How often do people copy and paste from Stack Overflow? by afiori on Monday April 19, 2021 @06:23PM (#26868555)
for this specific use case a single html file that you open in the browser might be the best option (at least php offer that option and I appreciated it).
Re:How often do people copy and paste from Stack Overflow? by bluedino on Monday April 19, 2021 @08:19PM (#26869335)
The first PDF I had was a 'bonus' book that came on a CD included with a programming book. There was a compiler along with sample code from the book, and then something like SAMS Teach Yourself Visual C++ in 21 Days.

I absolutely hated it. My screen was only 640x480, so I could barely see a whole page, much less see my IDE at the same time. These were the days of single 14 or 15 inch monitors, not dual or triple 24" widescreens.

It was also a little on the slow side. Early Pentium, 8MB RAM, 4X CD-ROM...

These days I'm delighted to see a PDF. There's a table of contents and index, they're searchable...copy and paste usually stinks, though.

PDF's are forever. They print nicely. They don't get lost when the project upgrades a major version, you can still use them when there's a DNS issue with your ISP, you can use them when you don't have internet...

Re:How often do people copy and paste from Stack Overflow? by hannofcart on Monday April 19, 2021 @03:44PM (#26867110)
I have a hunch that this tendency to look up SO rather than actual language/API docs is prevalent more in some ecosystems than in others.

For eg, with Rust and Go projects I would invariably read the actual docs (which I find are very accessible to read) as compared to when I write Python or C++ where I'm happy to SO my way through my task.

However, what I've found is that reading the actual docs is better for multiple reasons: 1) it reinforces your learning / memory via spaced repitition 2) you tend to glean some extra, related useful info from the docs.

These days I try and put myself in a no SO straitjacket as far as possible, forcing myself to read the actual docs instead.

Re:How often do people copy and paste from Stack Overflow? by cerved on Tuesday April 20, 2021 @04:20AM (#26872072)
I would definitely agree that it depends on the strength/weakness of the docs/SO for that ecosystem.

For example. MDN had terrific docs for JavaScript and web apis. Things are discreetly segmented and this easy to navigate. Terrific, up to date information about how to things, why as well as great information on the caveats of the API (what works where and what fails where).

The SO answers are often a hack on how to implement it in an outdated framework. And ten variations that are "faster".

But you might still end up there because you're not sure how to look it up directly in the docs. Maybe you do an SO layover.

.Net is similar, although the official documentation suffers from marketing speak pollution, where it's hard to find answers because Microsoft names their APIs by randomly permutating ASP, Entity, Core and Framework when making things.

Add to that all the trashy noob doc sites, codeproject, csharpcorner... that pollute search.

Both ecosystems suffer on SO because of SOs inability to stay up to date with a changing API. A great example is all the Python 2 answers.

Then you have ecosystems like Scala, which has terrific documentation in source code. As well as official docs that are reasonably easy to navigate. But it's not a huge ecosystem, so sometimes it's hard to find answers to questions that haven't been asked. Then SO provides a valuable platform to get those answers. Sometimes from the maintainers themselves.

All in all, SO often offers a good complement to official docs, ranging from excellent to subpar. Personally I wished it was better at providing up to date information.

Re:How often do people copy and paste from Stack Overflow? by simonsarris on Monday April 19, 2021 @03:10PM (#26866765)
I do this for <canvas> sometimes and get... myself in 2013 answering somebody
Re:How often do people copy and paste from Stack Overflow? by QuesnayJr on Monday April 19, 2021 @04:01PM (#26867305)
This happens to me too. It freaks me out, because it means that not only I forgot the answer, but that I forgot that I ever knew the answer.
Re:How often do people copy and paste from Stack Overflow? by glitchcrab on Monday April 19, 2021 @06:37PM (#26868654)
Also been there, however mine was me answering my own question. Several years later I helped myself out again with it.
Re:How often do people copy and paste from Stack Overflow? by rualca on Monday April 19, 2021 @02:33PM (#26866375)
> (...) acts as a weird sort of crowd-sourced centralized documentation for programming languages.

I see it more as an expert system where problems and their solutions are documented in a queriable way.

What stack overflow offers is more than your run of the mill documentation. It leaves a paper trail of weird corner cases and their workarounds.

Re:How often do people copy and paste from Stack Overflow? by davnicwil on Monday April 19, 2021 @06:18PM (#26868516)
Just in case this idea needed any more validation, a few years ago Stackoverflow themselves launched a 'Stackoverflow for Documentation' product [0], and eventually shut it down because, as was probably obvious to many going in and certainly in retrospect, this product was of course.. just Stackoverflow.

[0] https://meta.stackoverflow.com/questions/354217/sunsetting-d...

Re:How often do people copy and paste from Stack Overflow? by BuyMyBitcoins on Monday April 19, 2021 @07:00PM (#26868815)
It’s a shame, I really liked where that product was going. I work best with concrete examples.
Re:How often do people copy and paste from Stack Overflow? by onion2k on Tuesday April 20, 2021 @02:13AM (#26871267)
I just google something like "python reverse list" and click the first SO link.

If that's your workflow it might be worthwhile adding a custom search to your browser so you can just do "SO python reverse list" and only get results from SO.

Chrome https://www.google.com/amp/s/www.techrepublic.com/google-amp...

Firefox https://support.mozilla.org/en-US/kb/assign-shortcuts-search...

Re:How often do people copy and paste from Stack Overflow? by stinos on Tuesday April 20, 2021 @04:03AM (#26871940)
Or use duckduckgo: it basically has this builtin, so it works the same way without configuration across browsers. Enter !so <query>. No configuration is always nice, plus this really helps when working on other machines than your own.
Re:How often do people copy and paste from Stack Overflow? by jbverschoor on Monday April 19, 2021 @01:46PM (#26865798)
“Back in the good old days”, you’d get detailed documentation with for example DirectX. The whole visual c++ experience was so good. I never needed to look up anything. Browsing for documentation is such a zone-exiter...

Rails, Some gens, and some Java projects are the few properly documented projects out there.

Re:How often do people copy and paste from Stack Overflow? by number6 on Monday April 19, 2021 @04:00PM (#26867295)
list.reverse()
Re:How often do people copy and paste from Stack Overflow? by anitil on Monday April 19, 2021 @08:48PM (#26869531)
Or is it reversed(list)? checks Stack Overflow
Re:How often do people copy and paste from Stack Overflow? by fomine3 on Tuesday April 20, 2021 @12:30AM (#26870686)
Search it to find whether destructive operation or return new list
Re:How often do people copy and paste from Stack Overflow? by arduinomancer on Monday April 19, 2021 @08:50PM (#26869545)
That’s exactly the thought process lol