instructor situation.

This is a discussion on instructor situation. within the A Brief History of Cprogramming.com forums, part of the Community Boards category; using brackets in the argument list is pretty non-standard, even if it will compile and is technicalyl correct. Your professor ...

  1. #16
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    using brackets in the argument list is pretty non-standard, even if it will compile and is technicalyl correct. Your professor is wrong, it is ansi, but it does present a readability issue, since most people trying to read yoru code would be confused for a few milliseconds at what you are doing. The real test is whether -

    Code:
    void foo(int []);
     
    void main(void){  // i love you ***** :D
       int* bar = NULL;
     
       foo(bar);
       }
    will compile. if you can't use [] in a forward declaration without the variable name, and if the compiler wont accept it as synonymous rather than an overloaded function, then [] is incorrect.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  2. #17
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Are you seeing diagnostic messages with that code?
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #18
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    i can't believe I'm seeing that again.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #19
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by Dave_Sinkula View Post
    Are you seeing diagnostic messages with that code?
    Of course he does:
    temp.c: In function `main':
    temp.c.4: error: `NULL' undeclared (first use in this function)
    temp.c.4: error: (Each undeclared identifier is reported only once
    temp.c.4: error: for each function it appears in.)
    temp.c.3: warning: return type of `main' is not `int'

  5. #20
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    Yeah, copy-paste is a mother.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #21
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    If your boss (head developer / technical lead) told you to use the pointer declaration (or to do some other task their way), would you question their ability / understanding? [I hope not.]

    Sometimes I want something done a particular way (and have a very good reason) but don't want to spend the 15-30 minutes explaining the specifics it to a new staff member who is not experienced in real world systems/conditions.


    Quote Originally Posted by NeonBlack View Post
    Mario, maybe I exaggerated a little with the "vast majority" thing, but it seems like it is more common (among the people I know anyway).
    I agree with Mario.

    I do not use the array declaration and I have not seen many professional C programmers that do.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  7. #22
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by novacain View Post
    If your boss (head developer / technical lead) told you to use the pointer declaration (or to do some other task their way), would you question their ability / understanding? [I hope not.]

    Sometimes I want something done a particular way (and have a very good reason) but don't want to spend the 15-30 minutes explaining the specifics it to a new staff member who is not experienced in real world systems/conditions.
    And fair enough, but would you give an obviously false reason and expect it to go by?

  8. #23
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    435
    It's cool now- I was working today and he just happened to be passing by as the computer froze. The computer just completely locked up for some reason. He asked me 'What the hell happened?' I told him I didn't know. 'Probably because of the damn array notation in your prototypes.' We both had a good laugh and he went on his way.

    He must have been having a bad day.
    I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21