• BtM (unregistered) in reply to Steve

    Anonymous:
    i thought i had it bad at my university when we were instructed to make our own list, vector, and stack classes and NOT use STL...that was FUN                       

    It was even more fun in FORTRAN 77; no pointers, no record types, no dynamic memory, but at least you could fake recursion with the ASSIGN statement. 

  • Russ (unregistered) in reply to Gaz
    Anonymous:
    Heh, I thought I had it bad when we were forced to use Haskell for a time (that's right Haskell not Pascal), but at least they taught us pointers as well.


    Argh, if it wasn't bad enough hearing people complain about having to do ridiculous things like actually writing their own data structures, now people are ragging on Haskell. You do realise that so-called 'cool' features in modern languages (like list comprehensions in python, for instance) come directly from Haskell? You do realise that all the wonderful new stuff Microsoft is adding to C# in versions 2 and 3, like anonymous delegates, type inference, closures, coroutines, lambda expressions etc have been available in functional languages such as Haskell for YEARS?

    I got my grounding in Haskell in 1998; with any luck, by 2008 the mainstream languages will have caught up. I'm just grateful I wasn't a lisp programmer in the 70s - seeing all these 'new features' being heralded when I'd been using them for 30 years might just be too much to take.

  • Freddy (unregistered) in reply to me
    Anonymous:

    If you went to DeVry thinking you were getting a CS (meaning Computer Science) degree, you are part of the problem. You fail at life.

    Did you sign up for a CIS course of study by mistake?

    For what its worth, becoming a hands-on technician is what this school is good for. Very little theory, but practical training for the here and now. I can only speak for my EET Degree, but getting access to the HPVEE software, agilent digital oscilloscopes, matlab, PLC's, and CPLD's was only possible for me at this school.

    Don't badmouth the obvious easy target just because you're misunderstanding what degrees they actually offer. You can get rifraff from almost any "accredited" university or technical college.



    Wow, matlab? Do you really mean like "matlab"? A program used to calculate stuff, as used with simulink? The one which succeeds in crashing almost any computer?

    Why don't people use a python interpreter instead?
    I think it would be faster. And the thing would actually do what you programmed it for, without numerous bugs because you had filled in your variable gain in the block instead of in the mainscreen.

    I'm sorry, just a little stressed out on my last system-dynamics-classes.

    Just please don't tell me you're proud of using "mechanical desktop" as well?

    You are probably one of those guys we meet in our safety-courses with their "hands-on"-technology
    Do whatever you please, just don't try to fix MY machines.
    Ok, maybe you may change the lightbulb in the hallway, ... oh no, that would mean you would be touching my switchboard to turn off the electricity.

    Just forget it.
  • (cs) in reply to DZ-Jay
    DZ-Jay:
    If we were talking about any other language that actually support pointers,

    I'm pretty sure you don't really mean any other language that actually supports pointers.  Not all languages that actually support pointers even support arrays (try most assembly languages), and not all languages that support arrays use contiguous addressing to implement them (try bash).
    then the array index would be an *OFFSET* added to the POINTER (which is actually pointing to the beginning of the array, not to each element), in order to get to the memory address of a specific element.

    In the real mode addressing scheme on x86 platforms, there are two types of pointers--near and far.  Far pointers have two parts--a segment, and an offset.  The segment is 16 bits, as is the offset, but the total addressing scheme is far short of 32-bits.  Instead, the segment refers to one of a series of overlapping base addresses, to which the offset is added in order to address a particular byte in memory.

    As for the near pointers--they are nothing but an offset, and they must be applied to the proper base address (segment) in order to be used properly.

  • cs major (unregistered) in reply to Freddy

    good lord. i am a cs major and i can't see myself rubbing it into other people's faces.
    stressed out from your last class? booo, booo, <sniff>
    grow up, get down from your high horse and stop crying.
    no more self-righteous diatribes, please. and git some comm skills. also, socialize -- you'll realize cs majors are not demigods. we sleep and poop, too!

  • Greybeard (unregistered) in reply to Anita Tinkle

    Anonymous:
    I guess the students heads, if not the professor's, would have exploded if they dried to figure out how to use an OLE component to simulate a datastructure in VB6, much less write one by hand.

    OLE? Not COM?

    So what you're implying is loading Excel, stuffing your data in a worksheet, sort, and read the data back out?

    Man, that's beatiful.

    Enterprisey!

  • Mike (unregistered) in reply to Jony
    Anonymous:
    kswanton:

    One of the apps was to write a sort algorithm, and it could be any sort algorithm.



    There is no point in such a test. It just proves that someone can memorize things. It does not prove if someone is able to think, systematically approach a complicated problem and solve it, can write production quality code, can prioritize tasks etc. If you look for brain-dead code monkeys that might be a good test. Otherwise not.

    If I need a sort, I take it from the library. If there is none in the library, I google for an implementation. If there is non, I get out that old CS textbook and implement one. But not earlier. Memorizing sort algorithms was and is a waste of time.


    Memorizing how to do sorts is hardly useless.  There are plenty of times you need to implement your own sorting algorithms since you can optimize better than a generic sort.
  • (cs) in reply to Mike
    Anonymous:
    Memorizing how to do sorts is hardly useless.  There are plenty of times you need to implement your own sorting algorithms since you can optimize better than a generic sort.


    One-word answer to that: no.
  • (cs)
    Anonymous:
    eyu:
    em:
    Not even that. If the shuffling is truly random, there's just no guarantee the code will ever terminate; no matter how many iterations you've gone through previously, at each step, you're no more likely to hit upon the correctly sorted order than you were before.


    It's called bogosort.  If the shuffling is truly random, you have a pretty good chance of completing, although it's not technically guaranteed, and it likely won't be any time soon. Consider: the probability of *not* getting the right permutation each try is (slightly) less than 1. So the likelihood of failing n times is (probability of failure)^n. Given a large enough n, it becomes extremely likely that the algorithm will complete.

    Of course this is not absolutely guaranteed in finite time since it never quite goes to zero -- in fact, your computer is pretty likely to die of hardware failure or maybe the sun will go nova long before it produces a result -- but you are in a way making "progress" towards a solution even if the individual odds don't change.

    I don't agree with the last bit there about "progress" at all. Again, as we both have already agreed, no matter how many iterations you may already have gone through, you're no more likely to hit the answer on the next one; the chance of finding the answer on iteration #1 is the same as at iteration #googleplex. At every step you have both the exact same insignificant chance of finding the answer, and the exact same near certain chance that you'll eventually find it later. Or, to put it in your own words, the fact that the individual odds don't change mean that you're not making any real progress.

    Though anyway, my bigger point: if somebody were to give me that sorting "algorithm" as an answer to an interview question, I'd rightly point out that it is not guaranteed to terminate, and therefore, does not meet the common understanding as to what counts as an algorithm that solves a given problem.

    KITTY: "Alright, alright, now you listen up. I have had an extremely stressful day. And I am not proud of what I'm about to say, but someone give me a cigarette. Now!" ERIC: "But mom, we don't smoke..." KITTY: "Cut the crap, Eric! I am a nurse. I know that one in five teenagers smoke. (Pointing at them) One, two, three, four, five! Now, I am going to close my eyes, and when I open them there had better be a cigarette between these two fingers!"

  • (cs) in reply to brazzy
    brazzy:
    Anonymous:
    Memorizing how to do sorts is hardly useless.  There are plenty of times you need to implement your own sorting algorithms since you can optimize better than a generic sort.


    One-word answer to that: no.

    It's unclear what you mean by this.  Are you saying that you can never optimize better than a generic sort, that you don't have to optimize, or that there aren't really plenty of times when this applies?
  • Anon. E. Muss (unregistered) in reply to Freddy
    Anonymous:
    Anonymous:

    If you went to DeVry thinking you were getting a CS (meaning Computer Science) degree, you are part of the problem. You fail at life.

    Did you sign up for a CIS course of study by mistake?

    For what its worth, becoming a hands-on technician is what this school is good for. Very little theory, but practical training for the here and now. I can only speak for my EET Degree, but getting access to the HPVEE software, agilent digital oscilloscopes, matlab, PLC's, and CPLD's was only possible for me at this school.

    Don't badmouth the obvious easy target just because you're misunderstanding what degrees they actually offer. You can get rifraff from almost any "accredited" university or technical college.



    Wow, matlab? Do you really mean like "matlab"? A program used to calculate stuff, as used with simulink? The one which succeeds in crashing almost any computer?

    Why don't people use a python interpreter instead?
    I think it would be faster. And the thing would actually do what you programmed it for, without numerous bugs because you had filled in your variable gain in the block instead of in the mainscreen.

    I'm sorry, just a little stressed out on my last system-dynamics-classes.

    Just please don't tell me you're proud of using "mechanical desktop" as well?

    You are probably one of those guys we meet in our safety-courses with their "hands-on"-technology
    Do whatever you please, just don't try to fix MY machines.
    Ok, maybe you may change the lightbulb in the hallway, ... oh no, that would mean you would be touching my switchboard to turn off the electricity.

    Just forget it.


    Man, don't badmouth matlab, as a lot of Comp Eng/EE programs use it these days for signal processing. In fact, pretty much anything to do with ANY kind of signal processing for EE (and I'm talking about vision systems, detection and aquisition, echo detection, etc) as well as control systems will be modelled in matlab. Virtually all Masters and PhD thesis' on those topics use matlab extensively. For any matrix/vector data, development on matlab is fast. Real fast...

    I can see why DeVry would teach it, as a marketing ploy for their EET students to put on their resumes. However, doesn't actually mean said graduates actually understand the theory... they just know how to use matlab, yay.


  • poochner (unregistered) in reply to Russ
    Anonymous:

    (really quoting Russ; WTF is up with this forum software?)

    I got my grounding in Haskell in 1998; with any luck, by 2008 the mainstream languages will have caught up. I'm just grateful I wasn't a lisp programmer in the 70s - seeing all these 'new features' being heralded when I'd been using them for 30 years might just be too much to take.



    As in "oooooh, lookie!  Aspects!  What a new and marvelous idea!  and Advice!  Wowza!  That's spiffzifferous!" 

    Uh... that's old school, dude.  Cross-cutting concern?  Like, say, file access in an editor?  How long has ange-ftp or something similar been in emacs, anyway?  It's enough to make you cry that these babies have no clue about That Which Went Before(TM).
  • MusiGenesis (unregistered) in reply to lpope187
    lpope187:
    I'll admit that I've used the Listbox sorting design pattern before, although it wasn't for production code but rather an algorithmic proof of concept for Delaunay Triangulation (Given a random grid of points, output the triangular mesh).  It's definitely easier to debug a complex algorithm when each step's output is visible.  Once the algorithm is proven, it can easily be ported to production code along with optimizations.

    Honestly, I can't think of any project where I needed sorting that wasn't available in the language or libraries I was using.  That doesn't make the exercise useless in regards to coursework though.  What people need to realize is that formal education is a foundation upon which the rest of a career lies.  An exercise such as this emphasizes base concepts that can be applied to the myriad of design problems found in real life.  During college, my department head told me that formal education perhaps accounted for 20% of all the knowledge required during a career.  I personally would say that's optimistic and it's closer to 10% for any field where technology changes rapidly.




    At my current job, we are supporting an app (C#) that actually uses ListView controls as a data structure.  Any time you find a function that looks like:

    function doSomething(System.Windows.Form.ListView data)
    {
        // does something
    }

    it's time to run away screaming.  It's better than another app I have to support:  the "architect" of the system decided to roll his own DataTable, implementing it as an array of custom-written DataRow objects.  The problem?  Each DataRow object contains an array of type object, with each element representing a field value from the original SQL Server table.  Unfortunately, each row also contains an array of strings, which each element representing the name of the field.  So, for 1000 rows you have the field names duplicated 1000 times. 

    And of course the performance problems are blamed on the PDA hardware we're using.


  • MusiGenesis (unregistered) in reply to brazzy
    brazzy:
    rsynnott:
    Nah, looks like he wants drones.


    What I want is people who are more interested in writing maintainable code than in proving their superior knowledge. I want someone who can look at a convoluted class hierarchy with lots of copy,paste&modify coding and work out how to slash 80% of the code without losing any functionality. I do NOT want someone who thinks Duff's Device is something that should actually be used in production code. If you define intelligence as a compulsion to reimplement standard functionality just because you think you can do it a bit better and show off your knowledge in the process, then yes, I'd rather have stupid programmers.



    Well said, dude (or chick, as the case may be).
  • MusiGenesis (unregistered) in reply to captcha=wtf
    Anonymous:
    Anonymous:
    In my first year, I wrote a sort function called a "fux0rt".

    It would check if the elements were in order. If they were not, it would randomly change them and check again. If I got asked to do that during an interview, that's what I'd pull out and write.

    That wouldn't get you the job. Unless your program has infinite time to run, it's not guaranteed to complete.

    That's true. A much better algorithm would be to enumerate all the permutations of the array and iterate through them to find the one that is sorted!



    I was about to type "but what if more than one permutation is sorted?", but then my brain turned back on.

  • Looce (unregistered) in reply to MusiGenesis
    Anonymous:
    Anonymous:
    Anonymous:
    In my first year, I wrote a sort function called a "fux0rt". It would check if the elements were in order. If they were not, it would randomly change them and check again. If I got asked to do that during an interview, that's what I'd pull out and write.
    That wouldn't get you the job. Unless your program has infinite time to run, it's not guaranteed to complete.
    That's true. A much better algorithm would be to enumerate all the permutations of the array and iterate through them to find the one that is sorted!


    I was about to type "but what if more than one permutation is sorted?", but then my brain turned back on.

    Another permutation is sorted. It's called "ascending order" and "descending order" ;)
  • (cs)
    Alex Papadimoulis:

    This is way too convoluted a solution. Just use the Easy button.

  • Freddy (unregistered) in reply to cs major

    Did I ever say I was a cs major?!

    Yep, my last class in system-dynamics which was scrapped the year after I got my credits for the subject.
    It had a very hands-on approach with very little theoretic background (We were supposed to already have that theoretic background).
    Basically a cookery-book; measure this, measure that, model a block-scheme, simulate, make nyquist-diagram, adapt constants, ..., trial and error 'till thing is stable.
    Then write 20 pages on which controller you used and why, and which parameters and why, and which not and why. Then spend most of your time in getting diagrams from mathlab and doing the layout in your picture-editor of choice, before you can post them in your report.

    And yeah, I am aware that it is easily doable to add titles and stuff to your graphs in mathlab, only a few lines of code, and the grid and axis and stuff are just easy commands, but the thing more or less does as it pleases. And if you want it to show more than 500 seconds of simulation, on a decent resolution, you can plot out 20 graphs I guess? Paste them together in coreldraw or something?
    And don't forget to write your own trace-function, you wouldn't want to miss your poles would you?

    Matlab and Simulink are obviously the best, everyone uses them, as do most people use MS office, and autocad, also very handy, and very expensive, so it has to be good, ... and it can't use filetypes from other programs, as most free and open-source software can (for which you cs-majors and amateurs keeping yourselves busy with that should earn more credit, data-interchange isn't easy to implement and to keep up to date).

    I last saw an add promoting inventor over other programs, not because of its capabilities, but because "it can handle dwg-files without problems". If a manufacturer can't even handle his own file-types ...

    I don't know nothing about devry, and I've never been near it, but saying they are good because they have PLC's and oscilloscopes and matlab just seems a bit over the top. Is there a place where they DON'T have PLC's and oscilloscopes and try to teach you that stuff? Now THAT would be WTF university.

    CAPTCHA : perfection

  • (cs) in reply to Jon
    Anonymous:
    themagni:

    In my first year, I wrote a sort function called a "fux0rt".

    It would check if the elements were in order. If they were not, it would randomly change them and check again. If I got asked to do that during an interview, that's what I'd pull out and write.

    My favourite silly sorting algorithm is: while (!is_sorted(begin, end)) next_permutation(begin, end);
    Grimoire:
    When interviewing, I ask the candidate to "sort an array of 10000 integers".  Full marks for using either the C library qsort or one of STL's sorts, partial marks for implementing an O(n lg n) sort, low marks for O(n^2), and ridicule for doing nothing (j/k).
    How many marks would you award them for a radix sort?

    How about:

    while (std::next_permutation(begin, end));

    since next_permutation returns true until it goes over the top and generates the lexicographally-smallest permutation (a.k.a. the list in sorted order), when it returns false. Hooray for a disgusting one-line solution rather than a disgusting two-line solution!

  • (cs) in reply to yy2bggggs
    yy2bggggs:
    brazzy:
    Anonymous:
    Memorizing how to do sorts is hardly useless.  There are plenty of times you need to implement your own sorting algorithms since you can optimize better than a generic sort.


    One-word answer to that: no.

    It's unclear what you mean by this.  Are you saying that you can never optimize better than a generic sort, that you don't have to optimize, or that there aren't really plenty of times when this applies?


    The last: it's rarely the case that a hand-optimized sort would be significantly (rather than a few percent) faster than a generic one, and even a significant speedup (like a factor of 2) is rarely worth the time spent implementing it. Unless your program really spends 50% or more of its time sorting, it won't be a noticeable difference.

  • kap (unregistered)

    Now after reading few posts here I really understand why there are so few C++ WTFs here, I don't mean to offend anyone but ...err  const char VB[] ="Crappy language" ?

  • Francois Botha (unregistered) in reply to anonymous

    Still baffled about how and why "indices" turned into "indexes".  A total WTF on its own.

  • (cs) in reply to yy2bggggs

    yy2bggggs:
    brazzy:
    Anonymous:
    Memorizing how to do sorts is hardly useless.  There are plenty of times you need to implement your own sorting algorithms since you can optimize better than a generic sort.


    One-word answer to that: no.

    It's unclear what you mean by this.  Are you saying that you can never optimize better than a generic sort, that you don't have to optimize, or that there aren't really plenty of times when this applies?

    You read the answer.

    No.

    'nuff said.

  • (cs) in reply to mnature

    mnature:
    I still have my COBOL textbook. . .

    Arrest that terrorist!

  • Jason (unregistered) in reply to Josh

    Hate to rain on anyone's WTF parade, and I'm not a big VB supporter or anything, but the list box method was actually a best practice in VB6. Since the list box is an inherent Window control, this form of sorting was way, way faster than any VB6 (i.e. 3GL) programming sort. I personally would (and should) berate newbie programmers for creating their own sort routines from scratch in any 3GL...in fact I think I even once used this as an interview question for developer candidates to weed out certain types...you know who you are. ;-)

  • Yusaku (unregistered)

    Reminds me unfortunately of my recent experience with entrance exams to Master courses at University of Economics, Prague. There were two exams there - Economics and IT. Having studied IT for some time, I prepared mostly for Economics - and the exam proved simple enough. But the IT requirements I did not pass. Sample questions (let me remind you again that this is Masters course):

    1) Divide computers
    2) What is a database system
    3) Describe localization and customization

    Rest of the questions were from Software Engineering field - UML, ER etc. Not my thing, but at least the questions were normal.

  • Steve Heller (unregistered) in reply to brazzy

    Actually, a distribution counting sort (or a radix sort), which are O(n), are almost always much faster than any generic sort for large numbers of elements. It is true that this won't matter much if your program doesn't spend much time sorting, but then that is a general rule of optimization, not specific to sorting.

  • J. (unregistered) in reply to Gaz
    Anonymous:
    Heh, I thought I had it bad when we were forced to use Haskell for a time (that's right Haskell not Pascal), but at least they taught us pointers as well.
    Ignorance.

    Haskell, or any other functional-paradigm language is on the contrary a very competent language, for example very well suited for data structures and algorithms.

    The fact that some who would call themself programmers cannot adapt to any other paradigm than imperative programming is just sad.

  • Your.Master (unregistered) in reply to anonymous

    Okay, I know I'm months late to this, but it was linked recently, and this is a real WTF.

    As a trained lifeguard, lifeguards ARE trained to first yell "Hey, that person is drowning! Someone help!" (except more concisely, as in "HELP!" + pointing. Further, they are trained to dial 911 (when exactly they do that depends on the situation). A person who is drowning has a fairly high chance of needing a paramedic, and, long-term, a doctor. You especially have to do this if they need CPR.

    CPR is exhausting and lasts longer than in the movies. Your call for help may help recruit people to call 911 for you, or to take over for you in CPR, under your watch and guidance.

    This is an utterly horrible analogy. Maybe I can salvage it: it's more like training doctors to call a lifeguard when their patient stops breathing.

  • wtfmaker (unregistered) in reply to Looce
    Looce:
    Anonymous:
    Anonymous:
    Anonymous:
    In my first year, I wrote a sort function called a "fux0rt". It would check if the elements were in order. If they were not, it would randomly change them and check again. If I got asked to do that during an interview, that's what I'd pull out and write. That wouldn't get you the job. Unless your program has infinite time to run, it's not guaranteed to complete.
    That's true. A much better algorithm would be to enumerate all the permutations of the array and iterate through them to find the one that is sorted!
    I was about to type "but what if more than one permutation is sorted?", but then my brain turned back on.
    Another permutation is sorted. It's called "ascending order" and "descending order" ;)

    If you are sorting objects, of course you can get more than one sorted permutation, if you want to be capable of distinguish between distincts objects at the 'same' position.

    The real WTF is people that still comment on this article....

  • Shinobu (unregistered)

    Big WTF that everybody seems to have missed: VB's ListBox doesn't sort properly when visual styles are enabled. Look it up in the KB - Microsoft knows that the problem exists but apparently isn't going to fix it. Instead they tell you to implement your own listbox sorter.

  • PDXBUYS (unregistered) in reply to Dan

    Isn't that Turing's "Halting Problem"?

  • Daveed (unregistered)

    WTF is the only University for me!

    And I am NOT a robot!

  • Daveed (unregistered) in reply to Josh

    How is it possible that people attending DeVry and/or the U of Phoenix could be thought of as less than magnificently intelligent?

    Incidentally, isn't it pronounced Po Henix?

  • WTF student (unregistered) in reply to John

    I think WTF is the greatest U I have ever attended, and I have attended (and graduated from) three.

Leave a comment on “Studying at WTF University”

Log In or post as a guest

Replying to comment #:

« Return to Article