- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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.
Admin
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...
Admin
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...
Admin
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).
Admin
It is rude to talk about your private classes in public!
I swear captcha is psychic: "ewww"
Admin
Let me guess. It was a temporary workaround to let you do unit testing on private interfaces?
Admin
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?
Admin
The best C++ rule covers friend functions. Only your friends can see your private parts.
Admin
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. :)
Admin
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;
Admin
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.
Admin
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...
Admin
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...
Admin
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".
Admin
Admin
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.
Admin
He's just lucky they didn't get into the psychology of dependancy injection, or the fabrication of concrete classes...
Admin
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.
Admin
why the picture of the University of Illinois. I'm pretty damn sure that this wtf didn't happen there!s
Admin
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.
Admin
Admin
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).
Admin
I want someone to write up fizzbuzz in Malbolge.
Admin
Here's FizzBuzz in Haskell, using points-free style:
Admin
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.
Admin
Umm, no, inheritance is when you have to maintain code developed by somebody else. That's why it's called legacy code, dumbass!
Admin
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"
Admin
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?
Admin
"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"
Admin
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.
Admin
Could also be written:
btnOk.enabled := Length(field1.text + field2.text + field3.text...) > 0;
Admin
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.
Admin
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 ;).
Admin
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...
Admin
This is a joke, right?
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
AAAAAAAHHHHHH!
It's reaheally horrifying what anyone can teach others these days, and actually can get paid for it...
Admin
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.
Admin
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.
Admin
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.
Admin
Admin
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.
Admin
Wikipedia is wrong.
A Megabyte has been and always will be 1024 bytes, no matter what some group of obsessive-compulsive nerds says.
Admin
Great Geek taught him/herself. Who was there qualified to teach Bill Gates in high school?
Admin
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.
Admin
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."
Admin