• tgsegse (unregistered)

    Huh. Did anyone actually have good teachers? All my CS/MIS teachers were quite competent. Heck, other than my elective management accounting course, all the teachers I had in university were fairly decent.

  • my personal favourite line of code (unregistered)

    wasted on you lot, i actually used this in production code.

    #define private public

    it's obvious why i did it, but extra credit if you can explain why it would ever be the right thing to do...

  • boogieman (unregistered) in reply to Heron

    Sounds like we may have had the same teacher (I played a LOT of Starcraft in AP Comp Sci when I was in high school).

    My teacher graded me down on a test once because I initialized a variable when declaring it: "int i = 0;"

    Already knowing C++, I explained to him that it was valid code, compiled and ran perfectly, and that it was even good/standard practice. He replied that he never wanted to see me write code like that again.

    So I figured he didn't know crap about programming, and if I did the same thing on another test, he wouldn't even notice. And I was right. >:)

    High school teachers... what a laugh...

  • (cs) in reply to Random832
    Random832:
    seejay:
    (the only one that stands out was her putting 333.333.333.333 as an IP address on an exam two years in a row even though several students had told her it wasn't a valid IP address).
    Who gives a crap if it's a real IP address? Movies and TV will use invalid IP addresses too, like 555 numbers.

    Except that if we really needed to, we could extend the phone numbers into the 555s (in fact, there already are some 555 numbers). 333.333.333.333 will never be a valid IPv4 address (or, for that matter, a valid IPv6 address). That's like saying your phone number is 8$6 2%6-2*)3 (i.e., never valid).

  • JohnFx (unregistered)

    It is rude to talk about your private classes in public!

    I swear captcha is psychic: "ewww"

  • JohnFx (unregistered) in reply to my personal favourite line of code
    my personal favourite line of code:
    wasted on you lot, i actually used this in production code.

    #define private public

    it's obvious why i did it, but extra credit if you can explain why it would ever be the right thing to do...

    Let me guess. It was a temporary workaround to let you do unit testing on private interfaces?

  • Andrew (unregistered) in reply to John
    John:
    Nodren:
    this is a great example at why the school system as it exists now doesn't work for teaching programming languages. Most other things they teach in school, math, science, history, etc have had many years of refinement(save science, but they generally teach you stuff that's been around for alot of years) programming languages are rapidly improving and growing. there is no way a brick and mortar building could keep up with having to buy and learn new curriculum each year... realistically online classes are the best, with the programming languages own documentation for learning material and tests that are slightly modified to reflect changes in the language.

    I took a CS class, and then an AP CS class in high school. I got a 4 on my test, and a refused to answer one of the questions as it was asked because I felt it was too inefficient (aah, youthful optimism, today I'd just let those suckers have the N squared run time). I think high schools can do fine teaching CS, as long as they get a good teacher. It's no different than math, I had a terrible Algebra 2 teacher (he refused to give me points once when I answered 11 and he didn't provide that on the multiple choice. 11 was right, 10 was wrong, I still didn't get points).

    Why was an Algebra test multiple choice? Basic Algebra students need to show all their work, and the teacher better check it. How can anyone learn that way?

  • Andrew (unregistered) in reply to JohnFx
    JohnFx:
    It is rude to talk about your private classes in public!

    I swear captcha is psychic: "ewww"

    The best C++ rule covers friend functions. Only your friends can see your private parts.

  • Jon (unregistered) in reply to quamaretto
    quamaretto:
    This is actually the FizzBuzz question. There was a big stink over it via some popular blogs, starting with the original article: http://tickletux.wordpress.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/

    It descended fast into a coding competition - the shortest I've seen is 45 characters of Perl. (I've done it in 65 characters of dc.)

    My best was 56 characters in Python:

    i=1;exec"print'FizzBuzz'[i%-3&4:12&8-i%5]or i;i+=1;"*100

    On http://golf.shinh.org/p.rb?FizzBuzz, 56 is still the shortest Python solution. Incidentally, the shortest Perl solution listed is 48 characters, so if you have it in 45, please submit it. :)

  • Marcos (unregistered)

    And I thought I had it bad when one of my teachers told us that to declare a constant in C you did this: #Define z = 5;

  • Tim (unregistered) in reply to redwizard
    In one particular instance in class, while going over the code that represented a circuit, I realized the circuit design couldn't possibly exist in real life - but the code would run.

    That's funny. I took an accounting course last semester where we had to calculate machine-hours for job costing. At one point, the example problem had the machine working 9,200 hours per year. I tried to explain to the instructor that there was at most 8,784 hours in a year (leap year), but he couldn't get his brain out of "regurgitate from the book" mode.

  • Dan (unregistered) in reply to Anonymous
    Anonymous:
    Worst is, when I plop down my $800 (or whatever) and the teacher's name is Osama. (I shit you not). Nothing against foreigners, really. I'm very worldly that way. But bottom line; if you're going to teach English-speaking students, you've got to have top-notch English language skills. Period. If the teacher HAS a good understanding of what Public and Private mean, but don't have a good way to explain it clearly in English - especially to a student who's struggling - what's the difference?

    I said the same thing in college. In the US, if the prof doesn't speak English well (and I mean, little to no foreign accent), then his TAs damn well better. To have both be barely comprehensible, so that you spend half your brain just trying to figure out words, was unacceptable and very frustrating. The worst classes I had were those; the best ones were when at some point, a native English speaker was involved, be it the prof or a TA.

    politically incorrect, maybe, but if thats what needs to be done to get our own workforce up to speed...

  • Alex T. (unregistered)

    My web-programming teacher was also incompetent. We were learning PHP and he removed me 5 points for source code inconsistency, because sometimes I would use double-quotes and other times single quotes...

  • Old Wolf (unregistered) in reply to Poltras
    Poltras:
    You didn't use the real STL, as defined by the standard. It wasn't fully compliant. Try using algorithms with generators, binary binds and compositors in VC 6.

    Thinking STL is only about vector<> and list<> and iterators is a WTF in itself.

    Saying that the C++ standard defines STL, is a WTF.

    Actually the C++ standard defines the Standard C++ Library, which includes iostreams and algorithms. "STL" refers to pre-standard libraries, although it's often used to mean "those bits of C++ I haven't learnt yet".

  • Old Wolf (unregistered) in reply to Ken
    Ken:
    KattMan:
    B% (0nv3r71n9 3v3r%7h1n9 70 #337$p34|{ 7h3n %05r 4r3 70 #337 70 b3 $70#3n r0m.
    The scary thing is I was able to read all but 3 words of that gibberish. (Of course, I once wrote TECO macros.)
    I thought it was Fizzbuzz written in Brainfuck. I'm still waiting for the lolcode version..
  • Mythokia (unregistered)

    I remember I had a multiple choice question for a history paper in Secondary School once that went like:

    Which of these produces a mushroom shaped cloud: A. Hydrogen Bomb B. Nuclear Bomb C. Atomic Bomb D. some other crap that I can't remember.

    Of course, B was the only correct answer.

  • Flownez (unregistered)

    He's just lucky they didn't get into the psychology of dependancy injection, or the fabrication of concrete classes...

  • (cs) in reply to Heron
    Heron:
    @John Doe:

    VC++ 6.0 has the STL... I know, because I did the same thing bstorer did (used VC++ 6.0 instead of what the class used). I still use VC++ 6.0 occasionally.

    VC++ 6 had A STL, but it didn't have THE STL.

    The C++ standard wasn't finished when VC6 came out, so microsoft just made the rest up by themselves - hence any code that uses VC6's version of the STL probably won't compile on any real C++ compiler.

  • jim (unregistered)

    why the picture of the University of Illinois. I'm pretty damn sure that this wtf didn't happen there!s

  • jim (unregistered) in reply to jim

    In fact, the way many of you talk about your instructors, it sounds like you should have gone to UIUC. Southeastern Opossum Creek Community College seems to have been a waste of money.

  • (cs) in reply to Old Wolf
    Old Wolf:
    Ken:
    KattMan:
    B% (0nv3r71n9 3v3r%7h1n9 70 #337$p34|{ 7h3n %05r 4r3 70 #337 70 b3 $70#3n r0m.
    The scary thing is I was able to read all but 3 words of that gibberish. (Of course, I once wrote TECO macros.)
    I thought it was Fizzbuzz written in Brainfuck. I'm still waiting for the lolcode version..
    I saw that months ago... *clickety* here it is: http://lolcode.com/contributions/cheezburger-fizzbuzz 1071 characters...
  • Peter (unregistered) in reply to ActionMan

    Heck, I programmed at that time porting "STL" code from Windows to SGI Workstations and Pluto Space Boxes (bsd variant). NOBODY had a "real" stl, and all of the (ephamsism) stl libraries on the net would grossly fail to compile at all on anything.

    Heck, even SGI's compiler didn't compile STL code (they had this "thing" about the string definitions, and in a snit they didn't include them in their version of the STL).

  • Anon (unregistered) in reply to Old Wolf
    Old Wolf:
    I thought it was Fizzbuzz written in Brainfuck. I'm still waiting for the lolcode version..

    I want someone to write up fizzbuzz in Malbolge.

  • Jon (unregistered)

    Here's FizzBuzz in Haskell, using points-free style:

    import Control.Arrow

    if' = (. (flip (:) . (: []))) . (.) . (flip (!!)) . fromEnum is = (>>> uncurry id) . (&&& id) . ((flip (flip if' Right) Left) .) yes = right no = left kthx = either id id divisibleBy = ((== 0) .) . flip mod

    fizzBuzz = is (divisibleBy 15) >>> yes (const "FizzBuzz") >>> no (is (divisibleBy 5) >>> yes (const "Buzz") >>> no (is (divisibleBy 3) >>> yes (const "Fizz") >>> no show >>> kthx) >>> kthx) >>> kthx

    main = mapM (putStrLn . fizzBuzz) [1..100]

  • csrster (unregistered) in reply to TheRubyWarlock
    TheRubyWarlock:
    This just goes to show the old saying:

    Those who can, do. Those who can't, teach.

    A bit of an over-generalisation, no? I did my cs masters' at a real elite cs department. All of the lecturers I encountered were pin-sharp uber-geeks. If they hadn't been, the student uber-geeks would have eaten them alive.

  • csrster (unregistered) in reply to Brandon
    Brandon:
    Too bad he didn't stay for the inheritance lecture... I believe every programmer should get his parents involved in software development.

    Umm, no, inheritance is when you have to maintain code developed by somebody else. That's why it's called legacy code, dumbass!

  • Gerald (unregistered)

    At my university the first year we had a programming course (C actualy) and the first thing the teacher told a guy in our class, lets call him vern (captcha): "Vern don't know why I am teaching you this, because you will be to expensive to program anyway"

  • Simon (unregistered)

    The difference between open source and closed source software is that the former uses the public keyword and the latter uses the private keyword for all its variables, right?

  • Dhericean (unregistered) in reply to suomi finland prkl
    suomi finland prkl:
    I had a CS teacher who mostly knew his stuff, but used a method that is a WTF. He wrote code on the projector, from which the students were supposed to copy it to their computers. The code flowed to eyes and from there to the fingertips, never touching the brain on its way. I'm still not sure how the hell that was supposed to teach us anything, except that copy-paste may be a relevant coding method later when we land in a programmer position.
    This reminds me of a description of University Lectures that my father uses (I don't know where he got it).

    "Lecture - A method of transferring information from the notes of the Lecturer to the notes of the Students without it passing through the brain of either"

  • lauwersw (unregistered)

    We had a Turbo Pascal programming class in high school, but they had better given a word processor class instead. Only two people had some general computer experience, me and another guy. Not the teacher.

    His first explanations were still ok, but he handed out some floppies on which we had to save the results of our assignments. They were unformatted however. So he started with his instructions:

    "Type 'A:' otherwise we will start formatting the internal harddisk, and that would be very unconvenient"

    We immediately raised our hands: "Sir, that won't work, the floppy is unformatted so you can't go to it with the 'A:' command. You need to format it first with 'format A:'"

    "No no, don't take any risks" he answered.

    We looked at each other and thought "wtf, let's show him". And got an error of course. "Ow, that's strange! It appears you were right. So what do we do now?" I must admit it could have been worse, he admitted our superior knowledge immediately, at least for some time...

    We showed him how to do it properly, even when it got complicated because it were half density disks, requiring some extra arguments in the format command. But the whole class succeeded with the right command written on the blackboard.

    The best part came the next lesson. We had given him our disks at the end of the previous class for inspection. He returned them and said that he had reformatted them all. Another teacher had shown him how to do this with a fancy menu from within Windows 3.1, and apparently he trusted that way better than the cryptic commandline stuff we showed him. He immediately lost all my technical respect.

    I must admit he got much better by the end of the year, I used to like Turbo Pascal for some years after that class, though I mainly learned it on myself.

  • Cloak (unregistered) in reply to ExiledSwagman
    ExiledSwagman:
    Just yesterday I was showing a budding developer how to make a set of fields on a form determine the accessibility of a button (in Delphi)... I told him he would need to use regular expressions but for now I would just check for null strings to illustrate what could be done; I created a simple procedure which is called on the on-change of any of the determining fields:
    btnOk.enabled := (field1.text <> '') and (field2.text <> '') .... ;
    Yes, with the brackets, to make it clearer. Immediately the question came, "what do the two arrow symbols next to each other mean?"

    Could also be written:

    btnOk.enabled := Length(field1.text + field2.text + field3.text...) > 0;

  • Cloak (unregistered) in reply to Alex T.
    Alex T.:
    My web-programming teacher was also incompetent. We were learning PHP and he removed me 5 points for source code inconsistency, because sometimes I would use double-quotes and other times single quotes...

    Its good programming practice (GPP) to remain consistent throughout your entire program. Writing things once like this and once like that makes it unnecessarily more difficult to read; It also must look like there were at least two programmers at work.

  • Tarilla (unregistered) in reply to Anonymous
    Anonymous:
    Worst is, when I plop down my $800 (or whatever) and the teacher's name is Osama. (I shit you not). Nothing against foreigners, really. I'm very worldly that way. But bottom line; if you're going to teach English-speaking students, you've got to have top-notch English language skills. Period. If the teacher HAS a good understanding of what Public and Private mean, but don't have a good way to explain it clearly in English - especially to a student who's struggling - what's the difference?

    Actually, I once had a teacher who did SAP and was from Pakistan originally and was fluent in 4 or 5 languages, including English (hard to deal with IT without it) and German (good idea if you teach in Germany). Hearing him on his phone was always great, because he would usually mix AT LEAST 3 languages, wich leads to conversations half-english, half somethign else, with the occasional german word tossed in... and usually ending the the german "Tschüss". So, always wait in judging your teacher till you actually heard him speak ;).

  • grep (unregistered) in reply to Cloak
    Cloak:
    ExiledSwagman:
    Just yesterday I was showing a budding developer how to make a set of fields on a form determine the accessibility of a button (in Delphi)... I told him he would need to use regular expressions but for now I would just check for null strings to illustrate what could be done; I created a simple procedure which is called on the on-change of any of the determining fields:
    btnOk.enabled := (field1.text <> '') and (field2.text <> '') .... ;
    Yes, with the brackets, to make it clearer. Immediately the question came, "what do the two arrow symbols next to each other mean?"

    Could also be written:

    btnOk.enabled := Length(field1.text + field2.text + field3.text...) > 0;

    Now, I'm not too experienced with Delphi, but wouldn't that just check if any of the fields contained something? That doesn't seem to be the purpose from the first example...

  • Thijs (unregistered) in reply to Cloak
    Cloak:
    Alex T.:
    My web-programming teacher was also incompetent. We were learning PHP and he removed me 5 points for source code inconsistency, because sometimes I would use double-quotes and other times single quotes...

    Its good programming practice (GPP) to remain consistent throughout your entire program. Writing things once like this and once like that makes it unnecessarily more difficult to read; It also must look like there were at least two programmers at work.

    This is a joke, right?

  • Brady Kelly (unregistered) in reply to Anon
    Anon:
    Well, you had it made! In my high school computer math (FORTRAN) class, the administration was too cheap to buy a compiler. We turned in all of our assignments on coding paper (80 columns, landscape paper tablets) which were all hand graded by the teacher. I never ran a single program for the class.

    Aah, the days. I also did that for a COBOL course, in about 1994. Evening classes twice a week, and a five hour practical every second Saturday, on 80 column coding sheets. Man did we have to write to get that code out in five hours.

  • Toby (unregistered)

    Please Please Please release the name of the university or school that this lecture was provided in. This person deserves to be fired. It is unacceptable to be in a position of teaching authority if you have no-idea about your subject matter.

  • Iris (unregistered)

    My first exposure to C++ came in a captive training class being run by one company for a client of theirs. The entire class demanded that we be given some time with another instructor, because the first one was so bad.

    One has to wonder though, if that was the first really goofy statement from this instructor, whether it was a joke. My husband is a chemistry prof and once told a group of students that the way to safely eat tuna was to hold the whole fish by the tail and swing it around, so the mercury goes to the head, then cut the head off. Not all of them seemed to immediately understand that this was a joke.

  • Dave (unregistered)

    I've heard similar, even at university level. I remember at uni some lecturer bleating on about how in C++ it is impossible to put anything on the heap and that's why Java is better.

    Same guy claimed that the computer crashes if, in C++, you use diamond inheritance as the computer doesn't know which instance of the base class to use (resisted the temptation to ask questions about virtual inheritance here).

    Had another lecturer whose code was full of memory leaks as he was freeing objects using a pointer to the base without a virtual destructor and the guy didn't realize virtual destructors were even possible.

    Had a software quality lecturer going on about code metrics and function points once. I asked a question about how it relates to classes but he didn't know what a class was.

    Another was insistent that a megabyte was 1000 kilobytes rather than 1024.

    I've never really had one who knew what they were talking about, the best one was the guy who didn't understand virtual destructors, but could put that down to the fact he hadn't used C++ in a while.

  • David van der Sluis (unregistered)

    AAAAAAAHHHHHH!

    It's reaheally horrifying what anyone can teach others these days, and actually can get paid for it...

  • (cs) in reply to Thijs
    Thijs:
    Cloak:
    Alex T.:
    My web-programming teacher was also incompetent. We were learning PHP and he removed me 5 points for source code inconsistency, because sometimes I would use double-quotes and other times single quotes...

    Its good programming practice (GPP) to remain consistent throughout your entire program. Writing things once like this and once like that makes it unnecessarily more difficult to read; It also must look like there were at least two programmers at work.

    This is a joke, right?

    Which part? AlexT's might be, Cloak is not and is actually correct. If you think Cloaks statement is a joke, I hope I never have to fix the bugs you are creating; and you should hope I never do a code review on you.

  • ExiledSwagman (unregistered) in reply to grep
    grep:
    Cloak:
    ExiledSwagman:
    Just yesterday I was showing a budding developer how to make a set of fields on a form determine the accessibility of a button (in Delphi)... I told him he would need to use regular expressions but for now I would just check for null strings to illustrate what could be done; I created a simple procedure which is called on the on-change of any of the determining fields:
    btnOk.enabled := (field1.text <> '') and (field2.text <> '') .... ;
    Yes, with the brackets, to make it clearer. Immediately the question came, "what do the two arrow symbols next to each other mean?"

    Could also be written:

    btnOk.enabled := Length(field1.text + field2.text + field3.text...) > 0;

    Now, I'm not too experienced with Delphi, but wouldn't that just check if any of the fields contained something? That doesn't seem to be the purpose from the first example...

    Well-spotted, as Adam said when he saw the first leopard.

    The other problem with the suggestion is that it doesn't allow easy adaptation for regex checks instead. But WTF, that isn't the issue here... I can see other, more efficient ways, of doing this, especially if complex regexes are involved. A flag byte could be used (provided we are sure there will never be more than 8 fields to check) and the bit for each field set to a 1 if it is invalid, then just check to see if the flag as an integer is 0, in which case the button can be enabled. This would negate having to recheck every field every time any of them changes. But as the dev's question showed, that would just have been challenging his skills too much for one day.

  • Ron (unregistered)

    The funniest part: She's actually unintentionally partially correct.

    For languages like C# and (ugh) Java, they are compiled into immediate-languages that can very easily be decompiled almost verbatim.

    Due to this, obfuscators were invented to screw up the variables names in the IL as much as possible.

    However, due to .NET and Java's requirement of cross-assembly communication, all public members must retain their same names, wheras private members can be safely obfuscated.

    Irony.

  • guest (unregistered) in reply to Dave
    Dave:
    Another was insistent that a megabyte was 1000 kilobytes rather than 1024.
    http://en.wikipedia.org/wiki/Megabyte
  • el jaybird (unregistered)

    At the school I went to for my Master's, it was standard policy to offer TA positions to all foreign students who were accepted into the program. It was a large part of the funding package they offered, and probably done this way since foreign students wouldn't have the appropriate work visas to get a job external to the university.

    That's it. No check to see how well you spoke English. No check to see which subjects you are qualified to TA. Just, OK, welcome, you'll be TA'ing this class this term.

    This explained a LOT of my undergrad frustration.

  • JOHN (unregistered) in reply to guest
    guest:
    Dave:
    Another was insistent that a megabyte was 1000 kilobytes rather than 1024.
    http://en.wikipedia.org/wiki/Megabyte

    Wikipedia is wrong.

    A Megabyte has been and always will be 1024 bytes, no matter what some group of obsessive-compulsive nerds says.

  • Jason (unregistered) in reply to Luke Gaddie

    Great Geek taught him/herself. Who was there qualified to teach Bill Gates in high school?

  • Jason (unregistered)

    Guys and Gals,

    Greatest Geek taught him/herself. Who was qualified to teach Bill Gates at high school? Don't blame your teacher for your failure.

  • anonymous (unregistered) in reply to KattMan

    Here's a clue: the type of quote is syntactically significant and determines the rules for things like backslash interpretation and variable interpolation. Single quotes are different than double quotes.

    Although cloak is 'correct' in that consistency is generally good realize that asking for consistency in this case is like complaining because "Sometimes you use =, and sometimes you use == so that's inconsistent and bad."

  • (cs) in reply to boogieman
    boogieman:
    High school teachers... what a laugh...
    Why would a skilled developer become a high school teacher when he/she could earn twice as much writing software?

Leave a comment on “Privately Public”

Log In or post as a guest

Replying to comment #:

« Return to Article