• (cs) in reply to GalacticCowboy
    GalacticCowboy:

    But but but *sputter* it's only 1:45!

    Alex Papadimoulis:
    Nikolay was trying to figure why one candidate turned in only this code file, when the assignment was a small app that demonstrated database connectivity in Delphi ...

    /*
    ** hellowin.csx (C#) - example: axwscript hellowin.csx
    ** Demonstrates the use of Windows Forms to display a messagebox
    **
    ** See also hello.csx
    */

    Classic redirection technique... If the interviewer asks you to solve a particular problem for which you're not prepared to answer, simply substitute with the answer to a different question.  "That sounds like a fascinating problem, but I'd really like to discuss the use of Windows Forms for messagebox display."



    I talked to someone a year ago who was attending classes at MIT who said that for his admissions essay he wrote about a topic not even on the list because he didn't think their topics were interesting.
  • ben (unregistered) in reply to verisimilidude

    Note that this could stack overflow because C doesn't do tail call elimination.  This is a one example of why languages that do tail call elimination are so nice, you can break code into functions and do function calls at the end (lots of return foo(); for example) without having to worry about running out of stack space.  This is related to the so called "Continuation Passing Style" (CPS).

    What you wrote almost looks like CPS, but not quite (exclude the while stuff).  Do you really need all those while statements?

  • (cs) in reply to Jeff
    Anonymous:
    Other than that, though, the only real differences between Delphi and C++ were mostly syntactical.


    Please crosspost your post in some Delphi forum, I'm sure they will agree fully with you! Please
  • (cs)
    Alex Papadimoulis:

    I always used to be skeptical of giving job candidates a take-home code test. The reason was that the assignment needed to be simple -- no in-demand developer would spend more than a few hours on it -- and even the most incompetent developer could surely throw together an elegant solution if he put enough hours into it. But leave it to Nikolay Simeonov(*) to show me the way. Following are some examples (<FONT size=5>warming</FONT>: Delphi ahead) that job candidates turned after several days of working on a simple take-home assignment ...

    <FONT face=Georgia>Warming the Delphi before use is a sure way of messing it up.</FONT>

    <FONT face=Georgia></FONT> 

    <FONT face=Georgia>>BiggBru</FONT>

  • Mr. Egregious (unregistered) in reply to PCBiz
    PCBiz:
    Alex Papadimoulis:

    procedure Tfrmobr.Edopolm3KeyPress(Sender: TObject; var Key: Char);
    begin
    if not (key in [#8,#44,#48..#57]) then key:=#0;
    if key=#46 then Key:=#44;
    if key=#44 then
       if pos(key,edopolm3.text)<>0 then key:=#0;
    end;


    if key=#46 the Key := #44;

    This line was a waist of time.  #46 would not have made it past the previous line.


    True, and copying it that many times adds to the WTFishness.

    #46 is a period. The apparent intention was to replace periods with commas, and the requirement to have only one means they're using it as the decimal separator, not thousands separator.

    Two other points:

    It's "apostrophe", with an H not an I.

    Also, Edward Plonk demonstrates his own moronity with his bigoted comments.

    Egregiously,
    Mr. Egregious

  • Kiss me, I'm Polish (unregistered) in reply to ben
    Anonymous:
    Note that this could stack overflow because C doesn't do tail call elimination.  This is a one example of why languages that do tail call elimination are so nice, you can break code into functions and do function calls at the end (lots of return foo(); for example) without having to worry about running out of stack space.  This is related to the so called "Continuation Passing Style" (CPS).

    What you wrote almost looks like CPS, but not quite (exclude the while stuff).  Do you really need all those while statements?

    So, it's called CPS? Ok then, but just because it has a name doesn't mean it's a good thing to do :)
  • (cs) in reply to kipthegreat
    kipthegreat:
    PCBiz:
    Alex Papadimoulis:

    procedure Tfrmobr.Edopolm3KeyPress(Sender: TObject; var Key: Char);
    begin
    if not (key in [#8,#44,#48..#57]) then key:=#0;
    if key=#46 then Key:=#44;
    if key=#44 then
       if pos(key,edopolm3.text)<>0 then key:=#0;
    end;



    if key=#46 the Key := #44;

    This line was a waist of time.  #46 would not have made it past the previous line.


    "waist of time".  That maid me chuckle.

    Yes. My growing girth as a result of age is truly a "waist of time".

  • (cs) in reply to ParkinT
    ParkinT:
    kipthegreat:
    PCBiz:
    Alex Papadimoulis:

    procedure Tfrmobr.Edopolm3KeyPress(Sender: TObject; var Key: Char);
    begin
    if not (key in [#8,#44,#48..#57]) then key:=#0;
    if key=#46 then Key:=#44;
    if key=#44 then
       if pos(key,edopolm3.text)<>0 then key:=#0;
    end;



    if key=#46 the Key := #44;

    This line was a waist of time.  #46 would not have made it past the previous line.


    "waist of time".  That maid me chuckle.

    Yes. My growing girth as a result of age is truly a "waist of time".

    <FONT face=Georgia>Don't make me laugh out loud when I'm in the school library! Now people think I'm crazy! [:P]</FONT>

  • Jeff (unregistered) in reply to pjsson
    pjsson:
    Jeff:
    Other than that, though, the only real differences between Delphi and C++ were mostly syntactical.


    Please crosspost your post in some Delphi forum, I'm sure they will agree fully with you! Please

    Well, my statment was correct as far as the two languages go; environments and libraries not so much.  Since "Delphi" can either refer to the enviornment or the language (object Pascal), the statement itself was a little amiguous.  What I MEANT was that C++ and object Pascal aren't that different, and they aren't.  They are both object oriented and while each has a few concepts that the other lacks (C is a little more streamlined and flexible while Delphi force a little more structure onto the developer, casing notwithstanding), the same basic abilities are there.  The devil is in the frameworks/libraries/3rd party tools.

    And yes, Delphi's VCL was great, and one of the biggest selling points for the product IMHO.

    I doubt any Delphi proponents would seriously disagree with what I've said here.
  • (cs) in reply to ben
    ben:
    Note that this could stack overflow because C doesn't do tail call elimination.  This is a one example of why languages that do tail call elimination are so nice, you can break code into functions and do function calls at the end (lots of return foo(); for example) without having to worry about running out of stack space.  This is related to the so called "Continuation Passing Style" (CPS).

    What you wrote almost looks like CPS, but not quite (exclude the while stuff).  Do you really need all those while statements?


    I don't know who you were replying to, but you're claiming that C compilers don't transform tail-recursive calls into iterations? If so, you better check your facts. Compilers can and do do this optimizanion. (I hate writing repeated words...) You need to use optimization with both GCC and Sun CC, but both will optimize away the tail call in the canonical tail-recursive version of factorial.
  • (cs)

    Am I missing something here?

    if selection then begin

    The value of "selection" is undefined as you enter this loop.  The loop will NEVER be executed![:#]

  • (cs) in reply to Jeff
    Anonymous:
    GoatCheez:
    Why did the first guy create more than one of the same function? What the hell? The function is also strewn with WTFs too.... WHAT THE HELL?!?!?!?!?!
    Because these are event handlers generated by clicking on the individual controls in the visual designer.  Each method is handeling the key press event for a different control.  This code easily demonstrates that the person understands the tool but doesn't understand software development.  Handeling each event seperatly is the straightfoward (but quite unmaintainable) way of developing software.  I've seen tons of code like in many different visual environemnts and it is pretty clear that those who write code in this way need to find other professions because while they might be able to make programs work, they don't write good software (maintainable, robust, etc.).

    This doesn't make me say "WTF".  More like "*sigh* another one of those . . . "  I've just seen this too many times for it to make much of an impression.


    Ahh yes, quite obvious now.... It was actually quite obvious shortly after I made my post lol. I've seen alot of similar things with VB coders... Those are the kind of people that throw a control onto a form and make it invisible because it has a Picture property and they know no other way to make an object of type picture, or are naive in some other fashion that I can't even begin to imagine
  • Murdocj (unregistered) in reply to Edgar Plonk

    What I like are jerks who think they are superior to other people because they disdain certain programming languages (speaking as someone who has programmed in a variety of assemblers, Pascal, C, C++, VB, VB.net, Java, and a variety of other languages).

    Guess what... VB is a perfectly good language.  Works fine.  Generates code that runs fine.  I wouldn't write a web server in it, but for client-side applications it's a reasonable choice.

    Deal with it...

  • Derek_farn (unregistered) in reply to Otto
    Otto:
    Anonymous:
    I don't see any problem with the for/case example.  Execution of the case statement is dependent on a test that varies on a loop index, as do the bodies of each labeled statement. Why is this being held up as an example of WTF?  Can anbody come up with a more elegant solution (not that I think this one is bad)?

    Because it's using a loop and variable along with conditional jumps to excute what is essentially a never changing block of code. Unroll the loop, and the code being run never, ever, varies. Why not just change it from this annoying and hard to manage structure into a static 13 statements? It'll be both faster and less confusing.


    The inefficiency of this for/case is a minor issue.


    "Hard to manage"?  I think not.  A set of labels are appended to a sequence of statements that only needs to be changed once to impact them all.  This strikes me as being less error prone during maintenance that a list of separate assignment statements.


    Ok, the actual code may have been more complicated.  But as written the for/case has some desirable attributes.

  • (cs)
    perl -e "$str=qq(85,115,101,32,109,111,114,101,32,67,32,97,110,100,32,115,116,97,121,32,97,119,97,121,32,102,114,111,109,32,116,104,97,116,32,112,108,117,115,47,112,108,117,115,32,115,116,117,102,102,32,58,41); foreach $ch (split(/,/,$str)) { print chr($ch); } # FriendlyMessage "
    

    [|-)]

  • (cs) in reply to Maurits
    Maurits:
    Otto:
    Sorry, but RFC 821 was superceded by RFC 1123 on this particular subject.


    RFC 2821 in turn supersedes RFC 1123 (the mail bits of it, anyway) and reinstates the legality of the RFC 821 behavior:

       "... Older client SMTP systems MAY, as discussed above,
    use HELO (as specified in RFC 821) instead of EHLO, and servers MUST
    support the HELO command and reply properly to it." (my emphasis

    Well RFC "Marvin_Rabbit" says that I don't have to accept any mail I don't want to. So Neay!
  • (cs) in reply to marvin_rabbit
    marvin_rabbit:
    Well RFC "Marvin_Rabbit" says that I don't have to accept any mail I don't want to. So Neay!

    Sure, you can reject for any reason you like.

    I note that you're not rejecting at HELO time, which is good... many mail servers like to send lots of email messages on the same HELO connection, and they get confused if you reject at HELO.

    As long as your rejection message is clear (which it is,) you're RFC-good.

  • (cs) in reply to verisimilidude

    verisimilidude:

    I have worked with so many people who cannot understand the rudiments of parser construction that I have mostly given up on writing 'little languages' within 'enterprise'y code.


    How often are new "little languages" justifiable at all these days? They're more fun than damn near anything, certainly, but high-quality implementations of useful scripting languages, easily embedded and extensible, are available free off the shelf. Sometimes you need something so domain-specific that nothing existing will do the job, but how often is that, really?


    verisimilidude:

    That being said, I am aware that there are MUCH better ways to code the parser.  The best is if you can use some tools like yacc and bison (in C) or JavaCC (if in Java) and then you can get close to maintaining the specification for the parser rather than the implementation.  If you must hand code use the GoF state pattern in an OO language (an object for every state with a polymorphic funtion that returns the following state). 



    Yacc's cool, though it's a PITA to write a re-entrant parser with it. That state pattern might be objectionable for some applications because of virtual function call overhead, but probably not too often... Sounds like the typing overhead might be more painful.


  • (cs) in reply to Benjamin Smith
    Anonymous:

    Wow. Talk about useless inanity.

    It's as though you confuse case sensitivity with, oh, actual CODE STRUCTURE  or something.


    NO, Beavis. Wrong. I said that the languages stupid people use are often case-blind (are you seriously claiming otherwise?) Then I said that that's a good thing, because, essentially, stupid people deserve to suffer. If you're stupid and you're trying to transition from a case-blind language to a case-sensitive one, you'll suffer more than you would otherwise. That's all I said. Can't comprehend it, eh?

    Why do I get the feeling you're a VB CRUD-monkey who tried to learn C and couldn't cope with pointers?
  • (cs) in reply to Jeff
    Anonymous:

    Why in the world is Pascal a "Moron" language?  Because it isn't case-sensitive?  For most good programmers that little fact isn't going to matter at all. 


    For anybody who's not a hopeless drooling idiot, it's not going to matter at all. That's why I said it was only the stupid people who'd suffer.

    Anonymous:

    Other than that, though, the only real differences between Delphi and C++ were mostly syntactical.  You could do just about anything in Delphi that you could in C++ (and usually faster in the days of MS VC++), and generally could do more than VB.


    Delphi was ("was"?! Is it gone now?) surely a lot less godawful than VB. And yeah, while it lacked a lot of the amenities of C++ (templates, operator overloading, the STL that those two make possible, function overloading, class instances as stack variables with destructors called automatically on scope exit, etc. etc.), C lacks those amenities too. And Delphi compiled to real native code, and let you treat bytes as bytes and pointers as pointers, so yes, it was not a toy. It had (or has) bitwise operators too, right?

    Not my language of choice, but it deserved better than to languish among the CRUDies.

  • FFrenzy (unregistered) in reply to ParkinT
    ParkinT:

    Am I missing something here?

    if selection then begin

    The value of "selection" is undefined as you enter this loop.  The loop will NEVER be executed![:#]

    It could have been a global variable ( which is possible in Delphi )

  • tdog (unregistered) in reply to Edgar Plonk

    Edgar Plonk:

    NO, Beavis. Wrong. ...

    So would that make you Butthead?

    tdog

  • wtfer (unregistered) in reply to Edgar Plonk
    Edgar Plonk:


    Delphi was ("was"?! Is it gone now?) surely a lot less godawful than VB. And yeah, while it lacked a lot of the amenities of C++ (templates, operator overloading, the STL that those two make possible, function overloading, class instances as stack variables with destructors called automatically on scope exit, etc. etc.), C lacks those amenities too. And Delphi compiled to real native code, and let you treat bytes as bytes and pointers as pointers, so yes, it was not a toy. It had (or has) bitwise operators too, right?



    Delphi has function overloading
  • (cs) in reply to Jeff
    Anonymous:
    Edgar Plonk:
    moron languages like Pascal


    Why in the world is Pascal a "Moron" language?  Because it isn't case-sensitive?  For most good programmers that little fact isn't going to matter at all.  Other than that, though, the only real differences between Delphi and C++ were mostly syntactical.  You could do just about anything in Delphi that you could in C++ (and usually faster in the days of MS VC++), and generally could do more than VB.

    It might not be the best choise today for a number of reasons, but Delphi was a great, if undervalued, development tool for many, many years.

    At the end of the day, I think it wiser to focus on programming principles and writing solid code than trying to argue the superiority of lanugages.  Any argument against Delphi is going to be based on popularity, not the capabilities of the tool.  But I guess that's been said before.  It just saddens me that so many people missed out on the great tool that was Delphi because it didn't gain the popularity it deserved, but that too is an old, old story.


    Out of curiosity, have you ever read this article by Paul Graham:
    http://www.paulgraham.com/avg.html
    (be prepared for rampant lisp-o-philia)

    While I have no opinion one way or another on Delphi (having never used it myself) your objections to the (admittedly nastily inflammatory) previous comment sound a little like those mentioned in the "blub paradox". This is not an accusation (as I said, I'm not qualified to judge either way), just a "think about it".

  • (cs)

    I'd be interested in takin a crack at the test myself. You should post the actual test.

  • (cs) in reply to Derek_farn

    Anonymous:
    I don't see any problem with the for/case example.  Execution of the case statement is dependent on a test that varies on a loop index, as do the bodies of each labeled statement.

    Why is this being held up as an example of WTF?  Can anbody come up with a more elegant solution (not that I think this one is bad)?

    2 things: 1) you could (should) have this common code in a method that the events would call. 2) But even more specific to Delphi is that you can assign one event handler to multiple events, so you could just have the one method in your code and have all the labels pointing to the same KeyPress procedure, saving tons of repetative code.

    -shnar

  • (cs) in reply to Edgar Plonk

    Edgar Plonk:
    Pascal identifiers are case-blind, aren't they? So that gets the FALSE guy mostly off the hook; it looks stupid, but it'll compile and it'll do what it ought to at runtime -- unless Delphi diverges from normal Pascal in that respect.

    Personally, I enjoy the fact that moron languages like Pascal and VB are case blind (not to mention Microsoft's filesystems): It gives stupid people a well-deserved kick in the teeth if they ever try to venture beyond the apron strings. The more arbitrary barriers to entry there are, the less chance they'll ever bullshit their way into a real job and generate WTFs for me to waste my time on.

    Delphi's ObjectPascal is an extended version of Pascal adding lots of powerful OOP into the language. Delphi's real strength though is the VCL. Easiest comparison is C# and the DotNet runtimes. C# is just syntax, but the real strength is in the libraries. VCL however came out over 10 years ago and was an incredibly advanced way to program for Windows.

    And to think that a language makes you a superior coder is just stoopid. If anything, a case-insensitive language produces fewer "silly" bugs than a case-sensitive one. I can't tell you how often I spend debugging other developer's code to find the problem was they were using the same variable name just different casing. Compilers won't catch that, and neither do human eyes, and so lends itself to buggier code.

    Experience has taught me that being as explicit as possible is much more important than case-sensitivity in a langauge.

    -shnar

  • (cs) in reply to pjsson

    pjsson:
    Anonymous:
    Other than that, though, the only real differences between Delphi and C++ were mostly syntactical.


    Please crosspost your post in some Delphi forum, I'm sure they will agree fully with you! Please

    Actually, the C++ programmers say the same thing, at least the ones who use Borland's C++Builder. It used the same VCL libraries after version 3(?) and so effectively the only practical differences between Delphi and C++ was the syntax. Ultimately boiled down to a personal coding preference, do you prefer C++ or ObjectPascal? (though I heard that Delphi projects compiled/built exponetionally faster).

    -shnar

  • (cs) in reply to Edgar Plonk

    Edgar Plonk:
    Delphi was ("was"?! Is it gone now?) surely a lot less godawful than VB. And yeah, while it lacked a lot of the amenities of C++ (templates, operator overloading, the STL that those two make possible, function overloading, class instances as stack variables with destructors called automatically on scope exit, etc. etc.), C lacks those amenities too. And Delphi compiled to real native code, and let you treat bytes as bytes and pointers as pointers, so yes, it was not a toy. It had (or has) bitwise operators too, right?

    Still around, Borland just released Delphi 2006 (effectively version 10) and has with each version been adding more and more language features. Method overloading exists (since version 5), and they just added operator overloading. Everything else you mention, and you could even add your own Assembly code if you wanted to. It still does compile to real native code, making it still one of the best Win32 programming langauges on the market (especially for business/database applications).

    -shnar

  • (cs)

    This is getting deep enough that nobody will likely read it, but nobody pointed out that what was meant by "dotting the i's and crossing the t's" wasn't about case, but about naming. When you write a large form with lots of components, its just plain common sense to NAME THEM. And, in Delphi, all you have to do is click on the control, click on the "Name" field over in the property list, and then TYPE A MEANINGFUL NAME and it alters the code in your editor automatically.

    Once you've named your components, it makes it much easier to write the code that reads/writes/shows/hides them, and a whole lot easier to debug and maintain.

    Also, a few other FYIs about Delphi:

    1. In Delphi, you start (usually) with an empty form, and add components to it, much like VB. The form is a class, and every component you add gets tossed in as a pointer-to-component field. Every event you create gets added as a method. You can add your own fields and methods, and re-use events so long as their prototype matches what is needed. So, where some people were wondering where variables came from, they were likely just private fields of the form class, added with poorly chosen names by the canidate.

    2. Someone suggested subclassing the edit blank. This is possible in Delphi, but not quite practical. If you are willing to create+add the component at runtime (like Java-style), then its no problem. But creating at runtime sucks (as any Java programmer will realize if they've played with Delphi or VB) and its much nicer to have the component serialized with the form, along with its properties and event handlers (which are method pointers, essentially). In order to do this in Delphi, you would need to get your subclass "onto the toolbar" which is done by putting the subclass in a different file and building a package out of it, which turns into a sort of DLL thing that the IDE can load on the fly and then let you use (and edit the properties of) it in the designer. The component's code can then be either staticly or dynamically added to your project. So in other words, people usually only subclass objects if the object is reusable.

    Every Borland-made component has lots of "events", however, and these make it very easy to add functionality to an existing class without subclassing, and have the added benefit of being able to use values from fields in your form object. (which otherwise might require you to give a subclassed component a pointer to its parent, so it could access these values)

    In short, rather than making 3 handlers & copy-paste, the canidate should have made one handler for the first text blank, and then used the drop-down list on the other two events to select the handler they already wrote.

    [ Note: I'm another one of those guys who thinks that the story of Delphi not becoming mainstream is a tragedy for the programmers of the world ;-) You use it like VB, but the interface and component library are implemented better, the language is as low as C and almost as high as Java, with an expressive type system, it compiles faster than anything thanks to its single-pass design, and the syntax is pascal with an OO twist. ...ok, so some people don't like the syntax, heh. ]

  • Anonymous (unregistered) in reply to TomCo

    perl -wle 'print map chr, 73,32,102,105,110,100,32,121,111,117,114,32,117,115,101,32,111,102,32,112,101,114,108,32,100,105,115,116,117,114,98,105,110,103,10'

  • trolski (unregistered)

    Is it me or are there a lot of trolls here today? Remember not to feed 'em....

  • erlando (unregistered) in reply to Nand
    Nand:

    What does the loop at the end do?
    "   b:=false;
        for i:=1 to 13 do b:=b or s1[i];
        selection:=b;"
    It's an utterly ugly way of finding out if any of the 12 elements of s1 is true. Especially when you want to set selection, and not 'b'.

    Pseudo-pascal:

    for i := 1 to 13 do
      if(s1[i]) {
       selection := true;
       break;
      }



    i = 1;
    while ( !selection && i <=13 )
    {
        selection = s1[i];
        i++;
    }

    Look mom.. No breaks..
  • erlando (unregistered) in reply to erlando
    Nand:

    What does the loop at the end do?
    "   b:=false;
        for i:=1 to 13 do b:=b or s1[i];
        selection:=b;"
    It's an utterly ugly way of finding out if any of the 12 elements of s1 is true. Especially when you want to set selection, and not 'b'.

    Pseudo-pascal:

    for i := 1 to 13 do
      if(s1[i]) {
       selection := true;
       break;
      }



    i = 1;
    while ( !selection && i &lt;=13 )
    {
        selection = s1[i];
        i++;
    }

    Damn forum ate my operator..
  • erlando (unregistered) in reply to erlando

    I give up..

  • (cs) in reply to Maurits
    Maurits:
    Single-element HELO is explicitly allowed by RFC 821, and back-compat'ed by RFC 2821.

    ...even if it's a HELO from some mysterious host who prefers to call itself "localhost"...

  • (cs) in reply to Jeff
    Anonymous:
    pjsson:
    Jeff:
    Other than that, though, the only real differences between Delphi and C++ were mostly syntactical.


    Please crosspost your post in some Delphi forum, I'm sure they will agree fully with you! Please

    Well, my statment was correct as far as the two languages go; environments and libraries not so much.  Since "Delphi" can either refer to the enviornment or the language (object Pascal), the statement itself was a little amiguous.  What I MEANT was that C++ and object Pascal aren't that different, and they aren't.  They are both object oriented and while each has a few concepts that the other lacks (C is a little more streamlined and flexible while Delphi force a little more structure onto the developer, casing notwithstanding), the same basic abilities are there.  The devil is in the frameworks/libraries/3rd party tools.

    Yeah, and C++ and Smalltalk aren't that different either. They are both objet oriented and while each has a few concepts that the other lacks (C++ is a damn heap of messy poo while Smalltalk is structured and streamlined) the same basic abilities are there.

    Anyone would seriously disagree with what you've said because it's stupid, you basically used the good ol' strawman "my language's Turing Complete and yours is too so they're equivalent".

  • J.A.O.E. (unregistered) in reply to taryn
    taryn:
    Out of curiosity, have you ever read this article by Paul Graham:
    http://www.paulgraham.com/avg.html
    (be prepared for rampant lisp-o-philia)

    While I have no opinion one way or another on Delphi (having never used it myself) your objections to the (admittedly nastily inflammatory) previous comment sound a little like those mentioned in the "blub paradox". This is not an accusation (as I said, I'm not qualified to judge either way), just a "think about it".

    Personally (I'm not the original poster of these objections) I would say that C++ programmers are generally more blubby than Pascal programmers. I do most of my coding in Object Pascal, but that doesn't mean I'll promote it as the best language ever and claim that anything else is inferior. Language choice is all about what you want. If you want syntax that is compact and effective (this can be quite beautiful, I'll give you that), go C++. If you want syntax that is intuitively understandable, even for non-programmers, and where the = sign means what it has meant for centuries, go Pascal.

    As for functionality.. of course, most (far from all, but most) objections to programming languages stem from ignorance. Many one-language programmers just assume that you can't do certain things in other languages. (I've met the argument, numerous times, that you can't even use inline assembly code in Pascal, something that you have been able to do at least since the ancient Turbo Pascal 6.0.)

    Still, I realize that there are things one cannot do in Pascal. If I need such a thing, I use another language for that specific project and temporarily endure its (personally perceived) syntactic ugliness, if any. And I've found that if I really need templates and operator overload (I mostly use FPC and haven't checked out Delphi 2006, so I don't have access to those things), then chances are that I will need to dynamically create classes during runtime as well. And as far as I know (correct me if I'm wrong), I can't do that in C++ either, so I have to switch to an interpreted language like Ruby.

    As for the article, I don't doubt that Lisp is a very powerful language (it's been years since I did anything with it, so I don't remember much), but it's certainly not easy to read. So unless I specifically need those powers, I'll stick to something more transparent.

    (By the way, first time poster on this infamous forum, so please excuse any formatting madness.)

  • (cs) in reply to Edgar Plonk
    Edgar Plonk:
    Wrong. I said that the languages stupid people use are often case-blind (are you seriously claiming otherwise?)

    I don't know about him, but I am.

    To say that "the languages stupid people use are often case-blind" is simply meaningless.  Many languages are case-insensitive.  Many languages are used by stupid people.  There is no correlation, so the statement is not worth making.  Anyone who reads TDWTF knows that there are just as many stupid people writing stupid code in C++, Java, and any other case-sensitive language you care to mention, and there are also smart people writing smart code in VB.  (Yes, really.)

    Therefore, it is patently obvious that there is no connection between case-insensitivity and stupid programmers.  Therefore, claiming that a programming language is used by stupid people because it is case-insensitive is stupid, and categorising a language as a "moron language" (as I seem to recall somebody doing) simply because it is case-insensitive is moronical.

    You may also like to read up on logical fallacies.  Asserting that anyone who uses VB does so because they're, what was it again, "a VB CRUD-monkey who tried to learn C and couldn't cope with pointers", is what we call an "ad hominem" argument.  Only idiots and trolls use them.  I wonder which you are?
  • (cs) in reply to SilverDirk

    Very eloquently put, SilverDirk.

    I agree whole-heartedly.  One of the important features of Delphi that you failed to mention is;

      While it compiles in one pass it also creates tight, efficient executable that can run on any Windows system. 

    No Runtime Libraries (the bane of Visual Basic), no CLR (the .NET 'framework' which is simply MS new version of the bloated runtime libraries).  I have successuflly written Delphi applications in the mid 1980's that ran on every available version of Windows (including Windows 3.0) and still run today on XP !

    I don't profess to be an authority on any one language (I have written applications in over a dozen different languages) but Delphi has NEVER disappointed me.

  • (cs) in reply to Iago

    Iago:
    Edgar Plonk:
    Wrong. I said that the languages stupid people use are often case-blind (are you seriously claiming otherwise?)

    Iargument.  Only idiots and trolls use them.  I wonder which you are?

    Although your statements are valid.  Your tone is a bit troll-ish.[:|]

  • (cs) in reply to Edgar Plonk

    You are a clown for lots of reasons....

    1. Why bother putting the panels there if they are always going to be invisible?
    2. Languages themselves do not make the applications, programmers do. VB has been used with success in lots of places. VB.NET also wipes the floor with your poncy virtual languages.
    3. You think you are clever as you are aware that some languages are case sensitive.
    4. Why are you reading this forum if it wastes your time and annoys you?
    5. But the main reason you are a clown is probably because your father was a clown.

    Cheers.

  • (cs) in reply to Otto
    Otto:

    On an only marginally related note, I've seen a variation of the for-case structure before which made some sense (for small cases), but which was no less annoying.

    It was an infinite while-case. The person who wrote it called it a "state machine", which made me kinda want to hit him.

    Basically it was like this:
    enum possibleStates = {state1, state2, state3, etc};
    possibleStates currentState = state1;
    while() // infinite loop
    {
    switch (currentState) {
    case state1:
        do some stuff
        currentState = state2;
        break;
    case state2:
        do some stuff
        currentState = state3;
        break
    ...


    This technique makes perfect sense if the state could change or ought to change due to some external input.   

    But yeah if it's just going in a predefined sequence then, well, this is just a reimplementation of the so-called "subroutine" :)

    Reed



  • (cs) in reply to Jeff
    Jeff:
    GoatCheez:
    Why did the first guy create more than one of the same function? What the hell? The function is also strewn with WTFs too.... WHAT THE HELL?!?!?!?!?!
    Because these are event handlers generated by clicking on the individual controls in the visual designer.  Each method is handeling the key press event for a different control.  This code easily demonstrates that the person understands the tool but doesn't understand software development.  Handeling each event seperatly is the straightfoward (but quite unmaintainable) way of developing software.  I've seen tons of code like in many different visual environemnts and it is pretty clear that those who write code in this way need to find other professions because while they might be able to make programs work, they don't write good software (maintainable, robust, etc.).


    Actually, anyone with any Delphi knowledge at all would know that you can assign the same event handler to more than
    one control; instead of double-clicking on the control, you just use the dropdown list in the Object Inspector. The "Sender"
    parameter to the event handler tells you which control generated the event.
  • (cs) in reply to ParkinT
    ParkinT:

    Am I missing something here?

    if selection then begin

    The value of "selection" is undefined as you enter this loop.  The loop will NEVER be executed![:#]



    Apparently, yes. :D

    Selection was not declared in the event handler we got to see, so it was apparently declared (and a value defined) elsewhere in the code.

  • (cs) in reply to wtfer
    wtfer:


    Delphi has function overloading



    And in the current version (Delphi 2006), it also has operator overloading.
  • bob (unregistered)

    And this same employer will call me and wonder why I turn him down when he's offering $40/hr or $60k/year for a Delphi expert.

    And then when he asks if I know anyone that might be interested, he'll wonder why I say, "Sorry, I don't know anyone I'd recommend for that price."

  • bob (unregistered) in reply to John Bigboote

    >That's not the WTF, I think. The WTF is that the default control names (panel1, etc) were never changed >when the form or page was developed.

    Disagree- the general concensus was that there was no reason to rename a UI element (like a panel) unless you actually addressed it in code. If it was just an element on the form, there's no reason to waste time renaming it- there're often many panels, etc.

    The WTF is the inconsistency- false, false, FALSE, false, false... panel, panel, PANELX, panel... Clearly- the one in caps wasn't generated by Delphi- someone had to type PANEL..FALSE because delphi wouldn't generate all caps.


    >I think that's VB.NET, BTW.

    No, it's definitely Delphi, even VB.NET isn't lame enough to use := when it means =.

  • bob (unregistered) in reply to Nand

    >so maybe the language just requires code like this.

    No, this is another case of, "You can write crap in any language." Language can poop.

    >Isn't Delphi an OO language?

    The language is essentially very close to Java/C# (C# and Delphi had the same guy design them, basically).

    >Subclass the edit field object and add a doSomething() method that performs the correct action

    Yes you could do that if you wanted-there're better ways than that, but there's no excuse for that crap code, hence the WTF.

  • (cs) in reply to Iago

    You may also like to read up on logical fallacies.  Asserting that anyone who uses VB does so because they're, what was it again, "a VB CRUD-monkey who tried to learn C and couldn't cope with pointers", is what we call an "ad hominem" argument.  Only idiots and trolls use them.  I wonder which you are?


    Now THAT is funny! Or did you not intend the irony?

Leave a comment on “Take-home Trouble”

Log In or post as a guest

Replying to comment #:

« Return to Article