• (cs) in reply to DrCode
    DrCode:
    Design patterns are not necessarily limited to any particular programming language, although some would be simpler (or more complex) in one language vs. another.  "Dessign" patterns, though, I'm not so sure about.

    I think the point is more that the instances of design patterns are language-specific but the concept of design patterns isn't. The GoF patterns can be applied in both C++ and Java without many issues because the languages are fundamentally extremely similar, but some of them can't exist in other languages, or are so integrated in the language and trivial/logical to use that they don't deserve the name of "patterns". Likewise, other languages have other design patterns that just wouldn't apply (or even be thinkable) in C++ or Java e.g. the concept of "Monads" in pure functional programming language can easily be seen as a design pattern, and just wouldn't make sense in Java.

  • (cs) in reply to masklinn
    masklinn:
    I think the point is more that the instances of design patterns are language-specific but the concept of design patterns isn't. ... The concept of "Monads" in pure functional programming language can easily be seen as a design pattern, and just wouldn't make sense in Java.


    Oh, I absolutely agree.  Another example would be continuation passing in Lisp or Scheme, which just can't be done in most languages, including Java.  But I was reacting to what I perceived as the earlier poster's implication that the concept of design patterns wouldn't apply to ML or Scheme.  The Strategy pattern would be very natural in a functional language, and the State pattern could be used in a sense in pretty much any language, but even if you see it as strictly an OO thing it could be used in CLOS or Ocaml, if not pure ML.  I think the Visitor pattern might be one that would be so simple and obvious in a functional language that it would hardly be worthy of being glorified with the title of "design pattern", but I'm not sure -- I've only messed with functional programming in my spare time, and never built anything significant with it.

    Actually, on that note, I must admit that I've never quite "gotten" Monads.  That's Haskell, right?  Wouldn't monads (and even my example of continuation passing) be more of just a feature of the language, and something that could be used as a building block in a design pattern, but not actually a design pattern in its own right?  Just curious.

  • (cs) in reply to DrCode
    DrCode:
    Actually, on that note, I must admit that I've never quite "gotten" Monads.  That's Haskell, right?  Wouldn't monads (and even my example of continuation passing) be more of just a feature of the language, and something that could be used as a building block in a design pattern, but not actually a design pattern in its own right?  Just curious.

    I'll have to admit that the last time I tried to grok it, my brain broke before I managed to full grasp the concept, but from what I understood:

    • Monad is a concept available in every language with functional abilities (e.g. you can build monads in Ruby or Python for example, even though it's not really useful. They're therefore not a feature of a specific language). It should be noted that the monad concept comes straight from the mathematical category theory (one more argument against the language-specific thing).
    • The monad concept is an important structure (design pattern?) of every pure functional language. Haskell being the most widespread pure functional language, monads are often associated with Haskell (Lisp, by opposition, is not a pure fonctional programming language).
    • Monads are important in FP languages because their role is to introduce side-effects (while keeping every function pure in a FP-context), which are forbidden in pure FP functions, side-effects being allowed in non-FP languages or 'impure' FP languages, the importance of monads dwindles.
  • Erik (unregistered) in reply to Rain dog

    Nah!

    There's actually only 6² possible ways to connect two hubs:

    Hub A bottom -> Hub B top (the standard way)
    Hub A left side -> Hub B top
    ...
    Hub A right side -> Hub B backside
    ...
    Hub B bottom -> Hub A top

    Use super glue if you want to make sure connection really sticks.... ;o)

    /E

  • (cs) in reply to ChiefCrazyTalk
    Anonymous:

    My two favorite interview questions are as follows:

    1.  If you could be any kind of fruit, what kind of fruit would you be?  (I was actually asked this once as an undergrad!)

    and the all time classic Microsoft interview question

    2.  Why are manhole covers round?

    I've heard a few variants on question 1 (fruit, animal, etc.), and people always seem to think it's a really dumb question. Well, it is, but that certainly doesn't mean the person asking it is dumb.

    The interviewer doesn't care what fruit you answer with. It's not like they have a big list of fruits, along with what each one says about your personality and programming ability. 'Course not. What the interviewer really wants to know is "How do you respond to dumb questions?" or possibly "How full of shit are you?"

    In an interview, this is important. If you're the kind of guy who can talk at length about what kind of fruit best describes you, and even work all the latest industry buzzwords into your answer, the interviewer knows you're full of shit. If you get agitated and start talking about how that's such a stupid question, the interviewer knows you get agitated easily and likely won't work well as part of a team. If you make a joke like "beer nut", that says something about you too.

    You see? Sometimes the only way to get an honest answer out of someone (try asking an interviewee how full of shit they are) is to not tell them what the question really is. A great example of this is the fruit question itself, since once you know what the question is for, it won't really "work" on you anymore.

    "What kind of fruit are you" is one of my favourite interview questions too. Not because it's dumb, but because it's so clever.

     

  • John Hensley (unregistered) in reply to mister r
    Anonymous:

    Its not all syntax. Not until recently Java didn't even properly support polymorphism. Putting a cast in everywhere is not just a matter of syntax, its a truely different semantic. When they finally fixed that bug, they called it a feature, and acted as if there hadn't existed programming languages with sufficient type systems before. They even gave it a new buzz-word-compliant name: generics.

    You know that Sun did not claim that Java 5 was the first language with type polymorphism so please don't make such an absurd accusation. Sun can call its language features whatever it wants to, and I wouldn't be surprised if the name itself originated outside Sun.

    What may not have fully occurred to you is that whatever language you use, with whatever snazzy features, it all ends up as machine code. So when a programmer says a language is unusable because it doesn't provide objects or reflection or exception handling, what he usually means is that he's not quite smart enough to either implement those things for himself or make do without them. If formal education teaches anything, it should teach how to get by in those situations.

  • csrster (unregistered) in reply to doug
    Anonymous:
    >>>> 5. For which kind of keys, is a hash-table faster than a binary-search tree?

    >>>According to our teacher, and big-O theory, hash tables are always faster.

    >>Consider for a moment the set of keys for which the hash collides on every key.  Store this set of keys in the hash table, and in the >binary-search tree.  Which data structure is faster for the lookup?

    >Did I really have to specify that it required a good hash-function?  Isn't that always implicit when discussing hash-tables?  Since we're being jackasses here, I'll just assume that the binary search tree is extemely unbalanced and both the hash table and the binary search tree have linear performance.  Happy now?


    The original question essentially asked about what keys violate the expected performance guarantee.  Those are the keys.  And the result for those keys is that even if in fact the binary search tree is maximally unbalanced and the search is also linear, so is the hash table, and so it is not faster.

    This is a practical flaw you can actually hit in the real world.  You think you have a good hash, but later discover that you have some interesting subset of the keyspace with a high collision rate.

    I guess potentially there's another answer involving small sets of keys where the linear cost of computing the hash is larger than log(n).



    Can also point out that the question didn't specify which _operation_ was being
    asked about - everyone has just assumed we are talking about lookup, but in
    some applications insertion and deletion might also be critical.
  • anonymous (unregistered) in reply to frosty
    frosty:
    Agreed.  My company does background checks on all incoming employees.

    Another reason not to get certified.... It might come up in a background check ... http://thedailywtf.com/emoticons/emotion-1.gif

  • sozin (unregistered)

    from the spolsky test -- always make sure you ask your interviewees to do something technical (be it right code, configure a router, whatever).

    http://www.joelonsoftware.com/articles/fog0000000043.html

    would you let a magician do your kids birthday party without asking him to do some tricks first?

    it amazes me how many tech interviews I've seen where the interviewee doesn't have to perform.

  • (cs) in reply to WTF Batman
    WTF Batman:
    gwfc:

    Sincerely,

    gwfc


    Gene Wirchenko For Congress ??


    Guessing "Gene Wirchenko Fan Club"...

  • Adam (unregistered) in reply to Pistol Pete

    Correct way to convert an object to a string...

    Object :) = new Object();
    String a = new String(:));  // or
    String b = :).toString();

  • Uneducated and Uncertified Systems Engineer (unregistered) in reply to John Smallberries

    There is only ONE way to connect two hubs together.

    ONE port on A.

    ONE port on B.

    and ONE crossover cable used.

    We'll be here all day trying to work out the mathematical possibilities of getting a simple task done. That's why the guy was fired in the first place!

  • (cs) in reply to Uneducated and Uncertified Systems Engineer

    They ended up using a wireless bridge, right?

  • Anonymous (unregistered) in reply to mister r
    mister r:


    My questions were a reaction to some of the people here claiming education itself is somewhat a WTF. I disagreed and tried to prove that there are subjects that do matter, that are more easily learned through formal education. I'm not the worlds' best programmer, and I'm not the worlds' best student. I choose the questions to be trivial. I'm suprised at how many respond as if i tried to show off my knowledge. I actually considered making the questions harder because otherwise some of you might make fun of it being such simple little pop questions. So perhaps I am naive.

    The general response was pure hate. Comments on how useless acadamic knowledge is, how "its not in real world" .. and about a half a dozen authority arguments .. ("..but i accomplished this and i accomplished that .. " ) .. zero insightfully technically relevant remarks. My interaction on this forum has not been what I expected and I actually regret that I posted those questions, but I dont think all the negative tone has a lot to do with _my_ ego.

    On another note, this forum is called What-The-Fuck .. as in look at us making fun of others .. guess i'm not allowed to thrash the trashers :-)



    There's a lot here that's disingenuous - and pretty boldly so, considering that mister r's actual first post and its actual first responses are just a few pages back.

    I'd analyze in detail, but I've been tired all day and have a headache at the moment.  Respond if you care, and maybe I'll feel better by then.
  • (cs) in reply to PO'd c++ programmer
    Anonymous:
     cause us c++ guys always do Everything right the First time.

    Except for speaking English, it would seem :)

  • (cs) in reply to Djinn
    Djinn:
    Anonymous:
    Strydyr:

    At a prior job, I was once told by a Manager that he'd never hire another programmer with a certification.

    "Why ?", I asked.

    "Because the people who know what they're doing are too busy working to take those tests."

    No trolling here (I'm actually thinking about getting my MCSD) -- just relaying his insight which is true all too often.



    I had a coworker tell me that he was glad he didn't interview me. He said that had he interviewed me, he would not have hired me because I have an M.S. in Computer Science and he thinks that people with advanced degrees do not know how to program or how to make it in the real world. (note: he said he was glad he didn't interview me because he was glad I was on the team).

    That same person later asked me how to upcast an object type....and why it couldn't be done in OO.

    I.e. He asked me why you couldn't do this:

    Object a = new Object();
    String b = (String) a;

    So anyway.


    Yeah, dude. People who couldn't afford to go to school are idiots.


    Presuming you are well educated, you are proof that idiots come both from educated backgrounds and "uneducated" backgrounds.

    As Napoleon Dynamite would say, "Idiots!"
  • (cs) in reply to Otto
    Otto:
    Mikademus:
    I'm from Sweden. Our education is free, all through your life.

    No, it's really not, as the Swedish income tax rate is somewhere between 33% to 60% per person, right? Let's not kid ourselves; you pay either way, somehow.

    The difference is that everybody gets the chance to get educated and earn a lot of money.  Paying afterwards (if you earn less, you have to pay less taxes, approx 20%) works fine for me, but I couldn't have afforded paying my education in advance.

Leave a comment on “Certified Bumblehead”

Log In or post as a guest

Replying to comment #:

« Return to Article