OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Mar 19, 2024 4:00 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Stack Overflow making me nervous
PostPosted: Thu Nov 26, 2020 6:50 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 811
Location: Hyperspace
It seems every time I see an answer on Stack Overflow regarding something I know, there's a highly-upvoted answer with something I know is wrong. Here is a question on web cookies where the second answer cites an RFC which is practically a work of fiction; it never matched actual practice.

Is Stack Overflow more trustworthy on deeper, non-web-related software questions? Or should I just be very careful which answers I pick?

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Thu Nov 26, 2020 9:01 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1590
StackOverflow is as trustworthy as any Internet resource, such as this forum, Wikipedia, Ask.com, the usenet, etc. They are all as trustworthy as their members/editors. Consider any information from there unverified opinion until it is actually verified. Anyone answering you might be talking out of an organ not typically used for that, or might be the world expert on the topic, and you have no way to know.

However, any time I've hit them up in the past, the answers they provided were at least correct (whether they were helpful is a different question). That said, I've typically searched for things regarding C or C++, and the answers typically consisted of liberal amounts of quoting from the standard. Or linking cppreference.com.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Thu Nov 26, 2020 10:38 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
I agree with Nullplan on this; you should never take any source as definitive (on the Internet or off) without some sort of verification. In some cases, you have to take an answer on faith when it is the only answer available, but don't be surprised if it turns out to be wrong.

As for Sewage Outflow, well, as you can guess I have my own issues with the site, given what I call it. However, the major problem I have with it is less about the replies, and more about how those answers are often misused; 'coding by Stack Overflow' is a known problem, here and elsewhere. Also, the relative lack of dialogue ensures that it is harder to identify and address instances of the XY Problem than in a more open-ended forum.

I am certain that Solar will be by soon to defend the site, and he's got better reason to than most; if you really want to know about the pros and cons of S-O, talk to him.

Having said that (and talking about your toxic web sites), I want to mention in passing that the question of cookie size limits came up briefly in the discussion of the classic Daily WTF article "Tossing Your Cookies" (Not Safe for Sanity, given how terrible the code in question is). Not that the horrible piece of code in question didn't have enough problems as it was, but it did lead a few to ask whether the poisonous cookie being generated was even viable in the first place. That program is so bad it almost counts as both a psychohazard and a cognitohazard; phrases such as "I refuse to believe that's production code" came up repeatedly in the comments. ~'s code is elegant in comparison to this eye-raping monstrosity, and the code itself isn't even the Real WTF (the way it stores a SQL query string in a cookie and then retrieves it for execution is).

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Sat Nov 28, 2020 12:15 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 811
Location: Hyperspace
nullplan wrote:
StackOverflow is as trustworthy as any Internet resource, such as this forum, Wikipedia, Ask.com, the usenet, etc. They are all as trustworthy as their members/editors. Consider any information from there unverified opinion until it is actually verified. Anyone answering you might be talking out of an organ not typically used for that, or might be the world expert on the topic, and you have no way to know.

Yeah... this reminds me to be extra careful to test thoroughly and not just trust. I'm not actually very good at testing, but I'm better at it than I am at comprehending some standards.

nullplan wrote:
However, any time I've hit them up in the past, the answers they provided were at least correct (whether they were helpful is a different question). That said, I've typically searched for things regarding C or C++, and the answers typically consisted of liberal amounts of quoting from the standard. Or linking cppreference.com.

That would be useful to me in saving time and frustration searching. Yesterday, I got a little frustrated searching the Intel x86 SDM for the significand sizes of floats. They weren't in section 4 which I understood specified floating-point things, they were in the section which specifies FPU-specific details. And binary representation of floats is something I'm much more comfortable than with some language details.

Schol-R-LEA wrote:
I agree with Nullplan on this; you should never take any source as definitive (on the Internet or off) without some sort of verification. In some cases, you have to take an answer on faith when it is the only answer available, but don't be surprised if it turns out to be wrong.

I hear you. It wouldn't be my first time for that kind of surprise. I remember there were one or two things when I was still at school, long before residential Internet access. These were published facts, but I was pretty sure some of the logic didn't add up. They may simply have been poor explanations... in fact, I recall figuring out an explanation was illogical but the fact bein explained was correct. When I'm not trying to get something done, I rather enjoy these things as challenges. (Last night, I got an idea to investigate regarding Fourier transform of square waves, but it won't be easy.) The trouble comes when I am trying to get something done.

Schol-R-LEA wrote:
As for Sewage Outflow, well, as you can guess I have my own issues with the site, given what I call it. However, the major problem I have with it is less about the replies, and more about how those answers are often misused; 'coding by Stack Overflow' is a known problem, here and elsewhere. Also, the relative lack of dialogue ensures that it is harder to identify and address instances of the XY Problem than in a more open-ended forum.

I haven't been a disciple of Duct von Tape for many years, but I can appreciate the temptation to just accept an answer. The XY Problem is a tricky issue. I've been blaming it for the bloat of Unix core utilities for longer than I've been aware of its name. I can fully understand why people do it, but I also understand how deep it goes if you really think about it. A friend (of sorts) took it to the point of saying "trying to use a computer for these things is the problem." :lol: He now writes his novels with a typewriter and he's happy with that. He also maintains several websites, so he hasn't given up on computers entirely. I was never quite clear what he meant by "these things". Anyway, this sort of thinking is why I got into Forth as an operating system, I thought it would cut out a lot of complexity and prove it unnecessary. I wasn't ready to abandon computers, but I hoped to prove much of traditional operating systems, languages, and GUI foibles to be extremely deep cases of the XY Problem. ;) Unfortunately, Forth brings its own complexity in the form of a broad and deep knowledgebase you have to have before you can fluently write good safe code.

Schol-R-LEA wrote:
I am certain that Solar will be by soon to defend the site, and he's got better reason to than most; if you really want to know about the pros and cons of S-O, talk to him.

I am a little surprised he hasn't turned up, but I have been using his time on another issue. Besides, I think it's covered by your and nullplan's replies.

Schol-R-LEA wrote:
Having said that (and talking about your toxic web sites), I want to mention in passing that the question of cookie size limits came up briefly in the discussion of the classic Daily WTF article "Tossing Your Cookies" (Not Safe for Sanity, given how terrible the code in question is). Not that the horrible piece of code in question didn't have enough problems as it was, but it did lead a few to ask whether the poisonous cookie being generated was even viable in the first place. That program is so bad it almost counts as both a psychohazard and a cognitohazard; phrases such as "I refuse to believe that's production code" came up repeatedly in the comments. ~'s code is elegant in comparison to this eye-raping monstrosity, and the code itself isn't even the Real WTF (the way it stores a SQL query string in a cookie and then retrieves it for execution is).

I had a look at that, got a few grins from reading the comments especially. I like reading about terrible code, although not so much the code itself. :lol: And yeah, it's such a wonderful example of security! :lol:

Thanks guys!

Edit: Almost forgot, but not sure how: SQL has true, false, and true2? That's a WTF in itself. :D

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Sat Nov 28, 2020 12:46 pm 
Offline
Member
Member

Joined: Fri Nov 22, 2019 5:46 am
Posts: 590
eekee wrote:
SQL has true, false, and true2? That's a WTF in itself. :D

Where did you read that? It has true, false, unknown and the non-value NULL.

Greetings
Peter


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Sun Nov 29, 2020 2:59 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 811
Location: Hyperspace
PeterX wrote:
eekee wrote:
SQL has true, false, and true2? That's a WTF in itself. :D

Where did you read that? It has true, false, unknown and the non-value NULL.

It was in one of the comments. It might have been something specific to SQL Server in or before 2005.

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Sun Nov 29, 2020 9:53 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1590
eekee wrote:
Edit: Almost forgot, but not sure how: SQL has true, false, and true2? That's a WTF in itself. :D
Clean your glasses, that comment was about varchar2. Which is a string data type, so of course it has every combination of characters you can imagine. Now, that a varchar2 and a varchar even exist, that is a WTF, yes.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Mon Nov 30, 2020 1:27 am 
Online
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
eekee wrote:
Schol-R-LEA wrote:
I am certain that Solar will be by soon to defend the site, and he's got better reason to than most; if you really want to know about the pros and cons of S-O, talk to him.

I am a little surprised he hasn't turned up, but I have been using his time on another issue. Besides, I think it's covered by your and nullplan's replies.


:lol: :lol: :lol:

Nah. I'm not going to defend SO much. It's like going to the coffee machine and asking coworkers about an issue; many a time you will get good advice, many a time you will get some cargo cult stuff that someone who really knows will turn his eyes up at in disgust. But it's better than trying to brute-force a problem without asking anybody at all.

This is my "favorite" example from the realm of "all the world is (assumed to be) ASCII-7". ;-)

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Stack Overflow making me nervous
PostPosted: Fri Dec 04, 2020 4:49 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 811
Location: Hyperspace
Thanks guys!

@nullplan: That was a different comment. I may have wasted a lot of time on those comments. ;)

@Solar: Fair enough! Most of those answers don't know about the problems, do they? (Or they didn't in 2013.)

I ended up browsing SO/SE at random because I was so tired. Like Wikipedia, it's a great site for relatively unimportant trivia, isn't it? ;) Plus there's the "worldbuilding" sci-fi board I would probably spend most of my time on if I was 20 years younger.

All that timewasting did turn up one relevant gem:
Quote:
For an embedded device, I have a hacked compiler that uses 0x20000000 as representation for NULL, with an XOR operation (which fits into a single instruction on ARM) to convert between pointers and integers. This avoids at least some of the problems with having interrupt vectors at address 0 and no memory protection. – Simon Richter 12 hours ago

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Solar and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group