[HN Gopher] Infrequently Asked Questions in Comp.lang.c (1999)
       ___________________________________________________________________
        
       Infrequently Asked Questions in Comp.lang.c (1999)
        
       Author : hummusandsushi
       Score  : 64 points
       Date   : 2023-08-20 13:22 UTC (9 hours ago)
        
 (HTM) web link (www.seebs.net)
 (TXT) w3m dump (www.seebs.net)
        
       | archfrog wrote:
       | I don't want to be toxic but why make a function to cast a char
       | to an int? I was astounded when I briefly skimmed through the
       | list. I hope this is not curriculum in education.
        
         | [deleted]
        
         | xhainingx wrote:
         | It's not. The whole thing is a joke.
        
         | Kamq wrote:
         | I don't see the one you're talking to on a brief skim, but
         | there are several functions that deal with processing a file
         | character by character. They generally use ints because they
         | need a way to signal end of file and you can't do that with any
         | value of a byte.
        
         | chihuahua wrote:
         | I got the impression that the entire document is meant as a
         | joke.
        
           | MobiusHorizons wrote:
           | Unambiguously so if you click to any of the footnotes.
        
       | [deleted]
        
       | zh3 wrote:
       | Some great in-jokes there (hands up who gets the EBCDIC one).
       | 
       | More seriously, a lot of the discussions about "undefined
       | behaviour" seem to be aimed at the kind of code that no
       | experienced engineer would write anyway. Until there's a language
       | that's proved formally correct, every language is going to have
       | "undefined" behaviour (though some languages - especially more
       | modern ones - cover more cases/make it harder for less
       | experienced users to blow their foot [or worse, someone elses]
       | off).
        
       | tragomaskhalos wrote:
       | A good reminder that there were a lot of smartarses on usenet.
        
         | NoZebra120vClip wrote:
         | Yes, like that snopes guy who cut his troll teeth on Usenet!
        
       | ukuina wrote:
       | Obligatory reference to http://vanilla-js.com
        
       | eska wrote:
       | Programmer humor is so shit, man..
        
         | not_your_vase wrote:
         | > Comes to a website that's very well known to be mostly
         | frequented by programmers       > Complains about the content
         | that tries to appeal to programmers
         | 
         | sigh
        
           | eska wrote:
           | I am the target audience.
        
             | wizzwizz4 wrote:
             | Well, no. The target audience is people who find this
             | funny.
        
       | raverbashing wrote:
       | Great joke list. Though sometimes reality beats fiction
       | 
       | > 1.6: I finally figured out the syntax for declaring pointers to
       | functions, but now how do I initialize one?
       | 
       | > With the assignment operator
       | 
       | Well what did you expect right?!
        
         | spacedcowboy wrote:
         | Given how opaque the syntax is, expecting to have to use a
         | screwdriver isn't that weird...
        
       | awestroke wrote:
       | After reading through this, I'm not sure if it's a list of jokes
       | or real information? For example:
       | 
       | > long ints can be entered using hexadecimal notation; for
       | instance,
       | 
       | > long int foo = 07;
       | 
       | How is this a good example of hexadecimal input?
        
         | torstenvl wrote:
         | Most of them are inside jokes that aren't very funny.
         | 
         | Most of them are indeed frequently asked, but by people who are
         | a bit obstinate or otherwise don't fit the mold that old timers
         | thought newbies should fit.
         | 
         | As a result, the responses are often intentionally dismissive
         | and unhelpful.
         | 
         | EDIT: It occurs to me that comp.lang.c was the 80s-90s version
         | of Stack Overflow. So at least they're comparatively _funnier_
         | than the SO responses they 'd elicit today.
        
           | bluetomcat wrote:
           | On SO, any of these answers would be downvoted to death by
           | people not recognising them as jokes at all. Language lawyer
           | types would cite the part of the standard that classifies
           | this as UB in the blink of an eye. It's a different world
           | we're living in.
        
             | torstenvl wrote:
             | On SO these questions would get downvoted to death and the
             | newbie would be admonished for breaking the site
             | guidelines.
             | 
             | 1.1: How do you decide which integer type to use?
             | Closed as opinion based.
             | 
             | 1.3: If I write the code int i, j; can I assume that (&i +
             | 1) == &j?                   Please provide a minimal,
             | complete and verifiable example.
             | 
             | Etc.
        
           | bluedino wrote:
           | It was better than StackOverflow in a lot of ways.
           | 
           | Sure, it wasn't useful as a searchable database of questions,
           | but the FAQ was very useful if you could spend time to wade
           | through it, and any zero-effort posters were either flamed to
           | oblivion or simply ignored.
           | 
           | I remember asking a couple stupid questions and directed to
           | the documentation. To this day, at work I will suggest "let's
           | see what the manual says", while troubleshooting and get a
           | funny look and eve pushback after I find the answer.
        
             | MrLeap wrote:
             | What kind of pushback?
        
               | layer8 wrote:
               | "The documentation can't possibly be up-to-date",
               | probably.
        
         | st_goliath wrote:
         | > After reading through this, I'm not sure if it's a list of
         | jokes or real information?
         | 
         | The whole point is pulling peoples legs, the joke being on the
         | person who doesn't know the language well enough and takes it
         | serious.
         | 
         | The answers in the list are the equivalent of telling an
         | apprentice to go get a can of blinker fluid (or Siemens
         | Lufthacken, etc...), which they dutifully do and end up getting
         | laughed at.
         | 
         | E.g. just before the one you quoted was this gem:
         | 
         | > 1.8: What's the auto keyword good for?
         | 
         | >
         | 
         | > Declaring vehicles.
         | 
         | Regarding your question:
         | 
         | > How is this a good example of hexadecimal input?
         | 
         | It _isn 't_. In C, a leading zero in an integer literal means
         | _octal_. It compiles and works out, because `7`, `07` and
         | `0x07` happen to have the same value.
        
           | ethbr1 wrote:
           | > _a leading zero in an integer literal means octal. It
           | compiles and works out, because `7`, `07` and `0x07` happen
           | to have the same value_
           | 
           | That is a hilariously beautiful and simple example to
           | communicate that.
        
           | IgorPartola wrote:
           | Smart apprentices take the day off when told to get blinker
           | fluid. But your point stands.
        
         | oaiey wrote:
         | They also go me for a while (and I have C in my education but
         | with C/C++ you never know for sure) but when Microsoft invented
         | C I knew something was wrong.
        
         | zh3 wrote:
         | Try compiling:-
         | 
         | main() { int foo = 08; }
        
         | TheSoftwareGuy wrote:
         | Most of the answers seem to contain bullshit. The one you
         | quoted is wrong because the leading 0 is for _octal_ notation,
         | not hex
        
         | teo_zero wrote:
         | Just as a broken clock shows the correct time twice a day, you
         | can use this syntax to input hexadecimal numbers less than 0A.
        
           | zoky wrote:
           | Less than 8 actually. 0 at the start of a number indicates
           | it's octal, so 08 and 09 are not syntactically valid numbers.
        
         | denotational wrote:
         | It's meant to be humorous, there are footnotes explaining some
         | of the jokes.
        
         | Smaug123 wrote:
         | You have asked question 19.27, by the way.
        
       | herdcall wrote:
       | These don't look like "stupid questions" at all, but the
       | disdainful smart aleck responders do look stupid. What a sad,
       | toxic group of people.
        
         | [deleted]
        
         | kichimi wrote:
         | Why is it toxic?
        
         | compiler-guy wrote:
         | It's a joke list of silly things. Not serious at all.
        
       | [deleted]
        
       ___________________________________________________________________
       (page generated 2023-08-20 23:01 UTC)