Slashdot Mirror


What I Hate About Your Programming Language

chromatic writes "Perl programmers like punctuation. Python programmers like indentation. Every programming language has its own syntax, stemming from its philosophy. What I Hate About Your Programming Language examines the issues that shape languages as they grow. It's not advocacy, I promise."

800 comments

  1. And now we have people... by TalonKarrde989 · · Score: 0

    ...analyzing why people hate each other's programming language. Joy.

    1. Re:And now we have people... by Bush+Pig · · Score: 0

      What I don't understand is how come he didn't mention FORTRAN. After all, there's a lot to hate there (although I kind of liked it).

      Oh, wait, no-one uses it any more ...

      --
      What a long, strange trip it's been.
    2. Re:And now we have people... by TalonKarrde989 · · Score: 1

      I'm curious as to why I got a negative mod, heheh. Oh well :) I'm suprised people still use ASP...it's a peice of crap. I could come up with some insulting "ASP really stands for ..." but then I would look like the rest of the people who try to be funny by doing that.

    3. Re:And now we have people... by the_duke_of_hazzard · · Score: 1, Interesting
      But his crits are so asinine... There's so much to hate about Java, yet he picks on points which are fundamental to its philosophy, eg "sometimes, I'd rather not worry about exceptions at all" - Java tries to encourage/force good coding; criticise that forcing philosophy rather than its consequences.

      Then he tries to have it both ways by wanting to ignore exceptions and yet force comments.

      And how can you have someone writing an article on various languages repeatedly saying "I don't really know much about this? *rolls eyes*

      And how exactly can you search databases without doing set operations?

      The rest of this article is full of cliches ("It's a lot easier to solve problems if you have a toolbox full of good tools.")

      And his English - "Language Badnesses"... Jesus.

    4. Re:And now we have people... by jeremyp · · Score: 1

      His criticism is wrong anyway. "I'd like to be able to propagate exceptions upwards" - you can.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    5. Re:And now we have people... by the_duke_of_hazzard · · Score: 1

      I think he means not even bother with declaring exceptions to be thrown with the "throws" keyword. Either way, it's still nonsense.

  2. PHP by sethadam1 · · Score: 4, Interesting

    What he hates about PHP doesn't sound so bad, and doesn't seem like anything that won't be corrected in PHP5.

    I knew there was a reason I liked it.

    1. Re:PHP by xeon4life · · Score: 1

      What!? # is so cool looking though.

      --
      Real programmers can write assembly code in any language. -- Larry Wall
    2. Re:PHP by Anonymous Coward · · Score: 0

      I agree, # is sexy.

    3. Re:PHP by DonkeyJimmy · · Score: 5, Funny

      What!? # is so cool looking though.

      As a perl programmer I just read that as "What!? "

      --
      "Probably the toughest time in anyone's life is when you have to murder a loved one because they're the devil." -Philips
    4. Re:PHP by sethadam1 · · Score: 4, Insightful

      Hate to tell you - but all three of those work in PHP. In fact, lots of good PHP programmers use all three for different kinds of comments -

      // is for instructions

      # is for copyrights

      /* is for
      multiple lines */

    5. Re:PHP by Anonymous Coward · · Score: 0

      Thank you Mr Suntse. You have cleared up the fact that "everyone thinks PHP coders are morons." Now that that is settled, php.net will close up shop tomorrow, realizing that is an inferior language, and I will kill myself. Thanks for the info.

    6. Re:PHP by TheTomcat · · Score: 1

      PHP supports all three of those comment syntaxes (syntaxi?).

      S

    7. Re:PHP by suntse · · Score: 1

      Are you posting anonymously because you are afraid that everyone will know that you are a PHP coder?

    8. Re:PHP by Hentai · · Score: 3, Funny

      syntaces.

      And 'anal-retentive' is hyphenated as a noun, but unhyphenated as an adjective - unless it is seperated from the noun it modifies.

      --
      -Hentai [in vita non pacem est]
    9. Re:PHP by tankdilla · · Score: 1
      I lost count, # refers to which language?

      guess i'll never get another programming job. but then again, who will?

      --

      -Look lively. LOOK LIVELY!!! --Mr. Shmallow

    10. Re:PHP by sethadam1 · · Score: 2, Insightful

      I think PHP coders generally lack the ego that non-PHP'ers have. Case in point...parent

    11. Re:PHP by uberdave · · Score: 4, Funny

      "You don't tug on Superman's cape.
      You don't spit into the wind.
      You dont't pull the mask of the ol' Lone Ranger..."
      ...and you don't make yourself the target of a programming language flame war.

    12. Re:PHP by Anonymous Coward · · Score: 0

      These aren't people we're dealing with afterall, these are HACKERS.

    13. Re:PHP by evilviper · · Score: 1
      As a perl programmer I just read that as "What!? "


      Translation:

      What!? \# is so cool looking though.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    14. Re:PHP by Phroggy · · Score: 1

      He meant everyone who doesn't use PHP.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    15. Re:PHP by nacs · · Score: 1

      separated

      Or as Kelso would say: "Ooooh! Double burn!"

      --
      "I filter at +6, and have yet to miss out on an important comment." (#822545)
    16. Re:PHP by draos · · Score: 1

      I began programming in php without using ANY reference because, it seems that if I can conceive a syntax to do something it will work. PHP combines ALL the syntax from PERL, C/C++, sh, so no matter what your native language is you can pick up php right off the bat.

    17. Re:PHP by Christianfreak · · Score: 1

      Umm in PHP you can use "#" and "/*" as well.

    18. Re:PHP by Anonymous Coward · · Score: 0

      Bah! Any _real_ programmer knows that slash-slash is for JCL.

  3. That's right... by xeon4life · · Score: 2, Funny

    ...we should all use Scheme.

    --
    Real programmers can write assembly code in any language. -- Larry Wall
    1. Re:That's right... by DonkeyJimmy · · Score: 4, Funny

      ...we should all use Scheme.

      What I think you meant to say was:
      (define language? (lambda (x) 'scheme'))

      --
      "Probably the toughest time in anyone's life is when you have to murder a loved one because they're the devil." -Philips
    2. Re:That's right... by Bendebecker · · Score: 2, Funny

      ...we should all use Scheme.
      They say that a langauge can be judged partly on how many people use it. As such, some other versions of Lisp are probably better since they are a lot common.

      --
      There's a growing sense that even if The Future comes,
      most of us won't be able to afford it.
      -- Lemmy
    3. Re:That's right... by Anonymous Coward · · Score: 4, Funny

      Except that you messed it up. The question mark should indicate a boolean return value.

      (define language? (lambda (x) (equal? 'scheme)))

      You can tell my code is better, because it has more trailing parentheses.

    4. Re:That's right... by drgnvale · · Score: 2, Interesting
      >>What I think you meant to say was:
      >>(define language? (lambda (x) 'scheme'))

      As someone already pointed out, ? indicates a predicate function, which returns #t or #f. And this function really doesn't take a parameter... so I'd actually just define it like this.
      (define language 'scheme)

    5. Re:That's right... by drgnvale · · Score: 2, Interesting

      Well, you might want to call it as a function, so this would be better.
      (define language (lambda () 'scheme))

    6. Re:That's right... by mccoma · · Score: 1
      They say that a langauge can be judged partly on how many people use it

      Watch out, you might be seen as supporting Visual Basic (although the partly might give you some cover).

    7. Re:That's right... by Daniel · · Score: 1

      equal?: expects 2 arguments, given 1: scheme

      Daniel

      --
      Hurry up and jump on the individualist bandwagon!
    8. Re:That's right... by ctrimble · · Score: 2, Funny

      I agree about the predicate function, but I understood the intention being whatever was passed in, the symbol scheme was returned. Which I then interpreted as meaning that scheme is the primordial language and every language is scheme under the covers. And then I thought that it's probably more accurate to say that Scheme is like Zelazny's Amber and that all the other programming languages are just shadows that differ in some flawed way. (C being somewhere down by the Courts of Chaos). And then I realised that I was out of new Mountain Dew LiveWire(tm) and should get my fifth bottle of the day. Oh, sweet nectar!

    9. Re:That's right... by Zeal17 · · Score: 1

      They say that a langauge can be judged partly on how many people use it

      Watch out, you might be seen as supporting Visual Basic (although the partly might give you some cover).


      ...or, god forbid, COBOL.

      --

      "If it sucks without butter, it still sucks with butter, only creamier." - AC
    10. Re:That's right... by Piquan · · Score: 1

      No, no, to really make your Scheme code better, you need to use obscure CS techniques that are very very rarely used in the real world!

      (define (curry fn a) (lambda x (apply fn a x)))
      (define language? (curry eq? 'scheme))

      As an aside: How are you supposed to preserve indentation within a /. ECODE? Is it a conspiracy against Python users?

  4. ASP by (54)T-Dub · · Score: 1, Insightful

    Never learn to program with ASP. The worst programmers I know started with that abomination of a language.

    And of course I'm stuck using it to bring home the bacon
    ~:-\

    --

    "I can not bring myself to believe that if knowledge presents danger, the solution is ignorance" - Isaac Asimov
    1. Re:ASP by (54)T-Dub · · Score: 0, Offtopic

      I said learn with asp fucknut. I learned with C. Fucking coward.

      --

      "I can not bring myself to believe that if knowledge presents danger, the solution is ignorance" - Isaac Asimov
    2. Re:ASP by Anonymous Coward · · Score: 0
      ASPs -- very dangerous; you go first.

      </sallah>

    3. Re:ASP by Uber+Banker · · Score: 1

      Perl, Python, PHP, C, damn break out that Cobol...

      I learnt with APL2. That kicks ass guy!

    4. Re:ASP by BrokenHalo · · Score: 1
      The worst programmers I know started with Pascal. Not COBOL. Not even BASIC.

      Of course, I come from the generation who all started with assembler, so I'm biased :-)

    5. Re:ASP by Anonymous Coward · · Score: 0

      I started with BASIC and then learnt PASCAL in my first year at college. Do you want to know what the language they used in the second year was?

      Visual Basic

      By all accounts, I should be the worst programmer in the universe. I did drag myself out of that hole by learning C and then C++, though I'm still scared by the earlier BASIC and PASCAL stuff. Luckily I forgot everything about Visual Basic. I can't even remember any if I try. Thankfully!

    6. Re:ASP by smagruder · · Score: 1

      The worst programmers I know started with Pascal.

      Sounds like a typical C++ coder bias. I've actually found the reverse to be true. At least Pascal doesn't all but encourage the wacky unreadable coding that C++ does. And Object Pascal rocks!

      --
      Steve Magruder, Metro Foodist
    7. Re:ASP by jackjumper · · Score: 1

      I learned with Fortran II (not IV). What does that say?

    8. Re:ASP by BrokenHalo · · Score: 1
      Sounds like a typical C++ coder bias

      After spending many years as a sysprog, and having mastered enough programming languages to fill up a lot of space in my CV, I am glad to be able to say that I have never (yet) used C++.

      I have used C, however, and I like it for all the same reasons I like Assembler.

      Nobody ever said assembly code was easy to read (for people), but when done properly, it's fast. For big projects, C is just a quicker way of writing assembly code :-).

    9. Re:ASP by BrokenHalo · · Score: 1
      It says you are probably a little older than I am. (I'm 40.) I learned Fortran with IV.

      I've always kind of liked the comfortable feeling of NOTHING HAS BEEN SAID UNLESS YOU SAY IT IN UPPERCASE :-).

    10. Re:ASP by maddskillz · · Score: 1
      Of course, I come from the generation who all started with assembler, so I'm biased :-)

      Wow! Coding back then must have been hard, trying to dodge roaming dinosaurs and such :P

    11. Re:ASP by ca1v1n · · Score: 1

      The worst programmers I know started with C. They write code with ad-hoc, prematurely optimized and unreuseable data structures that is riddled with memory leaks and completely unmaintainable. Then they call you a wuss when you want to write something in a language which enforces a modicum of type safety and provides garbage collection and language constructs like polymorphism which encourage code reuse and abstraction of detail. I don't blame them so much as I blame the amateur hackers who introduced them to it who have no regard or understanding of what responsible software engineering entails. I usually find that it is a better use of my time to berate these people until they start making unbiased choices with regard to their choice of tools and methods than trying to decipher their gibberish, though sometimes deadlines give me no choice. There are plenty of good uses for C, but there are lots of applications where more powerful languages save a lot of pain.

    12. Re:ASP by jackjumper · · Score: 1

      Sorry, 39. Learned it on a PDP/8 in 10th grade...

  5. The real answer by ucblockhead · · Score: 5, Funny

    What I hate about your programming language is that it doesn't work like mine does.

    --
    The cake is a pie
    1. Re:The real answer by Anonymous Coward · · Score: 0

      What I hate about your programming language is that you use it.

    2. Re:The real answer by hplasm · · Score: 1

      Or "What I hate about your programming language is that I don't understand it like mine.."

      --
      ...and he grinned, like a fox eating shit out of a wire brush.
  6. PHP by kupo+zero · · Score: 1

    What I love about php is how to do comments. // is a lot sexier than "#", or "/*"

  7. Slash by Malicious · · Score: 3, Funny

    I hate your Grammer/Punctuation.

    --
    01101001001000000110000101101101001000000110001001 10000101110100011011010110000101101110
    1. Re:Slash by rudiger · · Score: 1

      *cough*grammar*cough*

    2. Re:Slash by Malicious · · Score: 2, Funny

      You are correct.
      Slash isn't responsible. It's the fault of inferior poof reading.

      --
      01101001001000000110000101101101001000000110001001 10000101110100011011010110000101101110
    3. Re:Slash by Concerned+Onlooker · · Score: 2, Funny

      Please don't bring his grandmother into this.

      --
      http://www.rootstrikers.org/
    4. Re:Slash by Xcapee · · Score: 1

      You leave my Grammer out of this! She hasn't done anything.

      Punct U ation!

      --
      Oh shoot! Sig block again.
    5. Re:Slash by Soul-Burn666 · · Score: 1

      You are correct.
      Slash isn't responsible. It's the fault of inferior poof reading.


      This is another example of inferior proof reading :>

      Poof reading! The reading that goes "poof"!

      --
      ^_^
    6. Re:Slash by Anonymous Coward · · Score: 0

      Sarcasm, this is Soul-Burn666. Soul-Burn666, this is sarcasm.

      Just had to introduce you two -- it was obvious you hadn't met before. :)

  8. I hate all the text... by TheDormouse · · Score: 5, Funny

    That's why I use Whitespace, of course!

    1. Re:I hate all the text... by sheetsda · · Score: 4, Funny

      For those of you who like Whitespace, you might also take a look at Brainfuck. How can you go wrong with a 171 byte compiler? K.I.S.S. at its finest. :)

    2. Re:I hate all the text... by Anonymous Coward · · Score: 0

      Great. Now write the compiler in BrainF*** and we'll all be happy.

  9. ummm.. by Pfhreakaz0id · · Score: 4, Informative

    ASP isn't a language. You can use any number of scripting languages with it. Of course, most are done in VBScript, but many folks use JScript (javascript), because it is what they use for the client side script.

    1. Re:ummm.. by (54)T-Dub · · Score: 2, Informative

      sorry, i meant ASP in the general sense of VBScript. Just like when I say PC I refer to an x86 machine as apposed to a mac, even though both of them are 'Personal Computers'.

      --

      "I can not bring myself to believe that if knowledge presents danger, the solution is ignorance" - Isaac Asimov
    2. Re:ummm.. by Anonymous Coward · · Score: 0

      You probably should have said VBscript then. "ASP in the general sense of VBScript" isn't VBScript, VBScript is VBScript.

      Thats like saying 'cgi', when your really mean perl, just because perl scripts are commonly used as CGI programs.

    3. Re:ummm.. by Pfhreakaz0id · · Score: 1

      yeah. 90% of the time, when people say ASP, they mean VBscript, because most ASP is written in VBScript.

  10. Firestarter by Flounder · · Score: 4, Funny

    I used to have a T-shirt that was designed to piss off everybody. It said "Nuke the Gay Unborn Baby Seals". That's what reading this article felt like. Tinder to start a flame war that everybody can join in on.

    --

    No boom today. Boom tomorrow. There's always a boom tomorrow. - Cmdr. Susan Ivanova

    1. Re:Firestarter by Anonymous Coward · · Score: 0

      That should read "Nuke gay aborted whales for Jesus"

    2. Re:Firestarter by Anonymous Coward · · Score: 0

      No, I have that shirt too. "Nuke a godless communist gay baby seal for Christ."

    3. Re:Firestarter by Reziac · · Score: 5, Funny

      The article reminded me of this old gem:

      THE PROGRAMMER'S QUICK GUIDE TO THE LANGUAGES

      The proliferation of modern programming languages (all of which seem to have stolen countless features from one another) sometimes makes it difficult to remember what language you're currently using. This handy reference is offered as a public service to help programmers who find themselves in such a dilemma.

      =====> TASK: Shoot yourself in the foot.

      C: You shoot yourself in the foot.

      C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."

      FORTRAN: You shoot yourself in each toe, iteratively, until you run out of toes, then you read in the next foot and repeat. If you run out of bullets, you continue with the attempts to shoot yourself anyway because you have no exception-handling capability.

      Pascal: The compiler won't let you shoot yourself in the foot.

      Ada: After correctly packing your foot, you attempt to concurrently load the gun, pull the trigger, scream, and shoot yourself in the foot. When you try, however, you discover you can't because your foot is of the wrong type.

      COBOL: Using a COLT 45 HANDGUN, AIM gun at LEG.FOOT, THEN place ARM.HAND.FINGER on HANDGUN.TRIGGER and SQUEEZE. THEN return HANDGUN to HOLSTER. CHECK whether shoelace needs to be re-tied.

      LISP: You shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds...

      FORTH: Foot in yourself shoot.

      Prolog: You tell your program that you want to be shot in the foot. The program figures out how to do it, but the syntax doesn't permit it to explain it to you.

      BASIC: Shoot yourself in the foot with a water pistol. On large systems, continue until entire lower body is waterlogged.

      Visual Basic: You'll really only _appear_ to have shot yourself in the foot, but you'll have had so much fun doing it that you won't care.

      HyperTalk: Put the first bullet of gun into foot left of leg of you. Answer the result.

      Motif: You spend days writing a UIL description of your foot, the bullet, its trajectory, and the intricate scrollwork on the ivory handles of the gun. When you finally get around to pulling the trigger, the gun jams.

      APL: You shoot yourself in the foot, then spend all day figuring out how to do it in fewer characters.

      SNOBOL: If you succeed, shoot yourself in the left foot. If you fail, shoot yourself in the right foot.

      Unix:
      % ls
      foot.c foot.h foot.o toe.c toe.o
      % rm * .o
      rm:.o no such file or directory
      % ls
      %

      Concurrent Euclid: You shoot yourself in somebody else's foot.

      370 JCL: You send your foot down to MIS and include a 400-page document explaining exactly how you want it to be shot. Three years later, your foot comes back deep-fried.

      Paradox: Not only can you shoot yourself in the foot, your users can, too.

      Access: You try to point the gun at your foot, but it shoots holes in all your Borland distribution diskettes instead.

      Revelation: You're sure you're going to be able to shoot yourself in the foot, just as soon as you figure out what all these nifty little bullet-thingies are for.

      Assembler: You try to shoot yourself in the foot, only to discover you must first invent the gun, the bullet, the trigger, and your foot.

      Modula2: After realizing that you can't actually accomplish anything in this language, you shoot yourself in the head.

      CLARION: You tell your computer to create a program for shooting y

      --
      ~REZ~ #43301. Who'd fake being me anyway?
    4. Re:Firestarter by Becquerel · · Score: 1

      If the origional 'story' had been a post, it would have been modded flamebait in seconds, no one would have replied and everyone would have congratulated themselves on having been 1337 enough not to get drawn in to a blatent flamer.

      But at over 500 posts in 12hrs looks like not that many people spotted it...,

      either that or /. just loves a 'my language is better than your language' slanging match every couple of weeks no matter how childish.

      --
      My spelling isn't bad, I'm evolving the language
    5. Re:Firestarter by Interfacer · · Score: 1

      it has been long since i laughed this much while at work.
      thank you for lightening up my lunch break.

      Int.

    6. Re:Firestarter by Christianfreak · · Score: 1

      PHP: i_want_to_shoot_myself_in_the_foot($foot,$gun);

      But be careful because the i_want_to_shoot_myself_in_the_hand() function takes a different parameter order.

    7. Re:Firestarter by blibbleblobble · · Score: 1

      Favorite programming language? It is like asking you to pick your favorite painful dental procedure. The answer should be the one that will do what is needed with the best cost and least pain.

    8. Re:Firestarter by p3d0 · · Score: 1
      Oh man, the UNIX one is hilarious. So are Concurrent Euclid and Access.

      Thanks.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    9. Re:Firestarter by mqduck · · Score: 1

      Er, I don't get it. It acts just like it should... What, exactly, am I missing?

      --
      Property is theft.
    10. Re:Firestarter by BlueMonk · · Score: 1

      XML:
      <foot-shot>
      <Leg side="left"><foot /></Leg>
      <Gun id="1" type="colt" />
      <Bullet GunId="1" />
      </foot-shot>

      "Whaddya mean I can't shoot without XSL? Aw fine..."

      XSL:
      <xsl:for-each select="/foot-shot/leg/foot">
      <xsl:shoot with="/foot-shot/Bullet[GunId='1']" target="." />
      </xsl:for-each>

      "Whaddya MEAN xsl:shoot is a Microsoft-specific non W3C XSL extenstion!?"

    11. Re:Firestarter by p3d0 · · Score: 1

      It's not that it demonstrates a bug in the shell; rather, this is the perfect example of shooting one's self in the foot. A single extra character (and an invisible one at that) changed the meaning of the command such that it wiped out all of someone's files.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    12. Re:Firestarter by Anonymous Coward · · Score: 0

      The UNIX was by far the best. It felt like watchin a comedy!!!!

    13. Re:Firestarter by Mike1024 · · Score: 1

      Access: You try to point the gun at your foot, but it shoots holes in all your Borland distribution diskettes instead.

      I would like to suggest an update:

      Access: You try to shoot your foot by using your hand to trigger the gun, but find that the shoot function cannot access the foot. You find a gun that you can shoot with your foot, and shoot yourself in the foot. Both your feet simeltaniously become shot, because all instances of foot are using the same properties.

      And yes, I am bitter.

      --
      "Goodness me, how unlike the FBI to abuse the trust of the American public." -- The Onion
    14. Re:Firestarter by pjp6259 · · Score: 1

      Can you give more details? Is there some kind of invisible space between the * and the .o?

      --
      Computers don't make mistakes. What they do, they do on purpose.
    15. Re:Firestarter by p3d0 · · Score: 1

      Are you serious?

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    16. Re:Firestarter by LordNimon · · Score: 1

      I think he is. God, I feel sorry for him.

      --
      And the men who hold high places must be the ones who start
      To mold a new reality... closer to the heart
    17. Re:Firestarter by Crazy+Eight · · Score: 1

      Copy and Paste the `rm' text into a terminal window. I didn't read the space at first either.

    18. Re:Firestarter by Reziac · · Score: 1

      ROTFL!!

      XML: what happens when you put RTF and HTML in a blender!

      --
      ~REZ~ #43301. Who'd fake being me anyway?
    19. Re:Firestarter by Anonymous Coward · · Score: 0

      Python: You go to the online docs and proceed to shoot yourself in the foot 10 times as fast as you could with any other programming language.

    20. Re:Firestarter by Reziac · · Score: 1

      I never used Access, but have heard it described as "nothing but a big macro engine". Maybe its real purpose is to generate endless loops of foot -- in its own mouth :)

      --
      ~REZ~ #43301. Who'd fake being me anyway?
    21. Re:Firestarter by Anonymous Coward · · Score: 0

      Instead of just feeling sorry please explain.

      I cut and pasted in case the font in my browser was making the space too small, and I still just see rm *.o

      What am I missing, it acts like the user typed
      rm * .o, but I don't see a space between the * and the .o

      If there is something I'm missing please point it out. I'd hate to accidently delete all my files.

    22. Re:Firestarter by LordNimon · · Score: 1

      There is a space between the "*" and the ".0" in the original post. I can select it with my mouse.

      --
      And the men who hold high places must be the ones who start
      To mold a new reality... closer to the heart
  11. What I Hate... by larry2k · · Score: 1, Funny
    Perl programmers like punctuation. Python programmers like indentation. Every programming language has its own syntax, stemming from its philosophy

    And emacs handles all of this...

    --

    The package said "Windows XP or better. Pentium Class Processor or better"... So I got a Mac with OS X

    1. Re:What I Hate... by Anonymous Coward · · Score: 0

      Emacs isn't a programming language, its an editor.

      Stoopid noob

    2. Re:What I Hate... by Bush+Pig · · Score: 0

      I don't much care for Emacs, either (seeing as we're gearing up for a flame war here).

      --
      What a long, strange trip it's been.
    3. Re:What I Hate... by standsolid · · Score: 1
      And emacs handles all of this...

      Emacs handles all of these, but vim conquers then.... and it's 100 times better at it too
      --
      WTPOUAWYHTTOTWPA
      What's the point of using acronyms when you have to type out the whole phrase anyways?
  12. The programming language of future.. by Anonymous Coward · · Score: 0
  13. I hate by AvitarX · · Score: 4, Insightful

    I hate all your programming languages because they arn't just a .wav file of my dictating what I want it to do.

    PS.
    I don't program for a living

    --
    Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    1. Re:I hate by GlassHeart · · Score: 2, Funny

      I hate .wav files. They're so inefficient.

    2. Re:I hate by bbc22405 · · Score: 2, Funny

      I wonder why he didn't pick AAC or Ogg Vorbis. What a doof. :-)

    3. Re:I hate by Anonymous Coward · · Score: 0

      That much was pretty easy to figure out... people like you are why programmers have miserable lives. "Well, I just want it to WORK RIGHT!" What's the "right" way? What should it do in this situation? What about in the other one? What about all those special cases you didn't think about? People like you have no idea of the hell you put us through!

    4. Re:I hate by sean23007 · · Score: 1

      .ogg would be better. Jeez.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    5. Re:I hate by Anonymous Coward · · Score: 0

      > I hate all your programming languages because they arn't just a .wav file of my dictating what I want it to do.

      Only Bill Gates gets to use that programming language... He compiles it with his super-compiler... Microsoft.

    6. Re:I hate by Cipster · · Score: 1

      I suspect he possibly talks to girls....

    7. Re:I hate by gr8_phk · · Score: 1
      I've often considered the problem in that way. The means of telling the computer what to do (programming) needs to be similar to the way you tell a programmer what you want the computer to do. Or as an intermediate step, how a programmer tells another programmer what the computer needs to do. This means verbal explanation (perhaps written), diagrams, whatever. I suspect it also means a very smart machine - what AI was supposed to be before they gave up and redefined it as pattern matching. Many challenges to this approach, and I suspect if you had such a machine, the last thing you'd have it do for you is create programs ;-)

      With the rendering equation solved, I may want to revive my interest in AI for the second half of my life.

  14. At the end of the day... by gilesjuk · · Score: 3, Interesting

    Produce a language without some rules and you would end up with even messier code.

    I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

    1. Re:At the end of the day... by EvanED · · Score: 4, Funny

      >>I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

      I'm not sure if that would help... how many "// fucking compiler requires this" comments would you see?

    2. Re:At the end of the day... by elmegil · · Score: 4, Funny

      /* this is the mandatory comment */

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
    3. Re:At the end of the day... by flippet · · Score: 2, Insightful

      I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

      Better would be languages which are self-documenting... you don't need to read the comments because the purpose is clear anyway.

      Class or package specifications are an improvement over having to plough through masses of functions; there are bound to be methods of making plain code easier to read in the specification of the language too.

      Phil

      --
      "Cattle Prods solve most of life's little problems."
    4. Re:At the end of the day... by awb131 · · Score: 1

      >>I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

      Python *does* make comments part of the declaration of a class or function, though it's not required. Makes documenting things a bit easier, imho.

      --
      "There is no night so forlorn, no mood so bleak, that it cannot be infused with pleasure by tender meat..." - R.W. Apple
    5. Re:At the end of the day... by los+furtive · · Score: 4, Funny
      Yeah, my favorite of all time:
      /**
      *
      * Javadoc goes here
      */
      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

    6. Re:At the end of the day... by KrispyKringle · · Score: 1

      I think for the purpose to be that clear, the language would be impossibly verbose. Hard as it is to learn what amounts, often, to nearly another language or form of expression and to master the syntax of a new language, when you get down to it that abbreviated syntax, with every semicolon or parenthesis or bracket having meaning, is far more efficient in accurately expressing your ideas. That is why "psuedocode" tends to be far more verbose and far less precise than the actual code; while it is more human-readable, it in and of itself is not code and could never be understood by a machine due to its lack of precision.

    7. Re:At the end of the day... by xdroop · · Score: 4, Insightful
      Better would be languages which are self-documenting... you don't need to read the comments because the purpose is clear anyway.

      I think that this won't happen, partially for Mr. Kringle's comment above, but mostly because there is a difference between what you do and why you did it (and again from why you didn't do it a different way). You can see function, but you can't necessarilly see the intent of the programmer. There are many times in my programs where a single line (often, less than 10 characters long) will result in several lines of comments explaining why it is done that way. That way, the poor boob who inheirits the job of extending/fixing the program (who is usually me) has a fighting chance of figuring out my intent, not just my procedure.

      --
      you should read everything on the internet as if it had "but I'm probably talking out of my ass" appended to it.
    8. Re:At the end of the day... by L7_ · · Score: 1

      /* this post was here */

    9. Re:At the end of the day... by larry+bagina · · Score: 1

      check out literate programming (WEB, CWEB, etc).

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    10. Re:At the end of the day... by RevAaron · · Score: 5, Interesting

      Smalltalk is quite self-documenting. I'm sure most C/C++/java/Perl/Python programmers think you're joking when you talk about a "self-documenting language," but they're real.

      A simple langauge plus a decent code browser can equal a self-documenting language. Methods are organized into logical groups (e.g. "accessing" "initialization" etc), and clicking on a category will tell you the methods there. Especially when there is a tradition for short (7 lines or less is the rule) methods, as in Smalltalk- you can usually see what the entire method is doing just by looking at it, if you cannot guess at what is is for by looking at the name.

      People may think this is an exageration, especially if they're used to systems that require various man pages, books, and on-line class lib references just to write some code. Other than one book on Smalltalk style, I've not read any books on Smalltalk. I read some tutorials when I began, but after you learn the basic syntax [1], the very basic ideas [2], and especially, how to browse classes, you learn as you go, finding out classes to use as you need them.

      [1] All of Smalltalk's syntax can be summarized as-
      a := 1. ":= is assignment"
      obj + 2. "a binary message"
      obj methodName. "a unary messsage"
      obj methodName: argument. "a keyword message, unlim keywords"
      [ :a :b | a + b ] "block creation- a block closure, aka anonymous subroutine"

      [2] You don't even need to know anything about OOP or OOA/D- simpyl the rudiments of *object-based* programming... simply understand that an object is a chunk of data that can do certain things.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    11. Re:At the end of the day... by Magura · · Score: 3, Interesting

      The University I used to teach at designed and implemented their own OO teaching language that did enforce comments as well as invariants (pre and post conditions on methods).

      99% of the comments and invariants were just what the parent described. Sure, as markers we should have bounced more code back to the students, but heck, sometimes we just agreed with them!

    12. Re:At the end of the day... by inkedmn · · Score: 1

      I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.
      "Traceback (most recent call last): class Foo(Bar): CommentException: comment character length quota not met"
      nah, THAT wouldn't decrease productivity...

      --
      well, it's nothing one behind the ear wouldn't cure
    13. Re:At the end of the day... by Snork+Asaurus · · Score: 1
      I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

      I fully agree with you. Likewise, I wish Slashdot would force the posting of only informative, insightful, or (at least) humorous comments. Alas, although both wishes are highly desirable, the fulfillment of either wish, let alone both, is highly unlikely.

      --
      Sigs are bad for your health.
    14. Re:At the end of the day... by jcast · · Score: 1

      I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

      ELisp (at least) has this (although it's not required). The comments are even (usually) pretty good. That probably comes from having a tyrant like RMS as the program maintainer, though.
      --
      There are reasons why democracy does not work nearly as well as capitalism.
      -- David D. Friedman
    15. Re:At the end of the day... by edlong · · Score: 1

      'Forcing indentation' is a crazy reason to pick a programming language. You use 8 spaces, I use 4, 1 tab, 2 tabs, 3 tabs a lady...... Any good IDE will format your code, not just the indentations the way you want. ie:
      for (....) {
      or
      for (....)
      {
      etc.

    16. Re:At the end of the day... by WolfWithoutAClause · · Score: 1
      At university, I took a course in pascal, with an instructor that was fairly heavy on good style, adding comments, sensible names etc.

      Anyway, I made a point of making almost completely no comments at all. Every single time I would get back 'more comments'. Funny thing was, I still got a 1st on the course overall.

      The trick was, my code was incredibly well structured, all of the variable names actually did what they said- the code was extremely readable, it read like english.

      However, now I'm older and probably dumber, and besides I have to work with other peoples crappy variable amd function names. I now find it is a really good idea to comment each paragraph of code. I find that putting in the comments mean I have to read the code through, and I find a lot of bugs that way (a sort of self code inspection.) So perhaps the instructor was right, but it took me maybe 10 years to get to this point; and I was working on up to 350,000 lines of code or so before it made a big enough difference.

      --

      -WolfWithoutAClause

      "Gravity is only a theory, not a fact!"
    17. Re:At the end of the day... by mccoma · · Score: 2, Interesting

      An OO teaching language called Blue actually did require comments. It did have an interesting version of enumerators.

    18. Re:At the end of the day... by Anonymous Coward · · Score: 0

      Requiring comments is not feasible. In fact, it's almost silly. Look at what people do when they're testing their app after making a code change:

      *First Name:[ ]

      *=required field

      and what do you do? asdfadsfasdfasdf

      what's to stop programmers from doing the same?

      Most programmers presume their code is good. In fact, they think it's good enough they don't have to comment it and all which really matters is whether it runs (or not). There are some important thoughts: 98% of the people who write code have no business doing so. They think it's "kewl" to write code. Also, bad coders can write poor code faster than good coders can write good code and they can write bad code faster than good coders can fix the bad coders' code.

      Ever get pulled into a small business which had a single coder and you have to make mods to the existing code? You can almost picture the coder being there with you and after awhile, begin profiling their coding expertise as well as their real-life personality. Before long, it becomes, "What was this fuckhead thinking?" "How could they have allowed this guy to do this?" Then you realize the big problem: The existing code already runs (God only knows how) and you have to get those mods done. You throw an estimate to them so you don't overwhelm them with a huge bill - think about trying to tell them an air strike should be called in and the code rewritten from the ground up. So you give them an estimate with a small quantity of padding and get to work. Because you're shoehorning the mod into the status quo, you'll likely find yourself eating some hours to actually accomplish this feat.

      I had a job a few years ago where the company consisted of ten contractors and were being billed out at $125(US)/hour. That's not a bad fee for walking in, tuning/optimizing, writing a few reports, maybe some simple tutorials, stints of an hour or two, visiting all of "your regular clients" once every week.

      Now, ponder providing programming services at $125/hour. It's not always horrible if it's somethng small which you can crank out pretty easily. Think about "someone else's client" (after all, you do coding back in the office with a door, a big window, wearing shorts, and have a tv and stereo. Most of the rest of the people are the "out-in-the-field people." So this "other guy's client" (this "other guy" can be called "Brent") Brent wrote a program for a client which is suddenly not working. If the SATs had a section for programming, Brent would have scored a 4. His primary method of coding [and fixing bugs] approximates trial-and-errors; in fact, it almost falls into the category of the six million monkeys using six million typewriters to start writing Shakespeare. Brent's code has no error-checking -handling, (first, because he doesn't know how to do it; second, because if you confront him with it, he'd explain that messageboxes popping up would frighten the client because they'd think something was terribly wrong with their PC. So his code is littered with "On Error Resume Next" to ensure users never see errors.

      You're not totally hosed yet. This sits out on a manufacturing floor, in production. So you're limited to doing whatevre you're going to do before they open in the morning, after they close at night, or during some common break which provides a lull in the action.

      Company rules require source code to be installed alongside the executable at every client office. Guess what? If you think this adds to your "I'm hosed" total because the source is there (whew) but it won't compile, add 1 point. You go back to the office and find it's not on the company network. (Those who believe we've been told a copy of all source is supposed to be on the network but know this is a "I'm hosed" and this means it's not there, add 1 point).
      Your last chance. You corner Brent, hoping he's got current source (for some reason). Nope. It's on the client machine & the company network. And he's a bit peeved because the client is wondering when their changes will get applied and when things will begin working again.

      Now you know why 98% don't belong.

    19. Re:At the end of the day... by Bastian · · Score: 1

      Probably about the same as number of notes in my RCS-files that just say, "fucked with it" or "blah". Which is about 99%.

    20. Re:At the end of the day... by Anonymous Coward · · Score: 0

      or perhaps: /**/

    21. Re:At the end of the day... by Ed+Avis · · Score: 1

      At university I was once given an assignment to write two functions; what the functions should do was clearly specified in the assignment, and even how they should do it. (I think it was two different ways to calculate Fibonacci numbers, or something like that.)

      Obviously I didn't put a comment at the top of the two functions, because what they did was exactly stated in the spec I had been given, and the names of the functions (and a comment at the top of the file) made it clear that they implemented the spec. So an extra comment was not needed. But I still got marked down for not having one.

      Moral: programming assignments often aren't marked on what is the most sensible thing to do in this case, but on what would be the most sensible thing if this code were part of some imaginary 'larger project' that you know nothing about. Similar remarks apply to global variables, which can be the simplest and clearest way to do things in small programs but get awkward in other ones.

      --
      -- Ed Avis ed@membled.com
    22. Re:At the end of the day... by rpjs · · Score: 1

      I want a language that doesn't just force the use of comments in code, it forces one's cow-orkers to ACTUALLY FSCKING READ THE FSCKING COMMENTS before working on the file.

      Grr.

    23. Re:At the end of the day... by Hognoxious · · Score: 1
      So this "other guy's client" (this "other guy" can be called "Brent") Brent wrote a program for a client which is suddenly not working.
      I have met several Brents (I call them Freds), and been tasked with cleaning up the mess thay made.

      The bit I would add to the scenario is this: Fred is still in the company, but he's too important and busy developing new stuff to stoop to maintenance, of course. You might get a one word answer to a query after a week or so, but only if you threaten violence. Every time there's a fault in one of his programs, and you can't find why, the luser/project mangler etc says, in a whiny voice, "well Fred knows all about it", the implication being that Fred's smart and you're thick. No wonder you're only a maintenance jockey, eh?

      Fred knows how to fix it, of course he does he's the jerk who caused the problem in the freaking first freaking place with his cut and paste, uncommented, undocumented shite.

      As an analogy that PHBs might understand, take two car mechanics, and ask them to fix an engine. The one who set the points wrong is going to know they need adjusting, but you wouldn't consider him a better mechanic than the other poor sap who has to find the problem first.

      If the SATs had a section for programming, Brent would have scored a 4.
      Not familiar with the colonial school grade system, could you explain, old chap? Are you saying he'd score high (because he's quick & dirty) or low (because he's quick & dirty)?
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    24. Re:At the end of the day... by Anonymous Coward · · Score: 0

      Python gives you docstrings, which are available through the interactive help system (and good IDEs); Any string on the line immediately following a class/function definition will be taken as documentation about what the object's intended uses are.

    25. Re:At the end of the day... by AlecC · · Score: 1

      You have got the cart before the horse. If you have got your code right, the IDE will then prettify it so that indentation matches what you said, not what you meant. The point of forced indentation is that indentation is what you meant, and the compiler had better do that.

      --
      Consciousness is an illusion caused by an excess of self consciousness.
    26. Re:At the end of the day... by AlecC · · Score: 1

      Furthermore, there is always implicit information which doesn't appear in the code. For example ((today >= MONDAY) && (today could always bundle that up into bool iaAWeekDay(today), but that can sometimes make the code awfully bitty, because if you want to see what that means you have to hurtle off somewhere else to see what the implementation. OK, the IDE sould take you there, but is still breaks your train of thought.

      Can I put in a vote here for Folding Editors? Make a fold out of that expression, so you normall read the comment "today is a weekday" but are 1 click/keystroke from the expansion. It is my experience that extensive use of "explicit" folding (as JEdit puts it) plus doxygen forces all the comments you could reasonably ask for.

      --
      Consciousness is an illusion caused by an excess of self consciousness.
    27. Re:At the end of the day... by Wastl · · Score: 1
      I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

      Haskell does, sort of, using its strict type system. In very many cases, you can guess the meaning of a function simply by looking at the types of its arguments.

      Sebastian

    28. Re:At the end of the day... by hey! · · Score: 1

      Perhaps you should try a literate programming tool?

      Of course, this wouldn't make you add comments, but it changes the process of programming from one of writing code and decorating it with documentation to one of writing documentation and decorating it with code.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    29. Re:At the end of the day... by Anonymous Coward · · Score: 0

      We need a language that forces up-to-date comments. Otherwise reading the fscking comments becomes more confusing than not reading them at all...

    30. Re:At the end of the day... by Christianfreak · · Score: 1

      Perl/C/C++/Java/Python can all be self-documenting if the programmer chooses to do so. The problem is poorly trained programmers and the proliferation of bad code on the Internet :)

    31. Re:At the end of the day... by Grizzlysmit · · Score: 1
      Smalltalk is quite self-documenting. I'm sure most C/C++/java/Perl/Python programmers think you're joking when you talk about a "self-documenting language," but they're real.

      I find any well formated C/C++/Perl or any other language I know well (except maybe Basic), self documenting, the secret is becoming sufficiently familiar with the language to read it like your natural language. This works for me with any of the more than 20 languages I use.

      --
      in my life God comes first.... but Linux is pretty high after that :-D
      Francis Smit
    32. Re:At the end of the day... by RevAaron · · Score: 2, Insightful

      Perhaps that (bad code available everywhere) is part of it... but a big part, perhaps more important, is the environment. Most programmers think an IDE is something that gets in the way, or simply gives you a hotkey for running make. With Smalltalk (or Lisp, Dylan and other languages with a badass IDE), the IDE very much contributes to this self-documenting aspect. Hell, I'd go so far as to say that a well-done IDE is 50% responsible for making a language self-documenting. Most of the rest if a simple language with sensical stylistic traditions.

      But yeah, it certainly doesn't help when people simply download packages written by others which are poorly done. Especially when both the the interface/API is bad and the code is messy, no good.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    33. Re:At the end of the day... by seniorcrown · · Score: 1

      If Smalltalk is written in a pure OO style with many very short methods, then it can be a nightmare to read. This is because it's very difficult to see the "big" picture when all you have are many classes with lots of methods each of which tells you very little about the overall flow of the program.

    34. Re:At the end of the day... by p3d0 · · Score: 1

      It doesn't matter how good your names are; they can only describe what a thing is or what it does. You need comments to describe why.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    35. Re:At the end of the day... by Christianfreak · · Score: 1

      While I agree with you in principle, the biggest problem with IDEs is that not everyone uses the same one and often code from one gets mangled in another. Case in point I use VIM (and you can take it away when you pry it from my cold dead fingers :) ) while a programmer I work with uses something called 'PHP Coder' on Windows. His code is all nicely layed out on his screen but if I open it in mine things get jumbled, something to do with the way his IDE handles tabs.

      Point is, good programmers are the ones that take the time to learn how to code well on their own without the help of an IDE.

      As for reusing other people's code, I think that's a case by case basis. Sure there is bad code out there but there is also a lot of good code as well and my original point was about learning from bad code (i.e all the Perl programmers that learned stuff from Matt's Script Archive) rather than using it because it serves a particular purpose. I don't know how many times I've been coding in Perl and CPAN saved me tons of time. Not that one should just blindly use code (it should always be tested) but one shouldn't automatically set out to re-invent the wheel either.

    36. Re:At the end of the day... by ENOENT · · Score: 1

      And then, when you go back to maintain the code, you need to totally disregard any comments in it, as they are usually out-of-date or just plain wrong. Now, if the compiler would validate all of the explanations in comments, that would be something.

      --
      That's "Mr. Soulless Automaton" to you, Bub.
    37. Re:At the end of the day... by gilesjuk · · Score: 1

      I do something like this already, when writing a script or simple program I enter the pseudo code into the file as comments and then work on a line at a time.Saves you forgetting anything.

      I also tend to work at code from both ends (ie. start at the top of the function code and bottom). Then you don't forget to close things. I always create both curly braces when doing an conditional statement, no need to count them up later on. I'm sure other people have similar tricks.

    38. Re:At the end of the day... by p3d0 · · Score: 1

      Sounds kind of like Eiffel's Design by Contract. Contracts are something like comments that can be evaluated at runtime to make sure they are true.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    39. Re:At the end of the day... by WolfWithoutAClause · · Score: 1
      No, I don't think your code should say why- that is what the documentation is for. If you say why, then the code may be eroneous when somebody starts using your function for something else, or changes are made elsewhere.

      I think it should clearly say what and to some extent how it is doing what it needs to. And it needs to be quite local, and include any significant gotchas, non obvious connections out to other places in the code, that sort of thing.

      --

      -WolfWithoutAClause

      "Gravity is only a theory, not a fact!"
    40. Re:At the end of the day... by p3d0 · · Score: 1
      No, I don't think your code should say why- that is what the documentation is for. If you say why, then the code may be eroneous when somebody starts using your function for something else, or changes are made elsewhere.
      Frankly that seems intentionally dense to me. You ovbiously don't put comments in a function stating "why" callers should call it, or "why" they should use it. The comments should state "why" you chose to do a thing a certain way.

      For example:

      void removeDuplicates(ItemList items){
      int i;
      sort(items);
      /* now any duplicate items must be adjacent, so we can find them all just by checking adjacent pairs */
      for(i=0; i < items.length; i++) if(items[i] == items[i+1]) remove(items, i+1);
      }
      Without the comment, someone might not know why you're only checking adjacent pairs of items. This kind of comment is what I was talking about, and it suffers from none of the problems you mentioned.
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    41. Re:At the end of the day... by WolfWithoutAClause · · Score: 1

      That kind of comment is more of a what you are doing to remove duplicates, rather than a why. I don't have any problem with that comment, it's an excellent comment. But if you had added a comment to the insertItem function to mention that they needed to be sorted so that the removeDuplicates worked properly, then that's not right, that's what documentation is for.

      --

      -WolfWithoutAClause

      "Gravity is only a theory, not a fact!"
    42. Re:At the end of the day... by p3d0 · · Score: 1
      That kind of comment is more of a what you are doing to remove duplicates, rather than a why.
      Oh brother. Well, if you find it useful to put this comment (which we both agree is useful) into the same "what" category with comments like the one below, then that's your business:
      /* add 1 to x */
      x = x + 1;
      However, to me, the "what" versus "why" distinction is both clear and useful. The comment I gave describes "why" the code works.
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    43. Re:At the end of the day... by jacksonai · · Score: 1

      Comments are for weenies. As the old saying goes, "Since it was hard to write, it should be hard to read and understand." Well, something like that.

      --
      Like Sweepstakes? Try out my service @ http://www.yourpowersweeps.com -- Free 21 day trial, no cc needed.
    44. Re:At the end of the day... by Suidae · · Score: 1

      that's what documentation is for.

      Documentation? You document your source files? My comments explain what the code is *supposed* to be doing, and if necessary, why it does it that way. If you want to know what is *actually* doing, read the code.

      I generally run around 1:3 comment line to non-trivial code line ratio. Most people find that excessive, but I find it helps with maintainability. When I come back to a routine in 6 months because a user has reported a bug, I can scan the comments to get a very quick idea of what is going on. I find bugs much faster that way, and I always update the comments to reflect what the code is doing.

    45. Re:At the end of the day... by Inthewire · · Score: 1

      Agreed. I probably over-comment, but I don't want to have to spend the time relearning the problem domain - I just want to read a comment that explains WHY the code exists. The code explains what and how quite nicely.

      --


      Writers imply. Readers infer.
    46. Re:At the end of the day... by Inthewire · · Score: 1

      My guy wrote a program that runs all the time.
      If it chokes and dies production grinds to a halt.
      So he wrote another program that checks to see if the first program is running.
      If it isn't, well, restart it.

      The best part of working in a high rise is fantasizing about throwing people out the window.

      --


      Writers imply. Readers infer.
  15. He likes JavaScript??? by ajiva · · Score: 1, Interesting

    He likes JavaScript, but hates something about all other languages? Most of his complaints are just plain nonsense. Want regex in Java, well upgrade then! Upgrade to the latest compilers/bug fixes. He doesn't like the way Perl syntax LOOKS like??? He's not all that good looking himself! Most of his complaints are overly simplistic, and full of fluff. There are much worse things to complain about languages, besides syntax, and inappropriate usage.

    1. Re:He likes JavaScript??? by kervel · · Score: 2, Insightful

      i disagree. he did not complain about the lack about regexes in java, he complained about the fact the interpreter and standard library are one big package.

      also i think he correctly talked about 3 key issues: syntax, usage, and extra features (libraries/tools). what's important about a language besides that ?

    2. Re:He likes JavaScript??? by Anonymous Coward · · Score: 0

      Agreed. This guy is probably some teenager who thinks he knows how to program. My advice: go to school for a couple years, work in industry for a couple years, then make your analysis.

    3. Re:He likes JavaScript??? by notfancy · · Score: 2, Insightful

      JavaScript is a really nice language. For starters, Waldemar Horwat sure knows his stuff. He seems to give a lot of thought to new features before introducing them (check out the project page) and has managed to write an interpreter that can be configured to accept varying language versions (as in language="JavaScriptXXX"). Then, the whole idea of a prototype-based object-oriented language becoming mainstream should have made the Self team green with envy. It supports very powerful constructs, like dynamically attaching behavior to built-in objects via __prototype.

      Besides, JavaScript inconsistencies between browsers is mainly a DOM issue, not a language one. Chromatic should have blamed the browsers, not the language.

    4. Re:He likes JavaScript??? by moof1138 · · Score: 4, Insightful

      It is easy to rip on an article with the sort of vacuous criticisms you fired off, but you really did not address a single real issue in the article. First off, you make it sound like he is advocating JS, which in reading the article is clearly not the case.

      Secondly, covering your criticisms:

      When he said that working with anonymous structures or structures by reference can be ugly, you interpreted 'ugly' as 'looks like.' But the ugliness in 'my $count = keys %{ $self->{groups}[HACKERS] };' is ugly in more than just looks.

      The poster above already pointed out your gross oversimplifications regarding Java.

      Finally, your point that "there are much worse things to complain about languages, besides syntax, and inappropriate usage," is correct, and the article itself does just that.

      In short, your analysis is overly simplistic, and full of fluff.

      --

      Hyperbole is the worst thing ever.
    5. Re:He likes JavaScript??? by los+furtive · · Score: 1
      What I both hate and like about javascript (btw, all the spaces are thanks to the kind folks at /.:
      document.forms["formName"].elements["elementName"] .value;
      document.formName.elementName.value;
      doc ument.forms["formName"].elementName.value;
      docume nt.formName.elements["elementName"].value;
      eval(" document." + formName + "." + elementName + ".value;");
      document.getElementById("elementId"); //okay, so not quite the same

      You'd think it was perl there are so many ways to do it, and people are rarely consistent.

      One other beef about javascript. Say you have an array of checkboxes, but it's possible that there is only 1 checkbox, then you are forced to check first if there's only one instead of checkboxes.length == 1 sigh.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

    6. Re:He likes JavaScript??? by chromatic · · Score: 1
      Chromatic should have blamed the browsers, not the language.

      Indeed, that's exactly what I did. I was really impressed to discover that JavaScript supports niceties such as closures and Self-ish prototypes.

    7. Re:He likes JavaScript??? by Bendebecker · · Score: 1

      optimization, non ambigious semantics, type checking (strong or weak), how OOP is implemented, and about a million other design issues (dynamic or static scoping, how well does it support recursion, how well does it handle ADT's, what about concurrency?)

      --
      There's a growing sense that even if The Future comes,
      most of us won't be able to afford it.
      -- Lemmy
    8. Re:He likes JavaScript??? by Phroggy · · Score: 1

      But the ugliness in 'my $count = keys %{ $self->{groups}[HACKERS] };' is ugly in more than just looks.

      Hell yes it is. The [HACKERS] part lost me; somebody wanna explain?

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    9. Re:He likes JavaScript??? by notfancy · · Score: 2, Informative

      A side note: I've seem to have commited the sin of misattribution. Waldemar Horwat is not the current driver (or a peer) of the JS module at Mozilla: Brendan Eich (the original author at Netscape) is. Mr. Horwat seems to have been one of the redactors of the ECMA standard, though.

    10. Re:He likes JavaScript??? by L7_ · · Score: 1

      i am not that great of a perl coder, but how are there many ways to do that?

      Using a hash, the syntax is:

      document{$formname}{$elementname}{VALUE};

      ???

    11. Re:He likes JavaScript??? by los+furtive · · Score: 1

      Of course you're right. I was aluding to perl's There's more than one way to do it philosophy.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

    12. Re:He likes JavaScript??? by Moonshadow · · Score: 2, Insightful

      Very true, and very good points.

      I used to -despise- Javascript...then I started hacking on Mozilla/Firebird extensions. Once I realized that it was the provided API (via the browsers) that was crippled, and not the langauge, I really came to love it.

      Of course, I still hate using it in webpages.

    13. Re:He likes JavaScript??? by Molt · · Score: 4, Informative

      I think you'll find this guy does know how to program.
      As well as being well-respected within the Perl community (And possibly other languages too) he's the O'Reilly technical editor, the author of their "Extreme Programming Guide" and the chief author of "Writing Weblogs in Slash".
      I have a feeling I may well have just been trolled, but I thought it worth dropping this here so people at least knew that this guy was not some random schoolkid knocking out half-formed opinionating.
      My advice: Do a little research before posting

      --
      404 Not Found: No such file or resource as '.sig'
    14. Re:He likes JavaScript??? by Molt · · Score: 1
      $self is a reference to an anonymous hash.
      $self->{groups} dereferences it into the actual hash and obtains the element with the key 'groups'.
      $self->{groups}[HACKERS] is saying dereference that element as an array reference and give me the element numbered by the constant I've called HACKERS.
      %{$self->{groups}[HACKERS]} now says that that is itself a hash reference, and dereferences it back to the hash.
      keys %{$self->{groups}[HACKERS]} returns a list containing the names of all the keys in this hash.

      ..and finally..


      my $count = keys %{ $self->{groups}[HACKERS]}; takes this list and stores the number of elements in the list into the lexically-scoped variable called $count.

      Perl's references are like the Hulk. Powerful but ugly.

      --
      404 Not Found: No such file or resource as '.sig'
    15. Re:He likes JavaScript??? by Mr.+Piddle · · Score: 1

      JavaScript is a really nice language... ...with a crappy standard library?

      --
      Vote in November. You won't regret it.
    16. Re:He likes JavaScript??? by BZ · · Score: 2, Interesting

      This is all DOM, not Javascript. As in, you have a document object, some properties on it, form objects, element objects, reflected into JS. The actual syntax is JS. But the fact that document.forms["formName"] is the way you get a form is DOM, not JS. All the JS is doing is getting the "formName" property of the object that was returned when you got the "forms" property of the "document" object.

      So my conclusion is that you have never done any real programming in JS as a general-purpose language, instead of just using it as an interface to a browser DOM.

    17. Re:He likes JavaScript??? by los+furtive · · Score: 1

      So my conclusion is that you have never done any real programming in JS as a general-purpose language, instead of just using it as an interface to a browser DOM.

      Those are pretty strong words ;-) You're right, my earlier beef was about the DOM (although the checkbox/array beef wasn't). I'll admit that most of my javascript coding revolves around the browser DOM, but I've written a calendar app that was a lot more than that. Anyways, that's for the feedback and the insight.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

    18. Re:He likes JavaScript??? by Troll_Kamikaze · · Score: 1

      I think you'll find this guy does know how to program. As well as being well-respected within the Perl community...

      Run that by me again?

    19. Re:He likes JavaScript??? by Anonymous Coward · · Score: 0

      How can the interpreter and the standard library be one big package if you can plug in another JIT compiler?
      For me it seems the author has no clue about Java. For instance he mentions he is not able to let exceptions propagate to the top. This is nonsense. Of course one will need to add every thrown exception class to the "throws" statement but IMO that is a Good Thing.
      Also one can get regexp support for all the older Java versions. Not from Sun but from other vendors (GNU, Apache, ...). On the one hand people complain that the standard library grows with every Java version and on the other hand someone always wants something else to be included...

    20. Re:He likes JavaScript??? by notfancy · · Score: 1

      JavaScript is a really nice language... ...with a crappy standard library?

      The DOM is not really a JavaScript "library", but is part of the browser API exposed via JavaScript bindings. You could say that what has a crappy library actually are the browsers. The JavaScript "library" is comprised of the intrinsic objects: Number, String, Boolean, Date, RegExp, and Math.

    21. Re:He likes JavaScript??? by Mr.+Piddle · · Score: 1

      You could say that what has a crappy library actually are the browsers.

      Considering that the implementations of JavaScript in wide use are embedded within the browsers, there really aren't many practical uses of JavaScript that ignores the DOM. Given the weakness of the DOM coupled with the commonly weak use of JavaScript on nearly every website that employs it, I generally feel that JavaScript has contributed little to the advancement of the WWW. It is useful for updating a form field here or there, but attempts at graphics, fancy widgets, and other gimmicks are counterproductive towards making the WWW accessible, usable, and efficient. JavaScript was really just a marketing ploy by Netscape, anyway, during the early browser wars. And Flash...lets not even talk about Flash...

      --
      Vote in November. You won't regret it.
    22. Re:He likes JavaScript??? by rycamor · · Score: 1

      Completely agreed.

      I think it's unfortunate that Javascript has mainly been restricted to client-side browser programming. A good implementation of server-side Javascript would have made PHP an unnecessary exercise (in fact, that is reason I ended up using PHP). I know that Netscape servers and ASP support Javascript, but there is no real cross-platform implementation that I know of. How about a nice Apache module, hey? (Hmm... /me checks Google... and whaddaya know! Check out Whitebeam.org)

      But even better, Javascript as a generalized programming language would be very interesting, IMHO.

    23. Re:He likes JavaScript??? by Anonymous Coward · · Score: 0

      Very nice!
      Incredibly well informed rebuttal.

      You'll notice the perl-tarts here can't stand a
      perl atack and respond with the worst kind of
      character assassination and personality assaults
      but you'll survive.
      Rock on!

  16. Maybe he doesn't advocate a language, but ... by codefool · · Score: 2
    He does advocate a 'good text editor'.

    I suppose tastes are individual in all things, languages and editors alike...

    --
    "Stop whining!" - Arnold, as Mr. Kimble
    1. Re:Maybe he doesn't advocate a language, but ... by aster_ken · · Score: 1

      Indeed...

      That's the very reason I use Wine to get EditPad Pro to work on my GNU/Linux box. Before I switched to writing code for a decent platform, I was still using Windows software to do everything. I guess I just got so used to it that I felt... naked?... without it.

    2. Re:Maybe he doesn't advocate a language, but ... by Anonymous Coward · · Score: 0

      EditPlus is a great text editor for Windows (or Xfree86 using Wine). I prefer it to UltraEdit any day of the week.

  17. FlameRPL? by SHEENmaster · · Score: 2, Interesting

    If no one has heard of it they can't make fun of it. Until they realize that I haven't gotten around to loops in the released version yet :-)

    I think that varied languages are a necessity. It'll be better when .jar files can be executed from the console, J2dk for Linux/ppc version 1.4 is released, caffeine springs from trees, and C++ no longer requires the programmer to deal w/ pointers. Oh yeah, and all BASIC interpretters are dumped into Sol.

    --
    You can't judge a book by the way it wears its hair.
    1. Re:FlameRPL? by Anonymous Coward · · Score: 0

      Hey! Leave my pointers alone!

    2. Re:FlameRPL? by Anonymous Coward · · Score: 0

      java -jar myJar.jar

  18. Pretty limited scope by rpg25 · · Score: 4, Interesting

    I looked at this article, and I was disappointed by what a limited set of languages chromatic had examined. Where was Prolog? ML? Common Lisp? SNOBOL? Smalltalk? Dylan? All the languages in the article are in the class of "imperative languages with varying amounts of object-oriented gravy." If you're talking about how languages embody a philosophy, why stick to languages that pretty much embody the same philosophy, with some minor tail-fins and chrome as their differences?

    [I suppose that's some flame bait....]

    1. Re:Pretty limited scope by Anonymous Coward · · Score: 1, Insightful
      Not only a limited scope but a limited competency to be writing this article. His comparisons are very poor when they rely on his programming ability.

      "It's also worth asking how often the language gets in your way. I once wrote a program to send out update notifications when a web page had changed. My original program was a 10-line shell script running on a Unix box. For various reasons, the final version was several hundred lines of Java running on a Windows machine. Granted, my Java wasn't so hot, but the shell script just glued together existing Unix commands."

      If it takes you over a hundred lines of java code to check for a web page modifiation then you shouldn't be writing java or any other language for that matter.
    2. Re:Pretty limited scope by Anonymous Coward · · Score: 1, Insightful

      He also forgot (V)B... the language that no-one (at least in slashdot) admits to use but that majority of developers use.

    3. Re:Pretty limited scope by chromatic · · Score: 4, Informative

      I didn't list specific gripes about the languages you describe because I don't really have enough practical experience with them to analyze them well. I do discuss languages such as Lisp and Smalltalk in the analysis section though, just as you mention.

      Just to be fair, though, one of my gripes with Lisp is the idea that reducing all syntax to a Lambda form makes up for moving all the remaining complexity to built-ins and extensions. I certainly don't think in trees -- a little syntactic sugar is tasty. That doesn't make Lisp wrong; it just doesn't fit my brain as well.

    4. Re:Pretty limited scope by Usquebaugh · · Score: 2, Funny

      Haskell, you didn't mention Haskell. How can you mention Dylan, ML without Haskell.

      Eiffel, you didn't mention Eiffel. How can you mention Dylan, ML, Haskell without mentioning Eiffel.

    5. Re:Pretty limited scope by ddriver · · Score: 1

      My company's heart beat is vb/sqlserver. I admit it. But at home I run Linux and needed another language. I picked up on python and i have simce convinced my boss to start moving everyting except our production software to py!

      Unlike the majority of you highschoolers reading slashdot i make money with VB. Try to find a job programmng purl in OKC and you will need much luck.

      --
      I found my inner child, then I got caught abusing it...
    6. Re:Pretty limited scope by NetSettler · · Score: 4, Informative

      I looked at this article, and I was disappointed by what a limited set of languages chromatic had examined.

      Given the superficial and haphazard nature of the review, I was just as glad it didn't touch on those other languages. I really didn't get much of value out of the article and the only thing that would have been worse is an equally superficial treatment of my own languages of choice.

      And anyway, one person's opinion is just one person's opinion. It's a pity the author didn't attempt to do any kind of survey. Even an unscientific survey might have been more interesting and/or informative than this was. In its present form, there's no way to detect hints of incompleteness, idiosyncracy, bias, ... other than to incompletely, idiosyncratically, and in biased form say "well, here's something I noticed that I disagree with".

      I'm sorry if these remarks sound critical, but the entire article came across to me as flamebait and I'm not sure what positive quality I can draw from it. It started off as a nice idea--that language philophy can influence syntax or vice versa. But it diverged about halfway through from that to random, unmotivated jabs at this and that language and really ended up going nowhere with few, if any, useful takehome messages.

      Maybe I was also put off by the fact that the author's statement, that "Lisp is very much the lambda calculus". As a matter of history, several decades ago, it might have been reasonable to say that Lisp was "inspired by" ideas of the language calculus (though some might say "misunderstandings of the lambda calculus"), but the language was a whole is really enormously different than that now. It is often used as a teaching vehicle for esoteric things like the lambda calculus because other languages can't stretch that far, but mainstream Lisp does not look or feel much at all like the lambda calculus, any more than "modern music is very much that of Elvis Presley", however much his break from the past may have been a founding influence on modern music. This failed allusion injured the author's credibility with me within the article almost irreparably.

      --

      Kent M Pitman
      Philosopher, Technologist, Writer

    7. Re:Pretty limited scope by Anonymous Coward · · Score: 3, Funny

      And how can you mention Dylan without mentioning the Mamas and the Papas? How can you mention Dylan without mentoining Woodie Guthrie?

    8. Re:Pretty limited scope by radish · · Score: 1


      Miranda, you didn't mention Miranda. How can you mention Eiffel, Dylan, ML, and Haskell without mentioning Miranda?

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    9. Re:Pretty limited scope by __past__ · · Score: 1
      That indeed doesn't make Lisp wrong, mainly because that isn't what Lisp does. Probably you only know Lisp from some weirdo half-of-scheme course at uni or something, but I am heavily using lots of non-lambdaish constructs in my Common Lisp code, like destructive modifications of Arrays, Objects and Methods, etc. Believe you me, people who, say, try to explain variables in terms of anonymous lambdas are just showing off, nobody uses this in practice.

      The only part of Lisp where lists (and trees build of nested lists) play a vital role nowadays is manipulating Lisp programs, that indeed happen to be Lisp lists. I.e. Macros. Hard to call that a misfeature of Lisp, because about every language becomes a parse tree sometimes, it's just that Lisp allows you to do interesting things with that. Like, building your own kinds of syntactic sugar.

    10. Re:Pretty limited scope by RevAaron · · Score: 1

      Mmmm, Common Lisp.

      All the beautiful simplicity and elegance of Scheme's syntax, but with all the damned libraries of Java.

      I don't know about you, but I use lambdas all the time in CL and ISLISP coding. You'd be joking if you said (lambda (x) wasn't something any lisp prorgammer used plenty, although you are very right to say that practical Lisp programming sure as hell ain't "Intro to CS with Scheme"- #'loop does more than my swiss army knife.

      (and no, that's not a joke- i like the simple lisp syntax and having plenty of libraries at my command)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    11. Re:Pretty limited scope by RevAaron · · Score: 1

      I don't use VB. Ever.

      But then again, I do use REALbasic for making Mac OS 9, OS X and Windows apps on occasion. And I'm not afraid to admit it!

      For those who would like something like VB, but cross platform, Revolution a free-beer RAD tool compiles to Mac OS 9 and X, Winders, Linux, and oodles of other Unices. It's kind of like VB + HyperCard.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    12. Re:Pretty limited scope by RevAaron · · Score: 1

      Umm... what is the point of moving your code to Python if it isn't in production? I can see not moving *all* of your important code fo Python, especially if you've just picked up on it, but around these parts, anything that is used for anything real counts as production. :P

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    13. Re:Pretty limited scope by chromatic · · Score: 1

      I was a pretty new Java coder at the time, but it did far more than just checking date stamps on web pages. My biggest problem in those days (Java 1.1 had just come out) was finding a good SMTP library, though it took quite a lot more work parsing a simple text file of e-mail addresses in Java than it did in my shell script.

      In retrospect, "several hundred" is probably an exaggeration, though it was at least two hundred. I do count whitespace, inline comments, and javadoc, though.

    14. Re:Pretty limited scope by Molt · · Score: 1

      Where I work the term 'production' more or less qualifies to 'live client-facing systems'. Important but non-production code includes things like data conversion, log file analysis, and so on. The things that if they go wrong won't be noticed by the customer, and generally things where problems aren't quite as major since they don't result in a a live issue and can happily be fixed and re-run.
      By the sounds of it I'm in a similar situation as this guy. The place I work is primarily a Java place, but I'm a Perl programmer. I mainly do non-live things, although have done some things to handle some back-end live systems such as live database updates.

      --
      404 Not Found: No such file or resource as '.sig'
    15. Re:Pretty limited scope by Anonymous Coward · · Score: 0

      Unlike the majority of you highschoolers reading slashdot i make money with VB

      bahaha.. Yeah, I made money with VB, too.. But that was when I was in high school..

    16. Re:Pretty limited scope by Anonymous Coward · · Score: 0

      It sent out notifications of when the page changed. That's much more complex than simply checking whether the page changed. To whom do the notifications go? What kind of robustness and error-checking do you need to put in? If the notifications are email, and it's from the days before JavaMail was integrated into the JDK, then it's gonna be a lot of lines.


      Second, notice that the original leveraged Unix utilities, which are NOT AVAILABLE on most Windows boxes. To the extent that the Java version had to replicate the functionality of those utilities, then, there's a few more lines.


      Maybe you shouldn't be criticizing things before thinking about them clearly.

    17. Re:Pretty limited scope by Anonymous Coward · · Score: 0

      Slashdot programmers use Perl. It's really just the Unix visual basic, but somehow they make it perverted enough so that they can feel smart using it.

    18. Re:Pretty limited scope by Daniel · · Score: 1

      "Lisp is very much the lambda calculus"

      I suspect he was thinking of Scheme there. Even better is the bit a few lines down:

      I prefer dynamic typing and don't care much for the strong static typing found in C and its descendants.

      I'd have trouble calling C's type system "strong", personally.

      Daniel

      --
      Hurry up and jump on the individualist bandwagon!
    19. Re:Pretty limited scope by NetSettler · · Score: 4, Insightful

      I'd have trouble calling C's type system "strong", personally.

      Well, there's strong like Gandhi and there's strong like a bull in a china shop... The term is a bit vague and so I don't begrudge them its use as long as Lisp gets to use another.

      --

      Kent M Pitman
      Philosopher, Technologist, Writer

    20. Re:Pretty limited scope by Tom7 · · Score: 2, Insightful

      Maybe I was also put off by the fact that the author's statement, that "Lisp is very much the lambda calculus".

      Yeah, he pretty much lost all credibility with me there. Basically anyone who's used modern lisp knows that the language has mutated far beyond its initial inspiration by the lambda calculus. And, indeed, anyone who's studied the lambda calculus knows that lisp gets its static scope wrong--and in a language as minimal as the lambda calculus, that's enough to hardly make them related.

      The author seems to name drop functional and logic programming languages to make it seem as if he has programmed in more than just C-derived languages, yet what little he mentions indicates that he doesn't have more than a general knowledge that such languages exist. (Functional languages have no variables??)

    21. Re:Pretty limited scope by sinserve · · Score: 1

      > You'd be joking if you said (lambda (x) wasn't something any lisp prorgammer used plenty.

      You are right, we (I?) use lambdas to glue together code that is too simple or rarely used
      to become a named function, say as arguments to other functions (e.g. mapcar.) But no substantial
      body of code should remain un-named in a good program.

    22. Re:Pretty limited scope by rpg25 · · Score: 1

      I suppose I see the point. Of course the big advantage of reducing all syntax to an s-expression (not really a lambda form -- a lambda is a special flavor of s-expression) is that you can write non-trivial macros. No other language has as rich a macro facility as Lisp (and its dialects).

      XML has rediscovered the power of s-expressions. They just don't call them that, and for some reason seem to have confused the angle-bracket with the parenthesis. :-) Maybe it's so smileys work better...

      I'm with you in thinking that learning new programming languages is educational. I just think it's most educational to do ones that really change the way you think about solving a problem.

    23. Re:Pretty limited scope by rpg25 · · Score: 1

      OK, Haskell. And Eiffel.

      Reminds me of the old joke: "And to my nephew Irving, who always wanted to be mentioned in my will: 'hello, Irving.'"

    24. Re:Pretty limited scope by ratboy666 · · Score: 1

      "No other language has as rich a macro facility as Lisp (and its dialects)."

      Not true. Take SNOBOL4. Similar to LISP, only has
      a single statement. And, can emulate LISP quite handily (should you so choose). Has backtracking. And, the interpreter/compiler is available allowing the language to extend itself. Indeed, I would argue that, as a macro language, SNOBOL4 is lightyears ahead of Lisp.

      Ratboy.

      --
      Just another "Cubible(sic) Joe" 2 17 3061
    25. Re:Pretty limited scope by chromatic · · Score: 1

      Saying "s-expression" would have been much more accurate, thanks!

    26. Re:Pretty limited scope by Jeremi · · Score: 1
      If it takes you over a hundred lines of java code to check for a web page modifiation then you shouldn't be writing java or any other language for that matter.


      If you're that bad at Java, then you should absolutely be writing Java code. That's how you get better at it.


      (Writing articles about computer languages on the other hand... maybe not)

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    27. Re:Pretty limited scope by entrox · · Score: 1

      Yes indeed - Python even copies that feature (anonymous lambdas). Of course, Guido never took a straw from (Common) Lisp.. riiiight.

      --
      -- The plural of 'anecdote' is not 'data'.
    28. Re:Pretty limited scope by Degrees · · Score: 1
      Seriously. Where is RPG? If ever there was a language that deserved a "What I hate about...." ;-)

      (Note that I programmed in it 8 hours a day, five days a week for two years - so I might be a little biased)

      --
      "The most sensible request of government we make is not, "Do something!" But "Quit it!"
    29. Re:Pretty limited scope by ddriver · · Score: 1

      Not in production as in I work in a manufacturing facility. When we say production we mean serial number 123456789101112 (part number 2006-Tk) is in wip320 (double needle sewing). So what we mean when we say production is building our products. The other areas being Accounting/Purchasing, and systems support/integration which is where we use Python.

      I think that you were saying that from your perspective the software is the end product. From my perspective the end product is an automotive accessory. I don't make software, I help my company make the parts that we sell. There is a big difference.

      --
      I found my inner child, then I got caught abusing it...
    30. Re:Pretty limited scope by RevAaron · · Score: 1

      Perhaps not a substantial body of code, I agree on that being bad form. However, with functions like sort, mapcar, lambdas are neccesary and handy. And functions that aren't sort or mapcar as well. Granted, most lambdas I write are fairly short- but I'm of the mind that if you're have a lambda that is more than the equivalent of a line or two, you should put it all into a function, let's say #'fn, and then (lambda (n) (fn n)), but I guess that goes without saying. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    31. Re:Pretty limited scope by Anonymous Coward · · Score: 0

      Current CompSci pseudostandard usage is to split the issue into two orthogonal axes:

      Static: Variables are typed and compiler-checked (conceptually - doesn't always preclude RTTI)
      Dynamic: Things in variables are typed and runtime-checked (conceptually - doesn't always preclude compiler-optimisation)

      Weak: Typing is not strictly enforced
      Strong: Typing is strictly enforced.

      There is an older CompSci pseudostandard, whereby static typing was called "strong" and dynamic typing was called "latent" - but that proved too coarse-grained.

      So, these days, one has:

      Static Weak: C
      Static Strong: ML
      Dynamic Weak: Perl5 (just say no, kids!)
      Dynamic Strong: Scheme, CL (well, CL is "optional static")

      Languages like Forth and Assembly are a problem - some people call them "typeless", others "operator typed", since the types of operands are implicit in the operator applied.

    32. Re:Pretty limited scope by NetSettler · · Score: 3, Informative

      Static Weak: C
      Static Strong: ML
      Dynamic Weak: Perl5 (just say no, kids!)
      Dynamic Strong: Scheme, CL (well, CL is "optional static")


      Common Lisp (CL) is also optionally dynamic, in the sense that a declaration is considered to be what I guess would be called in law a "prima facie" case (rebuttable presumption) of truth.

      That is, if I say that X is an integer and the compiler cannot prove otherwise, it must believe me. That means it doesn't do either static or dynamic checking, and bad data can screw things up. But the power of this is that if the dataflow is such that it would be impossible for the compiler to prove the truth, I don't have to suffer with slow code (which I think outsiders naively assume I have to do when they hear "dynamic strong").

      If the compiler is very smart, of course, it is welcome to disprove any stated declaration--the CMU CL compiler does a great deal of work in this regard, and the resulting feel is very interesting. What's important is that the compiler is not required to do such checking, but it's allowed to do as much as it wants, so the language embraces ongoing/future work in proof technology in a graceful way, yet never changes the meaning of correct programs. It was very exciting to us as language designers to see CMU CL take this idea and run with it--the results are quite interesting, and I'd love to see more of this. One problem with static inference is that the langauge must be designed around the set of inferences that are within the scope of existing technology at the time of the language design; new static inferencing rules require new languages.

      Typically, in Common Lisp, one leaves in the dynamic checks that are not in performance bottlenecks, but does more careful by-hand data flow analysis in situations of critical performance and then declares things that one thinks the compiler might not easily deduce. The result is generally the best of both worlds--you aren't beaten down by making scads of unnecessary declarations in development, and you aren't held back from quite efficient programs in production. The main difference is that in C, every program is (at least superficially, ignoring issues of algorithmic complexity) efficient or you can't write it; in CL, you can write inefficient programs long enough to test them without fussing over tons of declarations that might never matter because you're just going to later discard the whole program. When you get to a program you're going to keep in CL, then you want to optimize it. But managers of CL programmers need to know to plan extra time at this point, rather than earlier in a project, or they will be surprised. If (just for seeing actual numbers) you assume that declarations double the time of any code-writing, and if you assume that the first phase of development costs time P (for "prototyping"), and the last phase of development costs time F (for "finalization"), and if you assume T prototypes are needed before finding the right prototype to finalize, CL will take P*T+2*F to develop a product, while C will take 2*P*T+F to develop a product. If you assume that P and F are roughly equal in time, or that T is large, then you can understand why CL programmers prefer not to write declarations. I don't raise these formulas to start a big advocacy dialog here, but merely to show that the shape of the development curve is different for the two languages; even if you disagree with my off-the-cuff formulas, if you agree that the languages have different formulas, you're seeing the real essence of what I'm saying.

      This is an example of something 'material' that a paper that talks about the relationship of 'syntax' and 'culture' should have addressed.

      --

      Kent M Pitman
      Philosopher, Technologist, Writer

    33. Re:Pretty limited scope by rpg25 · · Score: 1

      Another useful distinction, IMHO, is for whose benefit the typing is done.

      This can be seen when you compare C++ (and, pretty much Java), on the one hand, with ML on the other.

      C++ static typing is done for the benefit of the compiler. ML typing is done for the benefit of the programmer, specifically in order to help the programmer generate correct code. This is why the type language of ML is so rich.

      I had this unpleasantly brought home to me when I was a C++ novice (I never became an expert --- I just gave up! :->) and tried to use the C++ type system to ensure that one of my programs was typed semantically correctly, pretty much trying to replicate bits of ML-style typing in C++. Wooo. Not a mistake I recommend to others. The language just simply wasn't up to it.

  19. Two flame wars in one! by evronm · · Score: 5, Funny

    Anyone else noticed how, in the middles of the "my language is better than your language" flame war this guy was starting, he managed to slip in an editor flamewar by linking to vim?

    Truly brilliant!

  20. Java and the operator overloading.. by Steveftoth · · Score: 2, Insightful

    He complains that the Java philosophy says 'Operator Overloading is bad,' and still overloads strings. However I think that its the wrong way to look at the concept of operator overloading. Because adding operator overloading to a language is like giving the programmer the ability to change and mutate the language to her desires. In other words, giving a programmer the ability to overload operators, gives them the ability to create their own subset of a language. Similar to macros, operator overloading adds a whole new layer of complexity to what was supposed to be a simpler, easier to understand way of programming.

    1. Re:Java and the operator overloading.. by EvanED · · Score: 5, Insightful

      But, there are MANY times when operator overloading would make things sooo much easier. Which would you rather read:

      complex z1(0,1);
      complex z2(1,0);
      complex z3 = z1+z2;

      or

      complex z1(0,1);
      complex z2(1,0);
      complex z3 = complexMath.Add(z1, z2);
      ?

      (The second is still better than z3=z1.Add(z2) IMHO)

      I'll take the first any day.

    2. Re:Java and the operator overloading.. by pohl · · Score: 2

      It seems that complex math is always the example people pull out to support operator overloading. I've used complex math exactly once, when I was writing a fractal toy...that I didn't have operator overloading in Objective C didn't bother me. Are there any really compelling examples that don't resort to the tacit assumption that dealing with imaginary numbers is something all programmers deal with on a daily basis? I mean, talk about optimizing for an edge case.

      --

      The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

    3. Re:Java and the operator overloading.. by mongbot · · Score: 2, Informative

      Yes, there are many situations where operator overloading is essential to writing concise and readable code.

      * Streams. >> and graphically represent what is going on, and allow the chaining together of multiple elements.

      * Strings. + represents concatenation better than a "concatenate" method could. Even Java agrees.

      * Iterators. hasNext and Next is overly verbose and unnecessarily complicated, compared to ++ and *.

      * Containers. Subscripting (a[i]) is a very common operation and looks much clearer with nte subscripts than a "at" method.

      * Function objects. Having objects which can be called just like functions, "object(argument)", is crucial to creating generic algorithms.

      * Assignment and Equality. Assigning from one class to another using = is better than an "assign" method. Testing for equality with == and != is much clearer than an "equals" method.

      Anyway the whole "designing a new programming language" argument is wrong, because an operator is simply a function with a symbol and precedence. That is all. If operator overloading is defining a new language, then so is writing new functions.

      Obviously people can misuse and overuse operator overloading, but that is true of any language feature and should be expected. You can design the perfect language, but it will always be possible for bad programmers to make a mess with it.

    4. Re:Java and the operator overloading.. by WolfWithoutAClause · · Score: 1
      Because adding operator overloading to a language is like giving the programmer the ability to change and mutate the language to her desires.

      Yes. That's precisely why I want operator overloading.

      In some situations you really do need to do that. I wrote a library once in C++ that dealt with a special sort of list operator, that was going to be used ubiquitously throughout the code. Using double less than operator to put data into the list was a shoe-in, and worked extremely well.

      Frankly when you are reading C/C++ software, if you don't know what type a particular variable is, then you aren't reading closely enough. It's only confusing if you are a bad programmer. Admittedly there's plenty of those around, and everyone has off days occasionally. Still, C++ is remarkably intolerant of off-days, even if you never use operator overloading.

      --

      -WolfWithoutAClause

      "Gravity is only a theory, not a fact!"
    5. Re:Java and the operator overloading.. by 0rbit4l · · Score: 2, Insightful
      Phew, yeah, that overloading just complicates things beyond the point of reason. I mean, wouldn't you rather use this form:

      determinant = (b.multiply(b)).subtract( ((new BigDecimal(4.0)).multiply(a)).multiply(c));

      than this:

      determinant = b*b - 4*a*c;

      Yeah... thank god there's no overloading! (hint: this is just an illustration - I know I can use builtin doubles rather than BigDecimal.) Forbidding operator overloading is just silly. To claim that "java is simple - see, no overloading!" while ignoring the pain it causes is equally silly.

    6. Re:Java and the operator overloading.. by wormbin · · Score: 1

      I'd rather write the example that uses overloaded operators but I'd rather debug and maintain the example that uses named function calls.

    7. Re:Java and the operator overloading.. by haystor · · Score: 1

      Of course you need to constantly wrap your last line in:
      if (z1 != null) {
      z1.Add(z2);
      }

      Of course its real easy to get used to the LISP version of:
      (+ z1 z2 z3 z4 z5)

      --
      t
    8. Re:Java and the operator overloading.. by anshil · · Score: 1

      determinant = b*b - 4*a*c;

      But who would think that this operation would take an hour to compute, calls function which are possible to interfere which each other etc?

      Next a lot of people are overloading operators while destroying basic mathematical rules operators have! This has to forbidden, but the compiler can't control it.

      a * (b + c) = a*b + a*c
      Should always be true, no matter how operators are overloaded.
      a + b + c = c + a + b
      Aha so look! Even the string concation also violates a basic mathematical rule '+' follows.

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    9. Re:Java and the operator overloading.. by Anonymous Coward · · Score: 0

      Yuck!

      Operator overloading gets abused. Whenever I see << with a stream I think, "What the fuck! Why is he rotating that file pointer?", because << means bit rotate.

      Use a procedure to do something like that, use a function for a procedure that returns something (what does << with a file stream return?).

    10. Re:Java and the operator overloading.. by Istealmymusic · · Score: 1

      stream insertion operator. Likewise, stream extraction operator. You need to brush up on your C++.

      --
      "The lesson to be learned is not to take the comments on slashdot too literally." --Vinnie Falco, BearShare
    11. Re:Java and the operator overloading.. by Anonymous Coward · · Score: 0

      This is dangerous and don't do it!

      If you make large equations you'll be making objects without a need to make objects! Creation is slow and expensive and should be avoided. If you're just doing a summation do you really need to make double the objects?

      Operator overloading is not explicit enough to be considered safe. The best reason to use it is in generic programming (e.g. generic algorithms).

    12. Re:Java and the operator overloading.. by zurab · · Score: 1

      But, there are MANY times when operator overloading would make things sooo much easier. Which would you rather read:

      complex z1(0,1);
      complex z2(1,0);
      complex z3 = z1+z2;

      or

      complex z1(0,1);
      complex z2(1,0);
      complex z3 = complexMath.Add(z1, z2);


      They are exactly the same, and not at all applicable in all situations.

      (The second is still better than z3=z1.Add(z2) IMHO)

      Now, this is entirely different - if you are doing z1.add(z2) it usually means z1 is modified, not the same as above. Also, consider this:

      method add
      param complex z2
      param boolean overwrite
      param int replaceLevel
      param boolean updateStructures

      z1.add(z2, true, 4, false);

      Hence, the advantage and flexibility of OO. Use functions otherwise which would be equivalent of complexMath.Add() call.

    13. Re:Java and the operator overloading.. by Crispy+Critters · · Score: 1
      More:

      * Matrix operations
      * Polynomials (represented by array of coefficients, [1,1]*[1,1] gives [1,2,1])
      * Other string operations, like 3*"a" gives "aaa"

      Kind of strange to realize that the mathematical operations are one programming language (demanding a parse tree and so on) embedded in another language.

    14. Re:Java and the operator overloading.. by OneEyedApe · · Score: 1

      With regard to your last statement, character strings are not numbers, and in the normal course of events do not represent numbers, and are therefore not subject to the normal mathematical laws. There is no communative property of string concatenation.

      --
      Life sucks, but death doesn't put out at all....
      --Thomas J. Kopp
    15. Re:Java and the operator overloading.. by Anonymous Coward · · Score: 0
      okay, how's this for an invitation to a flamefest:

      This is dangerous and don't do it! If you make large equations you'll be making objects without a need to make objects!

      how, exactly, is that anything but an indictment of the compiler? if it can't optimize away an unnecessary object creation - either the optimizer is braindead, or the language specification is stupid in some way that forces implementors to write braindead optimizers.

      it's one or the other of those two, because if humans have to worry about what the language is going to end up doing behind their backs, then we're dealing with a very low-level language. those have their place... if you're fiddling bits on the bare metal writing device drivers or OS kernels. if you're using an object system, you likely want to use a HLL, where the compiler or runtime won't stab you in the back by forcing you to second-guess their internal workings just to get halfway decent code!

    16. Re:Java and the operator overloading.. by EvanED · · Score: 1

      *Technically* they are the bit-shift operators; the C++ ios classes overload them as the stream insertion and extraction operators. I can see how die-hard C programmers could get a little annoyed at the "misuse" of >, but to anyone who has started with C++ or Java, they are second-nature.

      Poll: Which is more readable:
      a. cout "The value of i is " i "\n";

      b. cout.out("The value of i is").out(i).out("\n");

      c. cout.out("The value of i is"); cout.out(i);
      cout.out("\n");

      d. printf("The value of i is %i",i);

      Now, I'm one of those people that started with C++, but I'll take (a) any day. You'll probably say (d), but I had to look up the printf control characters to be sure that I wanted %i. It depends on what you're used to.

    17. Re:Java and the operator overloading.. by clambake · · Score: 1

      This works until someone makes operator(--) map to operator(++) and bury it into some obscure library. Then you'll be looking at the code for weeks and never get why it's not working. Java may be verbose to write, but reading it is fairly clear.

    18. Re:Java and the operator overloading.. by EvanED · · Score: 1

      >>Next a lot of people are overloading operators while destroying basic mathematical rules operators have!

      First of all, That's not 's fault any more than it is if add(a,b) != add(b,a). That's entirely the programmer's fault.

      >>Even the string concation also violates a basic mathematical rule '+' follows.

      Which is wonderous that Java *includes* that then...

      But anyway, this argument is stupid anyway. Even things within the mathematical world don't always obey commutitivity/associativity/distributivity(?) anyway. Look at matrices. In general, A*B != B*A, yet mathematicians didn't come up with a new operator to do matrix multiplication. Actually, this is the only example I can think of at the moment since I'm fresh out of an introductory linear algebra course, but I'm sure there are examples of other things that don't behave as well as you'd like.

    19. Re:Java and the operator overloading.. by EvanED · · Score: 1

      ...which works until someone makes Decrement() map to Increment() and bury it into some obsure library.

      Don't you see? Operators are just functions that are called a little funny. You want to prevent me from making a function called -- that adds instead of subtracts? Then you should also prevent me from making a function called Decrement() that adds instead of subtracts, and prevent me from making a variable called 'filename' that would be better called 'command', and prevent me from making a class called 'ComplexNumber' that would better be refered to as 'MainWindow'. They are all the same.

    20. Re:Java and the operator overloading.. by EvanED · · Score: 1

      Yeah, uh, it stripped the <
      *Technically* they are the bit-shift operators; the C++ ios classes overload them as the stream insertion and extraction operators. I can see how die-hard C programmers could get a little annoyed at the "misuse" of << and >>, but to anyone who has started with C++ or Java, they are second-nature.

      Poll: Which is more readable:
      a. cout << "The value of i is " << i << "\n";

      b. cout.out("The value of i is").out(i).out("\n");

      c. cout.out("The value of i is"); cout.out(i);
      cout.out("\n");

      d. printf("The value of i is %i",i);

      Now, I'm one of those people that started with C++, but I'll take (a) any day. You'll probably say (d), but I had to look up the printf control characters to be sure that I wanted %i. It depends on what you're used to.

    21. Re:Java and the operator overloading.. by Anonymous Coward · · Score: 0

      ...which works until someone makes Decrement() map to Increment() and bury it into some obsure library.

      Don't you see? Operators are just functions that are called a little funny. You want to prevent me from making a function called -- that adds instead of subtracts? Then you should also prevent me from making a function called Decrement() that adds instead of subtracts, and prevent me from making a variable called 'filename' that would be better called 'command', and prevent me from making a class called 'ComplexNumber' that would better be refered to as 'MainWindow'. They are all the same.


      The difference is, you never know for sure which operators are overloaded and which ones are correct without going and reading every single souce file that you link to. At least with the seperation of methods and operators, you narrow down the list of things that could be wrong. Java may be more verbose but the benifit is less maintenece when something goes wrong.

    22. Re:Java and the operator overloading.. by alefbet · · Score: 1
      It is true that in C++ there are situations where you can overload an operator and alter the meaning the compiler would have generated without the code.

      However, most of the time operator overloading is used (and I believe most of the time its advocates talk about using it) are situations where without the overload the code wouldn't compile at all. In C++, it's obvious that when you invoke the operator += on a "complex" or a "string" that an operator overload is being invoked, because the compiler itself doesn't provide that definition. At that point, to an experienced C++ programmer, it's not that much harder to recognize

      string a; a+=b;
      as a function call than it is to recognize
      MyObject a=new MyObject(); a.incrementBy(b);
      as a function call. If there were no overload, the thing wouldn't even compile.
      --

      A hack is just an idiom waiting for wider use.
    23. Re:Java and the operator overloading.. by Hognoxious · · Score: 1
      Are there any really compelling examples that don't resort to the tacit assumption that dealing with imaginary numbers is something all programmers deal with on a daily basis?
      Adding different units e.g. feet & metres, or Euros & Belgian Francs, you could overload the + operator to a method that checks & possibly converts the units (assuming the type being operated on has a member that holds the unit, of course).
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    24. Re:Java and the operator overloading.. by Tony-A · · Score: 1

      also violates a basic mathematical rule

      + over integers, rationals, reals, complex numbers happens to be commutative, but in general + is used as the group operator for non-abelian groups.

      And you were expecting .... ??
      + on 16-bit integers violates closure. 32767 + 32767 = -2 (or overflow)
      For floating point, a+b=a+c does NOT mean that b=c.
      For floating point, (a+b)+c does NOT necessarily equal a+(b+c).
      For floating point, a*(b+c) does NOT necessarily equal (a*b)+(a*c).
      For floating point, sum(1/n) CONVERGES!

    25. Re:Java and the operator overloading.. by Anonymous+Brave+Guy · · Score: 1
      Because adding operator overloading to a language is like giving the programmer the ability to change and mutate the language to her desires.

      No. It lets you extend the language's operator systems so that the other extensions you create by adding new types can work the same way as what's already there. This is invaluable if your language also supports generic programming, and aids readability generally.

      It doesn't let you change anything in a sane language. You can't overload operator+(int, double) in C++, for example, because any overloaded operator must use at least one UDT.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    26. Re:Java and the operator overloading.. by Anonymous+Brave+Guy · · Score: 1

      Types where op overloading can provide a natural, intuitive notation that fits with the rest of the langauge? Off the top of my head, op overloading can provide:

      • natural notation for any mathematical type: Complex, BigInteger, FixedPoint, Matrix, ...
      • the usual [] indexing notation for any suitable container type: Array, Hash, ...
      • accepted notation for any textual type, in particular + for concatenation: Char, String, Regex, ...

      Complex numbers may not be common, but mathematical types, indexed containers and textual types generally sure are.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    27. Re:Java and the operator overloading.. by toriver · · Score: 1

      Streams. >> and graphically represent what is going on, and allow the chaining together of multiple elements.

      But why does C++ use them contrary to shell programming? e.g. cout << "This isn't input but looks like it".

      And in mathematics >> generally means "much greater than" anyway, so it's not really proper use from that viewpoint.

      Iterators. hasNext and Next is overly verbose and unnecessarily complicated, compared to ++ and *.

      What does getting the next element from an iterator have to do with multiplication? Oh, that's right, * can be anything so it's not intuitive at all what it means. Unary multiplication?

      an operator is simply a function with a symbol and precedence

      Not so: An operator is also part of a (small) set of symbols especially treated by the compiler's lexical analysis. Okay, so you get + and *, but what symbol can you use to express e.g. a mathematical sum over a function and range? Is the symbol for the square root @&-?

      Traditional programming languages are terrible at expressing complex mathematical expressions anyway (and not just because of the microscopic set of operators available). Therefore it's misleading to drag out the needs for mathematicans as argument for operator overloading in traditional programming languages, since they aren't designed to do the job of MathCAD, Maple or Mathematica.

      And why precedence? Smalltalk manages fine without it. Do the "precedence rules" for your class' problem domain fit the compiler's rules which assume numbers?

    28. Re:Java and the operator overloading.. by bhp · · Score: 1

      The original example of mapping -- onto ++ isn't very realistic. In real life, programmers will maintain the semantics of the operation in some at least semi-common-sensical way. If they didn't, they'd be fired, or shot, or something. A better example might be redefining assignment of references ("x=y", where x and y are references to an object) to mean constructing a new object instead ("x=y.copy()"). Then my code doesn't work because I modified y's fields in x, thinking they were the same thing when they weren't. If you make too much use of overloading operations, you end up always having to wonder whether things really mean what you think they mean.

    29. Re:Java and the operator overloading.. by alefbet · · Score: 1
      The original example of mapping -- onto ++ isn't very realistic. In real life, programmers will maintain the semantics of the operation in some at least semi-common-sensical way. If they didn't, they'd be fired, or shot, or something. A better example might be redefining assignment of references ("x=y", where x and y are references to an object) to mean constructing a new object instead ("x=y.copy()"). Then my code doesn't work because I modified y's fields in x, thinking they were the same thing when they weren't. If you make too much use of overloading operations, you end up always having to wonder whether things really mean what you think they mean.
      Again, though, this applies just as well to functions as it does to operators. Changing the semantics of a defined function that is part of a class interface is plain-'n-simple a bad idea in working code.

      And, yes, in Java, you always have reference semantics for assignment, so there's no worry that you might get value semantics when you were expecting reference semantics. I've always found this to be a weakness and one of the reasons I've stuck with C++ (despite all its flaws and caveats). In C++, you always have value semantics with assignment on the object level, so that never catches me by surprise. If your object represents a reference to another object, you better understand this about your object.

      Anyway, never fear. If they do ever add operator overloading to Java (which I doubt), I don't believe they'll allow the redefinition of operators already defined by the language. But it goes both ways for me. The fact that I can recognize operators that are actually function calls in C++, doesn't seriously deter me from Java, knowing that I could just use function calls and it would still work, albeit more verbosely. The two things (among a fairly long list) that most keep me from Java are:

      1. Deficiencies in the inheritance model. I've only used multiple inheritance a handful of times, but elsewhere knowing that I could use it if needed allowed my design decisions to be much simpler. And:
      2. Inability to do Design-By-Contract.
      --

      A hack is just an idiom waiting for wider use.
    30. Re:Java and the operator overloading.. by alexo · · Score: 1

      >>...which works until someone makes Decrement() map to Increment() and bury it into some obsure library.
      >> Don't you see? Operators are just functions that are called a little funny [...]
      >
      > The difference is, you never know for sure which operators are overloaded and which ones are correct without going and reading every single souce file that you link to.


      You can have global functions, file-scope (static) functions and member functions (methods) in C++. You can override functions based on the number and types of arguments and you can have default arguments to complicate matters). Member functions can be virtual (run-time resolution) or can be hidden by a definition in a subclass.

      Given all that, I really don't see much more problems with operator overloading.

    31. Re:Java and the operator overloading.. by pommiekiwifruit · · Score: 1
      Usefully overloaded classes:
      • complex - if you're doing fractals or physics
      • BigNumber - if you're dealing with money
      • Vector3 - for displaying stuff
      • Quaternion - for rotating stuff
      • string - for text concatenation
      • streams - for slow i/o

      Also overloading is essential for useful templates (another thing Java lacks), in particular operator=, operator==, operator, operator[]

  21. Say What? by fidget42 · · Score: 3, Interesting
    Python programmers like indentation.
    As a python programmer, I loath its indentation sensitivity. It is hard to find the end of a block and heaven help the people who use tabs rather than spaces for indentation.

    The lack of good line termination (sorry, but a caridge return doesn't cut it) is another problem.
    --
    The dogcow says "Moof!"
    1. Re:Say What? by los+furtive · · Score: 2, Insightful

      Amen to that! I used to think that tabbing as a form of indent was a major sin, but since most IDEs these days (and every text editor worth its weight in salt) will allow you to adjust tab length/replace tabs with spaces/replace spaces with tabs, I don't see what the big deal is any more, and in fact I think tabs are a better choice.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

    2. Re:Say What? by demi · · Score: 2, Interesting

      Yeah, I always forget if it breaks if you put a space after the \ character, and then I forget if you're supposed to indent another level or to the same level on the continued line. All of the other python programmers seem to have the same problem because all our Python code here is characterized by godawfully long lines.

      Note to repliers: this isn't a question I'm looking for an answer to, and it's not a criticism of Python (well, okay, obviously it is, but I hope you won't take it personally).

      --
      demi
    3. Re:Say What? by black+mariah · · Score: 1

      It's damned easy to find the end of code blocks. There's these handy little things called comments. You can put them anyplace in your code. You can use them as bookmarks, and you can even write handy little notes for yourself and others to help you remember what the program does at a later time. Neat, huh?

      I use tabs and haven't ever had a problem reading Python code, even complex programs written by others. Does the absence of a } really throw you off so much you can't read? Gimme a break, dude.

      --
      'Standards' in computing only impress those who are impressed by things like 'standards'.
    4. Re:Say What? by fidget42 · · Score: 1
      I know this is a troll, but here it goes:
      There's these handy little things called comments.
      I have been using that comment technology for quite a while. Unfortunately, I am not the only one doing python development and I can't rely on everyone else being so diligent. Also, if someone messes up the indentation of a close comment (as when someone removes an if statement), resolving the scope can be fun (even with tabnanny).

      I use tabs and haven't ever had a problem reading Python code, even complex programs written by others.
      Once again, if I were the only one doing development I wouldn't have a problem. Unfortunately, some of my fellow developers use spaces for various reasons.

      Does the absence of a } really throw you off so much you can't read?
      It is always nice to have the scope delimiters semantically required by the language. That way you can't get into trouble. And I am not talking about an end brace, but something line "end if," "end for," or "end while." Kinda like the stuff you put in your commend, "dude."
      --
      The dogcow says "Moof!"
    5. Re:Say What? by Anonymous Coward · · Score: 0

      Gimme a break, dude.

      Which would you prefer broken, your index finger or your thumb? Python's use of whitespace as part of the syntax is utterly asinine.

    6. Re:Say What? by Suidae · · Score: 1

      Speaking of. I've been meaning to learn some python, but I'll need a tolerable IDE. Does one exist?

    7. Re:Say What? by los+furtive · · Score: 1

      I don't do python, so i can only recommend text editors for you, but I believe ActiveState has a Python IDE and it its as good as their Perl one you should be happy with it, built in regex tools and stuff.

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  22. JAVA and Operator Overloading by Alpha_Geek · · Score: 1
    "The inconsistencies between what the language allows and what the standard library actually does bother me. If operator overloading is so bad, why does the String class do it?"
    This bothered me from the first day I started programming JAVA in a class in college. I always felt if they weren't going to allow us to do something, then they shouldn't do it themselves.
  23. Lisp by MonkeyBoyo · · Score: 1

    Liking LISP, I find it annoying that most other languages do not make a distinction between changing variable values (assigning) and binding variables. Nor do the seem to notice that there is a large semantic difference.

    1. Re:Lisp by Ardias · · Score: 1

      C++ allows you to bind one identifier to another using references.

      int a = 1;
      int & b = a;

      Whatevers happens to a also happens to b.

  24. HA! Missed me! by secolactico · · Score: 2, Funny

    No mention whatsoever of BASIC or Logo. Yes! At least he spared my languages of choice.

    --
    No sig
    1. Re:HA! Missed me! by TC+(WC) · · Score: 1

      You poor, poor man... :(

  25. It's not always technical by fishlet · · Score: 4, Interesting


    I don't think it's always technical. A few years ago it seemed like most comments in regard to Java were positive, but when it became evident that it wasn't really "free" in the same sense as is perl or python... then lots of people started bashing it. Though like many languages has it's flaws, it still remains a solid language. The same with VB, virtually no-one in *this* audience considers VB a great language, which is reinforced by the fact that no-one's really putting much effort into creating a VB like tool for Linux (albeit there are several dead projects that have tried). It's a shame because VB actually works quite well for a particular niche- quickly developing business apps. In the case of VB, I can safely predict most people here will not give it credit because of it's links to Monopolysoft.

    1. Re:It's not always technical by Sylver+Dragon · · Score: 2, Insightful

      Actually, I kind of like VB for certain purposes. I am not, nor do I have any wish to be a programmer, but sometimes there are things you just can't do in a batch file, and dammit if VB isn't a nice way to get around this limitation. Not to mention that it looks a bit cleaner, and certainly less scary, to the average end user, than a command prompt. Plus the ability to send windows messages (logoff and the like) can be really damn useful.
      So yes, VB is another MS product, but it can still be a very useful tool if you live in a windows world, and don't want to bother with becomming a programmer.

      --
      Necessity is the mother of invention.
      Laziness is the father.
    2. Re:It's not always technical by jkauzlar · · Score: 1
      Linux's VB? Python! Its just as simple and powerful, and in addition it's coherent. Don't you think VB is kind of awkward?

      Fortunately MS makes good IDEs which they build into Office with debugging and code-completion. So far I haven't found anything like that for Python.

    3. Re:It's not always technical by Lord+Kholdan · · Score: 1

      I'd say that the two main virtues of VB are:
      1) It is fast to code with.
      2) It is easy to learn.

      And it's main vices are.
      1) It doesn't force you into good programming habits
      2) It's still somewhat slow

      Personally, I enjoy coding in VB and will continue to do so. I know that it is not the prettiest language and it is not the fastest language, but, It is enjoyable to use and i get results fast with it. Shouldn't we all just use the languages we enjoy to use instead of fighting about what is the perfect mix of attributes for the ultimate language (tm)?

    4. Re:It's not always technical by aardvarkjoe · · Score: 4, Insightful

      Well, I rather suspect that the main reason why you see a lot more Java bashing is because most CS students used to have to learn C++; now they have to learn Java. Since /. is mostly high schoolers and college kids, you have a whole bunch of people that were forced to learn the language in the last few years. Obviously, you're going to end up with quite a few people that don't like it.

      There's not really all that much bashing of any other non-free stuff (the exception being Microsoft, but that's mostly because they're still beating up on the penguin.) I don't see it as being the primary reason for Java bashing.

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    5. Re:It's not always technical by Cynikal · · Score: 2, Insightful

      i'd have to say one of the things i hate the most about VB is the huge runtimes.
      oh how much would i pay for the front end of VB that compiled to a stand alone exe comparable to asm coded executables.

    6. Re:It's not always technical by Anonymous Coward · · Score: 0

      VB greatest strengths are:

      1. COM
      2. ???
      3. Profit

    7. Re:It's not always technical by pi_rules · · Score: 5, Insightful
      I can safely predict most people here will not give it credit because of it's links to Monopolysoft.


      This is probably true, and I'm as much as an anti-MS guy as you can get really, but I have my reasons for not liking VB. I did a few projects with it in the past year (ASP/VBScript with VB COM components, MTS, etc), so I speak from experience.

      I went into it thinking it would suck, but I quickly found it being okay for gettings things done. "Hey, maybe these guys are onto something I think...". Then the project gets more complex and I realize why I like langauges that are far more strict regarding what you can and cannot do.

      • Lack of short circuiting conditionals really started to eat me up. Mostly because every other language I used (except BASIC) would short-circuit conditionals. All too often I would find myself writing complex loops using short-circuits and then realize later on I had totally blown the algorithm. I wasn't the only one either. I saw experienced VB guys do stuff like: If (objRS IsNotNull AND objRS.RecordCount > 0) Then.... Not much fun when that blows up.

      • Some consistency would be nice. I think Pascal is the only other language I've ever used that would let you declare a function in two different ways. One for returning data and one that didn't. The seperation of Sub and Function is a friggen mess. It's even worse when you realize later on you need to return a boolean out of your Sub and suddenly you have to track down everybody that called it and change the method of which you call it.... even the ones that could care less about it's true/false return. What's wrong with the return type void?

      • No macros or a precompiler. VB didnt' clean up unused objects very well for itself and one point in time, if I recall correctly, which made developers (at least at where I was) make sure they always set objects to Nothing before a failed function would return. That's find and dandy, but I hated repeating the same awkward (due to lack of short-circuiting conditionals) cleanup code in function after function that were nearly identical. Think nearly identical functions with a bit of business logic in them passing data off to a data layer for the real DB access. Each function had maybe 3-4 lines of individual code, sometimes up to 20 though. Every function though was at least 30 lines long, with the same drivel repeated over and over again. How much better it would have been to write:

        If (ErrorState = True) Then
        CLEANUPCOMMONOBJECTS
        End If

        If I had good exception and a good GC I wouldn't have even needed this though.

      • That damned VARIANT type needed for COM. Okay, this is common amonst all COM enabled apps when going across boundaries, but it really stunk if you asked me.

      • Little bugs. If you return a 'decimal' datatype from an ADODB.RecordSet and called IsNumeric() on it would you expect a true or false? Assuming the value in question wasn't Nothing, you'd assume it's true, right? Bzzzzzz!. IsNumeric(CStr(val)) would return true though. All because IsNumeric didn't understand all the possible variant datatypes that you could toss into it. Minor oversight, but it turned up a pretty decent and noticable bug in my code once. Err, wait, that was VBScript, anybody know if that happens in Real VB?


      It's a short list, but it's been a while since I coded in it.

    8. Re:It's not always technical by radish · · Score: 3, Interesting

      OK, standard disclaimer: I did CS at a (very) good uni, and was taught the "proper" way to program, via Miranda, Modula, Smalltalk, Prolog, Turing etc. Never learnt C++ (all our lecturers hated it) - Java had only just come out at the time so did very little of that.

      Went straight into the finance world - first 2 years or so were straight ksh/perl/sybase - you'd be amazed how much of the banking world is held together with that stuff (which I affectionatly term "sticky tape"). Don't get me wrong, perl is great in it's place - but for enterprise trading apps? Nope, sorry :) So anyhow I know that end of things pretty well. Then I moved onto front end apps - which as you point out are frequently VB. The ones I worked one were typical of the generation built 5-10 years ago, and which are now proving to be maintenance nightmares and getting ripped out. I'm speaking of the 2-tier, VB front end, Sybase/Oracle stored proc back end. Yuch - horrible stuff. VB is fine for GUIs, provided you only care about running on windows (which we do) and don't mind having to desktop installs (tolerable). But VB programmers tend to think the language is all powerful (don't ask me why) and build all the business logic in there to (or even worse, build it into a myriad of massive sprocs) - that's a big mistake. The language is too loosely typed, too vague, and basically too much of a mess to write important code (IMHO). Maybe things have improved (I know some things have been fixed), but when I was working with it you had virtually non-existant error/exception handling, no polymorphism, no inheritance - to be honest it's whole notion of objects was kind of broken. It just felt yucky to me, as a formally educated coder (not trying to say they're the best kind, just that's what I am). Even perl felt that at least it was being honest - it had it's strengths (and it's damn good at them) but it doesn't try to be more than it is.

      So that brings me to now - and Java. Picked it up a few years ago - the language just makes sense to me. It's a simple language (and don't start on how big the class libs are - that's not the language), and it works. Sure some of the library classes aren't as wonderful as they could be, but they're being fixed pretty quickly (for instance nio, enhancements to collections, etc). The speed with which you can develop apps and - FAR more importantly - the level of correctness which you get at first round testing surpasses any other development platform I've come across. I'm currently heading up development on a (server side) project with 5 developers and 6 months of time. We've spent that time designing, churning out code, and testing. Not fixing bugs. There's none of the days spent chasing memory leaks or weird core dumps my colleagues working with C++ get. Are we better coders? No, the platform just seems more condusive to writing correct code the first time around. I've got people on my team who used to be C++ coders (and good ones at that), and when I ask them about implementing this project in C++ they just laugh. Honestly.

      Oh and as for microsoft, I haven't had a chance to spend much time with C# yet, but I look forward to doing so. So what did this have to do with VB? Very little...sorry for rambling :)

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    9. Re:It's not always technical by Strudelkugel · · Score: 1

      Your reply is a pretty good ad for .Net...

      --
      Imagine how much harder physics would be if electrons had feelings! -Feynman, maybe
    10. Re:It's not always technical by LibertineR · · Score: 1
      "Shouldn't we all just use the languages we enjoy to use instead of fighting about what is the perfect mix of attributes for the ultimate language (tm)?"

      Absolutely not!

      Dont you understand that the reason we are here, is to gain validation for our technology choices. You see; most of us are fat fucking nerdy slobs, who would rather code than fuck a supermodel.

      We gain self esteem from putting down others, and gathering up our groupthink-hate-microsoft numbers whenever we can in order to feel better about the fact that our last lover was our left hand.

      It doesnt matter if VB is the single most productive enviroment ever produced, nor does it matter that VB.NET has fixed just about everything wrong with VB. It only matters that we all agree, we all hate microsoft, and we all go to see Matrix Reloaded with our buddies tommorow, because we cant get a woman who shaves her legs to go with us instead.

      We are losers.

      Therefore, hating VB and all things Microsoft is the fucking law of the land.

      Got it?

    11. Re:It's not always technical by Anonymous Coward · · Score: 0

      You could try QuickBasic 4.5. Can't do much in the way of GUIs, but if you just want to write a quick-and-dirty stand-alone app, it's great.

    12. Re:It's not always technical by Steve+G+Swine · · Score: 3, Informative

      Scary thing is, all the things you mention are gone now in VB.NET.

      AndAlso/OrElse for short circuits, subs and functions all take parens to call, real exceptions, variants are dead, and they took the VBScript IsNumeric oddities to the grave with them (though you were begging for pain when you relied on IsAnything with VBScript).

      I mention this lest you think VB was crippled forever... Try the new stuff - it's like object oriented code with real words, instead of seventy different types of punctuation to make something simple look like some goddamn magic trick.

      --
      "Consider yourself a member of a virtual corporation with Mr. Torvalds as your Chief Executive Officer." - Linux Advocac
    13. Re:It's not always technical by Malcontent · · Score: 1

      That's because all .NET languages have look like C# and work like C#.

      --

      War is necrophilia.

    14. Re:It's not always technical by Malcontent · · Score: 1

      What the??

      You leave out things like lack of inheritance and polymorphism and concentrate on the little stuff?

      What gives kimo sabe?

      --

      War is necrophilia.

    15. Re:It's not always technical by Malcontent · · Score: 1

      His reply was an advertisement for java. Since .NET is nothing but a reworking of java anyway I guess it would apply.

      --

      War is necrophilia.

    16. Re:It's not always technical by wganz · · Score: 2, Interesting

      What about Kylix? Could it not be the "VB" for Linux?

      I don't have the experience with Kylix as I do with VB to definitively say one way or the other. Cross platform to a certain extent. But the Delphi compiler for Windows is quite pricey.

      my $0.02

    17. Re:It's not always technical by N1KO · · Score: 1

      I started hating java because it was this amazing, mysterious technology that would change our lives forever... until i my browser had to load a java applet for the first time ever.

      It was sloooooowwwww.

      They said a java program could run on any platform... they didn't mention you needed a vm and the code was bytecompiled, not native. Slooooooow.

      They said it was unlike c++ which wasn't a pure oo language. Then i found out java has things like integers and floats that aren't objects. It's a hybrid that manages to remove the practical aspects of a hybrid language.

      Not only is it not free, it isn't even standard.

      Everything about it seems unnecesarily complicated. Just to download the api docs you have to go through a bunch of lame tasks at sun's website.

    18. Re:It's not always technical by Anonymous Coward · · Score: 0

      I've got people on my team who used to be C++ coders (and good ones at that), and when I ask them about implementing this project in C++ they just laugh.

      Yeah, keep laughin'. Most Java programmers claim to have been good C++ programmers at one time - and I have some swamp land in Florida for you.

      If they were chasing down core dumps and memory problems then by definition they were not good C++ programmers.

      And by the way, fellow Slashdotters, enough with the "my friends said" stories. They're a load of crap to begin with and are even further "enhanced" by the time it gets posted to Slashdot.

    19. Re:It's not always technical by ipfwadm · · Score: 1

      and I have some swamp land in Florida for you.

      Really? I'll take it! My friend had a chance to buy some swampland in Florida 10 or 15 years ago and he passed it up. Last time he was down there his swampland had been turned into a development with condo upon condo. He could've been rich.

      And by the way, fellow Slashdotters, enough with the "my friends said" stories.

      Yes, I even got the obligatory "my friend said" story in there, just for good measure :-)

    20. Re:It's not always technical by __past__ · · Score: 1

      You could say the same about brainfuck, except that it isn't really slow.

    21. Re:It's not always technical by Anonymous Coward · · Score: 0

      2 = Put a Grid control in your app without having to earn a CS degree first.

    22. Re:It's not always technical by eidechse · · Score: 1

      No they don't. Two easy examples: Mondrian and Fujitsu COBOL. It'd be closer to say that all .NET languages need to be able to use the .NET Framework, still incorrect (technically), but closer.

    23. Re:It's not always technical by eidechse · · Score: 1

      Since .NET is nothing but a reworking of java

      Why do you say that?

    24. Re:It's not always technical by Microlith · · Score: 3, Informative

      Borland Delphi

      Sure it's not BASIC, but then that's not exactly a bad thing.

      Compiles down to a standalone executeable.

    25. Re:It's not always technical by Saeger · · Score: 1
      Yeah, let's drain those useless wetlands and get rich! That's the ticket!

      --

      --
      Power to the Peaceful
    26. Re:It's not always technical by erinacht · · Score: 1

      which is reinforced by the fact that no-one's really putting much effort into creating a VB like tool for Linux (albeit there are several dead projects that have tried). WRONG!

      There is an excellent VB like tool for linux

      It's called GAMBAS

      or GB for short

      Perhaps I'm the virually no-one, but I like VB - and I agree it's an excellent day to day language.

      When it stops paying the rent, I'll switch to another language. Simple as that...

    27. Re:It's not always technical by innerlimit · · Score: 1

      I'm joining the discussion a bit late, but I havent't seen anyone mention Oberon (Wirth) yet?

      Anyone any thoughts on it?
      I'm a 2-year CS student, Obeorn & Cobol are our main languages in the first two years...

    28. Re:It's not always technical by Khelder · · Score: 1
      Don't hate VB because it's from Micros~1, hate it because it sucks dead wasels through a lint clogged vacuum hose.

      I hate the language because: no inheritance, having to "Set" object assignments, and terrible namespace management.

      The IDE has lots of obnoxious problems, but I'll just list my favorite here: You can't save a file if it has a compile-time error in it.

    29. Re:It's not always technical by master_p · · Score: 1

      Standard disclaimer too: I've been a software engineer for 5 years for a big defense subcontractor with large experience in C++, Java and ADA. I also have quite a bit of experience in VB, since I worked for one year with it; got an MSc in Software Engineering, too.

      First, let me say what I like and don't like in the various languages I have worked with:

      C: for the task of writing applications that are close to the hardware (kernels, drivers, etc) it is ok. But it is the usual case that even defense apps need a higher level of abstraction. So, even if I find nothing seriously strange about C, I consider it lowlevel; one level above assembly. Another thing that I would be ok without is the -> operator; I would prefer to use the operator '.' instead. Yet another irritating thing is that unless I typedef a struct, I have to write 'struct' before each declaration.

      C++: duplication of API declarations in header/implementation files is a problem: in C it is not a problem, since I usually make the implementation file first, test it and then transfer the functions to the header; but in C++, I have to declare all interfaces first, then implement it and test it. And If I have to go back and change the interface during testing(and the comments of each method), I have to do it in 2 places. I don't have a problem on how templates are declared, I like that and I never found it a problem(and I usually typedef templates so its less of a hassle). Another thing is the lack of a standard multithreaded API, as the other languages have.

      Java: Lack of generalized programming (templates) has hurt me badly; everything needs to be derived from Object, and the language misses many chances for optimization. The libraries are top notch, but the end result is very slow. Perhaps a compiled version of a Java app (Java compilers exist, don't they ?) would be better. Another big thing is when finalizers run: it is not deterministic, creating big consistency problems. Yet another problem is that I can not use the stack to declare objects, leading to overuse of the heap, memory fragmentation, slower speed etc.

      ADA: Super strongly typed! in fact, so strongly typed that it gets irritating. Of course, it is the safest of the above languages since the compiler does not really let you do anything peculiar. But it takes a lot of coding.

      VB (up to v6): I am sorry, but I hate it. Null is different than Empty, I have to use many functions to do the job of operators, everything takes twice as long to declare, I can't make my code aligned into 80 columns unless I append '_' to each line...no true object orientation, no inheritance...VB has the nicest and fastest interface for developing GUIs, but that's about it.

      After having found Qt, I became a big supporter of C++. I am not advertising Trolltech, but Qt is the best API there is. Even greater than Swing. Qt does C++ justice! many novice programmers hate C++ because they have to deal with MFC, which is a terrible terrible bloated library that its sole purpose is to give C++ a bad name (and make users love VB). Of course, there may be other libs similar to Qt, but I can't comment on them. So, let me present my own arguments against yours, when it regards C++:

      The speed with which you can develop apps

      It all depends on the available libraries. With Qt, I can write the same app in C++ and in Java in equal time; and the APIs are much alike, so I am gonna use the same techniques. If I use MFC though, it would take the triple time than in Java.

      the level of correctness which you get at first round testing surpasses any other development platform I've come across

      That's true if the level of complexity of what you are coding is low. The higher the level of complexity gets, the lower the level of correctness is. In C++, you may get less correctness the first time round, but as your app gets bigger and the algorithms more complex, C++ and Java tend to be equal. After a certain

    30. Re:It's not always technical by Anonymous Coward · · Score: 0

      Because it mainly is? I've used both - there are a few differences. Note: I am comparing .net and J2EE, not .net and never-been-updated MS-JVM.

      C# lacks mandatory checked exceptions. That alone disqualifies it for some of the duties java systems that I know do.

      On the other hand, at least .net pays lip service to standardisation, and corrects a few of the niggling implementation mistakes of jvm.

      But, .net is also currently single-vendor, runs only on windows (mono is a joke), and is relatively immature.

      Other than that, it might as well be java.

      Anyway "Choice of Masters is not Freedom" - Given .net and J2EE, I'll take Common Lisp.

    31. Re:It's not always technical by Anonymous Coward · · Score: 0

      Off topic but, you said

      "provided you only care about running on windows (which we do)"

      does this still hold true?

      I was under the impression that MS's licensing 6.0 had been a unpleasant shock all round and that it would inform future IT planning.

      (Just curious, not shouting "Boo!")

    32. Re:It's not always technical by radish · · Score: 1

      I think we're agreeing on a lot of points, and there's plenty which I'm not enough of an expert in to really comment. But I feel I should pick you up on a couple of Java points :)

      Lack of generalized programming (templates) has hurt me badly; everything needs to be derived from Object, and the language misses many chances for optimization.

      Care to elaborate on those chances for optimization? Templates (or Generics as we call them) sure add expressive power, and can allow your code to be more typesafe, but I'm not sure how they can significantly improve overall execution time.

      Perhaps a compiled version of a Java app (Java compilers exist, don't they ?) would be better.

      A common myth. Java is compiled - it's not interpreted. However, the compilation is JIT, and in newer JVMs (HotSpot) you get self-tuning recompilation. It has been shown that this results in equivalent (or in some cases even better) performance than static compilation. This is particularly true for long-lived server processes which can fine tune their optimizations as the code runs in a way no static optimizer code ever could.


      Another big thing is when finalizers run: it is not deterministic, creating big consistency problems.


      Why do you need finalizers? You are mistaken if you think they replace C++ destructors - they don't. I've been coding big apps for at least 3 years now, and I can't think of a single instance where I've needed to use a finalizer. We have some ex-Sun people working with us and they say the same thing - finalizers are there for extremely exceptional circumstances only.

      Yet another problem is that I can not use the stack to declare objects, leading to overuse of the heap, memory fragmentation, slower speed etc.

      Not really relevent - Java manages it's own memory and it's pretty radically different from the traditional simple heap/stack. You have the new object zones, object-life related pools, etc. It can take some tuning of the -X params to get the most out of it, but it's something which should be considered at deploy time (via runtime args) rather than development time (via heap/stack allocation), IMHO.

      That's true if the level of complexity of what you are coding is low. The higher the level of complexity gets, the lower the level of correctness is. In C++, you may get less correctness the first time round, but as your app gets bigger and the algorithms more complex, C++ and Java tend to be equal

      Sure complexity increases as correctness decreases, but in my experience the Java curve is transposed towards the correct end more than any other platform I've tried (except things like Z of course!).

      After a certain level of complexity, C++ wins due to sheer speed.

      What's speed got to do with correctness?

      you are making a server side app; that means a web-based app, right ?
      This one is web based, I've worked on traditional client/server in the past and would use the same arguments.

      If you use proper development techniques and C++ constructs, you get 0 memory leaks. I have solely coded a C++ Qt application in 9 months which had 16 threads, multiple network sources (messages coming from all sides), real-time simulation of aircraft and ship motion, and that reached almost 60,000 lines of code

      Great - you're a good coder and you use good tools. Make that a team of 50 developers of varying skills working on a project for 2 years, with 1m LOC and hundreds of threads - still confident you will have no leaks? I am confident a Java app in that environment would have less issues.

      Guys in the next-door department struggled to incorporate a fast web browser in their Java app, because the Swing one makes the OpenGL radar display to skip frames

      Swing is a whole different thing ;) I'm not here to defend Java GUI performance :)

      Cheers for the interesting discussion!

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    33. Re:It's not always technical by master_p · · Score: 1

      Care to elaborate on those chances for optimization?

      Well, here is an example of an optimization: the operator =. How does the JVM executes the operator = ? through a virtual method, i.e. a call and a jump. And since it is a JVM, it needs to find out the vtable of the class. In C++, and through templates, it directly executes the operator =, and inlined also if it is declared in the header.

      Another optimization is the arrays: actually, the objects are not part of the array, but part of the heap (in Java). In C++, you can use vector(Foo *) or vector(Foo) according to your needs. When data objects are together, there is bigger chance that there are less cache misses and less work for the operating system's virtual machine. Java array allocating is much slower, since each object is allocated separately on the heap, whereas in C++ they are allocated in one 'malloc' call.

      It has been shown that this results in equivalent (or in some cases even better) performance than static compilation.

      Regarding speed, I am working with Oracle's JDeveloper (or rather forced to, I should say). It is slow as hell. I've noticed something: if you keep doing repeatedly the same thing, then speed increases. If you do different things, it is quite slow.

      The actual facts from big Java applications that we have developed in our company, Java apps are 20% to 50% slower than C++. For real, I am not joking. You may be right that a long-lived server Java thread may be executed quite fast, but a native app is still faster.

      Why do you need finalizers?

      If you don't use finalizers, how does a file object close a file ? You have to do it manually, calling 'close' on the file object. On the other hand, I do nothing: when the function that used the file returns, the file closes itself when destroyed.

      Not really relevent - Java manages it's own memory and it's pretty radically different from the traditional simple heap/stack

      In C++ I don't need to do anything like that: the stack is a saviour. Tell me, isn't a waste of resources to do button.setDimensions(new Dimensions(10, 20)) ? why objects that are used for interfacing have to be allocated on the heap ? In reality, heap-only allocation is so bad that our client requirements state specifically that all objects should be pre-allocated.

      How big complexity are you talking about ? It all depends. We have implemented a whole radar interface in Java, and that's a rather complex application. There is multithreading, multiple network resources, multiple data views, multiple screens. Java guys are still struggling.

      What's speed got to do with correctness?

      Your argument about correctness means that you develop your application in Java faster than C++. My reply was that, when it comes to speed of development, for more complex projects C++ is better because it is simply faster. You don't have to wait for Java to catch up with you. This regards the IDE also which is Java.

      This one is web based, I've worked on traditional client/server in the past and would use the same arguments

      One of the projects I worked last year was a client/server app. But the term 'client/server' is a generic one: our app did not have to do anything with the web; it was an interface between 4 different radar protocols. That's why I said about the web. It makes a difference, and C++ traditionally is not the right tool for the web, simply because web means text processing, first and foremost.

      Make that a team of 50 developers of varying skills working on a project for 2 years, with 1m LOC and hundreds of threads - still confident you will have no leaks?

      if you make available the right tools and impose some constraints as to what should be used and what should be avoided, yes. If everyone starts to do his own thing, that means there is no project management, so the project is doomed anyway.

      In the environment that I work, 50 developers for

    34. Re:It's not always technical by radish · · Score: 1

      First off your optimizations - they are all details of the JVM implementation. There's nothing stopping someone coming along and building a better JVM - we're confusing language and environment here. There's nothing in the language spec which says where array objects get created (for instance).

      Regarding speed, I am working with Oracle's JDeveloper (or rather forced to, I should say). It is slow as hell. I've noticed something: if you keep doing repeatedly the same thing, then speed increases. If you do different things, it is quite slow.



      You're noticing three things -

      (1) an app written in Java can be slow. Guess what? That's not unique to Java. I know some pretty slow C apps.

      (2) Swing isn't great performance wise. As I alluded to in my previous post, I don't wish to get into a Swing debate. There are great replacements for Swing (like the toolkit eclipse uses) which really are as fast as native guis.

      (3) Hotspot speeds things up as you do them more. In a server process this gives you massive advantages.

      If you don't use finalizers, how does a file object close a file ? You have to do it manually, calling 'close' on the file object. On the other hand, I do nothing: when the function that used the file returns, the file closes itself when destroyed.



      Well the FileInputStream (for instance) already has a finalizer - so of course it's being used. My comments were about writing your own finalizers, which is rarely needed. If you want the file closed at a specific time, close it manually. If you don't care when it's closed, as long as it's before the app quits, leave it to the finalizer. As soon as the object has no more references to it, it will be finalized and gc'd. I really don't see what other options there are??

      In reality, heap-only allocation is so bad that our client requirements state specifically that all objects should be pre-allocated.


      Your clients tell you how to write code? Hmmm.

      Java is different from C++, I'm not trying to make out that Java is automatically better for every purpose, though you seem to want to bash it so I'm defending. So you can allocate objects slightly more efficiently - in Java I NEVER have to worry about bad pointer arithmetic, buffer overflows or anything like that. They have different pros & cons - my original post was simply stating that in my world Java wins hands down.


      One of the projects I worked last year was a client/server app. But the term 'client/server' is a generic one: our app did not have to do anything with the web; it was an interface between 4 different radar protocols. That's why I said about the web. It makes a difference, and C++ traditionally is not the right tool for the web, simply because web means text processing, first and foremost.


      I know the difference. That's whay I said "this one is web, others are client/server". That kind of implies NOT web. I have worked on data warehouses, analytics engines, trade processing systems, GUI tools, and more.

      Your argument about correctness means that you develop your application in Java faster than C++. My reply was that, when it comes to speed of development, for more complex projects C++ is better because it is simply faster. You don't have to wait for Java to catch up with you

      No, correctness has nothing to do with speed whatsoever. Correctness is whether it has bugs. You save weeks of dev time by having less bugs, versus seconds because the compiler runs slightly quicker, or whatever it is you're trying to say. I really still don't understand.

      This regards the IDE also which is Java.

      Why does it have to be? Do you care what language your IDE is written in? You shouldn't. You should only care whether it does the job for you.

      In the environment that I work, 50 developers for 1m LOC and 2 years is way too much. I mean, too much: For the application before the one mentioned above, I personall

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    35. Re:It's not always technical by Malcontent · · Score: 1

      I am sure all five people who use those languages are very happy.

      --

      War is necrophilia.

    36. Re:It's not always technical by Malcontent · · Score: 1

      "Why do you say that?"

      mmm... Because it is!. It looks like a duck, walks like a duck, smells like a duck and sounds like a duck.

      --

      War is necrophilia.

    37. Re:It's not always technical by eidechse · · Score: 1

      And your point would be?

    38. Re:It's not always technical by eidechse · · Score: 1

      Uh huh...argument by sound-bite...really convincing. I take that back, it does convince me that you don't have any experience with .NET.

    39. Re:It's not always technical by master_p · · Score: 1

      First off your optimizations - they are all details of the JVM implementation.There's nothing in the language spec which says where array objects get created (for instance).

      But the point is the way objects are accessed. In C++, you can do a loop using pointer arithmetic. That translates to a simple increment in assembly. Contrast that with Java: each array member has to be dereferenced by the use of an index. Which means that the Java assembly has to have an address all the time in hand, and then add the index to it at each iteration, which is much slower.

      When in Java you do a String[] args(for example), strings may be allocated serially. But my point was about generics: In order to have a generic array, you have an Object[] array. The objects of this array can't be allocated serially, simply because each entry of the array is a reference to an object.

      Look at it this way: if generics was not an important feature, would Sun care to implement it in the next generation of Java ? generics is important, because they know it allows for good optimization, not possible without it.

      I know some pretty slow C apps

      Of course there are slow C apps. There even can be slow assembly apps. But that was not the point of my argument. My point was that the apps written in Java are slower than similar apps written in C++, thus Java being slower.

      This is reflected in the development tools written with Java: slow as hell. Don't tell me that Oracle does not have the expertise to write a fast app. I can't believe that a flagship product like JDeveloper was developed by non-experienced programmers. I also have JBuilder 4: sometimes it takes about 20 seconds to open the UI editor. Constrast that with something like Visual Studio 7, which on the same machine flies, and you can see what I mean.

      You save weeks of dev time by having less bugs

      But that's what I am saying: by using templates, constraint pointers, STL and other good things about C++, you have no bugs just like in Java, and you save time and frustration when developing.

      Why does it have to be? Do you care what language your IDE is written in? You shouldn't. You should only care whether it does the job for you.

      I don't care either, but it is slow and prohibits my productivity. That's why I am complaining about it.

      Just because you can churn out 100k LOC and I can only do 1k doesn't mean your code is any good, and it doesn't mean mine wouldn't whip it's ass

      I agree with you here. But the experience of a programmer in a language plays a big role on the understanding of the language, and hence the problems that might follow. In other words, since I am more experienced programmer than your colleagues, I can make a program in C++ without memory leaks, and appreciate C++ beauty more than you do. And in the end, I am more productive, since speed is greater.

      No shit - developers make mistakes in all languages

      Surely, but my point is that 50 people involved in a project with no strict coding rules can make the project hell and give the language a bad name. The example you mentioned was not indicative of C++'s quality, it just showed that lack of project management can lead a project to hell. 50 developers can easily screw a Java project, too.

      More stating the bleeding obvious - I can write better code in a language I know. No shit

      The bleeding obvious was overlooked by you, in the process of glorifying a language which is a subset of C++, that in trying to solve the C++ problems it creates a new bunch of problems.

      And that's crap. I am surrounded by experienced developers (and I am one). My C++ sucks, so it doesn't win hands down for me.

      But you are not experienced in C++, as you have previously stated. So, you critisize something you don't have experience with. You probably belong to the bunch of people that got scared by C++, heard a few bad things, then went a

    40. Re:It's not always technical by Anonymous Coward · · Score: 0

      i tried delphi, call me stupid, i just couldn't grasp it with as much understanding that i have for vb.

      i started with basic for the trash 80 when i was 8, grew up with basic languages, and although i can do stuff in delphi and C, im just missing the fundemental understanding in them that i have with basic languages. every year or so, i reinstall delphi or C++ and give it another shot, but i spend too much time trying to learn syntax and stuff rather than doing any real coding, become impatient, and give up.

      which is why i would love to see a more "basic" like front end for lower level languagues for us old farts who are getting too old to learn new tricks :D

    41. Re:It's not always technical by Suidae · · Score: 1

      It's a shame because VB actually works quite well for a particular niche- quickly developing business apps

      If thats your reason for using VB, you'd probably be better of with Delphi/Kylix, unless you absolutely have to have something Microsoft.

  26. something cool that I like about .NET by fine09 · · Score: 2, Interesting

    This just brought to mind the .NET CLR.

    I have done a little bit with this, coded a couple apps where a member on my team really really liked VB and myself a java guy liked J#.

    We could work well together without having to worry about learning a syntax that we didn't feel comfortable with.

    1. Re:something cool that I like about .NET by cant_get_a_good_nick · · Score: 1

      There was a post before, when the CLR first came out, about the CLR essentially introducing the concept of "skinnable" languages. Use the syntax you like, and it will work on the CLR. Cool, though not without its issues. A language is more than syntax, and essentially you're changing C# (C# and CLR development go hand in hand, it's definitely the first among equals as far as language goes) to say, VB.NET, but which object model are you using? A lot of VB users hate the new VB.NET because it's a fairly radical departure from normal VB (whatever normal means for VB users). I'ts almost as if someone made a script that converted Lisp to C++ primitives and it works as long as you forget that pesky list stuff because I'm sorry C++ just doesn't do lists easily. Interesting concept, but has flaws.

    2. Re:something cool that I like about .NET by eidechse · · Score: 1

      Well said. Not to mention having to maintain/extend/fix/rewrite code written by the last guy who refused to code in anything but Klingon Fortran .NET.

    3. Re:something cool that I like about .NET by Anonymous Coward · · Score: 0

      And what if you need to fix a bug in one of your fellow developers' code?

  27. BASIC by ucblockhead · · Score: 1

    BASIC wasn't so bad, before some company or other (can't remember which right now) decided to make a compiled version for "Visual" UI development.

    --
    The cake is a pie
    1. Re:BASIC by elmegil · · Score: 1

      I hate to break it to you, but compiled BASIC is very very old, long before VB. I remember compiling eBASIC startrek games in 1979 on CDOS (a CP/M variant from Cromemco).

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
    2. Re:BASIC by flippet · · Score: 4, Funny

      I hate to break it to you, but compiled BASIC is very very old, long before VB. I remember compiling eBASIC startrek games in 1979 on CDOS (a CP/M variant from Cromemco).

      Shhh, he's having a Microsoft bashing moment... it could be dangerous to interrupt slashdotters whilst in this state, you never know what they might do...

      Phil

      --
      "Cattle Prods solve most of life's little problems."
    3. Re:BASIC by Fred+IV · · Score: 1

      You're bringing back bad dreams about GOTO statements, BASIC was always bad.

    4. Re:BASIC by sketerpot · · Score: 2, Insightful
      It wasn't so bad because it was nearly dead, rather than a huge thing that gets packaged with most office software and goes wandering around like a zombie of a language that just won't die. Why can't it be replaced by a good language like Python? (I also hear good things about Ruby, and the example programs look pretty clean. I haven't gotten around to learning it yet.) I mean, who wants to keep writing "dim" statements until the end of their days?

      Curse you, Microsoft, for resurrecting Basic.

    5. Re:BASIC by KinkyClown · · Score: 1

      I started out in GWBASIC and I always used the GOSUB command instead of the GOTO. GOTO was optional and avoidable. I don' t know if older versions/types of BASIC didn' t have GOSUB but after that they all did.

  28. Calling Card of a Horrid Developer: by WndrBr3d · · Score: 4, Funny

    <%@ Language=VBScript %>

    Is you see this, please call Crime Stoppers at (888)580-TIPS.

    1. Re:Calling Card of a Horrid Developer: by nutbar · · Score: 2, Funny
      Is you see this, please call Crime Stoppers at (888)580-TIPS.

      But what's TBL's mom's number?

    2. Re:Calling Card of a Horrid Developer: by Anonymous Coward · · Score: 0

      Hey, if you find a an ASP developer that understands one can change the default language, you've pretty much got the cream of the crop.

    3. Re:Calling Card of a Horrid Developer: by ickle_matt · · Score: 1

      Heh.

      Once had a contract to write the code for a website for $WEBCO. $WEBCO's managers insisted that all code was writting in VBScript as that was "what our developers all work in".

      Finally managed to meet one of their devs last year - found out that they write almost exclusively in perl and had finally managed to get the budget to do a rewrite so they could maintain it better...

  29. Pascal? by malia8888 · · Score: 1

    hmm........... nothing tacky was said about Pascal!!

    --
    Harpo Tunnel Syndrome--my wrist feels funny.
    1. Re:Pascal? by tliston · · Score: 1

      Because BWK already said everything that needed to be said: Why Pascal is Not My Favorite Programming Language

      -TL

    2. Re:Pascal? by Anonymous Coward · · Score: 0

      That's nice. Linking to an article that's over 20 years old and that was written by a co-inventor of a competing language, I mean.

      But, to each his own; however, I doubt many objective people would deny that Pascal units are far superior to C headers.

    3. Re:Pascal? by JohnQPublic · · Score: 3, Interesting

      When Knuth set out to reinvent publishing, he had to decide what language to write TeX et al. in, and wanted others to be able to use it (or he'd probably have coded in MIX). In later years, he explained that he asked everyone he respected to name their three favorite languages. There was a wide range of #1s, but most folks put Pascal as #2. So he wrote in the language that everyone liked less than something else.

      On the other hand, if Pascal is good enough for the gods, it's good enough for us grunt coders.

    4. Re:Pascal? by Anonymous Coward · · Score: 1, Informative

      That's because every Pascal-bashing geek is referring to ANSI Pascal which is very limited in its features. Very few people know that the current Pascal implementations (Delphi, Virtual Pascal and some others) are much closer to Ada than to (forgotten more than ten years ago) ANSI standard.

  30. FoxPro Rocks by Anonymous Coward · · Score: 0

    Yeah you heard me right

    1. Re:FoxPro Rocks by Anonymous Coward · · Score: 0

      FoxPro blows.

  31. But by Timesprout · · Score: 3, Insightful

    As the article points out many languages have a lot of quirks. While the pragmatic programmer is one of my favourite books on coding I dont think learning a new language every year is a particularly useful thing to do. There is a world of difference between just 'learning' a language and gathering the experience over an extended period of time to become truly proficient in it. I already code in serval languages and while I might have a passing interest in reviewing a couple more just to see how they work I really dont want to invest the time required to learn them properly when I dont see them appear in job adverts.

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
  32. Great article! by Anonymous Coward · · Score: 1, Interesting

    Oh man, his criticisms of Java, C & C++ (three languages I enjoy) are dead-on. The way he addresses the whitespace issue in Python isn't anything new, but it's stated more clearly and articulately than I've ever read.

    My only complaint about the article is that his condemnation of XSLT isn't rabid and acidic enough for my tastes. :D

    Good stuff. None of the languages he addresses are glaringly bad and in fact most are actually quite good (well... XSLT is a bad joke), but these are great points to remember when someone starts spouting off about how language XYZ is the ultimate.

    1. Re:Great article! by chromatic · · Score: 3, Interesting
      My only complaint about the article is that his condemnation of XSLT isn't rabid and acidic enough for my tastes.

      I've used it to great effect. It does what it says it does. Combined with XPath, the syntax makes my eyes hurt, but it's stunningly effective.

      I think I'd rather see s-exps or even Python's indentations than a sea of angle brackets, but the choice of XML for syntax actually makes sense.

  33. Believe it or not... by Anonymous Coward · · Score: 3, Funny

    ...I work at a company that uses an early 1970's mainframe (won't divulge any details). We use punchcards (yes punchcards) to program the beast in FORTRAN. As you may or may not know, FORTRAN was originally adapted to punch cards, hence the 80 column limit and the 6 column space prior to issuing commands. (These limitations have been relaxed in FORTRAN 90/95). Of course, I also program on other, more modern systems using other languages, mostly C++ and Perl. However, I still find myself writing programs that basically mimic FORTRAN's style. I prefer short lines no longer than 80 characters and capitalized command names, etc. Once I actually rewrote some of gcc's source code so that reserved words like for, while, switch, etc. were changed to FOR, WHILE, SWITCH, etc. I also capitalized the functions in the standard library (!). Since then, I've gotten over my capitalization fetish, but FORTRAN's code still looks better to me. I guess old habits never die.

    1. Re:Believe it or not... by Anonymous Coward · · Score: 0

      ahh that's too much to read. too much work. go outside and play.

    2. Re:Believe it or not... by psoriac · · Score: 1

      Next time, you may want to investigate doing something like '#define FOR for' instead of modifying and recompiling your compiler...

      --
      I browse Slashdot at +3, Funny
    3. Re:Believe it or not... by FuzzyBad-Mofo · · Score: 1

      It's the Priceline supercomputer, isn't it? Tell me you don't have William Shatner imprisoned, feeding puchcards into the Priceline supercomputer and producing horrible commercials!

    4. Re:Believe it or not... by Imperator · · Score: 1
      Once I actually rewrote some of gcc's source code so that reserved words like for, while, switch, etc. were changed to FOR, WHILE, SWITCH, etc. I also capitalized the functions in the standard library (!).
      And I suppose all of that FORTRAN also made you forget how to use C preprocessor macros?

      #define FOR for
      #define Malloc malloc
      --

      Gates' Law: Every 18 months, the speed of software halves.
    5. Re:Believe it or not... by hayriye · · Score: 1

      I sometimes convert my java or C sources to all uppercase and suddenly, they become serious business programs.
      #INCLUDE <STDIO.H>

      INT MAIN()
      {
      PRINTF("HELLO WORLD\N");
      RETURN 0;
      }

  34. can you hate something you don't understand? by BlueLines · · Score: 1, Informative
    What I Hate About Perl
    The syntax for working with anonymous data structures and structures by reference is ugly:
    my $count = keys %{ $self->{groups}[HACKERS] };

    unless somewhere else in the code you've got a:
    use const HACKERS => 1;
    this code will do nothing. and if you've got a mapping of names to numbers (and HACKERS must be numeric, since it's an array indice), you should be using a hash instead.
    but of course, since this is perl, doing it correctly is even uglier :-)
    my $count = keys %{$self->{groups}->[$mapping->{HACKERS}]} ;
    --
    --BlueLines "The cost of living hasn't affected it's popularity." -anonymous
    1. Re:can you hate something you don't understand? by chromatic · · Score: 1

      You mean use constant HACKERS => 1; :).

    2. Re:can you hate something you don't understand? by Anonymous Coward · · Score: 0

      I have to ask -- are you defending perl, or subtly flaming it?

      It's pretty sad for perl that I can't even tell.

    3. Re:can you hate something you don't understand? by Molt · · Score: 1

      Not quite true. Unless strict checking is turned on the HACKERS could be the name of a subroutine. Admittedly this would be breaking almost all sane Perl conventions, but it's still possible given that snippet.
      I've spent too long trying to understand the inner workings of Perl golf to let that one past me, oh yes.

      --
      404 Not Found: No such file or resource as '.sig'
    4. Re:can you hate something you don't understand? by Anonymous Coward · · Score: 0

      (and HACKERS must be numeric, since it's an array indice)

      Sorry for the grammar lame, but you've pushed a major button of mine. It's index, not indice! I hate it when people undo plurals incorrectly, to create a bizarre pseudo-singular. Parenthesis, not parenthese! Matrix, not matrice! Grrrrrrrrrgh *boom*
    5. Re:can you hate something you don't understand? by Anonymous Coward · · Score: 0

      For a long time the convention for doing constants in Perl was to use subroutines. Most modules on CPAN still do it this way:

      sub HACKERS {1}

  35. As a novice programmer... by Anonymous Coward · · Score: 2, Informative

    I love Squeak. It's SmallTalk, OO, Realtime, runs on anything, and is easy to cope with.

    Check it out, if you are older, like me, and getting into programming but have never programmed much before:

    http://www.squeak.org/

    1. Re:As a novice programmer... by Anonymous Coward · · Score: 0

      Mod this -1 OFF-TOPIC. The Anonymous Coward begins with "I love..." and proceeds to not comment about "What I hate...". Mod this comment down. It is totally off-topic

  36. Can't anybody get C right? by Animats · · Score: 4, Interesting
    C is the syntactical ancestor of many programming languages today, but none of them get it right.

    ANSI C itself is at least stable. The procedural part of the language is generally accepted (it's basically the same in Java, C++, etc.) The declaration syntax has problems. It's broken for historical reasons. Originally, C was LALR(1), but then came "typedef", and it went downhill from there with "class", etc. Nobody has been able to fix this properly. This is why the parser gets lost in so many error situations.

    C++ suffers from some early bad design decisions. Templates came late. Strostrup knew about templates, and decided not to put them in. This led to great pain and ugly code, templates went in, and it's taken a decade to clean up that mess.

    Java was supposed to clean this all up, but now Java is getting generics, which it wasn't supposed to need. So it's going down the same path as C++, but with a new set of mistakes.

    Other attempts to fix C include Objective C (which still has a following) "C+@" (a Bell Labs product that predates Java), "C#", a Microsoft variant, and several others with tiny market share such as "D". None are enormously better than C.

    I'd like to see C++ cleaned up, but the ANSI committee is more interested in putting in obscure features for template writers.

    1. Re:Can't anybody get C right? by Anonymous Coward · · Score: 0

      Ok so we just need a C++++ to fix it. Its so simple and yet so overlooked.

    2. Re:Can't anybody get C right? by Tumbleweed · · Score: 1

      > Objective C (which still has a following)

      Actually, Objective C's following is growing with the advent of Mac OS X.

    3. Re:Can't anybody get C right? by be-fan · · Score: 2, Interesting

      I think the main problem with C++ is that you *can't* clean it up. It took an agonizing 5 years for compilers to finally support the C++ '98 standard, and any breaks in compatibility at this point will have developers up in arms. Also, remember that there are many large software systems written in C++ than Java or Python, so they can't afford to change things in a way that would break that code. Heck, given the pains Sun is going through to implement generics, I'd say that even Sun is having problems because of the need to mantain compatibility.

      So right now, the standards committie is trying to fix what it can. Since template metaprogramming is a aspect of C++ without a lot of compatibility issues they can afford to change around stuff a little bit without pissing too many people off. And god knows the template mechanism needs some attention. Template metacode is rather ugly. Some of the suggested features in C++ 0x, like template typedefs and typeof will greatly help in making template code easier to read.

      --
      A deep unwavering belief is a sure sign you're missing something...
    4. Re:Can't anybody get C right? by Anonymous Coward · · Score: 0

      What about Objective-C? I realize it's just C, with frills. But for GUI programming (I use OS X), I find that Objective-C just rocks. Objective-C plus the design of the NeXTStep libraries, with Apple inherited.

      The retain/release convention makes memory handling easy, the id type allows for very loose type checking, objects can acquire new methods at run-time. Or you can be as fussy as ordinary C permits.

      How does clicking on a button do something? It sends a action (think of a function with a certain signature) to its target (a pointer). If you want to have the same object respond to more than one button click, just have the buttons send different actions. Easy. Clean. Simple.

      In Java, this requires a single function called by all buttons with a if (...) else if (...) else if {...} test to figure out what called the action. And if you want the same object to respond to buttons, sliders, etc., pretty soon the list of interfaces implemented gets really long.

      In Objective-C, it's just as simple as having

      -(void)buttonFooBarClicked:(id) sender
      { // do stuff here
      }

      -(void)buttonBarFooClicked:(id) sender
      { // do different stuff here.
      }

      -(void)sliderMoved:(id)sender
      { // handle slider movement
      }

      And wiring up things in the Interface Builder.

      I don't even want to think about MFC... that scarred me for life.

    5. Re:Can't anybody get C right? by Animats · · Score: 1
      I know, I know.

      There is a strain between the people who just want templates as generics and the people who view templates as a way to do compile-time computations. The template mechanism is a painful way to do compile-time computations, but clever people have been able to hammer it into doing so. The resulting code is incomprehensible. So attempts are being made to kludge the language to make it less so. The result may work, but it won't be pretty.

    6. Re:Can't anybody get C right? by Anonymous Coward · · Score: 0

      Actually, Objective C's following is growing with the advent of Mac OS X.

      Not really. I've been working with Apple (internally) and I can say 99% of any new code is C++.

      For certain things you use Objective-C, but almost all the engineers seem to be using C++.

    7. Re:Can't anybody get C right? by Cthefuture · · Score: 1

      I've posted on this before, here it is again.

      Basically, I would like to make some minor updates to C that add minimal high-level modularity (similar to Erlang) and some generic programming capability (eg. a better preprocessor).

      --
      The ratio of people to cake is too big
    8. Re:Can't anybody get C right? by be-fan · · Score: 1

      It's not just about compile-time computations. It's about giving C++ a proper compile time metalanguage. It's not a new concept. Lisp macros do a lot of the same things, although Lisp macros are implemented properly in that it uses the regular Lisp language within the macros themselves. There is a difference in that Lisp offers the compiler at runtime, but there is no reason why C++ template "macros" couldn't be made as powerful, within the limits of what can be computed at compile time.

      If you doubt the usefulness of metaprogramming, consider a simple example. I recently had to write several low-level classes that had to expose lots of state variables to higher levels of a library. I did not want to get stuck writing dozens of trivial, pass-through, accessors. It was the matter of maybe 50 lines of code, using templates and operator overloaded, to write a class that generated accessors for me. Defining each state variable went from about 7 lines of code (definition, 2 accessors) to 1 line of code. As Alexanderscu showed in his book, this technique can be extended to write code generators for class factories, etc.

      Lastly, I wouldn't say template code is "incomprehensible." It's synactically ugly, but really is comprehensible if you are used to reading functional code. A lot of the ugliness is just boilerplate stuff your mind learns to ignore.

      --
      A deep unwavering belief is a sure sign you're missing something...
    9. Re:Can't anybody get C right? by Anonymous Coward · · Score: 1, Funny

      Nah, C+=2 would be better...

    10. Re:Can't anybody get C right? by Anonymous Coward · · Score: 0

      I have done some work with template metaprogramming, and have found them extremely verbose to do even the simplest things. I suppose I just didn't get to the point where I'd learn to filter out the reams of boilerplate code where some details here and there would be significant.

      As far as I can see, as compared to lisp macros the greatest failing of template metaprogramming is that you need to use this completely different declarative language to do the compile-time stuff, thus requiring extensive rewrites any time you decide that some run-time stuff would be better done at compile time, or vice versa.

      Out of interest, did you actually save that many code lines in total?

    11. Re:Can't anybody get C right? by be-fan · · Score: 1

      I saved about 6 lines of code for each declaration, and I had to write 30 or 40 accessors, so I came out about 80 lines ahead. But the point is that I only had to write the code once, and I can use it again. Meanwhile, the 180-240 lines of code to write the accessors manually is stuff that I'll never be able to reuse.

      However, I completely agree with you that template metaprogramming's greatest flaw is that it's uses a seperate syntax. It's an unfortunate side-effect of the way templates evolved. However, I disagree that "extensive rewrites" are involved. By and large, it's really not that interesting to calculate stuff like factorial(n) at compile time. More useful is doing code generation (generating accessors, class hierarchies, etc) which is stuff you couldn't do at runtime anway.

      --
      A deep unwavering belief is a sure sign you're missing something...
  37. Well, yes by ucblockhead · · Score: 1

    Hence the for "visual" UI development clause.

    --
    The cake is a pie
    1. Re:Well, yes by elmegil · · Score: 1

      If that was the important clause, he might just as well have left off the bit about being compiled. Seems he thinks that compiling BASIC is some sort of unique Microsoft heresy or something.

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
  38. You are probably the worst programmer you ever met by LibertineR · · Score: 1

    If you dont know that ASP is NOT a language, then the above applies to you. ASP sucks and nobody at Microsoft would tell you any different. Lucky for many, ASP sucked so bad, that Microsoft came up with ASP.NET, which completely rocks. No more spaghetti code. Codebehind is great for keeping the idiot designers from fucking with your logic. Being able to use C# when I feel like it or VB.NET when I feel like it is great. Of course, you would not know that, until you learn what makes a language a language.

  39. Re:You are probably the worst programmer you ever by los+furtive · · Score: 0

    Yeah, too bad you'll be stuck running your code on a microsoft server, bwahahaha. What a waste of money, let alone pseudo-security.

    --

    I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  40. Re:You are probably the worst programmer you ever by neurostar · · Score: 2, Interesting

    you'll be stuck running your code on a microsoft server

    http://www.apache-asp.org/

    Currently just supports perl scripting though.

    neurostar
  41. Language indepedant: Debugging by CuteAlien · · Score: 4, Interesting

    Actually i enjoy programming in a lot of languages and, as problably most who programmed for a while, the problem is seldom the language (otherwise you chose the wrong for the job).

    But it always get's ugly when it comes to debugging. You're in a bad mood anyway (it's a bug - probably your bug - and it will cost you, very probably, even more time than programming the whole f**king function).

    No matter which language, after a while you start hating your debugger. You're programming 3D and have a problem with vectors - all u see variables with some numbers. You're programming a database and the results don't fit.. all you see are variables with wrong result. Etc...

    It's always like your car broke down and you get messages like iron content of bumper 100%, mass of bumper 1.4, foo.ineedtorenamethis 1.5...

    And then you gotta dig through the dirt :(

    1. Re:Language indepedant: Debugging by jbum · · Score: 1

      the problem is seldom the language

      This is a good point. It's not the language. It's the programming environment as a whole.

      How long is your compile-test-debug cycle?

      How accurately can your compiler identify what's wrong with your code?

      Do you have adequate documentation that is both succinct and comprehensive?

      Did your teammate get up on the wrong side of the bed this morning?

      Is the target platform a known quantity? Is it stable?

      Are flamewars about languages on slashdot keeping you from getting your work done?

      etc.

    2. Re:Language indepedant: Debugging by Kashif+Shaikh · · Score: 1

      And then there were race conditions and obscure bugs /w many threads. Where your program core dumps everyday except Thursdays:)

    3. Re:Language indepedant: Debugging by Anonymous Coward · · Score: 0
      You're in a bad mood anyway (it's a bug - probably your bug - and it will cost you, very probably, even more time than programming the whole f**king function).

      Finding my bugs are vastly easier than finding other people's bugs. If that is not the case for you, perhaps you should learn to just stare and step over a piece of code, instead of verifying it should have indeed be doing what you intend it to do and how.

    4. Re:Language indepedant: Debugging by newhoggy · · Score: 1

      I've been finding that unit testing helps a lot. Writing the unit tests themselves are a chore, but having written them, I find it makes the debugging experience all the more rewarding. This is especially the case because doing so ensures the code has been written with testing and debugging in mind.

  42. and C is exactly where you should stop. by Anonymous Coward · · Score: 0

    you said

    "Never learn to program with ASP. The worst programmers I know started with that abomination of a language. (emphasis added)

    mmmhmm.

  43. Phaeton Sez by Anonymous Coward · · Score: 0

    MY programming language can beat up YOUR programming language.

  44. Hey hey now... by wan23 · · Score: 1

    Not to pick nits but you do *not* have to catch every exception in Java, and if a method throws a checked exception there's probably a good reason for it. Last week I had to give a demonstration of our software engineering project and almost got an F because someone used unchecked exceptions somewhere that kept causing the entire thing to quit. The first thing I did when I got back was change all of those methods to throw checked exceptions and assigned someone to fix the twenty or so classes I broke. He wasn't happy but when we gave the presentation again we actually made it past the login screen. (What? I can't blame bad testing on RuntimeException? Our own fault? Naaah...)

    1. Re:Hey hey now... by Brummund · · Score: 1
      Hear, hear. Someone should tell the author about the throws keyword.

      And there's a few inconstincies in his argumentation (about SQL): The approach that feels most natural is often really, really bad. I don't naturally think in terms of set operations.
      Well, then SQL should be good, since it isn't "natural"?

      And about Java, again:
      Interfaces get around part of the lack of multiple inheritance, but I'd like to be able to reuse common code in ways besides inheritance. Mixins that don't require inheritance would be a nice touch. Well, doh. You can make a proxy/delegate. You could just instantiate a class, have it as a private member, and, erm, just use it?

      I have a hunch that the author isn't particularly experienced...

    2. Re:Hey hey now... by chromatic · · Score: 1

      I phrased the exceptions bit rather poorly. I should have said "deal with" instead of "catch". I'd prefer not to have to declare throws lists explicitly. It's just personal taste.

      My interface gripe is specifically that it feels like inheritance (and I lump interfaces in here, whether anyone else agrees) is the one true way to say "this object can handle the method I'm about to call on it". Is there an easy way to retain type checking when using a proxy or a delegate without using an interface?

    3. Re:Hey hey now... by Brummund · · Score: 1

      And, uh, SQL isn't a programming language, it's a query language. If you're using SQL as your main programming language for an application, I really hope you are building a datawarehouse or some database maintaince tool, or you're in for the Vendor Lock-in Price of the year.

      (Thankfully, most RDBMS vendors do provide you with the opportunity of plugging in code written in other languages, like Java, C, or Perl, instead of those ugly stored procedures)

    4. Re:Hey hey now... by Brummund · · Score: 1
      Ah, we're getting down to the meat :)

      I don't use inheritance that much. I use interfaces to make an object polymorphic, so it can act differently in various contexts. I seldom write methods that expect a class, they expect an implementation of a very specific interface.

      AFAIK, the answer to your question is no, but I'm not quite sure what you're getting at.

      But interfaces might solve your gripe, if they are defined very specific. Let's say you define a class for handling some game logic. The game is supposed to be "playable" and "configurable".

      I then make two interfaces, called Playable and Configurable. The Playable will have a method "play()" and the Configurable probably get/setConfiguration(). The configuration system will accept something that is configurable, and set the configuration. The engine will expect something that is "Playable".

      Now, if I were to reuse some code between two games, I'd refactor it out into an utility class, and just forward the calls internally in the class to the util. If the code at hand is very specific, I might even make a super class, putting the common code there, implementing the interfaces, and just sublcass it to allow for the variations.

      So, have you considered defining interfaces very specific to a task, or have you used them more to lump play and set/getConfiguration into a single interface?

      (Anyway, this is interesting. If I misunderstood your question, please elaborate)

    5. Re:Hey hey now... by chromatic · · Score: 1

      You've described the best approach I know of in Java.

      I think there's an important difference between asking "can this item support the message I'm about to send it" and "does this item fit into a type hierarchy"? Unfortunately, languages with static typing tend to care far more about the latter.

      There are lots of ways to achieve code re-use: inheritance, aggregation, delegation, and mixins. Those are all good ways for one item to be able to support various messages. It's unfortunate that inheritance is the way to mark that it can handle that message.

      Java's interfaces are one way to mark that, but they don't quite go far enough, since you don't get any code re-use with them. (Maybe it's possible, but I've never seen an example.)

      Maybe I'm really overthinking things, but it seems like an important distinction to make.

    6. Re:Hey hey now... by mwing · · Score: 1

      I use interfaces mainly for type checks and to make sure that my co-workers use the correct methods for certain types of classes. I find them flexible enough to serve my purposes, and provide me with a kind of polymorphism.

      As fas ar code reuse goes, doesn't a call to super.methodX() do what you want? Providing that the interface is implemented in the super class.. That's the way I've implemented it quite many times, not the best solution, but creating a common interface, and them implementing it in a abstract class, and overriding the necessary methods in the "real" class.

      I sometimes miss polymorphism (flashbacks from my C++ days still haunt me :), but I can easily cope without them. Interfaces are not a drop in replacement though.

  45. Reactionary languages by SimHacker · · Score: 3, Insightful
    Many languages weren't designed, they were just reactions to the mistakes of other languages.

    Perl is a reaction to the flaws of many different languages. Unfortunately it reacted by imitating all the worst flaws of all the worst languages. People who think Perl is great are totally ignorant of other languages, and have extremely bad taste. They are desparate about their job security, which is why Perl is the best choice for corporate parasites looking to drum up busy-work to justify their salary.

    PHP is a reaction to Perl, used by amateurs who were burned by Perl, but actually want to get work done, however they don't know any better languages. Perl (mis)taught them that programming languages were extremely difficult to learn. But they couldn't stand Perl, so they switched to PHP because it seemed "simpler", without realizing how much better other programming languages are. So they stick with PHP because they're afraid to learn another programming language, having been traumatized by Perl, and tranquilized by the incredible mediocrity of PHP. PHP was designed to recruit disillusioned Perl programmers.

    C++ is a baroque overreaction to C, whose designers were obviously ignorant about programming language design, learnability, usability, readability and maintainability. So all those lessons had to be (mis)learned again, the hard way. Which brings us to...

    Java is a moderate reaction to C++, that still ignored much about programming language design that C++ designers never bothered to learn (so as not to drive off C++ converts by forcing them to learn new concepts). So if you know C++ but don't know Lisp or any other reasonable language, you think Java is great. Java was designed to recruite disillusioned C++ programmers.

    So PHP is to Perl as Java is to C++. The lesson: You can't fix a badly designed, fatally flawed language by imitating it.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Reactionary languages by Mattwolf7 · · Score: 1
      I do not agree with you on your Perl PHP argument.

      PHP is a reaction to Perl, used by amateurs who were burned by Perl, but actually want to get work done, however they don't know any better languages. Perl (mis)taught them that programming languages were extremely difficult to learn. But they couldn't stand Perl, so they switched to PHP because it seemed "simpler", without realizing how much better other programming languages are. So they stick with PHP because they're afraid to learn another programming language, having been traumatized by Perl, and tranquilized by the incredible mediocrity of PHP. PHP was designed to recruit disillusioned Perl programmers.


      I learned to program in this order QBasic, TCL\TK, Visual Basic, Python, C, C++ then PHP. Ive never ever looked at Perl code so I was not traumatized by it. Why would someone make or even want to learn a language that was difficult? The idea of a language is to program not make complex code mearly complete a task. What ever gets the job done wins in my book. Shouldnt you pick the path of least resistance? I do, good luck working on Perl while I work on PHP which is "simpler" (you said so yourself)
    2. Re:Reactionary languages by Camulus · · Score: 1

      so what language(s) do you recommend then as the "superior one(s)"?

    3. Re:Reactionary languages by Tsugumi · · Score: 1
      C'mon, -1 troll, surely. And your reaction hypothesis could just as easily be any other design process. First realise that there is nothing out there that does exactly what you want. Then design something that does what you want. Then find a whole bunch of people for whom your new thing solves a lot of their problems, but who have a whole heap more problems that it doesn't solve yet. Then your thing evolves.

      That is pretty much how perl evolved, and for all your trollisms, there is still nothing that comes close for what it is used for. That you think PHP is for disillusioned perl programmers shows just how much you miss the point. PHP is a web page scripting language, which seems to me to have more in common with asp than perl. Perl has been used to produce dynamic web pages, but jeez, I've never produced a perl cgi in anger, and I use perl every day.

    4. Re:Reactionary languages by mbrubeck · · Score: 3, Interesting

      Paul Graham put together a brief list along those lines, titled What Languages Fix.

    5. Re:Reactionary languages by Bendebecker · · Score: 3, Insightful

      I know Lisp, Java, C, C++, PHP, and Prolog. First, I think your view of PHP and Perl is correct but don't ignore that fact that they are very powerful and very useful languages, regardless of their flaws. Just because PHP is simple doesn't take anything away from it, it was meant to be simple. Every language was designed with a use in mind and PHP in that theater has its uses that make it better than other languages. People don't just use PHP becuase "they are afraid to learn other programming languages." Rather most poeple use PHP because it is the best tool for the job.

      As for the rest it just seems that your pissed off that people perfer languages that aren't Ada. C++ is sort of a mess, I'll give you that, but that is mostly because they tried to keep too much of C in it. As for Java, it is a grea language. It is very readable, it is easy to write, it's OOP design (if implementing a good modularized design) makes it very easy to maintain, etc.. The developers didn't ignore programming language design, they made choices as all developers must. They had certian goals for the language in mind and they met those goals. Just because you don't like their design choices doesn't mean they didn't know how to design. You have to make trade offs as well. You can't have your cake and eat it too. I have programmed in Lisp. Java is still great. Java is an object oriented language, Lisp is a functional langauge. They have different design issues for different paradigms. As for readibility, writibility, and maintainability consider this: how many versions of Java re tehre? How many verison sof Lisp are there? Ever try to write a Lisp program that could runb in all implementations of Lisp. How about teh fact that Lisp goes crazy with (). Every try to read a Lisp program with twenty nested function calls? Even writing them and trying toi keep track of all those () are a pain in the ass.

      Go read "Programming Languages" by Kenneth Louden.

      --
      There's a growing sense that even if The Future comes,
      most of us won't be able to afford it.
      -- Lemmy
    6. Re:Reactionary languages by JohnQPublic · · Score: 1

      People, people, people! Flame off! Don knows whereof he speaks. For chrissakes, the man wrote a debugger in Postscript for NeWS! And Pie Menus, in Postscript and a bunch of other languages. And speaking of Pie Menus, he's got serious human-factors cohones. So listen up.

      BTW, Perl did imitate the worst languages. In the very beginning it started as an awk replacement, and the first versions were 100% source-compatible with awk! I can't think of a worse starting point (OK, I can, but I try not to).

    7. Re:Reactionary languages by frodmann · · Score: 2, Insightful

      Some very strong comments. It appears that you have dabbled in these languages but not used them for anything serious.

      I use perl and its not because I'm ignorant of other languages. I've built applications using many different languages including functional languages like Haskell, logic languages like Prolog, strongly typed OO languages like Java and C++ and scripting languages like tcl, bash and perl.

      Perl has some extreme strengths, I find it useful from complex shell script and trolling log files for useful information. The wealth of modules available make it extremely easy to perform almost any task in very little programming time.

      I admit that for larger applications I would prefer to use Java as the need for more robust, reliable and maintainable applications become more important than quick development time. Java is great but you definitly need a reasonable IDE like Netbeans or Eclipse to improve your efficiency, otherwise even simple tasks can take some time.

    8. Re:Reactionary languages by jbum · · Score: 1

      People who think Perl is great are totally ignorant of other languages, and have extremely bad taste.

      Having some feelings there? I learned Perl after programming in C, C++, Lisp, Prolog, Forth, BASIC, Pascal, Awk, various shell scripts and countless other languages for about 15 years.

      For all those niggling half-a-page scripts that I used it for, Perl was (and is) great. Of course, I do have mismatched socks....

      I might have agreed with you if you had inserted a few caveats (such as "those who attempt to use Perl for large projects...").

    9. Re:Reactionary languages by sryx · · Score: 1

      how many versions of Java re tehre?
      How many verison sof Lisp are there?
      Ever try to write a Lisp program that could runb in all implementations of Lisp.
      How about teh fact that Lisp goes crazy
      and trying toi keep track of all those


      Now did you say you program in Lisp, or with a lisp? Hehe, like I'm any better :P
      -Jason

    10. Re:Reactionary languages by Anonymous Coward · · Score: 0

      "those who attempt to use Perl for large projects" without adequate planning.

      What scares me is when people use Perl for large projects and start with minimal Perl or programming knowledge. Those projects quickly become unwieldy and are immediately legacy systems.

      These days, people should know to write tests, refactor at times, write documentation and all that malarky.

      The problem is when, after 5 years of patching this system have passed, you want to do more but are so unsure of how the system will react you spend a week doing anything. And then you try to retrofit the tests and refactoring and stuff. Blimey.

      This, of course, applies to any language, not just Perl.

    11. Re:Reactionary languages by Anonymous Coward · · Score: 0

      People who think Perl is great are totally ignorant of other languages, and have extremely bad taste.

      Flame much? While we're talking about languages, that comma doesn't belong there, Turbo.

      BTW, people who characterize everyone who disagrees with them as having bad taste are generally assholes.

      That includes me.

    12. Re:Reactionary languages by Kashif+Shaikh · · Score: 1

      Perl is fucking powerful and a joy to program in -- you could write messy C routines beautifully in Perl and do very fast function prototyping. My philosophy is this: if it takes you 100+ lines to do something very simple(i.e. doing a db query with have the function full of sprintfs) then find another language to do it in.

    13. Re:Reactionary languages by varjag · · Score: 1

      I have programmed in Lisp.

      Probably not a lot.

      Lisp is a functional langauge.

      Lisp is multi-paradigm language. Its OO system far exceeds the one of Java in elegance, flexibility and expressive power.

      How many verison sof Lisp are there? Ever try to write a Lisp program that could runb in all implementations of Lisp.

      ANSI Common Lisp is the dominant Lisp today, with numerous free and commerical implementations. Writing portable applications in it is certainly easier than, say, in C.

      Every try to read a Lisp program with twenty nested function calls?

      You don't need to nest 20 function calls very often (I believe I never did that). Lisp-aware source editors conveniently indent the source and match parens for you, so this is not an issue. The argument is on par with "ever tried to read a Java program written in single line"?

      --
      Lisp is the Tengwar of programming languages.
    14. Re:Reactionary languages by duggy_92127 · · Score: 1
      People who think Perl is great are totally ignorant of other languages, and have extremely bad taste.

      Yea? Well, you smell, and your dog's ugly, too.

      Doug

    15. Re:Reactionary languages by mofolotopo · · Score: 1

      I can't believe this was modded as insightful...seems like trolling to me. In the past I've made extensive use of Java, C, C++, and Perl, and guess which one I use every day? Perl. Saying that people who use Perl are ignorant of other languages is just asinine. Perl has a niche that it is very very useful in. It's equivalent to saying that people who use hammers are ignorant of screwdrivers; a smart programmer uses the tool that is appropriate for the job. If the author of the original comment is sticking to a particular language out of linguistic jingoism or the kind of intellectual snobbery displayed in his comment, he's picking languages for the wrong reasons.

    16. Re:Reactionary languages by SimHacker · · Score: 1
      Then perhaps you should get a job sniffing dog butts and judging dog beauty contests, instead of programming in Perl. The world would be a better place if you applied your skills where they're most appropriate.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    17. Re:Reactionary languages by Magius_AR · · Score: 1
      Perl (mis)taught them that programming languages were extremely difficult to learn

      Difficult to learn?!? There's only three data types, none of which need to be declared. You don't need prototypes, pointers, memory management, bounds checking, etc... I couldn't count the degree of complexity C/C++ has over Perl. You can learn Perl in like less than a day reading a book. Now to be truly great at it takes some time.

    18. Re:Reactionary languages by SimHacker · · Score: 1
      Why don't you explain to the class how to use references in Perl, and then justify why they're so well designed, compared to C/C++.

      Extra points for keeping a straight face and not projectile vomiting during your presentation.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    19. Re:Reactionary languages by Magius_AR · · Score: 1
      Why don't you explain to the class how to use references in Perl, and then justify why they're so well designed, compared to C/C++.

      References in Perl are established with a single \ appended to the beginning of a data type. They're deferenced with a $.
      References in C/C++ are established with a single & appended to the beginning of a data type. They're dereferenced with a *.

      I don't exactly see the vast difference you're implying.

    20. Re:Reactionary languages by defyance · · Score: 1
      Psst, /.'s core is Perl.

      Everyone has their own thing, why flame?

      --

      --
      A conclusion is simply the place where someone got tired of thinking.

    21. Re:Reactionary languages by Bob+Uhl · · Score: 1

      Yes, perl is better than C for several things. Beets are rather better tasting than exrement, but they are not in the class of, say, sushi or ice cream. So too perl, while better for some things than some languages, is very poor at other things, compared to other languages (most particularly Lisp, IMHO). Also, the 100+ line C function should, if possible, be written more cleanly anyway--done right, it should look very much like the perl function.

    22. Re:Reactionary languages by Kashif+Shaikh · · Score: 1

      Also, the 100+ line C function should, if possible, be written more cleanly anyway--done right, it should look very much like the perl function.

      Oh you could, but then you need to write a lot of helper functions in C. I mean, perl has a lot "nifty" features, while C by it's nature doesn't.

      Kashif

    23. Re:Reactionary languages by SimHacker · · Score: 1
      As you've explained it in terms of surface syntax, there is little difference between Perl references and C++ references, except for the charcters you type.

      You've demonstrated how Perl programmers tend to think in the surface syntax of the language, instead of the underlying semantics. Instead of "what do I want to do" you think "what characters do I want to type".

      I'm not asking about what characters you type to use references, I'm asking about the semantics and rules about references.

      Please explain the MEANING and SEMANTICS of Perl references, and how they compare to references in C++.

      I will give you a hint: You're wrong about C++ references. You have them confused with pointers. A common mistake of people who think in terms of surface syntax instead of the underlying semantics. References and pointers are very different, especially in Perl.

      The extreme differences between Perl and C++ references are a very common source of confusion. Please explain what that difference is. So far you've just demonstrated that you are confused, and added to the confusion.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    24. Re:Reactionary languages by SimHacker · · Score: 1
      If there is no difference between references in Perl and C++, then how do you create a reference to a file IO handle in Perl?

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    25. Re:Reactionary languages by SimHacker · · Score: 1
      Here are some typical comments about Perl references from Google, to get you on the right track (the right track being not programming in Perl because it's a foolishly designed language, since much better languages are freely available):
      ma[i][j][k] is different from $ma->[i][j][k], you need to remember - the shortform only separates uses of [ ] but the -> CANNOT be left out when it follows an ordinary lvalue (C-speak you should know)

      Precedence of the operators and other dereferencing is confusing - I think especially for people who know C previously. Now, finally, after a lot of persistance it all flows naturally, but for me, learning to read and write Perl references and complex data structures has to be on of the most difficult things I've had to feed my brain since I don't remember when.

      ...

      > It's getting stuff *out* of the data structures that I find to be radically different.

      Yes. This is due to the dichotomy between first-class variables and references, and it's a confusing problem for people, I can see. And that doesn't even begin to cover such horrendous things as typeglobs.

      # note that I had to change the braces to parens in the assignment to
      # a hash: curly braces return a /reference/ to a hash -- when you want
      # a "real" hash, you need to use parens. if you ran the code as it
      # originally was posted, you'd get a hash with one element (the hash
      # reference { Bob => [ ] ... }. Which is illegal. mea maxima culpa!

      After I sit back and look at this, I realize just how strange dealing with perl's references is. To me, of course, it's natural: but for someone just looking at doing some scripting, I can totally empathise. I'm just so numbed by looking at things like:

      $var{ foo }[ bar ]("baz");

      all day long that I occasionally lose sight of how strange that is.

      Perl programmers have invested enormous amounts of effort, time, energy and brainpower into understanding how to use references. Wouldn't it be better to apply that energy to solving the problems you're being paid for, instead of struggling with the programming language you foolishly chose to use? That's why I say that Perl is the ultimate programming language for corporate parasites who would be out of a job if the software they wrote wasn't incomprehensible to anyone else and didn't keep falling apart and crashing every time the wind blows.

      If Perl references are so great, why were they only kludged in late in the development of Perl? That's the deep-rooted problem with Perl: nothing was designed, everything was kludged in at the last minute. It's so sad to see people who are so damaged by Perl, that they can't even feel the pain any more.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    26. Re:Reactionary languages by Anonymous Coward · · Score: 0

      References were added to Perl in version 5.0.0. That was almost ten years ago.

      Ignorance is forgivable, but you're also obnoxious. What's the matter, did some guy named Larry once kick your dog?

    27. Re:Reactionary languages by SimHacker · · Score: 1
      References were added to Perl 5, which was released on October 18 1994, 7 years after the first release of Perl 1.0 on October 18 1987. They were clearly an afterthought.

      Ignorance is forgivable, but Perl advocates and apologists aren't just ignorant, they're maliciously spreading a Contagious Linguistically Acquired Mental Illness (called CLAMI syndrome), that eats up your brain. CLAMI is also known as Mad Webmaster's Disease.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    28. Re:Reactionary languages by Magius_AR · · Score: 1
      If there is no difference between references in Perl and C++, then how do you create a reference to a file IO handle in Perl?

      You do it the same way I just said, with a \ reference

      my *FILE; # declared filehandle
      my $ref = \*FILE; # established reference

      And that doesn't even begin to cover such horrendous things as typeglobs

      I thought typeglobs were officially dead? I agree they're hideous, that's why I never use them. I thought they were an artifact of older Perl.

      I'm just so numbed by looking at things like:

      $var{ foo }[ bar ]("baz");

      all day long that I occasionally lose sight of how strange that is.
      Why is that in any way strange?
      How's that differ from this:

      var->foo.bar("baz");

      People diss what they aren't familiar with.
      The Perl line above makes perfect sense to me, as does the C++ line. All it takes is a basic grasp of the grammar of the language.

      Perl programmers have invested enormous amounts of effort, time, energy and brainpower into understanding how to use references.

      You still haven't proven to me this "enormous amount of effort, time, energy, or brainpower"...I believe I've shown references in Perl as being simple to use.

      That's why I say that Perl is the ultimate programming language for corporate parasites who would be out of a job if the software they wrote wasn't incomprehensible to anyone else and didn't keep falling apart and crashing every time the wind blows.
      You now show your true bias. Don't hold the rest of the Perl world liable for the mistakes of shitty Perl programmers you've met. I've met my equal share of C/C++ spaghetti coders. There's nothing wrong with the language. It's just that Perl lets you get away with alot more uglier things than C will allow, and there's alot of bad programmers out there that make the language look awful when it can in fact be very elegant and clean in the right hands.

      If Perl references are so great, why were they only kludged in late in the development of Perl?

      My guess would be that early on Perl was considered more of a scripting tool than a programming language. And kluging is faster than rewriting whole languages.

      That's the deep-rooted problem with Perl: nothing was designed, everything was kludged in at the last minute

      See Perl 6. A full re-write of the language to handle all these kluge-issues you seemingly have deep concerns with.

  46. too young to hate properly by Anonymous Coward · · Score: 0

    Complaining about Java & Python?

    Please, if you REALLY want something to hate you've got to go back to the 70s & 80s on the mainframe:
    - COBOL
    - JCL
    - MARK IV
    - RPG
    and the grandaddy:
    - Auto-Coder!!!

  47. Re:You are probably the worst programmer you ever by Anonymous Coward · · Score: 0

    Ever heard of Mono?

    Open source, multi platform .net

  48. ations by Anonymous Coward · · Score: 1, Insightful
    Perl programmers like punctuation. Python programmers like indentation.

    Visual Basic programmers like masturbation.

    ~~~

    1. Re:ations by Anonymous Coward · · Score: 0

      Who doesn't?

    2. Re:ations by Anonymous Coward · · Score: 0

      you call VB Programmers "Programmers" ???

  49. MOD PARENT UP!!! by Anonymous Coward · · Score: 0

    yes that was a little bit flame like but really that is one of the most insightfull posts i have ever seen on /.

    1. Re:MOD PARENT UP!!! by Bendebecker · · Score: 0, Troll

      Either you haven't been on /. long or that fact speaks volumes about how much thought goes into the comments here.

      --
      There's a growing sense that even if The Future comes,
      most of us won't be able to afford it.
      -- Lemmy
  50. What I want is... by Bendebecker · · Score: 4, Funny

    A programming language where I don't have to do any work. One where I can just decide, "hey, I have a great idea for a program" and then discover that my computer had already programmed it for me.

    --
    There's a growing sense that even if The Future comes,
    most of us won't be able to afford it.
    -- Lemmy
    1. Re:What I want is... by Anonymous Coward · · Score: 0

      Great! After that you can have it compute your best alternate career choice.

    2. Re:What I want is... by theCoder · · Score: 1

      Look in /dev/random -- your great new program should be somewhere in there :P

      --
      "Save the whales, feed the hungry, free the mallocs" -- author unknown
  51. Wow.. SNOBOL by Lawrence_Bird · · Score: 1

    dude.. havent heard that one in 20 years..

  52. What I Hate by Anonymous Coward · · Score: 0

    There is no good way to say ted is a tool.

    He thinks hes some leet haxor, but doesnt use ++ or --.

    WTF.

    Also, there should be a programing language specific to GRITS and NATALIE PORTMAN. Perhaps a way for PONCH to hack out of a paper bag as well.

    PROPS TO MAUS.

  53. Language is irrelevant by The+Bungi · · Score: 4, Insightful
    As long as you have a good library and support of some type (community or corporate).

    Other than that, the language is just like the favorite couch - it doesn't really matter where you sit, but that one just happens to be more comfortable.

    That's one of the reasons .NET is cool. It provides a unified runtime library that caters to any number of languages, as long as someone has bothered to port them. The end result should always be the same. We joke about COBOL.NET, but the reality is, it's made possible by this - dare I say - revolutionary idea. Soon we'll have Python.NET, Perl.NET, Ruby.NET, PHP.NET, etc, etc.

    You will be assimilated =)

    1. Re:Language is irrelevant by Laplace · · Score: 2, Interesting

      I think that the gcc group had that figured out first. gcc uses front ends to translate the c, c++, fortran, java, and whatever other languages it can use to intermediate files, which are then compiled to assembly then machine code.

      Once again, Microsoft "innovates" themselves into territory where others have lead them.

      --
      The middle mind speaks!
    2. Re:Language is irrelevant by The+Bungi · · Score: 1
      You're confusing the concept of a "backplane compiler" with the way MSIL/CLR works in .NET. I don't know if gcc was the first widely available compiler suite to use the backplane model, but I suppose it's possible they did. I'm sure Microsoft didn't, because they bought the technology from a french company back in 1992 to create what later became VC++ 1.0.

      Once again, Microsoft "innovates" themselves into territory where others have lead them.

      That's nice.

    3. Re:Language is irrelevant by ratfynk · · Score: 1

      The uncool thing about .NET is that it can reset standards at the drop of a hat! Try using XML standards to code for all browsers. HA the standard just changed. Do it to another standard for IE, and another standard for Geco and so on. Bullshit. .NET is a way to modify standards to avoid inter-operability and competition! Microsoft has destroyed the whole basis of html and most people to not even understand how they do it.

      --
      OH THE SHAME I fell off the wagon and use sigs again!
    4. Re:Language is irrelevant by NineNine · · Score: 1

      You're right. Language *is* irrelevant. But for the wrong reason... language is irrelevant because there are no fucking programming jbos left! You can program until you're blue in the face, but if nobody will pay you to do it, what's the fucking point? That's like arguing which style of horse drawn buggy is the best. The answer is neither! The question is irrelevant.

    5. Re:Language is irrelevant by Lazarus+Short · · Score: 2, Interesting
      Soon we'll have Python.NET, Perl.NET, Ruby.NET, PHP.NET, etc, etc.

      Actually, that's unlikely.

      This blog entry by Dan Sugalski gives an expanation:

      First things first--both the JVM and .NET are perfectly capable of being target machines. They're fully turing complete, so it's not an issue of capability. But, like the Infocom Z machine, which is also turing complete, the issue is one of speed.

      Perl 5 has two big features that make using the JVM or .NET problematic--closures and polymorphic scalars. Perl 6 adds a third (which Ruby shares) in continuations, and a fourth (which Ruby doesn't) of co-routines. (Though arguably once you've got continuations, everything else is just a special case) Python has similar issues, though I'm not the guy to be making statements about Python, generally.

      --
      The most valuable commodity I know of is information. - Michael Douglas as Gordon Gekko, Wall Street
    6. Re:Language is irrelevant by Anonymous Coward · · Score: 1, Interesting

      God help you if you're quoting a guy who drafted at least 12 different calling conventions for his vaporware Parrot VM in the last year. (Gee, we'll make ALL the registers available for parameters! Scratch registers - what are they?)

      The only way Perl6 will be finished is if Parrot finds a real designer - not a pretend one like it has now. I predict that Perl6 will be finished BEFORE Parrot is completed. Someone will take Larry's Apocolypses and just write a frigging Perl6 interpreter without a line of Parrot.

      If you want a really small and fast interpreted language - go to www.lua.org

    7. Re:Language is irrelevant by eclectechie · · Score: 1
      That's one of the reasons .NET is cool. It provides a unified runtime library that caters to any number of languages, as long as someone has bothered to port them. The end result should always be the same. We joke about COBOL.NET, but the reality is, it's made possible by this - dare I say - revolutionary idea.
      You can dare, but revolutionary it ain't.

      All languages on IBM's System/38 compiled to a common form in 1978. They continued to do so on the AS/400, and still do on the iSeries. Cobol included. Oh, and you didn't have to recompile them to take advantage of the 64-bit processors when they were introduced on the AS/400 in the late 90's.

      BTW, Microsoft used to use AS/400's to run their own business; I wonder where they got the idea?

      --
      "The empty vessel makes the greatest sound." -- William Shakespeare; Henry V, 4. 4
    8. Re:Language is irrelevant by Anonymous Coward · · Score: 0

      Actually, MSIL is closely related to the output produced by the VC 'backplane'. Unlike traditional compiler vendors, Microsoft went and product-ized it. GNU refuses to document theirs because they fear it could be used as a licence backdoor.

    9. Re:Language is irrelevant by The+Bungi · · Score: 1
      Actually, that's unlikely.

      Tell that to ActiveState.

    10. Re:Language is irrelevant by ronabop · · Score: 1
      Dear Ada:
      So, I have this really ugly couch stuffed with 7 tons of down feathers, so it's now comfortable for everyone. To put it anywhere, I need a crane, and a team of 3 movers.

      I don't mind though, because everyone *I* know who uses it for their guestbooks and web-to-mail forms and other wep-app-101 tutorial tasks is happy.

      Funny thing, though, people who care about speed and performance and portability keep complaining about it.

      What does is matter if it's big, heavy, ugly, and unportable... it's comfy!

      What can I tell these poor souls who don't enjoy my couch, and want high-speed lightweight benches, or standing-room-only environments?

      -Bop

    11. Re:Language is irrelevant by Nurgled · · Score: 1

      Take a close look at what ActiveState Perl.NET does some time. You'll see that it's nothing but a clever hack. Their .NET "compiler" is similar in operation to their PerlApp tool, and I don't think anyone could keep a straight face while saying that the support for creating assemblies from perl is clean and elegant.

      For most purposes, what ActiveState have produced works well enough, but perl is far from integrated into the grand scheme of things.

  54. VB instead of batch files. by pi_rules · · Score: 1

    I'd suggest, if you would like to do it in a batch file but cannot, that you do in VBScript instead. Just hack it up in a .vbs files and you're ready to go. No development environment needed but a good text editor and web browser to hit MSDN. A self-contained .exe that may need the VB runtime distributed with it is a bit overkill IMHO. Think of it as the Perl for Win32, when you dont' want to install Perl.

    Just my two cents. I hate VBScript for most things, but for this, I'll glady use it.

  55. Wrong, Wrong, and Wrong by avdi · · Score: 4, Informative
    C++ suffers from some early bad design decisions. Templates came late. Strostrup knew about templates, and decided not to put them in. This led to great pain and ugly code, templates went in, and it's taken a decade to clean up that mess.


    Bjarne wanted to put generics in from the very beginning.

    Java was supposed to clean this all up, but now Java is getting generics, which it wasn't supposed to need. So it's going down the same path as C++, but with a new set of mistakes.


    Java "cleans up" nothing, it simply strips out all the more powerful features of C and C++ which novices tend to stub their toes on. Oh, and it adds one important feature: inner classes. Unfortunately the result is a language whose omitions actually make it more verbose and harder to maintain than C++.

    Other attempts to fix C include Objective C (which still has a following) "C+@" (a Bell Labs product that predates Java), "C#", a Microsoft variant, and several others with tiny market share such as "D". None are enormously better than C.


    Neither ObjC nor C# is an attempt to "fix" C; Objective C is an attempt to embed a Smalltalk object system in C, and C# is an attempt to fix Java. Neither of them are applicable to the same problem domains as C.

    I'd like to see C++ cleaned up, but the ANSI committee is more interested in putting in obscure features for template writers.


    Everything in C++ belongs there, and most of it was intended to go in from a very early stage. The only thing that needs to be "cleaned up" is the C preprocessor. Templates could use easier syntax but no one has come up with anything signifigantly better than the current syntax.
    --

    --
    CPAN rules. - Guido van Rossum
    1. Re:Wrong, Wrong, and Wrong by the+gnat · · Score: 2, Interesting

      Unfortunately the result is a language whose omitions actually make it more verbose and harder to maintain than C++.

      I disagree with this a little; I find uncommented Java code easier to understand than commented C code. Regardless, I'm not a huge Java fan, partly because I've always found the class library to be a pain in the ass. The first Java project I worked on, I spent hours trying to figure out how to manipulate dates properly. Writing the code in Python or Perl instead would have been much shorter, easier to understand, and took me a few minutes to figure out. I've never figured out how Java's anal retentive typing is supposed to make this type of thing "better".

    2. Re:Wrong, Wrong, and Wrong by The+Cydonian · · Score: 1

      My favourite implementation of dates in Java (among other languages, of course; first preference is LISP) is the Calendrica package. Note that the code has not been released under (L)GPL though.

  56. Thanks for examples, dickhead. by Anonymous Coward · · Score: 0

    jerk off.

    1. Re:Thanks for examples, dickhead. by Anonymous Coward · · Score: 3, Funny

      jerk off.

      I will, thank you.

      Unlike programming languages, jerking off is something we can ALL enjoy.

    2. Re:Thanks for examples, dickhead. by larry+bagina · · Score: 5, Funny
      Unlike programming languages, jerking off is something we can ALL enjoy.

      I don't have any hands you insensitive clod!

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:Thanks for examples, dickhead. by Cached+Hit · · Score: 2, Funny

      FINALLY, my sig becomes useful!

      --
      "look ma! no hands!!!" - random amputee
    4. Re:Thanks for examples, dickhead. by Li0n · · Score: 1

      learn to use your feet.

      --

      ~
      ~
      :wq
  57. It's not plus, it's equals-equals! by the-matt-mobile · · Score: 2, Informative

    It seems that complex math is always the example people pull out to support operator overloading

    I was just thinking the same thing as I read the parent comment. Everyone uses complex numbers as an example. But, when programming in Java, it's not being able to overload == and != (and even sometimes [] if we're talking about collections) that drives me up a wall!

    Take for example a class which contains both native types and objects. In order to implement the equals(object obj) method, you have to do the following:

    return this.intType == obj.intType && this.objectType.Equals(obj.objectType) && this.byteType == obj.byteType && this.objectType2.Equals(obj.objectType2); // etc. etc. etc.

    Yes... it's functional. No, it's not pretty. And that's where operator overloading is most sorely missed in my book.

    1. Re:It's not plus, it's equals-equals! by pyrrho · · Score: 1

      Yes, your's is a much better example.

      --

      -pyrrho

    2. Re:It's not plus, it's equals-equals! by anshil · · Score: 1

      But equals and == is a mostly necessary distinction!

      Do you want to compare if two objects (pointers) are the same or alike? Meaning both point to the same object, or both point to objects which are alike. Thats somethign cruitically different!

      In Java this is solved brillantly exactly throught this way. The same is ==, and alike is equals().

      Due to the operating overloading this in C++ a very common problem a lot of bugs result from, since it's chaotically used if you make just pointer comperasions, or in depth comparisions, and how many depth level your comparing. (Since the object itself contains again object which can be the same or alike, etc.)

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    3. Re:It's not plus, it's equals-equals! by Jester99 · · Score: 1

      In Java this is solved brillantly exactly throught this way. The same is ==, and alike is equals().

      Frankly, I fail to see the brilliance of it. Native types still use == for alike...

      So if I have code like:


      int x = 13;
      int y = 12;

      return x == y;


      It works as I expect it should.

      However, if I suddenly have to change those x and y to Integer objects (I don't know, maybe I need to store them in a vector), now I have to change that last line so it all reads:


      Integer x = new Integer(13);
      Integer y = new Integer(12);

      return x.equals(y);


      Now that I've changed the types for x and y, I suddenly have to change how I use them, which shouldn't be the case in a consistent model.

    4. Re:It's not plus, it's equals-equals! by RedWizzard · · Score: 1
      I was just thinking the same thing as I read the parent comment. Everyone uses complex numbers as an example. But, when programming in Java, it's not being able to overload == and != (and even sometimes [] if we're talking about collections) that drives me up a wall!
      I would have liked to see Java define at least some operators as shorthand for specific functions. That way you could overload operators by defining the particular function. E.g. if a + b is shorthand for a.add(b) then any class that wants to overload '+' could do so be defining void add(Object b). Doing operator overloading that way should reduce the instances of inappropriate overloading while still permitting clear syntax in appropriate cases.
    5. Re:It's not plus, it's equals-equals! by Steveftoth · · Score: 1

      Object x,y
      x == y
      This means that x is pointing to the same instance as y, or that the value of x is equal to the value of y.
      x.equals(y)
      This means that the value that x points to is the same in every functional respect as the value that y points to. But it does not mean that x == y.

      int x,y
      x == y
      this means that the value contained in x is equal to y.

      Remember that all 'Object' variables are actually pointers and thus you need the distinction of == and equals.

      BTW, you never need to write x==y for checking equality in objects. If you ever overload an equals function, that should be the first thing you do. And if you say that it's inefficient to do it that way then I say you are prematurely optimizing your code.

  58. Don't get me started about machine language. by Anonymous Coward · · Score: 5, Funny

    I can't stand machine language. I'll be typing along and accidently type a '0' when I meant to type a '1' and my program goes apeshit. They should fix that.

    1. Re:Don't get me started about machine language. by Anonymous Coward · · Score: 0

      That's nothing, you should see what happens if you input a '2'..

    2. Re:Don't get me started about machine language. by sean23007 · · Score: 4, Funny

      Oh I know! One time I accidentally pressed '2' and my computer grew a leg and kicked me in the nuts. Who knew?

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
  59. also by Anonymous Coward · · Score: 1, Informative

    The JScript engine is (was? it's been a while since I paid attention) faster than the VBScript engine.

    And for that matter, VBScript is a horrible abortion of a language. Imagine, VB - but less graceful and powerful. Ugh.

  60. M$ by Bendebecker · · Score: 1

    Monopolysoft?
    Oh, you mean Microshaft!

    --
    There's a growing sense that even if The Future comes,
    most of us won't be able to afford it.
    -- Lemmy
    1. Re:M$ by benzapp · · Score: 1

      I am glad I am not the only one who never had seen that one before

      --
      I don't read or respond to AC posts
  61. Plain English Code by KrispyKringle · · Score: 1
    The ultimate goal of computer programming should clearly be plain english "code." If I remember my history right, this was the goal of Ada, in a sense, but even the term "code" itself demonstrates that most languages are hardly considered readable, hence the reliance on "psuedocode."

    I've programmed in a fair handful of different languages, my current favorite being Java rather than some esoteric near-English language, and obviously lower-level languages will forever persist for the same reasons they currently do. But for most tasks, I shouldn't have to deal with memory pointers as in C; I shouldn't necessarily have to deal with strict object typing as most languages require (although I am displeased with Perl's vaguely counter-intuitive method of dealing with illogical variable comparisons, etc); and, ideally, I should be able to express an iterative sequence or bit of logic in little more than strictly-written English, essentially what psuedocode is now.

    I have to agree with prior posters that while some of chromatic's comments are completely valid, they quibble over issues of punctuation and style in a world where the necessity of these rules are the issue.

    If I have to remember to use different syntax when I do Java or PHP, I can handle that; any decent programmer can. Hopefully, though, there will be a time when I can describe briefly to the computer a task I want to do and simply have it do it. English would be the ultimate in "whipupability." (Note that I value this for its "whipupability," the ease of dealing with minor tasks quickly and efficiently as many scripting languages are designed to do now, not for its value in larger long-term projects; as I noted, low-level languages will always have their place.)

    1. Re:Plain English Code by chromatic · · Score: 1
      quibble over issues of punctuation and style

      Yes! That's exactly the point. Those are minor issues, but arguing over them has wasted a great deal of time and energy.

      Granted, I want to use a language that fits my brain (just as you do), but I'm much more interested in useful features than syntax.

    2. Re:Plain English Code by KrispyKringle · · Score: 1
      OK, but, I think useful features is a totally different issue than many of the specific complaints you had in the essay. Now, I agree that, for example, there may be issues with packaging the Java VM, but they are fairly minor issues. When it comes to useful features, the most important step is not specifically what features are available--in my mind that is a later task once the language has been adequetly developed--but rather how those features are added.

      For example, Java comes with so many professionally-written, extremely useable and well-documented built-in class libraries. This is really one of the greatest points in Java's favor; you yourself commented quite accurately on the value of CPAN for Perl, and I see Java class libraries as much the same thing. Is it important that Java has a class for SSL negotiation, or that it can have one so easily?

      I admit that this sort of language structure is probably beyond the scope of what you were discussing; designing a complete language from scratch is certainly beyond my own experience. But I think true usability and features both derive more from that sort of abstract structure issue than from mundane complaints about syntax. Even the most alien sytax will look natural with enough use; natural spoken languages, cobbled together over centuries or millenia, are apt demonstrators of that. But the true defining features of a programming language or a real language is not the punctuation but the abstract structure.

      For example (using real languages), Japanese has only two tenses, past and present/future, and very little specificity of the subject in a normal sentence, while Latin has 6 tenses and a very clear specificity on the subject of every verb. Programming languages can run much the same spectrum, in a sense (though all are necessarily much more specific than any spoken language); programming languages range from strict variable typing to laisse-faire. Programming languages can be functional or imperative. These sorts of issues, not punctuation, are the important features to consider. Nonetheless, it was an informative and well-thought-out essay; I appreciate someone making this discussion accesible and making it in layman's terms.

    3. Re:Plain English Code by mccoma · · Score: 1
      The closest I've seen to this is AppleScript. It is pretty English-like. I like it, but a lot of people hate it for its Englisk-like structure.


      Didn't one of the Dr. Dobbs columnists (Swaine?) review a book about Herbal Latin that talked about the specialization of Latin to express exact meanings in a subject area (plants)? You might find the book interesting (sorry, don't have a current reference).


      Also, wasn't this the original intention behind Cobol, too.

    4. Re:Plain English Code by MacDaffy · · Score: 1
      Granted, I want to use a language that fits my brain (just as you do), but I'm much more interested in useful features than syntax.
      Program comment (output );

      const
      c_snobbery = maxint;
      myFavorite = 'Pascal is still a great language';

      var
      modPoints : integer;
      agreement : integer;
      derision : integer;
      iPostThis : boolean;

      begin
      if ( iPostThis ) then
      modPoints := agreement - derision;

      writeln ( myFavorite );

      if ( derision >= c_snobbery ) then
      halt;
      end.
    5. Re:Plain English Code by chromatic · · Score: 1

      I quite agree. By pointing out mostly syntactic quibbles, I hoped to make it clear that they're much less important than the language philosophy. Some of the things I mentioned could be changed without affecting the underlying language structure. Some cannot.

  62. Visual C++ by ucblockhead · · Score: 4, Funny

    Probably about as many as the number of "// TODO: Place code here" in Visual C++ projects.

    --
    The cake is a pie
    1. Re:Visual C++ by Snork+Asaurus · · Score: 1
      LOL.

      It really should read "// TODO: Place code here AND THEN REMOVE THIS DAMNED COMMENT"

      --
      Sigs are bad for your health.
  63. Self-documenting? by steveha · · Score: 5, Interesting

    Better would be languages which are self-documenting...

    There is no language that will force perfect code. There is always room for a poor programmer to produce hard-to-understand code. Functions that do two unrelated things, confusing control flow, bad variable names, broken code that was repeatedly patched instead of being cleaned up... the possibilities are endless.

    Nonetheless, some languages have been designed with self-documenting code in mind; sometimes it even works.

    If you look at languages like COBOL, they have long descriptive keyword names designed to make the code easy to read. But you get tired of looking at those long keywords.

    I haven't used ADA, but I understand that it is somewhat designed for self-documenting code, and that as a result you are hemmed in on all sides by language rules. (ADA fans please comment here.)

    The best language I have seen for this is Python. As a rule there is exactly one way to do things, so you don't trip over obscure hackish tricks that you have to puzzle out. The language doesn't force self-documenting or comments, but it does force indentation; everyone indents their Python pretty much the same (compare with the mess that is C indentation). The language is high-level enough, with lots of libraries, so you don't need to write 10 lines of code just to do one simple thing.

    Python was designed by a guy who is both a computer geek and a math geek. The math geek in him led to a very tidy language design, and I like it very much. I think schools ought to be using Python to teach introductory programming classes.

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
    1. Re:Self-documenting? by elmegil · · Score: 1
      But you get tired of looking at those long keywords.

      Looking at? Hell, I never want to type another one again!

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
    2. Re:Self-documenting? by Anonymous Coward · · Score: 0

      Python was designed by a guy who is both a computer geek and a math geek. The math geek in him led to a very tidy language design, and I like it very much. I think schools ought to be using Python to teach introductory programming classes.

      "Tidy"? More like @#$(^! anal retentive!

      Math geekness isn't exclusive of "tidyness", though.

      And I hope to hell my school never uses Python to teach introductory programming courses. I pity the student who thinks programming is all about dealing with whitespace.

    3. Re:Self-documenting? by Teach · · Score: 1

      I haven't used ADA, but I understand that it is somewhat designed for self-documenting code, and that as a result you are hemmed in on all sides by language rules. (ADA fans please comment here.)

      I used Ada for my second semester of Data Structures in college. All that I really remember about it was that the code was really hard to get to compile. But once you got it to compile, it usually worked as intended.

      The design of the language moves a lot of logic errors into the realm of compiler errors. Which was nice for learning, but might be annoying once you were experienced enough to avoid the logic errors on your own because you'd presumably still be having to go through the syntactic rigor without as much benefit.

      --
      Graham "Teach" Mitchell, computer science teacher, Leander HS
    4. Re:Self-documenting? by random_static · · Score: 1

      i've just finished an Intro to CS course that used Java. i spent most of the semester wishing to all heavens the prof'd used Python instead. i ended up learning a lot more about the syntax and idiosyncracies of Java than i did about CS - with Python, the language-specific stuff would have taken a huge lot less time to cover, and caused many fewer headaches.

    5. Re:Self-documenting? by geckofiend · · Score: 2, Insightful

      After more than a few commerical projects where people don't know the meaning of whitspace (or commnets for that matter) I'll take Python's forced whitespace any day.

    6. Re:Self-documenting? by Bush+Pig · · Score: 1, Informative

      Ada's actually quite nice - it was the teaching language at Adelaide University when I was there. Although even Defence don't use it much any more (so it doesn't translate directly into a gig), it teaches you good programming habits, and it's what Oracle used as a basis for PL/SQL, so you can use what you've learnt at any Oracle site without too steep a learning curve.

      --
      What a long, strange trip it's been.
    7. Re:Self-documenting? by Lord+Ender · · Score: 1

      That's why Python is called "Executeable Pseudocode". It is the easiest to use language ever written.

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    8. Re:Self-documenting? by Bob+Munck · · Score: 3, Insightful
      I haven't used ADA, but I understand that it is somewhat designed for self-documenting code, and that as a result you are hemmed in on all sides by language rules.

      Ada allows you to write what your program does as code. Most other languages make you kind of sneak up sideways on what you want the program to do, tricking the language into doing your desire. Then you have to add comments to say what it is you really wanted. I write quite a few comments in programs to remind myself (and in some circumstances others) what the program does. In Ada, I'll write the code, look at it, realize that it says what it does, and not need to write comments. My best code has no comments, and no need for them. (Except for hypertext pointers to design and requirements documents.)

      I don't understand about the "hemmed in on all sides by language rules." Ada has fewer rules than, for example, Java. That is, the syntax and semantics can be expressed in significantly fewer definition constructs (BNF, VDL, whatever). For me, moving back to Ada after a stint programming in Java or C++ is like coming out of a dark and stuffy room into a nice spring afternoon.

      Python was designed by a guy who is both a computer geek and a math geek.

      So was APL. Ever seen APL? It's essentially encrypted at the source.

    9. Re:Self-documenting? by mandolin · · Score: 1
      I haven't used ADA, but I understand that it is somewhat designed for self-documenting code, and that as a result you are hemmed in on all sides by language rules. (ADA fans please comment here.)

      Ada (as implemented by the GNu Ada Translator, GNAT) is ok. Think of it as industrial-strength PASCAL. It was 3-4 years ago for me.

      Bad points: The scarcity of operators (no +=, no ?:, no bitwise operators in ada '83?) meant the code got a bit wordy. Formatted printing ("%s%d\n" etc.) .. not there. Whatever the equivalent of pointers was, it was constrained. Typecasting was constrained, to the point where if you did it right it could bite you in the ass later. There was some useless syntactic sugar like distinguishing between "function"s and "procedure"s, having a silly kindof-write-only 'out' parameter type, and 'begin' and 'end' are harder to follow than {}s for me. No 'continue' statement (but you could break from a nested loop). For runtime support Ada tried to reinvent the C standard libraries, poorly. Ada '95 tried to do OOP, and it came out a bit alien (IMO). Didn't try to wrap my noggin around it. There is no standard preprocessor for the language.

      Good points: There was excellent support for interfacing to C and Fortran(?) code (and probably C++ in GNAT). The whole concept of packages is cool, since when you call packagename.function() you obviously know exactly which package (think: sourcefile) to go to if you don't know how the code works. (This is enforced by the compiler unless you use the evil 'use (package);' statement. Using renaming (basically, aliases) is much nicer.) The multi-threaded programming constructs you got 'for free' with Ada were kindof cool, as long as the C threading library GNAT sat on top of was up to snuff. I liked Ada's exception handling better than the throw()/catch() of C++. I like the way Ada uses () instead of [] for array indices the same way it does with functions. You know how gcc extends C to support structure labels (MY_STRUCT a = { var1: 2, var3: 'c' }; )? Ada defines that as part of the language, and it's Good. Also you can define default initialization values for a given structure type (like a constructor, but less wordy). You can take array slices and copy arrays. Some "attributes" (s'Image) are handy. Ada generics look IMO prettier than C++ templates. The CONSTRAINT_ERROR runtime checking that is built into the language (but can be disabled w/a compiler switch, I believe) saved our butts a couple of times.

      Really the saddest thing about Ada is when you're looking at obviously-formerly-C-code that somebody hacked into Ada just so it would meet the requirements for some old DoD contract. Unchecked_Conversion()s everywhere. It brings out the worst in both languages.

    10. Re:Self-documenting? by TopShelf · · Score: 1
      If you look at languages like COBOL, they have long descriptive keyword names designed to make the code easy to read. But you get tired of looking at those long keywords.

      I guess this depends on the environment you're coding in. When you're in a department of 30+ programmers and you get into the inevitable maintenance, the legibility of COBOL becomes a major plus. I'm an ex-COBOLer who's having to migrate to RPG now (I can feel myself devolving by the day), and I find it an ugly task. Most of the time I feel like Gandalf towards the beginning of FotR:

      USER: I can't make out the words.
      ME: There are few who can. It is written in RPG, a language which I will not utter here...

      --
      Stop by my site where I write about ERP systems & more
    11. Re:Self-documenting? by steveha · · Score: 1

      In Ada, I'll write the code, look at it, realize that it says what it does, and not need to write comments.

      An example of such code would be welcome here. As I said, I have never used Ada.

      Ever seen APL? It's essentially encrypted at the source.

      APL: the Write-Only Language. (People call Perl a WOL but APL is in a league all its own.)

      Fortunately, Guido Van Rossum used his math geek powers for Good, rather than for Evil when he created Python.

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    12. Re:Self-documenting? by steveha · · Score: 1
      It could have been worse: about 20 years ago, my high school had an intro to programming course using Applesoft BASIC on Apple ][ computers. Students had to learn a whole lot about how broken Applesoft BASIC is. Just one example, in both C and Applesoft BASIC:

      if (flag)
      DoSomething(3);
      else
      DoSomeOtherThing(4);

      // next statement


      120 IF FLAG = 0 GOTO 160
      130 GLOBAL1 = 3
      140 GOSUB 600
      150 GOTO 180
      160 GLOBAL2 = 4
      170 GOSUB 700
      180 REM next statement

      600 REM DoSomething() -- argument is GLOBAL1

      700 REM DoSomeOtherThing() -- argument is GLOBAL2

      No block structuring: you can only have a single statement after an IF. For anything else, you have to test for the opposite of what you really want to test for, and GOTO the line number of the ELSE case. Then you fall through to the IF case if you didn't take the GOTO. At the end of the IF case, don't forget the GOTO to skip over the ELSE case to the next statement! If you want a subroutine that will have some sort of argument, you need to use a global variable. (You could actually use the same global for both functions, since there is no danger of multiple threads of execution or anything like that.)

      Modern languages are so much nicer than the evil old BASIC languages.

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    13. Re:Self-documenting? by Black+Parrot · · Score: 1


      > I haven't used ADA, but I understand that it is somewhat designed for self-documenting code, and that as a result you are hemmed in on all sides by language rules. (ADA fans please comment here.)

      In my experience Ada feels like a strait jacket when you first start using it - especially if you don't come from a Pascal background - but after you get some experience with it it starts feeling very liberating instead.

      For a nontrivial program there will be lots of rigorous definitions up front, but once you've made a good set of definitions you can deal with your data very abstractly, so you end up programming at a "higher level" than you would in lots of other languages.

      Unfortunately Ada is a "big" language and it will take you a while to absorb all the goodies it provides. On the plus side you can write real programs with a subset of the language that is conceptually identical to Pascal (with just a few syntactic tweaks) and bootstrap your knowledge of the language from there.

      Other plusses are the free GNU compiler (GNAT, now rolled into GCC 3.x, but the GCC version not quite ready for prime time yet), lots of on-line reference sites, and some really nice built-in stuff like support for multi-tasking, distributed programming, and multi-lingual programming; OOP; very powerful generics; etc. There's also a first rate and well documented set of bindings for GTK+ in case you want to do some GUI programming.

      But possibly the nicest thing about Ada is that its strong typing[*] moves bug-catching forward in the development process. In Ada you will catch a lot of things at compile time that would only be caught at run time in most other languages, and you'll catch things at run time that you would only catch in most other languages if you happen to notice that the output is incorrect. For me those features are priceless, and make the language well worth using even as a beginner when you still feel like the rules are too strict.

      * When I say "strong typing" I'm talking about something far beyond what C++ers call "strong typing". Ada programmers laugh when they hear someone say that C++ offers strong data typing.

      --
      Sheesh, evil *and* a jerk. -- Jade
    14. Re: Self-documenting? by Black+Parrot · · Score: 1


      > Bad points: The scarcity of operators (no +=, no ?:

      You can easily write your own extensions for that kind of stuff, though you can't make it look like the syntax from the C family of languages. I have a package of math utilities where I define an overloaded inc procedure for various data types, so that

      inc (x)
      will increment x by 1 (or by 1.0 if its a floating point number), and
      inc (x, y)
      will increment x by y rather than by one. I in-line the procedure so that there won't be any call overhead for it.

      Different syntax; same result.

      > no bitwise operators in ada '83

      AFAICT, there's no reason for anyone to use Ada 83 unless they're maintaining legacy code. Ada 95 has been out for eight years now...

      > Ada '95 tried to do OOP, and it came out a bit alien (IMO).

      The syntax is different from the C++ tradition, but it works well enough. The bindings to GTK+ are all OO, and you can easily derive new kinds of widgets by inheritance from the old. The GTK+ bindings include support for GtkExtra, and I've used that to create some "plot" objects that I can create on the fly, paste on a canvas, and update as the program runs. Designing them as objects makes programming with them trivially easy.

      I use objects for all kinds of other stuff too, ranging from specialized message loggers to map viewers for experimental games to the neurons in artificial neural networks. (Using objects for maps is really cool, because it makes it easy for you to provide players with the ability to dynamically create and destroy auxiliary maps giving different views of the world. For example, if your game supports auto-centering on an agent in the game, you could have different maps following different agents around with almost no extra programming required.)

      [snip other good points]

      --
      Sheesh, evil *and* a jerk. -- Jade
    15. Re: Self-documenting? by Black+Parrot · · Score: 1


      > I used Ada for my second semester of Data Structures in college. All that I really remember about it was that the code was really hard to get to compile. But once you got it to compile, it usually worked as intended.

      And that's really only a newbie problem. I found it very frustrating to try to get stuff to compile when I first started using Ada and still thought like a C programmer, but after a few years of programming with it intermittently (hobby time only) I have started thinking like an Ada programmer and can almost always get my stuff to compile the first try.

      > The design of the language moves a lot of logic errors into the realm of compiler errors. Which was nice for learning, but might be annoying once you were experienced enough to avoid the logic errors on your own because you'd presumably still be having to go through the syntactic rigor without as much benefit.

      That's part of the design intention, since Ada was designed for use on big, complicated projects with lots of people working on them and an extended life for the program to be maintained after deployment. All those definitions you could potentially keep in your head instead of typing in are actually an important part of the program specification: all those other developers and maintainers can't be expected to read your mind.

      Think of the syntactic rigor as a type of constraint-based programming. The more you constrain the possible meaning of your program, the less likely certain classes of error become.

      --
      Sheesh, evil *and* a jerk. -- Jade
    16. Re:Self-documenting? by Ed+Avis · · Score: 1

      Can you give an example of something that Ada's strong typing helps with, but C++ (or C) does not? I agree that C++'s type system could do a lot more but I'm not familiar with Ada.

      --
      -- Ed Avis ed@membled.com
    17. Re:Self-documenting? by Hognoxious · · Score: 1
      the legibility of COBOL becomes a major plus.
      LOL! All that content free packing (e.g. GIVING)in COBOL does nothing to increase legibility; it merely provides a forest to hide the trees in.
      Verbosity != Legibility.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    18. Re:Self-documenting? by TheLink · · Score: 1

      AFAIK most programs do exactly what was written. But often that's not what is wanted.

      Often it is easy to tell what is really wanted.

      Sometimes you need comments for a second opinion, so that in event the comments say "This is supposed to be done" and the program is doing something else, it may be good to look at that section more thoroughly.

      I suppose your hypertext pointers cover that. Hopefully they material they point to don't change and refer to inappropriate versions.

      --
    19. Re:Self-documenting? by Col+Bat+Guano · · Score: 1

      Being able to distinguish between different integer types is one good example.

      Languages abstract upwards, from bits to bytes, then to ints, chars, floats, and that's typically where they stop.

      Ada however allows you to abstract further - to divide the predefined types into different realms...

      type Weight is new Integer range 0..300;
      type Height is new Integer range 0..200;

      You can declare variables of these types, but you can't -accidentally- (note that word!) mix them in an expression.

      They are considered different types by the language, and intermingling is diagnosed as a fatal error. You can of course do type conversions (casts) so that...

      W : Weight := 100;
      H : Height := 100;
      BodyMassIndex : integer;

      BodyMassIndex := Integer ( W + Weight (H)); -- fake algorithm

      This is just one example of a few.

      Be warned though - although most of Ada is easy to read, there are parts of the language which are confusing.

    20. Re:Self-documenting? by Ed+Avis · · Score: 1

      Numbers with a specified range is something I've always wanted in C and C++ - and about the only good thing I remember about Pascal. I imagine that although assigning a larger-range number to a smaller-range variable is illegal without an explicit cast, it ought to be okay to do the opposite, for example (excuse the lack of Ada syntax):

      a : integer 100..200
      b : integer 150..160
      b := 155
      a := b # okay, it will be in the range

      Your example seems to suggest that the two ranges are considered completely different, as if they were different units (as 'weight' and 'height' must be). I hope there is a way to make two integer types which are of the same 'units', so they can be added and stuff, but of different ranges. Or conversely to make two types which have the same numeric range but mean different things (maybe 'age' is 0..100 and so is 'popularity_rating').

      I do wonder if range-limited integers would not be possible with C++ templates and compile-time assertions, as in:

      range_int<100, 200> a;

      But I can't see anything in the STL or at boost.org for this.

      --
      -- Ed Avis ed@membled.com
    21. Re:Self-documenting? by 87C751 · · Score: 1
      The best language I have seen for this is Python. As a rule there is exactly one way to do things
      So does that imply python == ~perl or python == pascal++?
      </lamejoke>

      --
      Mail? Put "slashdot" in the subject to pass the spam filters.
    22. Re:Self-documenting? by Chelloveck · · Score: 1

      Spoken like someone who hasn't coded much assembly...

      LDA #0
      CMP FLAG
      BEQ FLAG_CLEAR

      FLAG_SET:
      LDA #3
      STA GLOBAL1
      JSR DO_SOMETHING
      JMP DONE

      FLAG_CLEAR:
      LDA #4
      STA GLOBAL2
      JSR DO_SOME_OTHER_THING

      DONE:
      BRK

      DO_SOMETHING: ; Arg is in GLOBAL1
      {blah}
      RTS

      DO_SOME_OTHER_THING: ; Arg is in GLOBAL2
      {blah}
      RTS

      BASIC? We used to dream of BASIC! :-)

      --
      Chelloveck
      I give up on debugging. From now on, SIGSEGV is a feature.
    23. Re:Self-documenting? by vague · · Score: 1

      But you probably get to use real register don't you? Don't you? The real mess is keeping track of what's where in the 387 register stack. Never did I comment my code as much :-)

      And not to talk about all these macro things, what, a machine code monitor is all that you need...

      --

      -
      Listen. Strange women lying in ponds distributing swords is no basis for a system of government.

    24. Re:Self-documenting? by Anonymous Coward · · Score: 0

      class range_int
      {
      private:
      int val;
      void check_range(void) {
      if(!(val<ulim && val>dlim) throw //blahblah;
      protected:
      static int ulim;
      static int dlim;
      public:
      operator =(...) {<do assignment>check_range();}
      range_int(range_int r) {<do assignment>check_range();}
      etc.
      };

    25. Re:Self-documenting? by Ed+Avis · · Score: 1

      Your range_int class does the checking at run time, which is often better than nothing but does make it a lot slower than a normal int.

      Better would be using templates and compile-time assertions to do the check at compile time, for example:

      range_int a;
      range_int b;
      a = 15;
      b = 2 * a; // guaranteed to be in range, okay
      b = 3 * a; // error - not necessarily in range

      For cases like that third assignment, an explicit conversion could be used so the programmer knows that the conversion might fail:

      b = range_cast(3 * a); // run-time check

      For these explicit casts there will be a slowdown and a possible exception thrown. But for calculations certain to be within the allowed range the code compiles down to normal integer operations.

      I don't know if such a library is possible with C++, or just a template-addled fantasy.

      --
      -- Ed Avis ed@membled.com
    26. Re:Self-documenting? by Ed+Avis · · Score: 1

      [sorry, forgot about Slashdot's brain-damaged HTML quoting system the last time I posted]

      Your range_int class does the checking at run time, which is often better than nothing but does make it a lot slower than a normal int.

      Better would be using templates and compile-time assertions to do the check at compile time, for example:

      range_int<10, 20> a;
      range_int<20, 40> b;
      a = 15;
      b = 2 * a; // guaranteed to be in range, okay
      b = 3 * a; // error - not necessarily in range

      For cases like that third assignment, an explicit conversion could be used so the programmer knows that the conversion might fail:

      b = range_cast<20, 40>(3 * a); // run-time check

      For these explicit casts there will be a slowdown and a possible exception thrown. But for calculations certain to be within the allowed range the code compiles down to normal integer operations.

      I don't know if such a library is possible with C++, or just a template-addled fantasy.

      --
      -- Ed Avis ed@membled.com
    27. Re:Self-documenting? by Anonymous Coward · · Score: 0

      I think you're confusing english-like and unreadable. I don't think japanese is unreadable. I just haven't learnt it. It takes a bit more effort to learn APL than, say, COBOL. But once you do, APL is a much clearer way to write some hairy multidimensional array operations...

    28. Re:Self-documenting? by Anonymous Coward · · Score: 0
      I don't think it does only check at runtime. Most of the code will turn out to be dead code and eliminated by the compiler, if it is indeed possible to calculate at compile time. Notice that check_range will be inlined.

      The compiler may not be intelligent enough to realize ulim and dlim is assigned exactly once. There was a way to tip off compiler about that but I can't remember. I was thinking something like: class Percent : public range_int{ Percent(void) { ulim=0; dlim=100; } }; Is it possible to declare something static const and assign a value just once? The stuff you want can't be done with templates, since templates work on class names and class names cannot be only numbers. With an good linker you can probably define _0,_1,_2 etc classes and use them, perhaps, but that would be ugly beyond words.

    29. Re:Self-documenting? by Anonymous Coward · · Score: 0

      I did the same stupid mistake.. --- I don't think it does only check at runtime. Most of the code will turn out to be dead code and eliminated by the compiler, if it is indeed possible to calculate at compile time. Notice that range checkin code will be inlined. The compiler may not be intelligent enough to realize ulim and dlim is assigned exactly once. There was a way to tip off compiler about that but I can't remember. I was thinking something like: class Percent : public range_int{ Percent(void) { ulim=0; dlim=100; } }; Is it possible to declare something static const and assign a value just once? The stuff you want can't be done with templates, since templates work on class names and class names cannot be only numbers. With an good linker you can probably define _0,_1,_2 etc classes and use them, perhaps, but that would be ugly beyond words.

    30. Re:Self-documenting? by Ed+Avis · · Score: 1

      I don't think most compilers would be smart enough to optimize away the checks at run time. For example, if f is declared to return a number between 10 and 20:

      range_int x(11, 12);
      x = f();

      (Here I have passed the min and max to the constructor at run time, following your example.)
      I really doubt that any compiler will be smart enough to see that f()'s returned value does not need further checking, even if f() uses range_int internally. Maybe if f() is inlined then some would. But certainly not across translation units.

      The essential problem is that your idea leaves no way to declare things like 'f is a function which returns a value between 5 and 10'. All you can say is 'f returns a range_int' but the compiler has no idea what the range is (short of doing very cunning static analysis).

      OTOH, if you did manage to implement it with templates then you could be certain of no overhead in the cases where the number is guaranteed not to overflow, because you could arrange for no code to be generated. Only in the cases where there could be overflow would there be overhead, and these cases would require an explicit range_cast() from the programmer.

      Some people have defined 'typeints', a mapping between integers and types, to be able to do fun stuff with numbers in templates. And of course you can parameterize a class by an int or two. So perhaps the range_int<n, m> idea is not out of the question.

      --
      -- Ed Avis ed@membled.com
    31. Re:Self-documenting? by Rich0 · · Score: 1

      Not 100% sure on what CPU this is for (looks a little like 6502 actually), but does this machine actually lack a stack? If the CPU supported indexed memory access (ie VAR EQU BP+4) and I had a macro assembler I think I'd write my own PUSH and POP macros...

    32. Re:Self-documenting? by steveha · · Score: 1

      Spoken like someone who hasn't coded much assembly...

      In fact, I haven't coded much assembly, although I have done some. But you are missing the point here, dude. Would you use Applesoft BASIC (or assembly) to teach an Introduction to Programming class to high-school kids?

      No. You want a language that lets you focus on the basic concepts of programming, without having to learn tons of annoying syntax. Pascal is better than BASIC for this. Java is better than Pascal. Python is probably best.

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    33. Re:Self-documenting? by steveha · · Score: 1

      once you do, APL is a much clearer way to write some hairy multidimensional array operations.

      Maybe so, but the set of problems for which APL is the perfect solution is small enough that few are willing to master it.

      Python, with serious math libraries (written in C) grafted onto it, can do hairy array operations too. And once you master Python, you can use it for more than just matrix math; you can do pretty much anything. I read an article about how a science lab was switching away from FORTRAN to Python for their matrix math; there was a quote something like "after trying Python, no one wants to go back to FORTRAN." Alas, I didn't keep the URL and I can't find the article now.

      If you like APL, that's fine with me. I still like FORTH, even though some people call it a Write-Only Language.

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    34. Re:Self-documenting? by Col+Bat+Guano · · Score: 1

      Ada allows you to create range checked versions of discrete types - the subtypes.

      subtype Months is Integer range 1..12;

      function Month (D : Date) return Months is...

      now : Months := Month (Today);

      Because you have specified that the function Month returns a constrianed type (constrained because it can only have certain values) the assignment to "Now" doesn't have to be checked - there is no way that it can overflow.

      Another interesting feature of subtypes is that you can use them as the specified index for an array (yay! not every array starts at 0! :-)...

      type Rainfall is array (Months) of Natural;

      (Natural is another subtype, which goes from 0 to the largetst integer). You can then process the array...

      R : Rainfall;

      for i in R'range loop
      r (i) := 0;
      end loop;

      - no checking, no errors - it always works. I use Ada to code up CGI programs, and it is very easy. It's got good string manipulation, and if you step off the end of an array you get an exception.

    35. Re:Self-documenting? by vague · · Score: 1

      I might have misread your post, if I did, sorry =)

      The 387 is the x86 FPU architechture. It doesn't have regular registers but is (at least was) stuck with 8 (?) 'stack registers', which meant that all register accesses are done relative to the current top of stack register. This meant the same value had to be accessed from different points, so keeping track of the top of the register stack was extremly important.

      This design had me entierly confounded, and it's widely believed that it was partly responsible for the x86 FPU's often non-competetive performance.

      --

      -
      Listen. Strange women lying in ponds distributing swords is no basis for a system of government.

    36. Re:Self-documenting? by Mooncaller · · Score: 2, Insightful

      I really don't care if no one uses Ada right now. It has got so many advantages over C that it is well worth learning. I use it for my personal coding. I have several projects cooking. Once they are stable ( and documented, even Ada need good documentation!) I will be releasing them GPLed. If the community ignors them because of the language, so be it. I don't care. I want secure maintainable code. The only real problem with Ada is that which is common to all strongly typed languages and that is it is easy to get carried away defining types. As more project leaders come to the conclusion that the most of the problems with modern code can be traced to errors that are a direct result of the characteristics of C/C++, the appeal of Ada will increase. The only other contender is Java but it carries too much baggage.

    37. Re:Self-documenting? by Mooncaller · · Score: 1

      You don't undestand what was ment. If you have ever worked on maintaining and extending a large open ended project writen in C or C++, and a simular project written in Ada, you would know. The same can be said of Python vs. PERL. A tool written in Python using accepted Pythonistic techniques will generaly be easier for a Pythonista ( and even a non Pythonista) to read then the same tool written in PERL is for a PERL hacker. One needs to think more in decoding the syntax. The fundimental reason Ada syntax is easier to read the C is straight forward. C syntax was designed to map very well onto the underlying computor hardware. The syntax of Ada was designed to map onto the problem space for which computors are applied.

    38. Re:Self-documenting? by Mooncaller · · Score: 1

      If Ada code writen by C programers still thinking in C is anything like C code writen by EEs still thinking in BASIC, I don't want to see it.

    39. Re:Self-documenting? by Ed+Avis · · Score: 1

      Yes, if it can be determined at compile time that the return of Month fits into the range Months, then no run-time check is necessary.

      I've hacked up an equivalent in about 30 lines of C++, it lets you declare variables as

      bounded_int<5, 10> i;
      bounded_int<6, 7> j;

      Then 'i = j;' will compile happily, since the range of j is within the range of i. And of course another bounded_int<5, 10> could be assigned to i. However, if you want to assign the other way round, you have to use an explicit cast:

      j = range_cast<6, 7>(i);

      and this will throw an exception at run time if the value is outside the allowed range.

      However, my prototype code is still ugly, in particular I haven't worked out a clean way to say:

      bounded_int<5, 10> i = 7;

      which ought to compile without complaints because 7 can be statically determined to be within the limits. There are other rough edges such as having to pass the new range explicitly to range_cast, you can't just say 'j = range_cast(i);'. Maybe this can be done with cunning template code, maybe not. In a way it is cleaner to have the support directly in the language. OTOH, some would say it's better to have an expressive but minimal base language and implement this stuff in the standard library.

      In any case, from a practical point of view, Ada has bounded integers while C++'s standard library does not (yet), so Ada wins.

      As for indexing arrays from not-zero, this is trivial to do with a wrapper class, either for native arrays or for classes like the STL's vector. But again, there is no current provision for it in the standard library and no clean integration with classes like the bounded_int I wrote.

      C++'s STL is notorious for not having any bounds checking on many of its containers, particularly vector. This means that you have little excuse not to use vector (which does at least auto-resize if you ask it to grow) rather than built-in arrays, but it also makes it harder to write and debug safe code. I'd prefer to have the safe behaviour of throwing exceptions on bounds errors by default, and the option of turning it off in really performance-critical code (or when the compiler can figure out statically that no check is needed, as when using bounded integer types). Failing that, at least the option of turning it *on* would be welcome. Again this is something you can easily provide yourself, but it's not in the standard library.

      --
      -- Ed Avis ed@membled.com
    40. Re:Self-documenting? by Rich0 · · Score: 1

      I see where we're missing each other. I was looking at the parent post assembly listing (which doesn't look like 387 to me - I'm guessing it is 6502 or something like that). The way he was passing variables to proceedures made it look like the CPU lacked a stack (which could be the case - I don't know much about the 6502 or whatever he is using).

      I assumed from your post that you had identified his code as being 387 code. I was not thinking 80387 since I do know a bit about that - I was assuming there is some other obscure chip out there with a 387 in the model number.

      I'm guessing the 387 designers figured that what works for an HP calculator should work for a CPU. I've never done much with 387 assembly, so I don't know how well it works in practice. It does seem strange to use a completely different architechture on your FPU though...

    41. Re:Self-documenting? by TheLink · · Score: 1

      If you know the language, and the language is not totally screwed up, you usually know the WHAT - that's not the problem. The problem is sometimes you don't know the WHY.

      Example:

      You see a line
      if (c > 0) then doblah;

      Obvious what it does. But is this what it SHOULD be doing? Should it be c >=0 instead?

      Sometimes it's clear. Sometimes it isn't. That's where the documentation and comments come in.

      And then there are errors of omission. Maybe there should be an "if (c > 20000)" line as well. It might not even be in the design documents because the designers weren't aware it could be a problem.

      I find it hard to believe anyone who says comments in code are unnecessary just because it's written in Language X.

      So what if it's a very high level language or a low level language, or it maps to the problem space well. People and situations are imperfect.

      Say you tell someone to bring the heads of the software team to a meeting, and maybe they will chop heads off and bring them to you[1].

      Was that what you intended? Maybe it was, you really did want their heads chopped off and you were intentionally exploiting a "feature"! Or maybe it wasn't. Perhaps we'd see that incident commented in your diary, followed by a Bwahahaha!, and we'd know for sure.

      [1] http://bible.gospelcom.net/cgi-bin/bible?passage=2 KGS+10:5-9&language=english&version=NIV&showfn=on& showxref=on

      --
    42. Re:Self-documenting? by vague · · Score: 1

      Well, my (albeit limited) experience is that it, in practise, does not work very well at all =) I hated every second of it, but it did provide a bit of perspective.

      I still have a lot nicer memories of m68k asm than those of x86 asm =)

      --

      -
      Listen. Strange women lying in ponds distributing swords is no basis for a system of government.

    43. Re:Self-documenting? by Suidae · · Score: 1

      In Ada, I'll write the code, look at it, realize that it says what it does, and not need to write comments.

      I think this has a lot to do with proficency in a language. It might be clear to you because 1) you wrote it and 2) you are so proficent in the language that, to you, it reads like plain English (or whatever you happen to speak).

      Pity the guy who comes along next to maintain your code. He may not know the language as well, and might not think the say way you do, so your lack of comments will make his job harder.

      The best coders don't just turn out working stuff, they turn out working stuff that other people can use and maintain with a minimum of effort.

    44. Re:Self-documenting? by Bob+Munck · · Score: 1
      It might be clear to you because 1) you wrote it and 2) you are so proficent in the language that, to you, it reads like plain English

      As a general rule, your comment is right on. However, I've been teaching programming and documentation for some 35 years and am very much aware of the phenomenon of "internalization" where you become so familiar with things in a system that it never even occurs to you to say them. I'm also much aware that levels of language proficiency can vary. In fact, I've several times written systems that I knew at some time in the future would be converted to another language, and hence had to assume that those doing the conversion would be relatively more proficient in the new language and less in the one I was writing.

      Once when I was at Prime, Bob Frankston (of VisiCalc fame) stood up in front of us and explained that his code was so well written that it didn't need comments. I thought at the time that he was being extremely arrogant, and later, when I had to do something with his code, realized that he was also extremely wrong. My comment sounded like that kind of attitude, and for that I apologize.

      My intent is that a person who doesn't know Ada at all, who has had maybe a single Pascal course (and who speaks English), will be able to understand my programs because of the choice of names, structures, and constructs. Ada is the only language I know where I have a prayer of accomplishing that.

    45. Re:Self-documenting? by Suidae · · Score: 2, Interesting

      My intent is that a person who doesn't know Ada at all, who has had maybe a single Pascal course (and who speaks English), will be able to understand my programs because of the choice of names, structures, and constructs.

      Excellent! I love coming across code that has been written that way (and try to do so myself as often as possible). Often I find that choosing names for things is one of the the hardest parts of getting a good design. Probably an indicator that I need to study more design patterns :)

  64. "Your favorite language sucks" by el-spectre · · Score: 1

    My favorite T-Shirts are 2 I saw at defcon, coupla years back, in white on black (a la 'got milk'):

    "Your OS sucks"

    and

    "Your favorite language sucks"

    --
    "Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
  65. Redefining a language is essential. by rjh · · Score: 4, Insightful
    Ask any LISP programmer how well they could work if they weren't allowed to redefine the language (redefine it on-the-fly, even). Operator overloading is not bad; it's reckless use of overloading which is bad.

    If you overload + so that it suddenly means "Multiply by 34 and truncate to the nearest prime", that's not the language's fault: that's your own fault for being a damnfool idiot. Just like if you overload + for complex numbers so that it does complex arithmetic, it's not to the language's credit: it's to your credit that you used an appropriate overload.

    Look at LISP, in which pretty much any part of the language can be overloaded. Nobody's ever complained that this linguistic flexibility has harmed LISP; in fact, this linguistic flexibility is almost universally hailed as one of LISP's strengths.

    Parting thought for the overloading-is-bad crowd:

    C overloads, too.

    After all, you can do:
    float pi = 3.14159;
    float e = 2.71828;
    float result_float;
    float result_int;
    int constant = 1;

    // + defined for addition of two floats
    result_float = pi + e;
    // + defined for addition of two ints
    result_int = constant + 0;
    // + defined for addition of a float and an int
    result_float = pi + constant;

    ... I mean, come on. C overloads, so "overloading is evil" is a meme which you really ought to know better than to propagate.

    Overloading isn't evil.

    Stupid overloading is evil.

    And you will never, never, never, succeed in creating a programming language in which it is impossible to do stupid things.
    1. Re:Redefining a language is essential. by damiam · · Score: 1

      C may overload, but you can't overload in C (short of using #defines). Therefore, you can't mutate the language to the same degree you can with C++.

      --
      It's hard to be religious when certain people are never incinerated by bolts of lightning.
    2. Re:Redefining a language is essential. by JohnQPublic · · Score: 1

      Look at LISP, in which pretty much any part of the language can be overloaded. Nobody's ever complained that this linguistic flexibility has harmed LISP; in fact, this linguistic flexibility is almost universally hailed as one of LISP's strengths.

      Excuse me? The only environment more fractious than Unix is (well, was for 20 years or so) LISP. Common LISP was an attempt to heal the wounds caused by all the rampant language-redefinition, in many ways a similar idea to Single Unix Specification, X/Open PG et al., albeit more successful.

    3. Re:Redefining a language is essential. by rjh · · Score: 3, Interesting

      While technically right, this misses the point.

      McCarthy's LISP 1.5 was never meant to be used by industry. (In fact, it was never meant to be a computer language at all; McCarthy's LISP was meant as a simpler model of the Turing Machine, and it was only turned into a proper programming language by an enterprising grad student.)

      MacLISP, ZetaLISP, etc., were all attempts to take a purely theoretical language and turn it into a language useful for productive tasks. Why do you consider this to be an example of LISP's flexibility causing forks? If LISP wasn't that flexible, it would have never been able to make the leap out of the laboratory and into the real world.

      Once people had experience at making LISP work in the Real World, then Common LISP came about. This is the way languages evolve, and that's just the way it should be.

      No language ever springs from a designer's head full-blown and perfect, like Athena erupting from Zeus' skull. A cycle of languages diverging and then converging is a sure sign that the language is healthy and alive.

    4. Re:Redefining a language is essential. by Anonymous Coward · · Score: 0
      No language ever springs from a designer's head full-blown and perfect, like Athena erupting from Zeus' skull.


      Except INTERCAL.

    5. Re:Redefining a language is essential. by Steveftoth · · Score: 1

      I'm not saying that Operator Overloading is evil, I'm saying that it's complex. Well, more complex then just having functions.

      Overall, I do wish that it were in Java, being a full time java programmer. (Though I would rather have covarient return types first ;) )

      The only real complaint that I have about operator overloading is that it starts out as a good idea, then gets shoehorned into ideas that it cannot easily describe.

      Since operator overloading is just another way to call functions and is exactly the same as redefining the way that functions are called, people can use it instead of functions. Say that you create a class that has no functions, just operator overloading. ++, --, $ ,& , + , * whatever every time you do something to an object it would be some crazy shortcut. Now I agree that only the truely insane would go to this length to avoid all real function names,, and you could do the same thing with functions by using nonsense names like ZAZAZA for function names.

      So I say that by limiting the options of all programmers you make it simpler for everyone, but at the expense of those few programers that actually know what they are doing.

    6. Re:Redefining a language is essential. by rjh · · Score: 1

      So I say that by limiting the options of all programmers you make it simpler for everyone, but at the expense of those few programers that actually know what they are doing.

      So you think that since very few artists are capable of making good line art (line art is perhaps the hardest of the Western artistic styles), we should forbid artists to have pencils, in the name of improving the average quality of art?

      The trick is not to lobotomize a language into something that even an idiot can use safely, because then only idiots will use it. The trick is to create a language in which the idiots won't need to know the advanced techniques (overloading, functional programming, generic programming, etc.) in order to accomplish their tasks, and in which the maestros won't need to resort to ugly kludges and hacks in order to use their advanced techniques.

      My favorite language for this "good for idiots and for maestros" is currently Python. It's not perfect, though--I really, really miss true lexical scoping and strong lambda.

      I think C++ went too far one way: in order to write nontrivial programs often requires a very nontrivial understanding of the language. I think Java went too far the other way: many extremely powerful programming techniques are simply not possible in Java, all in the name of making things simpler for the average programmer.

    7. Re:Redefining a language is essential. by Viol8 · · Score: 1

      Using the plus operator to add floats and ints is not really an example of overloading since all C
      does is cast the int to a float then do the addition. The result then gets cast (read chopped) to fit in whatever variable its being
      assigned to. Something that always fools new programmers to C is that you can do something like:

      mystring = "hello" + "world"

      They believe that the + is adding two strings whereas in fact C has just taken the memory addresses
      and passed the numeric values to plus. So in C IMO it would be better to say maths operators do implicit casting rather than overloading.

    8. Re:Redefining a language is essential. by JohnQPublic · · Score: 1

      MacLISP, ZetaLISP, etc., were all attempts to take a purely theoretical language and turn it into a language useful for productive tasks. Why do you consider this to be an example of LISP's flexibility causing forks?

      LISP 1.5 was an early-60s phenomenon. There was a siginificant bloom of LISP dialects in the 70s (heck, RUTGERS-10 half a dozen so alone!), more if you count the derived languages like Scheme and Emacs LISP. Common LISP did a nice job of pulling the community back together, but it was a long time coming.

    9. Re:Redefining a language is essential. by Steveftoth · · Score: 1

      So you think that since very few artists are capable of making good line art (line art is perhaps the hardest of the Western artistic styles), we should forbid artists to have pencils, in the name of improving the average quality of art?
      Yeah, I'd say that it as always, depends on the people that you are working with. If you are an amazing programmer with an amazing team of people who are also amazing programmers, then Java might not be the best choice. But if you are a bumbling fool and have fools for co-workers then Java or another simple language might be a better choice. There will never be a language or tool that is good for everyone, that will fit any problem perfectly.

      Java is IMO, a good balance a lot of the time. Not always, and sometimes I do want much more power. However, anytime that I use a new library in Java it is almost always simpler then using a library designed in 'harder' languages like C++.

      A good example is that I needed to read excel files in my current java application. There is a libarary that is maintained at the apache site. It took me a whole day to download, read and implement the basic functionality of reading and writing excel files. This task was made much easier by the fact that Java handles things like memory for me. That the APIs were simple due to the simplicity of the language.

      We could argue all day over which language has the best tradeoff of features for power. I do agree that redefining the language is required if you want to create more advanced code that is more efficient and powerful.

    10. Re:Redefining a language is essential. by Piquan · · Score: 1

      Ask any LISP programmer how well they could work if they weren't allowed to redefine the language (redefine it on-the-fly, even). Operator overloading is not bad; it's reckless use of overloading which is bad.

      First: I am a Lisp programmer. I got lucky when my boss asked me to write a particularly hairy program: I said, "I'll need to write it in Lisp" and he said "Okay". And I agree with what you say about changing the language.

      Second: Non-Lisp programmers are going to be a bit confused by this. For their benefit, I'll briefly say that Lisp defines methods as specializations of functions, not as functions on classes. In other words, you don't define class FOO and a method BAR on class FOO; you define a generic function BAR, and a method for when BAR is called on a FOO. This is called "generic function" OOP, as opposed to "message passing" OOP like Smalltalk, Java, C++, Perl, etc use.

      That said, I'm going to make the assertion that Common Lisp does not quite allow operator overloading, although it gets close. Consider the operator + that you use in your examples. Suppose that I invent a type QUATERNION. (Google it if you care; it's a numeric type often used in 3d simulation. I'd use complex numbers, but CL defines them.) Now, even though addition of quaternions is defined, I can't overload + to do this.

      Okay, I'm ambiguous. I can make a QUATERNION:+ generic function, and set its unqualified method to dispatch CL:+ if I want. But this won't affect any code which isn't importing the QUATERNION:+ symbol. Defining QUATERNION:+ in such a manner is the same as defining a function QUATERNION:ADD. I'm not sure this would be usefully considered operator overloading.

      Of course, the limitation I'm describing is equivilent to a limitation in C++: the relevant header file be #included. It's necessary for C++, since it needs to know (for instance) which method to dispatch based on the second arg, or how it needs to cast the second arg.

      So what's the point of my rant, you ask? Lisp operator overloading is as good as overloading in any other language, right?

      Well, not quite. Suppose in addition to QUATERNION:+, you also have a HYPERCOMPLEX type (in the Davenport sense; again, it's another numeric type that CL doesn't define). It defines its own HYPERCOMPLEX:+. The two packages don't know about each other. So now you have two + symbols (three if you count CL:+) and you can only import one. One reasonable solution would be to import neither; define your own CL-USER::+ generic function, with appropriate methods. But that's exactly what operator overloading is supposed to do; you're now doing the work of the OOP system. Granted, it's not particularly onerous work. The advantages of CLOS far outweigh this minor inconvenience. But I don't think it's fair to say that CL has operator overloading.

      Okay, this example is a bit contrived. Who's going to use all these different numeric types? Well, let's switch to another operator, then: EQUALP. This may be something you've heard about if you read comp.lang.lisp. As you know, for any instance object, EQUALP behaves as EQ: it doesn't descend the structure. A lot of people define their own structures. The implementors of QUATERNION and HYPERCOMPLEX certainly would like EQUALP (or even EQL) to do the "obvious" things to their structures. So questions keep coming up about making EQUALP a generic function.

      Kent Pitman provides the most eloquent answers to this question. You'll sometimes see them in c.l.l, such as this article. (This article also discusses a similar problem with overloading +.) He also has written

    11. Re:Redefining a language is essential. by rjh · · Score: 1

      First--thank you for a wonderful response, even though I disagree with you. :)

      ObDisclosure: I've been programming in LISP for about eight years. I learned CLOS early on, and found it to be too elephantine for my taste; it seemed like very few problems required an OOP approach and could be better solved in classic LISPing. This is purely my own personal taste, mind you, and I'm not claiming it's the One True LISP Way. It will go to show you my prejudices, though.

      That said... I think before we go on we'll need to define what we mean by "operator overloading". As I showed in an earlier message, C overloads operators--practically every language engages in overloading. But anti-overloading partisans would take me to task for my C example, claiming... well, I'll let them make their claims themselves. :)

      Here's my definition of "operator overloading": redefining existing compiler-supplied functions and operators is operator overloading. If + gets redefined to support string concatenation or complex math or what-have-you, that's overloading.

      Why do I take this approach? There's not much difference between a function and an operator. In C, + is an operator which accepts two arguments and returns one returns. In LISP, + is a function which accepts arbitrary arguments and returns one value. Either way, they both take arguments and return values, which is the classical definition of a function. So given this, I consider an "operator" to be a function defined within the compiler and not its library.

      So does LISP support operator overloading? LISP allows me to redefine read, eval and print. Thus, by my definition of operator overloading, LISP supports operator overloading.

      Take away operator overloading and what you're really taking away is the programmer's ability to redefine the language. I don't think that enriches programmers; I think that impoverishes us.

    12. Re:Redefining a language is essential. by Anonymous Coward · · Score: 0

      This is true. Overloading doesn't kill people. Compilers do.

  66. Oh dear god help us by huhmz · · Score: 1

    Most...flamable...story...ever...fighting...urge.. .
    to...badmouth...php

  67. Execs, wrong C example by gallir · · Score: 1
    He said:

    Quick, what are the differences between execl, execlp, execle, execv, and execvp? If you're not using these every day, you'll be hitting man 3 exec often.

    It's plain wrong in the example. The execs...semantics are pretty clear, every letter has a concise meaning:

    • "l" (linear?) means all argvs to the program are passed in a variable number of arguments. That's to say, the arguments to the program are explicit in the paramaters of the funcion. The number is variable, the end marked by a NULL argument.
    • "v" (virtual?) means almost the oppossite, that the arguments of the programa will be passed from a variable sized array of char pointers, the last one indicated by NULL.
    • "e" (environment) You also pass the environment variables as argument.
    • "p" (path) Search the executable in the directories especified in the environment variable PATH.
    So, as a OS teacher, I see them quite clear, sistematic and consistent, at least much more clear than strncmp()/ strncasecmp(), just to mention a pair.
    --
    sgis ddo ekil t'nod i
    1. Re:Execs, wrong C example by Anonymous Coward · · Score: 0

      Perhaps more importantly, even if you agree the names are flawed, it's not a flaw in C or even the C library. It's a flaw in Unix. Those are Unix kernel calls, not C standard library calls.

  68. Looking at it from the reader's perspective by Ilan+Volow · · Score: 4, Interesting

    One fault I find with the author's assessment is that he is evaluating the language only from the standpoint of the one who is writing in it. I think a better language assessment would also evaluate a language from the viewpoint of the poor bastard who actually has to read someone else's code written in that langage. Does the language have the tendency to produce code that is readable and understandable by the person who didn't write it? Or does the language have the tendency to produce code that is readable/understandable by only its original author?

    For example, Perl allows the programmer who writes a perl program try to make their code as terse and unreadable as possible, fitting everything on one line by exploiting some bizarre behavior of the perl interpreter. While this "expressiveness" might be wonderful to the person who's writing the code, it's really going to be a problem for a second person who might want to contribute to it or maintain the project after the original author threw in the towel or got hit by a bus.

    Another example is operator overloading. Perhaps operator overloading is useful to the first person writing the code, as it provides a nice little shortcut where they can do foo + bar as opposed to something like foo.add(bar). But if there's another person who's decided to work on this project, and they're not very familiar with the code and they are trying to get the idea of how it works, how can they tell whether foo+bar is a mathematical operation or some sort of concatenation? Yes, if they look over the code enough, they can understand it. But perhaps that extra amount of fuss and the extra amount of time wasted trying to make sense of things will convince that person it would be easier to write their own stuff than try to reuse someone else's.

    A final area I wish the author focused on is documentation. Does the language support some sort of embedded and standardized documentation that make it easier for the first programmer to provide information that would help a second programmer make sense of the code, or is documentation at the discretion and mercy of the first programmer and whatever bizarre and non-standard documentation system they might use?

    I would suspect that projects using languages that make it harder on the person who has to read the code have higher incidences of duplication of effort and a great NIH (Not Invented Here) tendency.

    But that's just my opinion.

    --
    Ergonomica Auctorita Illico!
    1. Re:Looking at it from the reader's perspective by Pig+Bodine · · Score: 1
      Another example is operator overloading. Perhaps operator overloading is useful to the first person writing the code, as it provides a nice little shortcut where they can do foo + bar as opposed to something like foo.add(bar).

      In my opinion the problem with this reasoning is that it ignores the fact that specific communities might have very standard ways for overloading operators that won't hinder readability for anyone who would be likely to be reading the code. For example, I do matrix computations. If you use the operators without much thought for memory allocation, I suppose there can be some performance pitfalls that you might otherwise avoid. But as far as readability goes, it's a clear win: Instead of a messy list of function calls you have a direct translation of whatever equation(s) you might be working with in standard algebraic notation. Anyone for whom this isn't more readable is probably not familiar enough with the math to be looking at matrix codes anyway.

      Of course this begs the question of whether general purpose programming languages should be designed to be flexible enough to meet the needs of such specialized groups when we all know that plenty of other people will make stupid and unreadable use of a dangerous feature. But for me lack of this feature can make a language completely unsuitable (or at least highly inconvenient) for what I need to do. Maybe we should all be using the language that is tailored to our needs (Fortran 90 and later versions overload + - automatically to work on arrays, along with providing many other features handy for people writing numerical code). But use of many different languages also presents problems for people inheriting old code.

  69. Graphical programming by Anonymous Coward · · Score: 0

    The article doesn't mention the ease/difficulty of programming in a Graphical language ex. LabVIEW. I used to hate it till I started using it. Now I do almost everything in LabVIEW. What I Hate about it? + It ain't free. + No recursion + No OOP + Expensive toolkit add-ons for special functionality (Signal processing, Real-time etc.) + No matrix data-type. Of course you can use arrays but I would like to see a Matrix primitive What I love about? + Takes me a day to do a project which I would normally take a week to do in C. + Elegant and self explanatory + Dataflow programming style. + Great debugging tools

  70. Scheme -vs- Common Lisp by SimHacker · · Score: 3, Insightful
    Scheme is the intersection of all Lisps.

    Common Lisp is the union of all Lisps.

    It's not a matter of one sucking and the other ruling. They're both much better than most other languages. Because missions come in different sizes, it's great having a choice between a light fast sports car and a huge urban assult vehicle.

    Python's design was wisely inspired by Lisp. It's somewhere between Scheme and Common Lisp in complexity, and rates extremely high on the practicality scale (integration, library support, community, portability, footprint, design focus, long term plan, etc). But Python isn't as useful as Lisp for metaprogramming (because it doesn't have a real macro system).

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Scheme -vs- Common Lisp by Anonymous Coward · · Score: 0

      You know what I hate about common lisp? The complete inconvenience it is to make it talk to other programs or to the OS. Other than that, I really like its lexical simplicity and compact, malleable nature.

    2. Re:Scheme -vs- Common Lisp by SimHacker · · Score: 1
      "The complete inconvenience it is to make it talk to other programs or to the OS."

      Unfortunately that's the only thing about Lisp that Java copied.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    3. Re:Scheme -vs- Common Lisp by avdi · · Score: 1

      "Python's design was wisely inspired by Lisp."

      Where the hell did that bit of misinformation start? I've been hearing it a lot lately, and there's not a jot of truth to it. Python started out as a fairly limited procedural scripting language with C-style syntax, used for in-house scripting. It was "inspired" by the need to script things.

      Since then it has added a few lisp-ish features, but no more so than dozens of other languages. Taking some of the most distinctive features of Lisp:

      Code is Just Data
      Not in Python it isn't. This is arguably the most important feature of Lisp, and it's difficult to see how a language which cannot cleanly manipulate code at run time can be said to be "inspired by Lisp". Even TCL is more like Lisp than Python in this sense.

      Lambdas
      Lambdas were only added relatively lately to Python, and in a severely limited form. In this sense Perl, Ruby, Smalltalk, and even Java (with it's anonymous inner classes) are more Lisp-like than Python.

      Continuations
      Not supported, and I gather that the architecure of the Python interpreter is such that they may never be supported. Ruby, being actually inspired by Lisp (among others) from inception, naturally supports them.

      CLOS
      Lisp has one of the most advanced and flexible object systems around. Python's is feeble and kludgey by comparison.

      Tail Recursion
      One can't do a lot of Lisp-style funtional programming without proper tail recursion. A quick definition of an infinitely tail-recursive function in Python shows that Python lacks this: a "maximimum recursion depth" exception is eventually thrown. I understand this is another of those fundamental architecture issues, another artifact of the the fact that the Python interpreter was designed with strictly C-style programming in mind.

      Macros
      Lisp's usefulness in creating Domain-Specific Languages (DSLs) stems from it's powerful macro system. Python has no such system. Even C's pathetic preprocessor beats Python in this regard.

      In short, there is nothing "lisp-inspired" in Python that is not done better in supposedly less lisp-like languages.

      --

      --
      CPAN rules. - Guido van Rossum
    4. Re:Scheme -vs- Common Lisp by SimHacker · · Score: 1
      As I've said elsewhere in this discussion, Python is basically Lisp without macros. But of course there are other major differences, as you point out. Python is certainly not a dialect of Lisp, as could be said for ScriptX, Dylan, Sk8, Scheme, etc. But it is certainly deeply inspired and enlightened by Lisp, in a way that PHP, Perl, Java and C++ just aren't. Put bluntly: the designers of those "reactionary" languages didn't understand or appreciate or learn from or react to Lisp, while the designers of Python did.

      The concept of putting a macro facility into Perl is revolting. It would be much more pathetic that the C preprocessor. (Anyone who thinks the C preprocessor is an acceptable macro facility should stop programmimg immediately before they do any more damage, and go back to CS101 and read Paul Graham's On Lisp.)

      Macros are the one most important thing from Lisp that Python is missing. But Python can certainly manipulate code at runtime. The fact that Python code is not literally structured data is alleviated by the fact that the parser and compiler are available as part of the Python runtime, and you can easily manipulate and evaluate strings in Python. Certainly that's nowhere near as useful as Lisp macros, but at least you're not up a creek without a paddle as you would be with Java or C++. Yes I know you can link the Java compiler into Java, or call the C++ compiler as a sub-process from C++, but that's a totally impractical kludge, not a language-level macro facility.

      I'm glad that lambdas have been fixed in Python since they had problems in the earlier days, but I don't know what you mean by "severly limited form". If you ask me, it's Java's inner classes that are severly limited and extremely clumsy (and they also weaken the security system).

      Continuations are not as useful in every-day programming as most CS grad students with no experience in the real world would have you believe. Just what problem are you actually trying to solve, that you can't solve with threads, exceptions, generators, or better programming techniques?

      As a matter of fact, the Python architecture was easily modified to support continuations (called "Stackless Python"). The main purpose for implementing continuations in the interpreter was to get the interpreter's state disentangled from the C stack, which makes it much easier to embed the Python interpreter in other applications that can't relinquish control of the program counter. For example, with stackless python you can call into the Python interpreter every time slice from a timer callback, and Python can block on network input or whatever, and still return to the caller, so the application doesn't have block inside of Python during its timer callback. That makes Python easier to integrate (and therefore more practical), because it removes constraints on how you can call into the interpreter (because the call can return if the interpreter needs to block). It also enables Python to support tail recursion. But hardly anyone uses continuations in their full glory and splendor, for normal everyday programming.

      Also, Python now has "generators" (aka "weightless threads" or "coroutines"), which are quite useful for some of the other common uses to which people put continuations, but they are much easier to use and understand.

      CLOS is great, but I don't miss it most of the time, because I'm happy with the current object system in Python. Python's object system is quite simple, practical and flexible, and can be easily extended in its own way. ScriptX's object system was a lot like CLOS, as was Dylan's. But again, you usually don't need the enormously powerful generality of CLOS, and it comes at a cost in speed, space and complexity, that most people aren't willing to pay.

      I previously worked on ScriptX at Kaleida, and have written lots of ScriptX code. In some ways i

      --
      Take a look and feel free: http://www.PieMenu.com
    5. Re:Scheme -vs- Common Lisp by avdi · · Score: 1

      Put bluntly: the designers of those "reactionary" languages didn't understand or appreciate or learn from or react to Lisp, while the designers of Python did.

      You've yet to point to any actual data which supports that claim.
      And the idea that the creators of C++, Java, and Perl didn't "understand or appreciate or learn from or react to Lisp" is pure bullshit. I've read their writings. All of them were quite aware of Lisp, and consciously took what they wanted from it. In the case of those languages, what they wanted from Lisp was "not a lot", at least not directly. But this notion that their decisions were not even informed by Lisp knowledge just shows an ignorance of history.

      The fact that Python code is not literally structured data is alleviated by the fact that the parser and compiler are available as part of the Python runtime, and you can easily manipulate and evaluate strings in Python.

      So, in other words, it's no more Lisp-like than, oh, Perl or TCL in that regard. Code-as-data is often referenced as Lisp's "Big Idea", the thing that makes Lisp Lisp.

      I'm glad that lambdas have been fixed in Python since they had problems in the earlier days, but I don't know what you mean by "severly limited form".

      That last I checked they are still limited to a single expression, which makes them less useful than the equivalent construct in Perl, Smalltalk, Lisp, Scheme, Ruby and Java. In fact, using the Lambda Library, I can probably do more in a C++ "lambda" then I can in a Python one.

      Continuations are not as useful in every-day programming as most CS grad students with no experience in the real world would have you believe. Just what problem are you actually trying to solve, that you can't solve with threads, exceptions, generators, or better programming techniques?

      I'll grant that continuations are rarely useful in a relatively featureful language. However, they are useful building blocks for adding any given control structure that your language happens to lack. Moreover, they are part of what makes Lisp and it's derivatives special. You made the claim that "Python is Lisp without macros"; the burden is on you to prove how continuations are not am important part of Lisp. I suspect a lot of Lispers would disagree with you.

      As a matter of fact, the Python architecture was easily modified to support continuations (called "Stackless Python [stackless.com]")

      And last I read, the changes are never going to be rolled back into the Python trunk, making it irrelevant. Apparently there was some unacceptable tradeoff involved. We're talking about Python here, not Stackless Python.

      Also, Python now has "generators" (aka "weightless threads" or "coroutines"), which are quite useful for some of the other common uses to which people put continuations, but they are much easier to use and understand.

      If you're talking about the feature I'm thinking of, it's the one that due to a flaw in Python's architecture can't be used alongside exceptions. Making it practically useless. Tell me, what about Python's lisp heritage makes it so difficult to merge in generators, continuations, and full-fledged lambdas without breaking something else?

      CLOS is great, but I don't miss it most of the time, because I'm happy with the current object system in Python. Python's object system is quite simple, practical and flexible, and can be easily extended in its own way. ScriptX's object system was a lot like CLOS, as was Dylan's. But again, you usually don't need the enormously powerful generality of CLOS, and it comes at a cost in speed, space and complexity, that most people aren't willing to pay

      Once again, "Python is like Lisp! ...except in all those areas where it isn't".

      This is like me saying that imaginary lan

      --

      --
      CPAN rules. - Guido van Rossum
    6. Re:Scheme -vs- Common Lisp by SimHacker · · Score: 1
      Great reply! But you still miss my point. I'm not saying that Python is in any way a direct Lisp derivitive, or that any features from Lisp that are missing from Python are not essential to Lisp.

      The designers of other languages like Perl, C++, Java, etc, didn't have a good enough understanding or appreciation of Lisp, or those languages wouldn't be the disasters they are today. In fact, many of the "pop" languages have displayed an almost homophobic contempt for Lisp.

      Vanilla Ice surely knows about Miles Davis, just like Stroustrup known about Lisp, but he certainly doesn't draw any signifigant influences in a way that shows up in the quality of his own work, in the way that Python draws many infliences from Lisp.

      Please explain how anyone who actually understood the true power of Lisp macros, could have ended up designing something as awful and disgusting as the C++ template system? (And he still left in all the fractal syntactic interactions and subtle unintended toxic side-effects of the C preprocessor.)

      Since you say the burden is on me to prove how continuations are not am important part of Lisp, I refer you to the fact that continuations are not part of Common Lisp. Kent Pitman (who helped me learn lisp) writes:

      "I, for one, am glad not to see continuations in CL. If someone proposed adding them, I would argue strongly against the move. I feel about them the same way as others feel about GO. They encourage unstructured programming and I think they're a semantic mess."

      Scheme is very different from Common Lisp, in many signifigant ways, yet nobody would argue that it's not influenced by Lisp. Python is influenced by other languages than Lisp, but Lisp is certainly one of its main influences, and it's obvious that the designers understood Lisp well, and didn't hold it in contempt like the designers of the Perl or C++ template system.

      I think one of Lisp's greatest problems is that its name has homosexual connotations, and that scares off all the homophobic closet queens, who don't even realize why they're supernaturally subconsciously afraid of the language. I know a lot of gay Lisp programmers, which suggests that you have to come to terms with your sexuality before taking on a language with a name like that.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    7. Re:Scheme -vs- Common Lisp by avdi · · Score: 1

      A point to you, on the subject of continuations. I don't actually know Lisp very well - I know a lot about what Lisp and Scheme are capable of from all my reading, but I haven't used them much beyond Emacs Lisp hacking. Which doesn't count, I know. So I think there I was confusing Lisp with Scheme.

      I don't think Larry Wall or Bjarne Stroustrup held Lisp in contempt; in fact, I'm sure I've seen them both speak highly of it in various writings. Both Larry and Bjarne were trying to do something very, very different than Lisp with Perl and C++, and I think they succeeded admirably in their goals. Larry wanted a glue language what would roll all of the power of the various UNIX command-line utillities into one, in a way that enabled powerful programs to be expressed very concisely, and which bore enough resemblance to it's forbears that it wouldn't have a steep learning curve. Bjarne wanted to see how many modern abstraction techniques he could add to the domininant systems programming language of the day, C, without sacrificing backward-compatibility or efficiency. Ultimately, both of them wanted a language they enjoyed coding in, at which by all reports they succeeded. This claim that they held Lisp in contempt is just absurd though; read their writings long enough and you come to see that not only were they aware of it, they understood it and had a good deal of respect for it. That they chose different solutions for a different problem space in their own work doesn't indicate any lack of understanding on their part.

      As for your closing paragraph - I'm just going to assume you are joking. So: hah hah. Pity the poor fool who names his language "Queer".

      --

      --
      CPAN rules. - Guido van Rossum
    8. Re:Scheme -vs- Common Lisp by SimHacker · · Score: 1
      Well the title of this discussion invites flames, so I word my opinions strongly. But you understand what I mean.

      These days, if I wanted to designed a new programming languages optimized to be irrationally popular with millions of idiots because of its name, I'd call it "Bush".

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  71. Web service technology... by BobLenon · · Score: 1

    I want one like the guy I saw use at a MS Product launch last week for W2k3 and VS 2k3. He copied a stub for calling a web service incompletely (missing a }) and pasted it onto the design - NOT code view.

    He then "compiled" and showed us the end result - which was already open.

    Now if that would work. Damn that'd be sweet.

    --

    /* Lobster Stick To Magnet!*/
  72. Perl + Inline.pm = easy C extentions by Tikiman · · Score: 1

    The Inline module should erase complaints about the difficulties of extending Perl with C (or C++ or Python or Befunge or ...)

  73. Static Typing by Anonymous Coward · · Score: 0
    From the article:
    I don't write a lot of code that would benefit from static checking.

    Ok, I quit there. I've heard that from too many undergrads, the usual learn better when they hit their first all night bug.

    1. Re:Static Typing by chromatic · · Score: 1

      Have a look at Bruce Eckel's weblog on the subject which points to Bob Martin's thoughts. (Artima seems to be down at the moment, unfortunately.)

  74. Delphi.. by jagilbertvt · · Score: 3, Insightful

    What we can conclude from this article is that Delphi roxors :)

    1. Re:Delphi.. by PolyDwarf · · Score: 1

      Well, until you have to use anything but breakpoints and simple evaluations.
      Call Stack support is horrendous, as is tracing into a dll that is also in the project group, also built correctly, etc... I can get it to work maybe 20 percent of the time.
      Before you flame, I am a full time Delphi programmer. I love it, but it does have it's quirks.

  75. define "good" by SimHacker · · Score: 1
    In fact, lots of good PHP programmers use all three for different kinds of comments -
    // is for instructions
    # is for copyrights
    /* is for
    multiple lines */

    What do you mean by "good"? How does that improve the readability of the program? Is there some kind of error I might make if I mistake a copyright comment for an instruction comment? Is it supposed to make it easier to ignore the copyright? Aren't copyright notices meant to be noticed? Is there some reason I need to distinguish between multi line comments and single line comments? Isn't the fact that the comment spans multiple lines enough? Why use a different commenting syntax for each case? What are the rules for nesting all different combinations of comments?

    The designers of PHP and Perl didn't really understand the justifications or interactions of the features from other languges that they were aping -- they just copied them to make people feel comfortable. That's what I mean when I say that languages like PHP, Perl, Java and C++ are reactionary programming languages. The world doesn't need any more reactionary programming languages, designed with such a Cargo Cult Mentality.

    "We don't know why they're successful, but we want to be like them! Maybe if we immitate the commenting syntax of all the other popular languages, our new language will catch on as much as all those other languages combined! It will make porting comments and copyright notices so easy!"

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:define "good" by sethadam1 · · Score: 3, Interesting

      In fairness, some IDEs color different comments different ways. I've seen people use the different comment styles to make different kinds of comments. There's no steadfast rule, it's just preference, and SOME people use them that way.

      I understand what you're trying to say, but PHP doesn't really have a counterpart. You can't really compare it with Perl, Java, or C++. The closet we have to something that compares to PHP is ASP, which is hardly a substitute. Perl wasn't really designed for web use, althought it's found its way there.

      Either way, you seem awfully angry about this. PHP is flexible and is meant for all programmers. Like the rest of the Linux debates, the camp that "hates" PHP is often the same people who are elitist about Linux in general.

    2. Re:define "good" by SimHacker · · Score: 1
      Of course you can compare PHP with any other language. There's nothing special about it. It's just designed to be used in a restricted set of circumstances (serving web pages). That's not special, that's limited. Even Visual Basic is useful in more contexts that that.

      I've developed a web site using Python and Zope. Both the Zope front-end and the content processing back-end are written in Python. Because Python is powerful enough to use for implementing both the front-end and the back-end, they can easily share lots of code and data structures, so it makes programming much easier. The front-end needs to implement an interactive interface to many of the same functions and data structures that the back-end uses to bulk process the content every night. A Python class or function written for one layer will often be useful for the other layer. I don't want to have to rewrite every Python function I need in PHP, or maintain two branches of the code in different languages.

      It's important to choose a language that is able to grow with the project. PHP just doesn't cut it. Perl does, but the results are disasterous. People don't mean to write huge Perl programs -- they write small Perl programs that grow out of control. Growth happens to programs written in any language -- Python is just much more capable of dealing with growth (and is much more maintainable) than PHP or Perl.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    3. Re:define "good" by Anonymous Coward · · Score: 1, Insightful

      Corrections:

      - PHP can be used in a non-web application. Why do you think they have GTK linkage? I run PHP cron jobs every day.

      - "PHP just doesn't cut it"? What kind of statement is that?

      - PHP is no less maintainable than Python.

    4. Re:define "good" by pyman · · Score: 1

      Idiot. quite obviously you have never coded in python.

      --
      a ^= b; b ^= a; a ^= b;
  76. Re:Fuck you all!!! by ratfynk · · Score: 0, Troll

    Very lyrical and poet flame bait. Before I CEE what this is all about I think I will ASSEMBLE an answer,
    mayde I will code it in TASM, or NASM or just catch shit from my compiler by using C. I CEE that I have waded into a war of religion not a usefull discussion!

    --
    OH THE SHAME I fell off the wagon and use sigs again!
  77. pay attention, numbnuts by Anonymous Coward · · Score: 0

    Ok, follow the thread. ASP.NET was the implicit subject at the point you chimed in. The initial post introducing ASP.NET states explicitly that ASP != ASP.NET. Your post contains url for a ASP-clone product.

    Pay attention. If you can be bothered to cut and paste a link into a page (without an anchor tag, though that could be considered a stylistic preference), but missing the point entirely is unacceptable.

  78. Whitespace: a great macro language for Python by SimHacker · · Score: 2, Funny

    Somebody should write a Whitespace macro front-end for Python, then it will be better than Lisp!

    --
    Take a look and feel free: http://www.PieMenu.com
  79. What do you mean superficial? by Bingo+Foo · · Score: 1

    Superficial? He says he hates C++ because he finds the template syntax ugly, and he offers no way to improve it. That's deeper than 99% of what gets typed into Slashdot.

    --
    taken! (by Davidleeroth) Thanks Bingo Foo!
  80. Re:Reactionary languages - Perl by Anonymous Coward · · Score: 0

    Perl is very good, if you use it correctly!

    Start a Perl script with:

    use strict;
    use diagnostics;
    use Safe;
    use English;
    use vars qw/ varname /;

    and avoid punctuation, globals,
    undeclared, implicit $_ and @_,
    put some freaking comments,
    use Java like variable name and function name.

    Fire any perl programmer who is not!

    Java is SOOOOOO simple...
    When you are finished
    with your XML 200 pages of code (~6000 LOC)
    for your XML recursive DOM parser, let me know.

    I prefer this:
    use XML::Ximple;
    my $xml = XMLin( "file.xml", forcearray => 0 );

    much simpler!

  81. I program people by schappim · · Score: 1

    I program people. Some I program in english, others in arabic, a few in hebrew. I switched to mac because when I used to program people on windows, I used to get all sorts of conflicts. My name is God - I'm a god.

  82. What I hate about javascript by SCHecklerX · · Score: 1
    He didn't say he hated anything other than browser incompatibility. He missed a big one:

    1 + 1 in javascript will blissfully give you '11', unless you play some tricks to make sure 1 is known as a number (and of course, there is no type declaration in javascript).

    Using the same character for string concatenation and addition was a very dumb move, if you have no way of specifying the data type you are operating on!!!

    1. Re:What I hate about javascript by zxSpectrum · · Score: 1

      Check your facts, please;

      var a = 1;
      var b = 1;
      var c = a+b;
      document.write(c);

      will still output "2". If, however either a or b are input from, for instance forms, they are strings. When you use the '+' operator and one of the values is a string, all values in your expression are treated as a string.

      var a = '1';
      var b = 1;
      var c = parseInt(a)+b;
      document.write(c);

      will still output 2. As one should expect.

  83. What about REXX? by SCHecklerX · · Score: 1
    if this guy is learning a new language every year, why is he omitting such a useful scripting tool?

    Of course there are others...

    1. Re:What about REXX? by Brummund · · Score: 1

      I had my first paid job doing REXX programming on the Amiga :) Brings back sweet memories (and sometimes the horrors) of using Superbase, Cygnus Ed and PPage to automate the creation of rather large catalogs and generate postscript.

      And, as a bonus, the machine that controlled the RIP was a NeXT Cube :-)

      I still miss Cygnus Ed.

  84. OK, Here's My List by avdi · · Score: 5, Insightful
    C
    Let's start this off nice and flameworthy: what is the point of using C anymore? Nearly any valid C program is a valid C++ program, and C++ gives me the option of selectively using much higher-level abstractions than C can support, with little or no overhead, in a much safer and easire-to-debug way than any pure-C approximation. And most of the projects which are coded in C these days shouldn't even be coded in C++; they should be coded in something higher-level like Java or Python.

    C++
    • Manifest typing is so damn verbose! If the compiler's so clever, why can't it do a little type inferencing?
    • Needs Java's inner classes to do typesafe pseudo-closures
    • All C++ compilers suck. This in itself is not the problem; the problem is that all compilers suck differently.
    • Templates are powerful, but ugly
    • C++ code is full of juicy semantic information, which all IDEs uniformly fail to exploit, making coding far more painful than it should be in such a mature language.

    Java

    • In their haste to throw out every frightening piece of "complexity" from C++, the designers managed to throw out all the expressive power as well. The result is a langauge that is so syntactically impoverished that it is actually less readable than C++, the language it sets out to improve upon. See the bloated maintenance nightmares that are used to work around the lack of enums, just as one example.
    • Ironically, by eschewing out C++'s "confusing" features, Java actually manages to be more error-prone than C++. For example, by forcing casts to be used everywhere, Java defers to runtime a whole class of errors that would never make it past the C++ compiler. This makes type errors much harder to track down, hardly a net gain for the novice programmer.

    Perl

    • Doing OO in Perl is like... doing OO in C. Sure, you can do it, but it probably won't work with anyone else's OO code, and you have to do a lot of the compiler's work yourself.
    • Perl isn't as ugly as the Python fanatics claim it is; but there's still a hard limit on how readable it can ever be. Any language where the canonical way to sort an arbitrary list is expressed as @sorted = sort { $a <=> $b } @mylist; has readability issues.
    • Figuring out what chain of braces, sigils, and arrows is needed to properly dereference a deeply nested data structure is a PITA.

    Python
    By far the biggest problem with Python is the user community. There's something about Pythoneers that make them glom onto the language with religious zeal, and then go around telling every one else that their own language of choice isn't elegant enough. Many Python users have the mistaken impression that Python is a carefully worked-out work of modern programming cleanliness like Scheme. In fact, Python was an unremarkable in-house procedural "little language" that, rather than dying the graceful death that most such languages eventually experience, was hyped to a larger audience and has been loaded down with all kinds of trendy features. Unfortunetely, due to it's humble roots, these features have gone in rather awkwardly.
    All this would be fine, in fact, it would be similar to Perl's story, if it weren't for the singular nature of Python apologists. Python is perhaps the only open-source language whose users will proudly and vehemently defend a language flaw as a feature. The best example is the post-facto rationalization of the extra "self" argument to methods, which the Python FAQ helpfully explains was simply an artifact of the way OO was hacked into an originally procedural language. This fact doesn't deter the fanatics however, who will happily tell you that it was an intentional feature and that it somehow makes Python better.
    Other examples of Python's awkward growing pains and the inexplicable attitude of it's users: the fact that Pytho defines private variables as variables whose

    --

    --
    CPAN rules. - Guido van Rossum
    1. Re:OK, Here's My List by Anonymous Coward · · Score: 0


      Java

      * In their haste to throw out every frightening piece of "complexity" from C++, the designers managed to throw out all the expressive power as well. The result is a langauge that is so syntactically impoverished that it is actually less readable than C++, the language it sets out to improve upon. See the bloated maintenance nightmares that are used to work around the lack of enums, just as one example.

      * Ironically, by eschewing out C++'s "confusing" features, Java actually manages to be more error-prone than C++. For example, by forcing casts to be used everywhere, Java defers to runtime a whole class of errors that would never make it past the C++ compiler. This makes type errors much harder to track down, hardly a net gain for the novice programmer.


      I have never read a better critique of Java.
      Sincerely - honest! Thanks.

      No one believes me when I tell them my C++ solutions take considerably fewer lines than the equivalent Java solution. This is due in large part to operator overloading and templates.

    2. Re:OK, Here's My List by Anonymous Coward · · Score: 0

      Well put, especially about Java. I've been using C++ for 6+ years before jumping on to Java, which I've been using for the past 6 years, coming up. I loved all those Operator Overloading, TRUE Multiple Inheritance, Pointer arithmetic, Templates and the STL library, and yes, even the Macros, which had their own useful place. Going to Java was like forcing me to type a million types more, with less expressiveness. I believe a language shouldnt force things on you, and thats exactly what Java was doing. Finally, generics are coming to Java, hopefully before the end of the year, but it will be long time before there will be otehr useful features of C++ brought to Java.

      All said, I have come to like Java (mainly for the fact that I can write to many platforms), despite the regular irritations that come up every day, making me wish there'd be more C++ features in Java. Hopefully more usefull features of other languages will be added to Java in the future.

    3. Re:OK, Here's My List by CvD · · Score: 1

      Haskell is definately the worst language I have ever come accross. Maybe its the way its being shoved down our throats at my uni, but for me it just sucks (pretty much all the students here hate it, the teachers love it, which is why it is taught). Its way too hard to program in, hard to read code, and debugging it sucks, cause of the lame way too generic error messages. Its strongly typed such that it seems excessively paranoid. Most compilation errors occur because of its typing requirements.

      Bah! I hate it so much.

    4. Re:OK, Here's My List by listen · · Score: 1

      You really need better teachers.
      Haskell is an absolutely beautiful functional language, but has little in common with procedural languages.

      You really need to rethink your entire philosophy before Haskell will make sense. You tell it what you want to do, not how to do it.

    5. Re:OK, Here's My List by Tarpan · · Score: 1

      Any language where the canonical way to sort an arbitrary list is expressed as @sorted = sort { $a $b } @mylist; has readability issues.

      If you are forcing numerical sort then yes it's a bit longer, but if you just want string sort then nothing can beat the shortness of sort @mylist, and I also think that writing "this is the way you have to sort" and then include an assignment to a variable is wrong, since most of the time (at least for me) assign the sorted array to a variable. I feed it straigth to foreach, while, for, etc..

      Maybe I'm biased though, since I write perl for a living.

    6. Re:OK, Here's My List by avdi · · Score: 1

      The Ruby way:

      sorted = mylist.sort

      or:

      mylist.sort!

      to sort in place. Same syntax for lists of strings, numbers, dates, you name it - the sort is based on the overloadable <=> operator. If you need to specify the sorting order manually, it's:

      mylist.sort! { ...some comparison code... }

      C++ has the same kind of consistancy. The way to sort any kind of list of any kind of values is:

      std::sort(mylist.begin(), mylist.end()); ...to use the default criterion, or:

      std::sort(mylist.begin(), mylist.end(), myComparison );

      to manually specify the comparison method.

      Consistency is good, and sensible defaults are good. The sorting case is one of several cases where I think Perl falls short in it's stated goal of "making easy things easy".

      --

      --
      CPAN rules. - Guido van Rossum
    7. Re:OK, Here's My List by gse · · Score: 1

      You miss pointer arithmetic? Good god. I imagine you also miss coredumps and painful debugging sessions?

      --
      wordclock records :: flailing since 2000
    8. Re:OK, Here's My List by WWWWolf · · Score: 1
      Your comment about Haskell's one-letter documentation mania brought one idea into my mind: Haskell is probably a nice language, but it definitely needs some practical documentation. I'm not a theoretical computer science type (though I appreciate that subtle art), know a little bit of Lisp and Scheme, hear Haskell is cool, and get completely baffled by the online documentation. Anyone working on a book like "Haskell explained in monosyllablic words for former and current Lisp coders"? Or even "Practical Haskell"? Look, if I read a doc I don't want to know how you define some library function, I just want to know how to use the thing. Examples. Oh, let me clarify that request: Practical examples. Please.

      Speaking of documentation, I think Python's online documentation is extremely frustrating. (aesthetically unpleasing and can't find a damn thing even when armed with grep and the kind of regex that makes most Python people vomit) Ruby gets that right. And Ruby's .inspect is cooler than Python's dir() (says pen name "Blender's online API references drive me nuts".)

      I'm seriously also starting to believe Python doesn't like my Perl Coder Karma. Every time I try to use a Python app some small things start to click. Or, if I code in Python, some bad stuff happens. (Recently, I've been coding an exporter script for Blender. Blender's built-in editor in Windows works just fine but some characters don't work, oh, say, square brackets and backslash for example. Very convenient. At least cut and paste works. One day I'll call them and politely ask them something that can be summarised as "embed Scintilla or... or... or I'll get Wings3D!")

      And I agree with your points about Perl (especially the OO part), but it's still my language of choice for most of my tasks =)

    9. Re:OK, Here's My List by avdi · · Score: 1

      I was in the same place recently. I finally decided that come hell or high water, I was learning Haskell if it killed me, and dammit, I was gonna learn it via freely available resources.

      Here's the method that worked for me:

      1. Attempt to read the "Gentle" Introduction: http://www.haskell.org/tutorial/. Put it down hours later with a splitting headache and admit that for once a language tutorial is beyond me.
      2. Allow concepts partially-comprehended from the Gentle Intro to slowly seep into my brain over a period of weeks.
      3. With brain appropriately softened, read this rather more approachable intro: http://www.isi.edu/~hdaume/htut/tutorial.pdf. It's incomplete, but it's still quite good.
      4. Read the Gentle Intro again.
      5. Re-read the bits on I/O and Monads.
      6. Re-read the bits on I/O and Monads.
      7. Do a little experimental coding in the Emacs haskell mode. Find self instinctivley using Monads to chain together a series of operations that may or may not succeed. Experience "a-ha!" moment.
      8. Re-read the bits on I/O and Monads.
      9. Nod sagely at new enlightenment.
      10. Realize that with all my newfound knowledge and perspective, I now comprehend how to write procedural code! Yea verily, canst even bring forth exceptions and other species of flow-control from the raw aether!
      11. Realize that I just spent a whole weekend learning how to write simple procedural code, and yet somehow the forces of Computer Science have conspired to make me feel as if this is a momentous accomplishment.
      12. Experience an epiphany about Computer Science departments the world over: if this stuff seemed easy, how would CS proffessors ever get tenure?
      13. Find self unable to shake off desire to code more things in Haskell, despite having peeked at the man behind the curtain.

      --

      --
      CPAN rules. - Guido van Rossum
    10. Re:OK, Here's My List by Tarpan · · Score: 1

      Well the problem is that you can't make a smart function that knows what you want to do in perl or any other typeless language.. just since my array only contains numbers doesn't mean I always want it sorted numerically. And perl has a default like the others and you can specify a specific sort method.

      I do not see why mylist.sort! { ...some comparison code... } is easier or better than sort { ...some comparison code.. } @mylist

    11. Re:OK, Here's My List by avdi · · Score: 1

      Well the problem is that you can't make a smart function that knows what you want to do in perl or any other typeless language.

      Yes, you can do it in some "typeless" languages other than perl. The need is not for a "smart function", but for polymorphic functions. The enabler is in whether the language treats all values uniformly as objects. If so, than any object can overload some kind of standard "compareTo" method with a sensible default (in Ruby that method happens to be spelled out "thing1 <=> thing2", but it's still a method like any other). The sort call then uses that standard comparison method as it's default.

      And perl has a default like the others and you can specify a specific sort method.

      The only default perl has is for lexical string sorting. Anything else you have to specify.

      I do not see why mylist.sort! { ...some comparison code... } is easier or better than sort { ...some comparison code.. } @mylist

      It's not. But in Perl that's my only option unless I happen to want to sort strings (or things that can be converted to strings) alphabetically. In Ruby all objects,system or user-defined, can have sensible defaults, so that 90% of the time all I have to do is mylist.sort!. So in the rare case Ruby is equally as verbose as Perl; and in the typical case Ruby is even more terse than Perl (without losing readability).

      --

      --
      CPAN rules. - Guido van Rossum
    12. Re:OK, Here's My List by Tarpan · · Score: 1

      Well I disagree, I think that overloading just makes it harder to understand and read. You know that foo always does bar unless specifically told to do foobar. Overloading is good in places where you want to do the same thing with different types of data but not when they do different things, at least imo

    13. Re:OK, Here's My List by avdi · · Score: 1

      I'm not talking about overloading. I'm talking about polymorphism. If you take issue with polymorphism, fine, but that must mean you don't do any OO programming in Perl. If I have a class "Car" with a method "run()", and I also have a class "Truck" with a method "run()", that's polymorphism. If I have a class "Int" with a method "<=>", and I have a class "SensorReading" which also has a method "<=>", that's polymorphism.

      Overloading isn't even available in Ruby.

      "Overloading is good in places where you want to do the same thing with different types of data but not when they do different things, at least imo"

      And how is that different from what I was describing? I'm not advocating defining the "<=>" method to actually do multiplication. I'm advocating letting the programmer define correct comparison semantics for the "<=>" method of any user-defined type. And having standard library functions which actually utilize those user-defined methods.

      --

      --
      CPAN rules. - Guido van Rossum
    14. Re:OK, Here's My List by Yunzil · · Score: 1

      Let's start this off nice and flameworthy: what is the point of using C anymore?

      If you read the rest of your post, you'll have your answer. :)

    15. Re:OK, Here's My List by brunes69 · · Score: 1

      Haskell: The Craft of Functional Programming. We took Haskell as one of the courses in my programming languages course, and this was our textbook. It's kind of more geared toward "Haskell for OO / procedural Programmers" than the "haskell for Lisp" you are looking for, but it was a very nice book, easy to read, yet packed with just about everything you need to know.

  85. that explains all. . . by oordaz · · Score: 0

    why the people use visual basic.

    1. Re:that explains all. . . by Anonymous Coward · · Score: 0

      Thats where all the people who have lost faith in themselves and their capabilites eventually end.

  86. I'm just an anonymous coward... by Anonymous Coward · · Score: 2, Informative

    So this probably won't see the light of day, but...

    I thought that this was one of the best essays I've read in some time, even given its lack of technical substance.

    The message of this article ultimately is that our languages of choice are often as much a matter of subjective personal preference as anything else.

    A major theme of this article, then, was not to bash languages, but to celebrate the variety. The author's really trying to encourage us to explore our personal tastes.

    Did anyone else note the link to pragmatic programmers, following admonishments to learn a new programming language each year?

    How many on Slashdot try something like this? Maybe not every year, but on a regular basis? What's your experience been? Is it worth it? Anyone switch their language of choice because of it? Expand their respect for other languages?

    1. Re:I'm just an anonymous coward... by chromatic · · Score: 1

      Thanks. You understood what I tried to say.

  87. What I Hate About What You Hate About Ruby by Fweeky · · Score: 2, Interesting
    What I Hate About Ruby

    The sigils that mark instance and class variables always stick out visually in an otherwise clean language.

    Er, the use of @foo to define an object attribute is great; it means there's no need to type self. all the time, makes attributes obvious, and means you don't need to use lame prefixes like m_ObjectAttribute.

    A much better hate would have been the awful Perl/sh-era pseudo globals ($_ $@ $! $| $" $' $1 - what were you thinking matz!?); we all hate those ;)
  88. The uglier, the better... by jjohnson · · Score: 1

    My first degree was in the visual arts (printmaking and drawing), so I tend to approach programming languages the way I approach art materials: as tools with different ends in mind, that are preferred or rejected largely on the basis of familiarity, taste, and circumstance. Thus, I've been very lucky to avoid any sort of language fanaticism.

    However, I've found that, the more experience I get, the more I drift towards languages that are harder to learn, but more precise/delicate/dangerous in their syntax. I went from Javascript to Perl to Java to C++, just the same way that, in art school, I went from drawing with charcoal on newsprint to watercolor on expensive paper to stone lithography. The more intense and demanding the process, the more it interests me as I'm able to handle it reasonably well, and the more rewarding it seems to accomplish something.

    I've never really understood the motivation for language/platform zealotry, so I thought the article was great to lay out all those criticisms as the perfectly subjective kneejerks of the author.

    --
    Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
  89. all your language are belong to us. by Anonymous Coward · · Score: 0

    All your language are belong to us. Feeble man use syntax bad for operate binary.

  90. Isn't it interesting... by KefkaFloyd · · Score: 1

    ...that Objective-C isn't in there? I'm sure there are reasons to hate it, but it's the language of choice for Cocoa in Mac OS X (and is probably a better extension to C than C++ could ever be).

    --

    Conglom-O: We Own You (TM).
    1. Re:Isn't it interesting... by Anonymous Coward · · Score: 0

      What I hate about Object C is all the [] that you have to use instead of it being C like. Secondly, I hate the calling a function by key:value syntax. I dont like typing stupid stuff. You've got to be an oxymoron to give the excuse "I might forget what the order of params to the function are" and still remember all those keys to access the params by.

    2. Re:Isn't it interesting... by mccoma · · Score: 1
      If you don't play with OS X, you have probably had limited exposure (e.g. NeXT, GNUStep, Swarm). Heck, the gnu compiler once lectured people about the evils of #import, which wasn't too encouraging.


      If you like C and thought C++ was overkill, Objective-C would probably appeal to you. The simplicity and power of the object model is very cool (ask any Smalltalk or Ruby programmer).


      PS

      For the love of [insert your favorite Deity here], do not go to comp.lang.objective-c without flame protection. The maintainer of the FAQ has some serious issues and an irrational hate for NeXT, Apple, and anyone who programs on those platforms. I don't think that most slashdotters could work up the same viciousness towards Microsoft. It is truly a sight to behold. Keep a logic book handy to see how many fallacies of thought are unleashed.

    3. Re:Isn't it interesting... by Senjutsu · · Score: 1

      For the love of [insert your favorite Deity here], do not go to comp.lang.objective-c without flame protection. The maintainer of the FAQ has some serious issues and an irrational hate for NeXT, Apple, and anyone who programs on those platforms. I don't think that most slashdotters could work up the same viciousness towards Microsoft. It is truly a sight to behold. Keep a logic book handy to see how many fallacies of thought are unleashed.

      You mean David Stes is still spewing invective all over that newsgroup?! I stopped reading it years ago because he'd turned it into little more than a non-stop flame-fest, but I'd assumed he would have withered away and died after the huge influx of Cocoa/NeXTStep programmers who must have hit comp.lang.objective-c after OS X hit prime-time.

      Is his major problem still the fact that NeXTStep/Cocoa uses +alloc/-init instead of +new?

    4. Re:Isn't it interesting... by mccoma · · Score: 1
      Is his major problem still the fact that NeXTStep/Cocoa uses +alloc/-init instead of +new?

      Last time I checked that was a major. The Object vs NSObject is a still an issue. The side comments on using assembler in your runtime (he is not happy about that) was a sticking point. Oh, but the debates about "standard" Objective-C were truly an example of trolling at its best. The replies to Brad Cox's post were also pretty funny.

      I do believe he hates everyone who reminds him what company own the Objective-C trademark.

  91. I was disappointed by Aidtopia · · Score: 1

    I've been a bad programmer and I haven't truly studied many of the newer languages. I've always felt its good for programmers to learn different languages.

    C++ was my forth or fifth language and by far the hardest to learn. Not because of the OO-paradigm--I was already quite familiar with that--but because of the syntax klunkiness, size, broken tools, changing standards, libraries that defy good design, and linkage problems. I'm loathe to dive into a whole new can of worms now that I finally feel productive with this flawed by ubiquitous tool. If it takes such a huge investment to learn a new language well, how many languages can a programmer master?

    Is it better to be really good at a handful or to be somewhat skilled in a broad base? For a given project, knowing the implementation language well is essential. Having broad experience might help with good design.

    I took issue with some of his facts.

    I ... don't care much for the strong static typing found in C and its descendants.

    Lot's of people would argue that ANSI C is not strongly typed.

    [Static typing] feels like premature optimization to decide that a variable will always fit into eight or 16 bits.

    Huh? Types are still a level of abstraction. Except for certain language extensions, most types in C and its descendents do not define things down at the bit level.

    Thirty years of growth and patches to the standard library have produced many, many similar functions with similar, terse names. Quick, what are the differences between execl, execlp, execle, execv, and execvp?

    Ironically, these are not standard library functions, not ANSI C standard library anyway (as the context implies). Aside from nit-picking, I think this is a good illustration of my point: it takes a long time to learn the details of your language and libraries. How much software is developed by programmers who are learning new tools? How does that impact productivity and the ability to construct reliable programs?

    I'm probably becoming a luddite as I get older. I instinctively flinch when I'm told that newer ways are better. I always see trade-offs. As you move to higher-level languages (and libraries) you lose some control. Often that control is not necessary, but when your performance problem is due to thrashing because your STL container scattered bits of indexing and data all over the virtual address space--life sucks.

    1. Re:I was disappointed by chromatic · · Score: 1

      You're right about the strong typing (I meant "static" but didn't get rid of "strong") and the standard library bits.

      I also agree that understanding a language well is important to program in it well the really good programmers can sling around all sorts of idioms and work around implementation issues. A buddy just discovered that bitshift widths in C are done modulo 32. Sure enough, it's in Appendix C of K&R. No one in his office (including the brilliant lead engineer) knew it.

      On the other hand, I've learned more things more quickly about programming from seeing how different languages do things than by delving deeply into any one language.

      It's nice to be able to delve deeply into the guts sometimes, too. The point isn't to have to exert that level of control all the time. The point is that it's there when you need it.

  92. Re:Your sig by jcast · · Score: 0, Offtopic

    The Revolution will be Privatized....

    Thank God; I was beginning to worry.
    --
    There are reasons why democracy does not work nearly as well as capitalism.
    -- David D. Friedman
  93. Exceptions in java by Anonymous Coward · · Score: 1, Funny

    >I like the idea of checked exceptions in some
    >situations, but forcing every method to catch all
    >exceptions that its child calls or may call can
    >be tedious. I'd rather be able to ignore an
    >exception and let it propagate upwards.
    >Sometimes, I'd rather not worry about exceptions
    >at all.

    public methodThatJustPropagatesException() throws SomeException {
    doStuffThatMayCauseExceptions();
    }

  94. Why I like Python and SWIG by SimHacker · · Score: 2, Interesting
    I thought Perl was cool when I read the manual and played around with it in 1989. I loved what it could do, but hated the syntax and overall design of the language, so I got over it quickly.

    Why am I disappointed with Perl, and thrilled with Python and SWIG? I sent Larry Wall some fan mail in April of 89, enthusiastically asking about upcoming features, and describing what I wanted to do with it:

    From: don@brillig.umd.edu (Don Hopkins)
    Now what I'd *really* like would be a clean easy way to link in my own libraries and call them from Perl, and to be able to call Perl functions from my libraries. Instant extension language -- just add heavy water (and palladium)!
    He replied:
    From: lwall@devvax.Jpl.Nasa.Gov (Larry Wall)
    Subject: Re: perl
    To: don@brillig.umd.edu (Don Hopkins)
    Date: Mon, 3 Apr 89 15:33:13 PDT

    From: don@brillig.umd.edu (Don Hopkins)
    Enclosed is a message about what I'd like to do with perl. Do you think it's the right language in which to write "liaison" (a connection manager, process server, pumping station, whatever -- described in the last paragraphs below)? I'd also want the server to doll out pty's, as well. Know of any work in that direction? (I think it could all be done with emacs, but that's too heavy handed a solution. I'd rather just run one multi-window emacs at once, and make connections between it and various liaisons running on different machines, to take care of my remote editing urges.)

    Perl 3.0 will be better than 2.0 for that, since it supports binary data and will support sockets, as soon as I hack them in.

    Larry

    Python is extremely well designed to thoroughly solve the extension language problem -- on purpose, not as an afterthought! And SWIG makes it very easy to expose rich programming interfaces, structured data types and complex class libraries to extension languages.

    Will someone who's intimately familar with how Perl has evolved over the past 14 years since I submitted that request, please describe how difficult it is using Perl as an embedded extension language, integrating Perl with pre-existing applications, extending Perl with libraries written in C and other languages, exposing complex data structures and class libraries to Perl?

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Why I like Python and SWIG by rmohr02 · · Score: 0, Troll

      I am by no means an expert on Perl, but I do know that you can embed Perl in C, and that you can write Perl modules with C.

    2. Re:Why I like Python and SWIG by Anonymous Coward · · Score: 0

      Painless. People have even written books about such things.

      Basically, Perl has changed a fair bit since 2 (heck, since 4). What's also good is that the community has changed. It's not so focussed on hacks and is more interested in providing quality code.

    3. Re:Why I like Python and SWIG by SimHacker · · Score: 1
      Of course I know Perl has an extension interface, but how well designed and easy to use is it? Have you used it yourself? Have you used it for anything really complex, or just trivial one-liners? No this is not a troll, it's a serious question.

      How does Perl's extension interface compare to Python's? How hard is it to plug Perl into another application, using Python as an application extension language? How hard is it to integrate code written in other languages into Perl, and expose complex programming interfaces, data structures, and API's?

      For example of a non-trivial interface, let's take the Microsoft Speech API. Expose all of the classes, methods, functions, data structures and enumerated types. How long would it take you to write a Perl interface to that? How many lines of hand written code would it involve? I've used SWIG and Python to do that, and it took about 1500 lines of SWIG declarations and 1500 lines of C++ glue: pretty easy given the complexity of MS SAPI. SWIG writes all the glue code and Python class wrappers, so it's very convenient to use in an object oriented manner from Python.

      How about embedding Perl in Adobe Photoshop -- how many lines of hand written code would that take? How about exposing the Photoshop plug-in API, data structures, callbacks and extension suites so they can be conveniently called and hooked into from Perl? What about more complex APIs like Illustrator's incomprehensible interfaces to structured graphics, and AfterEffects constellation of complex interfaces to images, channels, timelines, keyframes, filters, parameters, user interface widgets, etc.

      Here are some interesting Python modules and application extensions to compare with whatever Perl modules you can come up with: http://opensource.adobe.com/

      This site contains open source projects which are related to Adobe products. The projects are provided under the Adobe Open Source license.

      If you have questions about this site or its contents check the help page.

      Simulated Partial Specialization for non-compliant C++ compilers. Allows a user to obtain many of the benefits of partial specialization of C++ templates without direct compiler support.

      Python action plug-in for Adobe Photoshop. Allows a user to write Photoshop action plug-ins using Python. Has Python interfaces to all the actions APIs.

      Python plug-in for Adobe Illustrator. An Illustrator plug-in adapter that allows users to access the C level API from Python

      Python plug-in for Adobe After Effects. An After Effects plug-in that allows users to access the C level API from Python.

      Python module for Perforce SCM. A C coded Python module that provides access to all the calls in the Perforce source code management system SDK.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    4. Re:Why I like Python and SWIG by SimHacker · · Score: 1
      Painless you say? Obviously you haven't done it yourself or read the slashdot review of the book, which proves my point that Perl's extension API sucks:

      "the authors flat out admit they think it is unfair that only so few of us get to have one foot in Perl and one in C"
      (Few people use Perl with C because it's extremely difficult.)

      "break down that barrier with lots of annotated code examples"
      (If the barriers weren't there in the first place, we wouldn't need this book to corrageously "break them down". It shouldn't take "lots" of "annotated" code -- that's a maintainance nightmare!)

      "However, wading chest-deep into XS and the Perl internals is not for the faint of heart."
      (This is my point! It's much easier and more maintainable to use Python and SWIG instead.)

      "Then the text seems to throw us a curve by leaping off into building Perl modules. But there is method to the madness: building Perl modules correctly is inextricably linked to XS."
      (What is this XS we have to deal with, then?)

      "Perl XS is acknowledged to be a nasty mess. My guess is the Perl guys would drop it like a hot rock for our stuff -- that would be as clear a win for them as co-opting Perl-style regexps was for us." -ESR

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    5. Re:Why I like Python and SWIG by Anonymous Coward · · Score: 0

      I have used both XS and Inline::C to write some fairly complex modules, I have no problems with either, but then again I am the greatest programmer to have ever lived (and like all great programmers I also despise PHP with a holy passion, but python is alright). The ideal language is ruby with python's syntactic whitespace (I used to hate it, but it's quite compact), perl's libraries, and C's speed (perhaps by generating parrot or .NET or JVM object code). perl6 also looks good, if complex. I use perl both at work (95% and about 5% C) and for personal projects.

    6. Re:Why I like Python and SWIG by avdi · · Score: 1

      1. Anything you can Python-ize using SWIG, you can do the same for Perl.
      2. Have you ever used the Inline::C, Inline::Java, etc. modules from CPAN? I'm not a huge Perl fan, but those are the most incredible example of language interop I've ever seen. With them you can literally write C, C++, Java, and various other languages (possibly including Python) inline inside your Perl functions, referencing variables defined in the Perl code. The module writes, and if necessary compiles, all the necessary scaffolding necessary to wire the languages together in the background the first time it is run.

      --

      --
      CPAN rules. - Guido van Rossum
    7. Re:Why I like Python and SWIG by SimHacker · · Score: 1
      Of course, SWIG is a wonderful tool, like a CD player that can play both Vanilla Ice and Miles Davis CDs. It works for Perl as well as Python and other scripting languages. But the important question is: what's the quality of the programming language and environment that you're plugging your code into?

      Inline::C and Inline::Java are amazing, but they're for calling C and Java code from Perl, for heaven's sake! You should ask: What the hell are you doing writing Perl code in the first place??!

      Turing completeness proves you can construct arbitrarily complex rube-goldberg devices in any language. But the point is to choose a language that doesn't force you to stretch it so far, just to do the simple tasks that you need to do often.

      SWIG is not a 100% solution, and the features it supports are not the same across all extension languages. When you use SWIG for any non-trivial task, you still end up writing a bunch of typemaps, glue code and convenience functions for "impedance matching". I wrote a SWIG interface to the Microsoft Speech API that was about 1500 lines of SWIG, and 1500 lines of glue code.

      So even with SWIG, you still have to compare the quality and usability of Perl's extension API with Python's extension API. And Python's extension API wins hands down. The anonymous coward who claimed that using XS was "painless" must be totally numb from the self-flagilation required to use it.

      In a discussion about the design of the "Parrot" runtime, Eric Raymond parenthetically pointed out that:

      "(One important place where I think everybody understands the Python side of the force would clearly win out in a final Parrot design is in the extension-and-embedding facilities. Perl XS is acknowledged to be a nasty mess. My guess is the Perl guys would drop it like a hot rock for our stuff -- that would be as clear a win for them as co-opting Perl-style regexps was for us.)"

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    8. Re:Why I like Python and SWIG by avdi · · Score: 1

      That's a tad circular. You're using Perl's lousy extension facilities as a reason why not to use Perl, and then saying that that it doesn't matter how easy Perl gets to extend, why would you want to write code in such a stupid language anyway?

      That's a bit like saying "Python sucks because it's object model is a kludge. But even if they fixed the object model, I still wouldn't use it, because it sucks (as I pointed out above)".

      --

      --
      CPAN rules. - Guido van Rossum
    9. Re:Why I like Python and SWIG by rmohr02 · · Score: 1

      I was merely stating a fact. I have never attempted to embed Perl into C or C into Perl. And yes, I have only used Perl for relatively simple programs, most of which could be done in C as well, but would take longer to code. It'll take a lot to convince me that there's a better language than Perl for simple text processing. But for complicated programs I think i'd have to stick with C or C++. As for plugins for applications, generally the application supports plugins best in one language, which is the language I'd try to use to write plugins for it.

      And so far, the only languages I've been exposed to are C, C++, Perl and RESOLVE/C++, so I cannot make many comparisons. I don't know a thing about Python, except that whitespace matters--I do plan to take the time to learn it at some point.

      Again, I was merely stating a fact. As far as I can see, nearly every language has it's pros and cons. I am not experienced enough to know many of them.

  95. Re:Moooooo by Bendebecker · · Score: 1

    Forget to take your medication again?

    --
    There's a growing sense that even if The Future comes,
    most of us won't be able to afford it.
    -- Lemmy
  96. King of Bastardizing Languages... by Anonymous Coward · · Score: 0

    Well, I liked C++ a lot, before Microsoft came and bastardized it with MFC. It really should be called Macro Foundation Classes. I liked Java a lot and Microsoft bastardized it with J# and C#. I never liked Visual Basic, but its also a bastardly language. I dont quite like JavaScript either, but Microsoft again came out with a bastardly language called VBScript. any language it touches, it makes a bastardly language out of it... I think its best to stay out of a language that Microsoft is pursuing actively.

  97. To everyone who whines about Python's indentation: by CoughDropAddict · · Score: 3, Insightful
    I can think of only two possible reasons why Python's whitespace-significant block structure would bother people:
    • people are determined to write code that is not indented the way it looks (so that the parser will recognize a different block structure than the indentation implies)
    • people feel warm and fuzzy staring at braces and "begin/end" keywords.

    Someone please explain: why does this feature make you so upset? How could it possibly make your life more difficult to know for a fact that the interpreter sees the blocks the same way you do on the screen?
  98. What does overloading look like in English? by semios · · Score: 2, Insightful
    If operator overloading is defining a new language, then so is writing new functions.

    I disagree. New functions are just that--they're new. They do not override any preconceived notions about what they're supposed to do. Operators, however, do have preconceived notions. Imagine if we applied the same reasoning to English and said, "the conjunctions 'and' and 'or' sometimes behave differently depending on the nouns they're chaining together." All of a sudden the sentence that reads, "Beer and dogs aren't pretty," is not comprehensible unless one refers to the dictionary, where it reads:
    Beer, n.
    1. A fermented liquor made from any malted grain, but
    commonly from barley malt, with hops or some other
    substance to impart a bitter flavor.
    and:
    1. drenched or to steep in moisture; to wet thoroughly;
    to soak; to saturate with water or other liquid;
    to immerse.


    Now the sentence means, Dogs drenched in beer aren't pretty. Significantly different from the first.

    I agree that overloading operators is more powerful for the code writer, but any reading of it will generally suffer, since it relies on knowing every other object's behavior.
    1. Re:What does overloading look like in English? by EvanED · · Score: 1

      >>New functions are just that--they're new. They do not override any preconceived notions about what they're supposed to do.

      Yes they do... in particular, the names of the function. I don't see any difference between the danger of people abusing overloading operators for things they were not meant for and the danger of people naming functions things that aren't descriptive enough or are downright misleading.

      I can write a function called add() that does nothing of the sort, and feel that if the framers of Java don't trust me enough to use the + operator correctly, the shouldn't trust me enough to name functions correctly.

      (OK, that said, I will admit that because operator overloading can be somewhat of a "oh, neat... look what I can do!" feature, it has a greater potential to be overused by people who are learning. But after you use + a few times to do fancy operations, the novelty should wear off.)

    2. Re:What does overloading look like in English? by Anonymous Coward · · Score: 0

      The thing is, with functions, you get a pretty good idea of what's going on.

      What does

      "foo" + 5

      do?

      how about:

      5 + "foo"

      What if, instead of a string, we had an int and a socket? Or a socket and a string? The Right Thing to do starts getting really fuzzy at some point, and becomes really subjective.

      Programming languages shouldn't do debatable and subjective things.

  99. Weird C Code by Quill_28 · · Score: 0, Offtopic

    main() {
    int a[10];
    int b=3;
    a[b] = 10;
    printf("%d \n", b[a]);
    }
    What happens?(Doesn't compile? Doesn't run? etc)

    try to answer it before you tryr to compile.

    I am not a great C programmer but I was quite surprised.

    1. Re:Weird C Code by Anonymous Coward · · Score: 1, Informative

      a[3] == &a + 3 == 3 + &a == b + &a == b[a]

      Breaks for non-wordsized types.

    2. Re:Weird C Code by Anonymous Coward · · Score: 0

      Offtopic you think the above reason might be why some people hate C code?

      It may be _slighty_ off-topic but worth a mod-point?

    3. Re:Weird C Code by Quill_28 · · Score: 1

      Dang it you spoiled it!

  100. Re:You are probably the worst programmer you ever by los+furtive · · Score: 1

    Yeah I've seen that before and it was in the back of my mind as I wrote my comment. But truth be told you'd have to be hard pressed to run a business on something like that.

    --

    I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  101. No one hates Forth? by B3Geek · · Score: 1

    You've heard it before, but it stands restatement - "When you've seen one Forth, you've seen one Forth."

  102. come with me by Anonymous Coward · · Score: 1, Interesting

    I've been thinking lately about languages, what if I could write code in a pseudo language, with extremely flexible syntax the ideals of what i'm trying to program. e.g. I want to add a bunch of integers together. Sometimes when I write papers, I do it by hand on paper, cause, believe it or not, my thoughts get lost sometimes because I'm trying to process the typing in my memory (lol, no, I'm not retarded) Usually my papers flow better that way, that's not to say that I couldn't go straight to typing and produce something great. But the idea behind this thought is that I don't want to aggravate myself about the details of any particular language. I just want to put my thoughts on paper or something and then worry about what language, what environment i want to run this through later, after the main details are put forth.

    I then want to take that pseudo code, which has strict syntax, pass it to a parser that then generates code in any language whatever it is that i want done. So I could say, convert to VB or C or Java or perl and out comes some generalized code that you can then compile with your favorite interpreter or compiler. I know it would be strange to convert object-oriented code into non-object-oriented code, but wouldn't that be a neat tool? And wouldn't that be a beast to code?

    Anyone interested in a project? Sorry, this is loose and somewhat stream of consciousness, but I think it has merits, open discussion?

  103. Re:Perl by knowledgepeacewi · · Score: 1

    As a perl programmer I just read that as "What!?"
    As if you could ever understand perl code without reading the #'s that explain it...

  104. Re:Reactionary languages - Perl by Anonymous Coward · · Score: 0

    You appear to have misspelt "warnings" as "Safe". There's no point using Safe unless you're doing stuff that needs it.

    These days, you should be using 'our' rather than 'use vars'. Plus, you say to avoid globals, but you 'use vars'?

    You should learn Perl rather than rely on English.

    You should not use Java like variable and function names, except where it matches with perlstyle.

    As with most languages, the best way to understand code written in the language is to learn the language. Make use of its features and its strengths. Get involved in the community. Read books, read articles and more articles. Contribute to code repositories. etc.

  105. okay, fine, I'll explain it by Anonymous Coward · · Score: 1, Insightful

    Here's how I see it:

    Appropriate use of whitespace makes code more readable. I'll give that to Python fans.

    However, the meaning of whitespace is a fuzzy thing. It shouldn't have exact meaning. Whether I happen to use 4 spaces instead of 3 shouldn't affect the syntactic correctness of my code.

    The best analogy I can think of is nonverbal language--gestures, gesticulations, etc. Gestures help in interpreting spoken language, but they are not essential to it. Waving my hands makes it clear I feel strongly about something. However, if I don't feel like waving my hands as much one moment, it doesn't affect the meaning of what I say.

    Similarly, whitespace helps visually clarify what is happening in the code. But it shouldn't be critical to interpreting the code.

    This is all compounded by the fact that whitespace, whether we like it or not, is interpreted by most people as a noncharacter. Things that aren't shouldn't be important to interpreting the things that are.

    There are all sorts of things surrounding this issue that are related to human perception and our ability to keep track of things. Whitespace is something that's just difficult for most people to keep track of. It's very similar to why most people can't can't stand Lisp: parentheses are logically a very elegant way of demarcating computational "sentences", as it were--but perceptually, they're very difficult for humans to keep track of.

    1. Re:okay, fine, I'll explain it by OneEyedApe · · Score: 3, Insightful

      I program in LISP, mostly for fun, and I don't worry that much about parens. A text editor that highlights matching parens and a bit of careful indentation allows me to mostly ignore the vast sea of ( and ).

      --
      Life sucks, but death doesn't put out at all....
      --Thomas J. Kopp
  106. Re:Perl by BrokenHalo · · Score: 1
    The best way to make readable code is to leave out the comments altogether :-)

    After all, the code should be self-explanatory :-)

  107. Aww, no C#? I really like that one. by Gldm · · Score: 4, Insightful

    Ok begin flaming me but I love what I've seen of C# so far. I'm not a very experienced programmer, but I was forced through C, C++, MIPS assembly, shellscripts, and Java in college. Since then I've done C# and PHP on my own. So far I like C# the best.

    Why? C is an ancient ugly mess that needs to adapt or die. I'd hate to do more than a 200 line program in it because I'd get lost without objects. "Oh but you can use objects in C by doing blah blah struct blah blah kludge etc." No thanks, it took me years to figure out what the big deal with objects was and how to use them without overusing them, and I'm never going back now for anything serious.

    C++ has objects you say, but they always feel like it's grafted on to C. Granted it works, and it's still reasonably portable, which is C's main advantage these days, but some things are still just ugly. How about an array who's size you don't know until runtime? Welcome back to pointers 101. Sure you can use new and delete instead of malloc and it looks nicer, but alot of things just don't have really elegant solutions, and the standard libraries are too sparse for what modern apps do with modern languages.

    Java... everything you hate about C++ fixed the wrong way! Yay we have big useful libraries now... but they're constantly changing, bitching that what you just used is now "depreciated", doing things you're not allowed to do etc. No I do not want to use something called "vector" to replace a linked list, give me a freaking "linked list" object! Even if it's just a renamed vector at least it doesn't confuse people into thinking I'm going to have calculus and matrices popping out in the next few lines. This may have been the fault of my instructor but he loved crap like this. "Don't use the Stack class, use vector to make your own stack!" Oh and just because I don't want to do something with pointers if I can help it doesn't mean I don't EVER want to use pointers, I'd like to code without a babysitter please. If I screw up at least it's me to blame. Everything must be a class! Umm yeah that's great when I just want a struct with an int and a float so I don't have to write half a dozen methods to implement a "proper" class with private data and constructor and operators and copy... Put up with all this and you're rewarded with 10x slower performance and maybe cross-platform execution on alternate tuesdays when it's raining and the moon is waxing.

    PHP seems nice, though I haven't really written much of anything in it yet. Some things kinda weird me out like how nothing cares if your variable is an int, float, string, etc. It's kinda nifty but extremely unsettling at the same time. At least it's easy to spot variables since they all start with $. I really don't have much else to say about it yet.

    By now everyone's waiting for why I like C#. I like it because it fixes the things I hate about C++ and Java and just seems to make everything work smooth. Want to use pointers? Sure, just put it in an unsafe section for the over paranoid. Want to use objects? It's easy. Want to do threading? We've got this easy to use library for it. How about resize an array? No problem. Arrays remember their own sizes. They can even sort themselves. They can even sort themselves and another array at the same time based on the values in the first array (someone PLEASE show me how to do this with qsort() in C++ elegantly). Networking? Got it. Performance? Eh, about 20% hit from C++ on my machine, less if you use ngen to precompile it. Still too bad? Ok, put your critical sections in C++, C, or even ASM libraries and link them seamlessly. GUI apps? Tons of easy to use stuff there, though it's mostly windows specific. The downside is you don't get the portability of other languages... yet.

    --

    Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!

    1. Re:Aww, no C#? I really like that one. by norkakn · · Score: 1

      Some things about C++ have been fixed. With STL there are new (vector, stack, queue, etc) types available.

      Still is a pain to work with sometimes, but it is getting better (Though I wish that they would stop renaming libraries!)

    2. Re:Aww, no C#? I really like that one. by Tim · · Score: 3, Insightful

      "C++ has objects you say, but they always feel like it's grafted on to C....some things are still just ugly. How about an array who's size you don't know until runtime? Welcome back to pointers 101."

      Uh...

      std::vector v;
      v.resize(some_value_from_somewhere_else);

      I don't see a pointer anywhere in there.

      --
      Let's try not to let fact interfere with our speculation here, OK?
    3. Re:Aww, no C#? I really like that one. by Gldm · · Score: 0

      See my bitching about Java for why I think using "vector" interchangeably with "array" is stupid.

      Array to me implies simple, no memory overhead storage that doesn't do random insert/delete. I have no idea what vector's properties are along those lines, and it's not obvious from the description. When someone talks to me about vectors I think of arrows with multiple numbers describing lengths in different dimensions. I don't see how the analogy translates over well at all.

      It's probably a combination of bad naming choice and holes in my education that led to this particular thing not being covered well or not at all.

      --

      Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!

    4. Re:Aww, no C#? I really like that one. by johannesg · · Score: 1
      How about an array who's size you don't know until runtime? Welcome back to pointers 101.

      You should not think of C++ as a language, but as a language-toolkit. You use the tools in your toolkit to first construct your language, and then you use the newly-constructed language to solve your problem. Whether this is a feature or a bug I'll leave to others to decide ;-)

      In your case you want to use vector for a dynamically sized array of thingies. It is part of STL.

      (someone PLEASE show me how to do this with qsort() in C++ elegantly)

      The most elegant solution is not to sort at all. If you want to store values that are identified through a sortable key, use map to store them. It is quick, easy, and after you do it a few hundred times the syntax will even start to make sense ;-)

    5. Re:Aww, no C#? I really like that one. by Anonymous Coward · · Score: 0

      A vector is also a one dimensional Matrix (in math terminology). Therefore C++ has vectors and Java inherited them from there. That said, Vectors and Stacks have been replaced by the collections in Java 2 some 4 years ago now, and if your instructor is still teaching you vectors, he's incompetent! So now you should really use the LinkedList classes among others. Check out the chapter on collections in Bruce Eckel's Thinking in Java for more. It's available for free on the net.

    6. Re:Aww, no C#? I really like that one. by Gldm · · Score: 1

      I know he's incompetent. He's also department chair and runs a class that's impossible to pass without cheating (Write me a full virtual machine for the output of my toy language compiler, and debugger, and modify my compiler to make debug code and add several new language features like support for floats and void functions, by yourself. Nevermind you've never seen JAVA before, it's exactly like C++!) Everyone I talked to that had passed the class said they'd either cheated by working in groups or failed it and then taken it again and cheated by working in groups. Being both antisocial and somewhat morally old-fashioned, I didn't cheat. I wound up dropping out of that school. If I go back it won't be there.

      I believe the texts used in the class were http://www.amazon.com/exec/obidos/tg/detail/-/0130 471771/qid=1052982045/sr=8-2/ref=sr_8_2/002-693275 1-0830466?v=glance&s=books&n=507846 and http://www.amazon.com/exec/obidos/tg/detail/-/0201 612739/qid=1052982076/sr=1-2/ref=sr_1_2/002-693275 1-0830466?v=glance&s=books .

      For compiler we were expected to use either VisualCafe or IBM's Eclipse project. (Oh you haven't used an IDE before because all previous classes forced you to used gcc in a telnet session on our SunOS server? Well you'll figure it out, it's not like it's completely new and unfamilliar.)

      --

      Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!

    7. Re:Aww, no C#? I really like that one. by Yunzil · · Score: 1

      I'd hate to do more than a 200 line program in it because I'd get lost without objects.

      God help us. This may comes as a great shock, but not every problem is best solved with OO. You may need to lie down for a while until you stop quivering. :)

    8. Re:Aww, no C#? I really like that one. by rjh · · Score: 1
      (Oh you haven't used an IDE before because all previous classes forced you to used gcc in a telnet session on our SunOS server? Well you'll figure it out, it's not like it's completely new and unfamilliar.)

      Guy, I hate to be the one to tell you this, but it sounds like your prof is giving you an early start on the real world. I've seen the following things happen in the Real World:

      • A Perl guru who's never written a single line of C in his life gets the responsibility of code maintainer for a 1-MLOC C program.
      • A C++ programmer who doesn't know a single line of COBOL becomes responsible for white-box testing telco switching software written in COBOL.
      • A C++ programmer who's never touched Java before in his life gets thrown a JDK, an IDE, a copy of the codebase, and gets told there's a milestone next week.
      ... Ask anyone who's in industry and they'll tell you that one of the biggest, most important skills to develop is how to come up to speed in a completely new language/environment in three days flat. Not "become a guru of the language", but learn enough of the language to be a productive programmer.

      So stop kvetching about how your prof expects you to know things you haven't been exposed to before. It's college. If you have enough intelligence to get the SAT scores required to get in, then you have enough intelligence to, on your own time, find someone who knows the IDE who's willing to give you an hour-long tutorial on it.
  108. Re: To everyone who whines about Python's indentat by jacobm · · Score: 1

    From the article:

    "The whitespace issue isn't a big deal (I use a good text editor), but I've spent too long debugging make files to be comfortable with invisible-yet-syntactically-significant characters. Python does have the advantage that it doesn't dictate how much whitespace to use, but I'm still leery of issues with copying and pasting code from a web browser or a newsreader."

    --
    -jacob
  109. Are you so sure? by rmdyer · · Score: 1

    ..."And you will never, never, never, succeed in creating a programming language in which it is impossible to do stupid things."

    Well, maybe true. Actually if assembly is counted as a language then I don't think you -can- do anything stupid there.

    Remmember, if you can't do it in assembly, then you probably shouldn't be having sex.

  110. WHY, not HOW by gidds · · Score: 2
    Better would be languages which are self-documenting... you don't need to read the comments because the purpose is clear anyway.
    Even if you could program in plain English, that would still only tell you the how: the low level of what it's doing and how it does it. Those sort of comments are usually redundant or obsolete, anyway.

    What's important to comment is why: the big picture of what's being done and how it fits into the rest of the system. Once you know that, then you can work out the rest, readable code or not, and work effectively. And that's what no amount of self-documenting code can do.

    --

    Ceterum censeo subscriptionem esse delendam.

    1. Re:WHY, not HOW by Hognoxious · · Score: 1
      the low level of what it's doing and how it does it. Those sort of comments are usually redundant or obsolete, anyway.
      Well said, Sir. The worst of all are the ones that simply paraphrase the code like:
      //Add foo to bar
      foo = foo + bar
      It seems that people who write comments like that tend to use meaningless variable names too.
      A good rule of thumb is that 95% of the comments should stay the same, whatever language the program is written in; that pretty much ensures that they should refer to the problem domain and not to the implementation.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  111. C++ obsolete by dh003i · · Score: 1

    C++ is a bunch of obsolete slow crap. Very confusing. The entire point of it is to confer the benefits of object-orientedness. Well, Obj-C gives you that with only a few additional stuff, and isn't confusing.

  112. I'm Having An Affair w. Your Programming Language by halfgeek · · Score: 4, Interesting

    This was a very interesting article. I natively speak Perl, C, and C++, know enough about PHP to get by, and still remember some Commodore 64 BASIC (10 ? CHR$(147)). I am also, as I believe I've said before, not afraid to learn things like Java, Python, Ruby, maybe even Visual Basic again (God forbid) should they prove exceedingly relevant to my case - in fact, I quite look forward to knowing (hopefully) all of them and then some. But never Pascal. (Just kidding.)

    I've really found that the thing I hate most about programming in general is that no single language is the right one to use for any of my programs! I am very interested in any effort I ever come across to do functional merging of disparate environments. In addition to a couple of workarounds I've invented in the past for shoehorning Perl into PHP, I like reading about things like SWIG, the open CLR, and even COM (the concept more than the implementation), and a smile always comes to my face when I think about the Inline library written for Perl.

    Now, the thing I really pine for is all of this interlanguage binding stuff being easy, fairly portable, more synactically simple, and less hacky. I know that these exist, but not quite completely together. If I write a program in Perl with use Inline C, I can never be sure that anyone else has all the development tools necessary to compile all the C on the fly. Writing a program in Visual Basic with a nice mouse-drawn GUI and an external component is really easy - but it's Visual Basic. Writing a component wrapper for Perl is fairly straightforward with SWIG, but some well-thought-out language features would make it easier. And COM... I'm going to have to try wrapping my head around that book again someday... I'm sure the ATL makes it all very simple, but can I use ATL from MinGW? From C? From Perl? And don't try to tell me that I need to learn yet another flavor of XML to make all of this work.

    That's mis tus centavos.

    (Note: I disclaim perfection. Don't hit me too hard; I admit I haven't done enough of my homework to claim this post isn't full of holes. Once I've looked this whole matter through, if ever, and if I still haven't come up with anything good, I may just have to take a deep breath, lay down a syntax, figure out how to use a lexer generator and a compiler compiler, and throw together some ghastly but very easy-to-use homogeneous aggregator system. Either that, or I wait for Parrot to interoperate with Mono...)

  113. MODUP by Anonymous Coward · · Score: 0

    hilarious

  114. thanks, by lommer · · Score: 1

    both to the parent and you, for making my day.

  115. Re:Moooooo by Anonymous Coward · · Score: 0

    Moo. Java. Moo.

  116. Er.... no we don't by devphil · · Score: 1
    I think that the gcc group had that figured out first.

    No we didn't. It's an old idea.

    gcc uses front ends to translate the c, c++, fortran, java, and whatever other languages it can use to intermediate files, which are then compiled to assembly then machine code.

    I don't recall what the 1.x series did, but the 2.x series (first release early 1992) never compiled to intermediate languages.

    The 3.x series certainly doesn't. Everything goes straight from the front-end language (C++, Java, whatever) to assembly. Many compilers build to an intermediate language, e.g., C, and then simply compile that -- in fact, the very first C++ compilers from Bell Labs did this -- but GCC is not one of them.

    Now, if you're talking about an intermediate in-memory representation, sure, every compiler does that, starting with the simple "syntax tree" that we all learned in CS 101. But don't call them files, since they're never written out and (often) don't even have a convenient text representation.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  117. What i HATE about your programming language by digirave · · Score: 2, Funny

    What i HATE about your programming language... is YOU!

    bleh~!

  118. I can't believe I'm being suck in by abulafia · · Score: 1
    This should have been a train wreck I could walk past. I learned to program in this order QBasic, TCL\TK, Visual Basic, Python, C, C++ then PHP. Ive never ever looked at Perl code so I was not traumatized by it.

    To try to meet you in the middle, I learned AppleBasic, some assembly, [nothing for a long time], sh*, awk*, csh, sql*, C*, Perl*, Tcl, Vb, PHP, Java*, Lisp*. (asterisks indicate that I'm still using them, and still learning. When do you stop learning?)

    Sorry, but Perl rocks. I'm building tools for people. Lately, that's sometimes is Java, sometimes in C, usually in Perl. Fast, bug-free development is the goal, and we do suprisingly well.

    I'll never argue that Perl looks pretty by nature[1]. If people want a pretty language, please, that bin is other there.

    For an example of my problems with PHP, look no farther than PHPGroupWare. It tries really hard to solve a really big problem, and honestly, comes somewhat close. But it blows, and is so impossible to read that nobody can fix it. We stared at it for months, and then gave up and built what we needed from it in perl, in 4 days. (We're filling things out, fixing dumb mistakes, and thinking about future moves before the code is released.) I won't even get in to these horrible messes of interlocked HTML, PHP, SQL (usually MySQL specific,) and poached Javascript that are the rule for this sort of crap...

    When you need another ounce of performance, use C. When you need a large engineering team working together, use C++ or Java. When you need a team of monkeys pounding out "dynamic" html (or doing a personal website where it doesn't matter), use PHP. If you're playing with compsci, use Lisp. Otherwise, use Perl.

    Flame off.

    There, have I done enough for the pageview count for the /. cabel yet? Will you call the goons off? I like my last son really a bunch...

    [1] It _can_ look pretty, if you actually have a plan. Many people use perl to build messes, and that is something they should have the right to do. Not my business. My code rarely gets messy, and when it does, I either comment it for fixing, or explain why I'm doing something weird. Contrast with the last 10K lines of C you've seen.

    --
    I forget what 8 was for.
    1. Re:I can't believe I'm being suck in by Anonymous Coward · · Score: 0

      Absolutely. PHPWiki also has a nice interface but the code is crap. I rewrote it using a few perl modules, it's now clean, functional, and fast. I also use perl at work (fortune 500 company), some XS or Inline::C where speed is needed.

  119. VB is just Very Bad by jefu · · Score: 1
    I've never programmed in VB, nor have I spent any amount of time looking at it.

    However, I've encountered more than a few people who learned to program in VB and who should be kept away from any programmer who values his/her sanity, and from any programming project that might eventually aspire to affordable maintenance.

    Maybe it was just coincidence that a batch of poor programmers with icky(TM) programming habits all happened to have used VB early in their programming experience. But they shared the same kinds of problems : complete misunderstanding of why local variables are a Good Thing, poor selection of variable/procedure names, a serious love of long runs of spaghetti code, inability to pick the right control structure.

    Are these poor habits encouraged by VB? (Enquiring minds want to know...)

    1. Re:VB is just Very Bad by alienmole · · Score: 1
      Are these poor habits encouraged by VB? (Enquiring minds want to know...)

      Yes. BASIC is the language which inspired this famous quote:

      It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
      -- Edsger Dijkstra, " How do we tell truths that might hurt?"
      Visual BASIC just takes all that mind-mutilating badness and wraps it in a GUI package. VB is actually not so bad if you treat it as a scripting language for Windows forms, but it shouldn't be confused with real programming languages.
    2. Re:VB is just Very Bad by fizbin · · Score: 1

      It's not that those bad habits are encouraged by VB, it's that they aren't forcefully discouraged strongly enough.

      I've occasionally watched my father's students (he teaches part-time at a local community college) struggle with their first VB programs. As I see it, the problem with VB is that the pattern of "debugging by random code modification" so often works, or at least doesn't throw up errors when run. (Though some errors might be thrown up when the project is compiled; in VB "run mode", as with many classic BASIC variants, code paths that aren't traversed aren't even checked for syntax errors) This is partially due to VB being an extreme DWIM language. (e.g. automatic conversions between numbers and strings that even make perl programmers cringe)

      But the tendency to just pound out spaghetti logic and then tweak it until it works is something that the students bring with them to the lab before they've ever used VB themselves.

      Some of their behavior reminds me of TAing calculus students. They fundamentally don't want to learn what's going on, they just want to get the answer/get the project to work and be done with it. Even if you can get them to realize intellectually that a deeper understanding would allow them to finish their assignments faster, the strong gut reaction against figuring out what's going on remains.

      The odd thing is that every so often I would find a student who was perfectly happy to learn the what was really going on, and get the deeper understanding that would have helped them, but only after fighting through the assignment the hard way.

      I don't mean to imply by this that the vast majority of the calc. students I TAed (or those taking my father's VB class) are lazy; I think this may have something to do with the nature of how people learn new concepts. It may be orders of magnitude more difficult to learn high-level concepts without concrete experience to which one can relate those concepts. It almost makes me want to track down an education major and ask them about what the current theories say.

      The problem with VB is that there is almost no incentive to go back and learn the "proper" way to do things after you've slogged through. The rapid increase in expressive power that one gains in most languages by taking the time to wrap one's brain around the language isn't really there in VB. VB, by design, makes certain that a muddled first-glance understanding is "good enough", so that's where many people stay.

    3. Re:VB is just Very Bad by Bigboote66 · · Score: 1

      The other posts answer the question, although I'd disagree that exposure to BASIC completely ruins a programmer (most of the great programmers now in their thirties go their start as kids writing BASIC programs on their Apples & C64s - the important thing is that they're ultimately exposed to the right ideas).

      VB gets such a bad rap because it is simply the most powerful & simple programming language that can be learned with no prior programming experience, and more importantly, no exposure to other programmers. Because of IDE, a great help system (particularly in VB5 - VB6 & beyond are too messy with help from the other VS components), and tons of sample code available to steal, it allows people who know nothing about programming to just cut & paste & start modifying. Good programming practices never emerge when the developer flies solo, so it's no surprise that so many bad programmers out there are VB people - the inaccessiblity of other languages forces learners to seek the advice of more experienced developers.

      That said, VB is great tool in the right hands. We do most of our development in C++ & Java, but VB has a place in our products as a front-end builder. Its help system & IDE are the best in the business. It's fast enough for 90% of all software written today. For someone who already has learned good practices from other languages, it allows you to produce usable, maintainable apps far faster & with less likelihood for hidden gotchas. I haven't tried the .NET version, but it sounds like they eliminated most of the annoyances that exist in the current versions -- mostly due to soft typing - stuff like Variants, implicit conversions, bad choice of operator overloading, and forcing you to use ActiveX (and all it's headaches with the Registry) for all component development.

      -BbT

  120. Theory vs Practice by jefu · · Score: 1
    In theory I hate the notion that whitespace matters in a programming language. Any whitespace (and, yup, that includes end-of-line markers - so the C preprocessor is a pain as are comments that start with // and go to the end of the line).

    In practice I quite like the way Python (Haskell too) works and use Python quite a bit and only rarely have trouble with whitespace.

    "So I contradict myself? Very well then, I contradict myself." (Thanks to Mr. Whitman for the quote.)

  121. Ruby notes... by aziegler · · Score: 1
    Ruby
    The trouble with Ruby is that it makes metaclass hacking just easy enough to be irresistable, but just awkward and limited enough that you inevitably start wondering if maybe you shouldn't just bite the bullet and learn Lisp and CLOS.
    I'm not quite sure what you mean here. In an RSS library that I'm working on, I did some metaclass hacking that was easy and understandable.
    Also it needs namespaces.
    It has namespaces, in spades. Since both modules and classes may be nested, you get namespaces for free. I'm writing a PDF library as PDF::. I have PDF::Type::String as a module/module/class, but it could have just as easily been class/module/class or anything else.
    -austin
    --
    Ni bhionn an rath achx mar a mbionn an smacht (There is no Luck without Discipline)
    1. Re:Ruby notes... by avdi · · Score: 1

      Heh... I have a friend who is re-writing Mark Pilgrim's ultra-liberal RSS parser in Ruby. See http://www.alieniloquent.com/rerss/ if you are interested.

      Metaclass hacking starts out seeming easy, but then you start running into walls. Usually not insurmountable ones, but eventually the methods of circumvention make it more trouble than it's worth. For one thing, you can't do much serious metaclass hacking without having to resort to eval-ed strings (not blocks; strings), which I regard as a failing. I shouldn't have to drop down to the string-munging level to generate new methods on the fly. Once I've resorted to string-munging I lose all the benefits of compile-time syntax checking, and things become harder to debug. Another thing you can't do in Ruby is to apply "advice" to methods - prepending, appending, or wrapping an existing method with new code. You can do this manually, but it's a pain in the ass - you have to save the existing method with a proc or an alias and then rewrite the method, inserting a call to the original code at the appropriate point.

      Ruby does not have the kind of namespace support I'm talking about. I'm talking about namespaces that are orthogonal to the class/module system. Ruby's ability to dynamically extend system classes at runtime is extrememly powerful, but it's hampered by the lack of a crosscutting namespace model. Library writers are discouraged from writing extensions to built-in classes by the fact that they never know when their extensions will collide with some other author's extensions. Supposing Karen writes security extensions module, including a new lock method on the Object class. Supposing Bob writes a concurrent programming extensions module, which includes a Object#lock method which acquires a thread-specific lock on the object. Then supposing I want to use both modules for an application I'm writing. Oops - name collision! There are also subtler errors possible when two different extensions coincidentally use the same name for an internal instance variable. Ruby needs a way to garauntee that methods added to existing classes, either by direct extension or via mixin, can operate safely without worrying about colliding with another method's namespace.

      --

      --
      CPAN rules. - Guido van Rossum
  122. Re:Moooooo by zerOnIne · · Score: 1

    but MOO is a great language!

    --
    09
  123. The reason that works by KnightStalker · · Score: 1

    and similar odd constructs like 3[a], is that the compiler translates it into something like *(a + b) and it doesn't really matter which order the addends are in. Or at least, that's how it was explained to me.

    --
    * And remember, it's spelled N-e-t-s-c-a-p-e, but it's pronounced "Mozilla."
  124. Of course he had nothing bad to say about ... by ironring · · Score: 2, Funny

    FORTRAN, tcl or S (R). Am I dating myself?

  125. /* IN SOVIET RUSSIA */ by Anonymous Coward · · Score: 0

    Programming languages hate you.

  126. Two Words... by aaaurgh · · Score: 1

    "Visual" & "Basic" ...and I have to use the *&!#&@$ thing every bloody working day.

    --

    Go permanent? In your dreams and my worst nightmares.
  127. Comments vs self-documenting by Latent+Heat · · Score: 1
    There are two kinds of comments. There is the narrative description of what a modules or function does along with an explanation of what all the parameters are for. Then there are the types of comments that explain all of your hacks and work-arounds.

    I don't think self-documenting languages will ever replace comment type 1. On the other hand, I believe that comment type 2 needs to be used very sparingly. You probably should rewrite/refactor your program if you have a lot of comment type 2 because you are trying to explain some kind of hack. Also, comment type 2 can get out of synch with code changes.

  128. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  129. Ruby by Anonymous Coward · · Score: 0

    I've been looking at Ruby, and its definitly a very nice language... it might be my favourite, although I havn't done any real projects in it yet, so it's hard to tell. I'm glad to see that the article doesn't find anything wrong with the language itself (the lack of English docs is annoying) other than that it occasionally doesn't look great visually.

  130. Doesn't anyone hate ... Objective C? by sbwoodside · · Score: 1
    How come Objective C doesn't come up on any of these lists? I mean, it's being used now by tons of programmers discovering the magical world of Cocoa. It's just C, with a tiny itty little bit of syntax added on to do (almost) everything Smalltalk does (and a little bit more). It's got dynamic typing. You haven't lived until you've tried dynamic typing. It's got all the good stuff you need to do OO and none of the nastiness and crud in C++. You use the objective bits for objective stuff and use C for all the normal, procedural stuff that OO programs still usually (and rightly) have.

    And it's self-documenting! No kidding! Check out the method call syntax: [self dataWithPDFInsideRect:copyRect] and you can mix and match your C and ObjC syntax: fabs([lastAbortDate timeIntervalSinceNow])

    Those are simple examples, though, this one shows the power of the language better:
    NSEvent * mouseEvent =
    [[self window]
    nextEventMatchingMask:NSLeftMouseDraggedMask | NSLeftMouseDown
    untilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]
    inMode:NSEventTrackingRunLoopMode dequeue:NO];
    What does it do? You have one second. OK, time's up. ;-)

    I think the main thing people hate about ObjC is that they don't get to use it.

    simon
  131. summary + ? by zarqman · · Score: 1

    okay, i've read a lot of comments here and it seems i can summarize by saying that there are no good programming languages -- they all have major problems. nearly everyone is offering reasons not to use certain languages, but few alternatives are being offered. so, here's your chance to make a suggestion and back it up:

    my background: started with basic, quickly moved to turbo pascal, which i liked and used heavily for several years. then i looked at c++ and then got tied up in school and didn't come back to anything for several years. eventually i found some spare time again and ended up messing with php, which is what i've been using lately. as should be evident, i am _not_ a professional programmer, i just tend to hack a little on my own.

    as i mentioned, i liked pascal -- it was strongly typed, compiled fast, and worked for me then. c++ left a poor taste in my mouth; probably because it'd compile way too much and bomb out at runtime -- i'd much rather a compiler error than a runtime error. php is okay, but the project i'm working on presently is getting bigger and i can see the day when it's going to get out of hand. and, it's oop support is definitely a bit below average.

    so, what should i consider? i use oop a bit, i prefer typed languages, but will deal with untyped langs if it's useful otherwise. mostly i'm developing web-based stuff today. probably the most important thing is i don't like the language getting in my way - my goal is to come up with functional software, _not_ waste time figuring out how to work around various bugs or idiosyncracies in a language or a compiler.

    so, here it is for karma-whores and meaningful contributors alike: what are your recommendations and why?

    --
    geek friendly VPS's and free API enabled DNS : zerigo.com
  132. he? by ucblockhead · · Score: 1

    Uh...I was the guy who wrote the original comment. I had "compiled" in there because it was mentioned in the post I was replying to.

    --
    The cake is a pie
  133. Very real by fm6 · · Score: 1
    You're making a joke, of course, but there's an important truth here. It's my opinion that you can't talk about a programming language without talking about the community of programmers that uses it. Programmers gravitate towards one language or another because it suits their way of thinking and working. This results in a two-way influence, as the language influences the work and thought habits of the programmer, and the programmers agitates for "obvious" changes to the language.

    Compare some of the big languages around: Perl, Java, C++, Visual Basic. Each has its own community, and each community has its own set of goals and priorities. Each community is wont to criticize the technical shortcomings of the others' languages. These criticisms often have some technical validity, but are usually beside the point -- each language "just works" for its own community.

    1. Re:Very real by Ed+Avis · · Score: 1

      Strangely, it seems to me that languages differ in the amount of bashing-other-languages they do. Perl books and articles seem particularly bad in comparing Perl to 'Java, C++ and other static-braindead languages' (a quote from one book), while I haven't so far read any C++ writings that make a point of bashing on other programming languages (with the obvious exception of interviews that specifically ask 'Dr Stroustrup, what think you of Java?').

      --
      -- Ed Avis ed@membled.com
    2. Re:Very real by jbolden · · Score: 1

      C/C++ communities spend a great deal of time worrying about effeciency. Here them talk about how slow xyz is (meaining execution time) how any language requiring a VM is really a protyping language....

  134. Try this some day: by avdi · · Score: 3, Insightful

    Take a hundred-line snippet of Python code. Stick it into a web page. Copy&paste the web page to an email. Post the email to a programming mailing list. Have a lengthy thread about the code, quoting and requoting the original.

    Now, let an intermediate Python programmer try to take the mangled code from the end of that thread and reformat it so that it works as intended. If it were in a language with explicit block syntax, chances are it would run as intended with nothing more than the removal of any quoting prefixes that mail clients have added. And a decent programmer would be able to whip up a script that would automate the transformation from mangled code into nicely indented code. Not so for the Python code.

    The problem is not so much that whitespace is signifigant by default; it's that there is no way to modify this behaviour in order to generate "portable" code which can survive whitespace mangling.

    But frankly, all things considered, whitespace signifigance is by far the least of Python's worries.

    --

    --
    CPAN rules. - Guido van Rossum
  135. It's From Microsoft by Ranger · · Score: 1

    If it's a Microsoft programming language, it's got to be bad. Ah but who can fault a visionless man for creating a software empire on visual basic, DOS, and bullying?

    --
    "You'll get nothing, and you'll like it!"
  136. What I hate about English by RadRafe · · Score: 1
    My language of choice is English. It offers an incredible versatility of expression and fewer syntax hassles than other languages. Some may favour Hebrew for its compressed writing, Latin for its stark style, or French for its beauty. But French is not concise; French and Hebrew are strongly typed in arbitrary, confusing ways; and Latin is obsolete, now only a teaching language. All of them suffer from complicated inflection.

    English, on the other hand, has great idiomatic versatility, little inflection, and a vast vocabulary. It is not without its problems, though. Here's what I hate about English:

    The most direct functions of the class AuxilliaryVerb cannot be inherited in the infinitive case.

    This deficiency forces awkward work-arounds: I hate to have to say to have to say rather than to must say. I want to be able to say I want to can say!

    Pointless rules of syntax have, over the years, been added to the language. Many of these false rules lingered in all the major compilers, rendering the language less usable.

    Examples include the injunctions against splitting infinitives and putting prepositions at the end of sentences, which force such constructions as the awkward Boldly to go where no man has gone before and the verbose This is the sort of nonsense up with which I will not put! These nonstandard rules are now nearly phased out, thankfully, but their scars linger.

    There are too many exceptions to standard verb-call syntax.

    Calls for most verbs is uncomplicated, but there are more than 280 verbs with syntactical exceptions, making a morass of inconsistent vocabulary that is hopelessly confusing to beginning coders. In this respect English should behave more like the obscure Esperanto, with its scrupulously consistent conjugation.

    But despite these deficiencies, English is undoubtedly the king of of languages. I vote for English!

    1. Re:What I hate about English by Crazy+Eight · · Score: 1

      I can't believe you haven't been for your wit modded up.

  137. Not advocacy. by raider_red · · Score: 1

    It's more like comparitive religion--from the point of view that these religions hate each other.

    --
    It's good to use your head, but not as a battering ram.
  138. coding in C is a premature optimization?! by Pr0xY · · Score: 3, Interesting

    The notion of "coding in C is a premature optimization" is completely rediculous. While I'll admit that for different tasks, different languages are more appropriate, if you know C best, then you should probably do it in C.

    Plus the notion that coding in C is an automatic optimization over other languages is absurd. It is true that do to the lower level nature of C, it can be used to make very efficient code. But in many cases I know I can write equally efficient code in C++ (or other languages) because of the nature of the problem.

    Heh, starting to sound a bit hypocritical here aren't I? I guess what i am trying to say is. If you can do it best in a given language, do it in that language. I am however an advocate of learning as many languages as you can, so that you can make a better choice regarding this issue..on your own.

    so don't go out of your way to do it in another language just because someone said you can do it slightly better if you took the time to learn about "language x."

    General purpose languages are just that "general purpose", it is silly to force yourself to program in an "uncomfortable" language just because it may fit the problem better...you'll probably end up making worse code anyway.

    proxy

    1. Re:coding in C is a premature optimization?! by Junks+Jerzey · · Score: 1

      The notion of "coding in C is a premature optimization" is completely rediculous. While I'll admit that for different tasks, different languages are more appropriate, if you know C best, then you should probably do it in C.

      Now that's a good example of what the author of the article was talking about. If you know C and, say, Perl or Python, you'll *know* that you'd be pretty dumb to approach many tasks in C. Yet many programmers will do exactly that anyway.

  139. I'll nominate by Cyno · · Score: 1

    ocaml and let this=be.that

  140. Why I Hate VB 6 by Anonymous Coward · · Score: 1, Insightful

    VB6 Error handling is pathetic.

    on error resume next
    if (0/0=5) then Msgbox "Yes, 0/0=5"

    Because the evaluation blows up, the next instruction (yes, the condition!!) executes!
    - - - - -
    Nulls are big trouble...
    Result=Strin & " This won't be concatenated"
    The correct way to fix it is...
    Result=(Strin & "") & " An empty one works??"
    - - - -
    The whole language is inconsistent, illogical, and worst of all, almost downright compatible to GW Basic, and of course QuickBasic.
    - - - -
    VB components/OCX's aren't descendant classes, they're individual objects (ok, OLE descendants). If you already know Kylix or Delphi, you will hate all the inconsistency. At least DAO/ ADO/ ODBCDirect/ Whatever-name has some hirearchy. Even MS Access is somewhat more organized.
    - - - - - -
    Anyway, maybe the real VB virtue is that it's usful with those common "Our client gave one month, last month. Today we tell you you have two days to design and program a working demo".

    MS Access let you do quicker prototypes, altough it's very tricky, and it has some nasty limitations. Reports are much much easier to do than VB's. Of course, with complex databases and more than 8-10 users, you must forget the nice wizards and begin thinking how to avoid LAN congestion.

    Delphi is much better, altough Pascal is very strict and the database part is somewhat more difficult to use.

  141. Two words. by An+Ominous+Coward · · Score: 1

    Damn. Straight.

  142. Nitpick: by eidechse · · Score: 1

    ...nor does it matter that VB.NET has fixed just about everything wrong with VB...

    Despite the marketing line, VB.NET is more a CLR cousin of VB than a fix/upgrade.

  143. It seems like Apple's "Objective C"... by callipygian-showsyst · · Score: 2, Funny

    It seems like Apple's "Objective C" is so irrelevant, it's not even on the list.

    1. Re:It seems like Apple's "Objective C"... by wemmick · · Score: 1

      The cranky former-NeXTStep programmer inside of me is screaming "Objective C is not owned by and was not created by Apple." Nor was it created by NeXT, Inc. It predates NeXT and was merely adopted by NeXT.

      --
      ___
      Cognitive Overflow
      more than yo
    2. Re:It seems like Apple's "Objective C"... by callipygian-showsyst · · Score: 1
      Well, you may be a former NextStep programmer, but I'm a current NextStep (aka OS-X cocoa) programmer.

      You should feel a bit sorry for me.

      In all seriousness, I think that OSX Cocoa would have a better acceptance rate if there were C++ APIs instead of Objective-C

  144. perl extensions by etan · · Score: 1

    Writing extensions in C can be Byzantine. Perl's internals are full of macros. Sometimes they make life easier; other times, they hide a lot of complexity that you really should know. XS is a hybrid of Perl macros, Perl, and C, and it can get quite complex.

    use Inline;

    problem solved.

  145. VB is not for real applications. by Ardias · · Score: 1

    Too many VB "programmers" out there think "I click, therefore I program." (I wish I could take credit for that quote, but I found it on the C/C++ Users Journal website in an editorial comment.) I have seen too many VB programmers who were basically clueless about abstraction, encapsulation, memory-managment, Big-O efficiency, or anything else except making GUI's quickly. This is not meant as flame-bait, because I have seen a small number of VB "programmers" actually become skilled software engineers.

  146. ADV: Nickle by po8 · · Score: 1

    From his comments, Chromatic would like Nickle. But I'm the co-designer---I have to say that :-).

  147. Re:It's not always technical - some corrections by Anonymous Coward · · Score: 0

    I agree with some of your comments about VB prior to .NET, however, many of these statements are not correct. This also reflects the main reason that most developers dislike VB - since nobody takes it seriously, nobody knows the little details which annoy many people. Please don't get me wrong - I hate many things about VB too (ERROR HANDLING!!!), but I want to correct some facts here.

    * Short circuit evaluation - point taken. However, putting these conditions into a simple function will often produce better self-documenting code AND allow you to do this.

    * You can call functions the same way you call Subs - your statement is simply not true. To call either you can use FunctionName(argument1, ...). It's just some people don't know that you can skip the "Call" statement.

    * VB cleans up local unused objects just fine. The practice of setting things to Nothing is a total urban legend. They get set to Nothing when they go out of scope every time. If you need clean up - use functions. Macros aren't great idea in a serious App anyways.

    * You don't NEED the variant type. You can marshall any type across a COM boundary except for a User-Defined type (and you can use a Class instead)

  148. NOT ADVOCACY?! by Anonymous Coward · · Score: 1, Funny

    Yes it is.

    That has clearcly been written by someone who is a vi fanatic!

    Emacs rules.

  149. Re: Poof reading by Anonymous Coward · · Score: 0

    ... or rather Reading poof, that was Oscar Wilde when he was in gaol.

  150. Java corrections by solprovider · · Score: 1

    Java 1.5 finally fixes the casting issues. I agree that the need to cast everything has made code less readable.

    String stringvar = (String) vector.nextElement();

    Since all variables are strongly typed, the Object returned by nextElement() should be automatically casted by the compiler. The Java 1.5 workarounds should greatly improve readability, but they still require unnecessary work from the programmers.

    ---
    The inconsistencies between what the language allows and what the standard library actually does bother me. If operator overloading is so bad, why does the String class do it?
    He picked the one case where not having the overloaded operator would have killed interest. Almost every language allows Strings to be concatenated with a '+'. Personally, I'd prefer they did not since this can cause problems with casting numbers.

    Interfaces get around part of the lack of multiple inheritance, but I'd like to be able to reuse common code in ways besides inheritance. Mixins that don't require inheritance would be a nice touch.
    I use static functions to get around this. For a current project, the main servlet has a
    public static void respond(HttpServletResponse response, String htmlString) throws IOException
    function to set the length and create the ServletOutputStream. The function is used by all our other servlets. The only difference between this algorithm and having a parent servlet class is the need to pass response as a parameter.

    The libraries and the interpreter aren't cleanly separated. There are ways (involving decompilers), for example, to get regex support in 1.3, but I'd prefer to upgrade the standard library and the interpreter separately sometimes, rather than in one big chunk.
    Good idea. I am forced to use 1.3 for a project, and would love to be able to steal classes from later versions. We moved to 1.3 to get HTTP 1.1 support, but our production environment would have been greatly simplified if we had stayed with 1.2.

    Also, why does the HttpURLConnection provide a method to set the user-client when it has no effect? (It always sends "Java1.3", which receives errors from MS IIS 4 servers that parse based on the semi-colons in the user-client.)

    I like the idea of checked exceptions in some situations, but forcing every method to catch all exceptions that its child calls or may call can be tedious. I'd rather be able to ignore an exception and let it propagate upwards. Sometimes, I'd rather not worry about exceptions at all.
    You can pass Exceptions to the parent function using the throws option in the function declaration. How did he manage to use the language without encountering this? I learned it on day one when I first learned the syntax for writing a function. I usually handle Exceptions as they occur, but the ability to pass them up the function stack has been critical a few times. (Otherwise we would need to catch the Exception and throw our own, which seems wasteful of our programming time.)

    --
    Slashcode: Why does Submit come before Preview?

    --
    I spend my life entertaining my brain.
    1. Re:Java corrections by fizbin · · Score: 1

      Good idea. I am forced to use 1.3 for a project, and would love to be able to steal classes from later versions. We moved to 1.3 to get HTTP 1.1 support, but our production environment would have been greatly simplified if we had stayed with 1.2.

      When we were faced with the same problem, we just went and used HTTPClient. Similarly, when we needed regexps in 1.3, we just went for the Jakarta ORO library. (And even in our java 1.4 environment, we're still using log4j)

      Sure, it would be nice if Sun split the standard library from the runtime engine, but third-party java libraries are plentiful and can often cover the gaps. Also, if there's some new feature in a higher java revision that you can't live without, you might want to first check whether Sun also released a version of this feature that's compatible with the java version you're stuck with. (e.g. JSSE for java 1.2)

  151. Nuke the gay baby whales for Jesus by Anonymous Coward · · Score: 0

    Nuke the gay baby whales for Jesus, is how I remember it. Obviously I mean the phrase not your Tshirt

  152. Please define a programming language. by ressu · · Score: 2, Insightful

    What amazed me most in the article was that XSLT was included as a programming language. Even though the definition for programming language is as follows (from WordNet):

    programming language
    n : (computer science) a language designed for programming computers [syn: {programing language}]

    And even if at some level XSLT matches that. I still think that XSLT is not a programming language and in such shouldn't be judged by it's format. eXtensible Stylesheet Language, is by it's name a way to define a style for an XML document, and it's not for programming applications.

    Although, i agree that XML is not the best way of representing applications and XPath itself is quite complex to use for even the simplest queries.

    1. Re:Please define a programming language. by chefren · · Score: 1

      XSLT is turing complete (= computationally equivalent to a turing machine). It is therefore possible for an XSLT stylesheet to do the same operations to the xml document it operates on as any other programming language. This XSLT stylesheet implements a turing machine and can therefore execute any program any other turing complete programming languages can. Therefore an XSLT stylesheet is effectively a program. Its input is the XML document is operates on and its output the resulting document.

      Oh, and XSLT stands for XSL transformations, where XSL is the extensible stylesheet language. XSL is not turing complete.

  153. SQL and then stop? by Tablizer · · Score: 0, Flamebait

    I find it odd that there are a jillion programming languages for procedural and OOP, and several for functional. However, I do not see a lot of competition for relational query languages. Why does everybody seem satisfied with SQL?

    SQL sucks IMO (as far as relational languages go). It is the COBOL of relational languages. I would like to see more competition there. I kinda like the BS-12 approach pioneered by IBM in the early days of relational but dropped. Some like "Tutorial-D" by Chris Date, but I don't like the infix syntax.

    Relational languages are virgin terrority for those who like making Yet Another Language. Why trod where everybody else has? Lets move beyond SQL.

    1. Re:SQL and then stop? by brlewis · · Score: 1

      The problem is the tradeoff between making a language flexible and making it optimizable. The limitations of SQL are there mostly to help the optimizer. However, if you want to extend SQL in interesting ways, the standard is always being updated. See about getting involved nin the committee.

    2. Re:SQL and then stop? by Tablizer · · Score: 1

      The limitations of SQL are there mostly to help the optimizer.

      I don't think this is true. It appears that its limits are because IBM wanted an "english like" language instead of one more programmer-friendly, and thus more expressive.

    3. Re:SQL and then stop? by Anonymous Coward · · Score: 0

      Why was parent marked "flamebait"?

  154. Spanish Error At Line 40 by halfgeek · · Score: 1
    "That's mis tus centavos."

    Mis dos centavos. Olvidaba mucho de mi español. Sumimasendeshita.

    1. Re:Spanish Error At Line 40 by brlewis · · Score: 1

      Quien dijo que fue Spanish? En muchas partes de North America es mas comun to speak en una mezcla de las tus languages. Iz call Spanglish.

  155. Actually PHP is a hack of a language by Imperator · · Score: 5, Interesting
    I code PHP every day, so I've become quite proficient at it. However, I constant find myself horrified at some newly-discovered inconsistency in its library. The language itself is not so terrible, but its library is a beast.

    As a particular example, take PHP's error handling. The language has no real exceptions, which is forgivable--but it insists of making up for it by faking them.

    It has something akin to sigaction(), but much less powerful. It allows you to provide one function to handle all errors, except for some that PHP insists on handling itself. At least that function can switch on the error, right? Nope! There are only 5 different error codes which your code can catch, only 3 of which you can actually throw (again, with a function instead of a language construct).

    And if you thought this was bad, try the error handling in the library. Each set of functions seems to have its own function to check for errors, and you have to repeatedly check the manual to find out how a function indicates failure. I've seen the following different methods of indicating failure:

    function returns FALSE

    function returns TRUE

    function prints a message to the browser

    function returns 0

    function returns 1

    function returns nonzero

    function returns negative

    call another function to find out

    functions returns something that can be fed into another function to find out

    function raises an error condition you can catch (through fake exceptions described above)

    function raises an error condition you can't catch

    pass in a variable by reference and the result will be there

    check if the returned array is empty, and if it is use a different function to find out whether that indicates an error or just a (legitimate in context) empty array

    Don't even get me started on the naming conventions of functions, or the ordering of their arguments. (Check out the array functions if you want some good examples.)

    PHP is a language that was designed for small, simple CGI scripts, and it does this well. It does not scale. PHP was never meant to be used from the command line, but how else can you write a cron job to do some nightly maintenance? (Write in another language? Sure, and give up all the libraries you've written for the project.) Sure, you can use lynx -dump http://example.com/nightly.php >/dev/null, but then you have to make sure no one but you can use that script, and it's just generally an ugly thing to do.

    For all of its faults (and it has many), one of the thigs Perl does well is provide actual language features for things like merging arrays, sorting arrays with a user-provided comparison function, or declaring a variable with loop scope. PHP's libraries keep growing, which is nice, but the language itself is too small and too limited. I don't want to use library functions for everything, nor do I honestly care whether the language is even context-free. I just want a lanugage that doesn't suck.

    </rant>

    --

    Gates' Law: Every 18 months, the speed of software halves.
    1. Re:Actually PHP is a hack of a language by brlewis · · Score: 1
      >PHP is a language that was designed for small, simple CGI scripts, and it does this well.

      I maintain that BRL kicks PHP's butt when it comes to small, simple CGI scripts.

    2. Re:Actually PHP is a hack of a language by Anonymous Coward · · Score: 0

      Dude. uksort().

      "uksort -- Sort an array by keys using a user-defined comparison function."

      array_merge() also exists...

      Just keep reading the manual and you'll find what you need. :)

    3. Re:Actually PHP is a hack of a language by Anonymous Coward · · Score: 0
      Sure, you can use lynx -dump http://example.com/nightly.php >/dev/null, but then you have to make sure no one but you can use that script, and it's just generally an ugly thing to do.
      Why not compile the PHP CGI binary?

      Then you can have scripts like:

      #!/usr/bin/php -q
      <?php

      # code..

      ?>
      and just set that script to be executable, and use like any other..
    4. Re:Actually PHP is a hack of a language by Imperator · · Score: 1

      I said language features, as in actual syntax, not just functions. I know about both of those, and they're clumsy compared to the way other languages do that stuff.

      --

      Gates' Law: Every 18 months, the speed of software halves.
    5. Re:Actually PHP is a hack of a language by Imperator · · Score: 1

      Because it's ugly. It's yet another place to look for variables passed into your script, you have to worry about which functions work from the command line and which don't, and so on. Yes you can do it, as I said, but it's a hack on a language designed to run in a CGI environment.

      --

      Gates' Law: Every 18 months, the speed of software halves.
  156. Re:Firestarter - RAMBOTRAN ?? by Dillan · · Score: 1

    which reminds me, whatever happened to the definition of RAMBOTRAN, the guide fro real men who use FORTRAN? I used to have a copy, but even google can't find it now.

  157. FACT... by Anonymous Coward · · Score: 0

    FACT somebody on your development team is stupid.
    FACT he writes stupid code.
    FACT it is a *good* idea, not a bad idea, to create a language that makes it more difficult to write stupid code.

    as much as I love all the lil tricks to make a semi-complicated line of code into a tidy nugget of bang wack dot at plus plus.. I hate like hell when mr. stupid does it.

    now, for my own projects.. that is code that me and only me will be writing (and if someone else contributes I will probably interpret their code and write my own version) then I dont really care.. but when I need to share a codebase with mr. stupid, reading other people's code, DEBUGGING other people's code.. well you get the point.

    FACT there is a difference in professional code and hobby code
    FACT 1 in 10 "professional" software developers is a fucking idiot
    FACT most "professional" code sucks

  158. Its not the language, its the speaker.... by Anonymous Coward · · Score: 0

    Its not the car, its the driver....
    Size doesnt matter, its how you use it...

    Well, you get the idea.

  159. What I hate about C+- by dreamsinter · · Score: 1
    http://www.technotimes.org/Topical/H0015.htm

    is the senses of paranoia it engenderz ...

    Then, I also hate the PPL - Paranoid Programming Language
    http://paul.merton.ox.ac.uk/computing/paranoid-pro gramming-language.html
    for much the same reason.

    Intercal
    http://catb.org/~esr/intercal/

    is perhaps the easiest of the three to use, and is one I recommend heartily as the be-all-and-end-all of all possible programming languages

    Because it's True!!!

    --
    "I his bow, and spun and wove, likes you." Vere de Vere out of my mould's mouth dragged me of the voluntary apes.
  160. Commenting styles by Bisqwit · · Score: 1

    Turbo Pascal has another choices too.
    (* beautiful comment *)
    { terse comment }


    My comments about the other commenting styles:
    /* this one looks hostile, like an army with spears */
    // Terse, unbalanced and lazy way of commenting,
    // but informative enough.
    # This comment works best on beginning of
    # a line. It looks clearly different than
    # anything else, and works well as a comment.

    And there's quickbasic that has this:
    PRINT "moi" 'Obligatory greeting
    Qb-style comments are very easy to make and not the less readable than /* comments */.

  161. What I love about MetaCard is the lack of crap by MonsieurX · · Score: 1

    Is the lack of all that bug-inducing syntax...
    Execution maybe slower than compiled c or assembler but the time required to develop ANY application is definitely worth the time! No searching for a misplaced comma! Code is totally self-explanatory (it's in english!) Even dynamically compiled scripts (build by your program during runtime) are easy to debug!

    put "I hate punctuation in program" into myhead
    repeat forever
    answer myhead
    end repeat

    go to www.metacard.com for relief!

  162. Re:Firestarter - RAMBOTRAN ?? by Anonymous Coward · · Score: 0

    Yes, what happened to it indeed. Infact, it seems the only reference google has to RAMBOTRAN is in a previous comment made on slashdot by YOU :-)

  163. Easy to avoid! by rastos1 · · Score: 1
  164. Re:Firestarter - RAMBOTRAN ?? by Dillan · · Score: 1

    If you search deep enough you also find this: http://mirror.lcs.mit.edu/telecom-archives/archive s/book.reviews/navigating.internet-gibbs

  165. So true by golrien · · Score: 1

    I find Python syntax just looks crazy.. it's like a book with no punctuation. You can see the meaning if you look hard enough, but without any seperators it's much more difficult to read. In any good language you'll spend more time reading it than writing it (solving problems vs. implementing the solutions), so the time gained by only having to tab is lost by constantly having to work out what the fuck is happening.

  166. he didn't mention cobol by andy666 · · Score: 1

    so i guess he considers it to be the perfect language.

  167. Prolog! by BenjyD · · Score: 1

    Comments down the page praising Prolog!

    I have to use it every day and it makes me want to gouge my eyes out. It's too damn freaky and recursive. For example, finding a member of a list:

    member(X,[X|T]).
    member(X,[_|T]):-
    member(X,T).

    1. Re:Prolog! by MonsieurX · · Score: 1

      in Metacard... it's just get lineoffset(t,x) put line it of x into avar Please dont gouge your eyes!

  168. Stream operators in C++ :-( by Anonymous+Brave+Guy · · Score: 1

    Actually, although I'm a fan of C++ generally, I think they got this one wrong. Using << and >> in this way encourages you to put the format of a composite string in code and not in data. That immediately creates problems with maintenance, flexibility and portability.

    This is particularly damaging in the area of i18n. For example, you can give the string

    Put the $1 onto the $2.

    to a translation agency, and get back the translation into the language of your choice, with the order of $1 and $2 swapped around if the new language requires it. You can't do that if your string is all broken up in code.

    I don't like printf much in terms of clarity -- it's very "old skool hackery" in that you have to know how it works before it makes any sense, and you still forget details -- but at least it put the logically whole unit, the string template, in one place. You can systematically construct a printf format string using any other string tools, you can send it off for translation as a unit, it's hard to introduce inadvertent changes during later edits, etc.

    The ability to extend the IOStreams system to allow I/O of new types and to allow I/O of existing types to new streams is great, but we could certainly do better now building on that experience, by keeping the extensibility without giving up the rest.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  169. Perl has to be the worst by Moe+Taxes · · Score: 1

    The first time I saw a perl listing I had to check the printer cables. I was sure there were some bad wires or a flakey connector.

    Sure there are people who claim to be able to read the stuff, but why would you want to spend your life staring a an ugly wad of nonsense. Real programming languages are designed for people to read. Sure perl is dense but I have a $120-80 gig drive; lines of code are cheap, my time is not. Spend lines of code and make time for yourself.

    Some languages have niche applications where nothing else does quite as well. Perl is not one of them. Anything written in perl from a complete web site to one line utility would run faster and be easier to read and maintain if it was written in something else.

    --
    It took a real world war to end the airplane's patent wars. - Fâché Rouge -
    1. Re:Perl has to be the worst by mofolotopo · · Score: 1

      The other end of that, though, is that in Perl you can write a one-off script in a few lines that you could spend days doing in another language. I grant you that it's difficult for others to go back and add to your code, but there are tons of situations I run across where that's never an issue.

      Perl is perfect for situations where you need special purpose code done very quickly that you don't really intend to distribute, and is absolutely unsurpassed when it comes to string manipulation. That makes it an absolutely perfect tool for bioinformatics, which is my field. Just letting you know that there is at least one niche that Perl fits perfectly, even if it's not something you'd necessarily do.

  170. And watch your code magically quadruple in size... by gatkinso · · Score: 1

    ...well, that is if you have written a 10 line program (but the point is still valid)! Had the poster meant "vector" I am sure he would have typed "vector".

    BTW, gcc allows this, but shouldn't:

    int myArray[someScalarValue];

    Visual C++ 7.x chokes (as it properly should). I haven't tried any other compilers.

    --
    I am very small, utmostly microscopic.
  171. In Soviet Russia... by Anonymous Coward · · Score: 0

    Programming languages hate YOU!

  172. Not quite ballistic podiatry, but... by 87C751 · · Score: 1, Funny
    I had a t-shirt made once that said

    #include

    What would the above list of languages use for an equivalent?

    Perl: use Clue;
    bash: . /etc/clue
    Pascal: uses Clue
    Java: public class main extends clue

    What else?

    --
    Mail? Put "slashdot" in the subject to pass the spam filters.
    1. Re:Not quite ballistic podiatry, but... by Abreu · · Score: 1

      Perl: use Clue;
      bash: . /etc/clue
      Pascal: uses Clue
      Java: public class main extends clue


      Python: import Clue

      --
      No sig for the moment.
    2. Re:Not quite ballistic podiatry, but... by Anonymous Coward · · Score: 0

      TCL (two methods):
      source clue
      package require clue

    3. Re:Not quite ballistic podiatry, but... by ozzy_ball · · Score: 1

      in Visual Basic (yegods!):

      Reference=*\G{00020430-0000-0000-C000-0000000000 46 }#2.0#0#C:\WINNT\System32\clue.dll

      --

      Dude, relax. You're being very un-Dude.
  173. OK, it *is* ballistic podiatry by 87C751 · · Score: 1
    What the Captain meant to say was...

    #include <clue.h>

    --
    Mail? Put "slashdot" in the subject to pass the spam filters.
    1. Re:OK, it *is* ballistic podiatry by Reziac · · Score: 1

      Hmm. Does this thing compile??

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  174. Re:To everyone who whines about Python's indentati by fgb · · Score: 1

    I think that we learned from COBOL that making the starting column of a statement significant is a really bad idea.

  175. The list didn't include Java... by revividus · · Score: 3, Funny

    ...in which you shoot yourself in a reference to your foot, and pass a message back to your foot informing it to behave as though it has been shot.

    1. Re:The list didn't include Java... by Reziac · · Score: 1

      LOL!! Oh, man... thanks to you and all the others who offered more things to #include [g]

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  176. XSLT - am I the only one who likes it? by iion_tichy · · Score: 1

    Once you get used to the long-winded syntax, it's actually kind of fun to use. And it suits the creation of html very well... I guess I also sometimes like to use languages that require a bit of hacking, ie clever workarounds to get things done. Same reason why I like SQL, although I wouldn't want to use XSLT and SQL all the time - just now and then for a change.

  177. What I hate about PHP... by Anonymous Coward · · Score: 0

    From what I know - no threading - and not planned in 5 either.

    1. Re:What I hate about PHP... by brlewis · · Score: 1

      Very few pages benefit from threading, so I'm not surprised PHP hasn't made it a priority. You could always code most of your project in PHP, but use a thread-enabled language like BRL for those few pages.

  178. Re:And watch your code magically quadruple in size by Carewolf · · Score: 1

    No it shouldnt. It has been part of the C standard since '99.

    Visual C++ usually doesnt get anything right. Atleast gcc has a feature to support the same bugs.

  179. (define (language? x) (eq? x 'scheme)) by brlewis · · Score: 1
    No, more trailing parens does not make it better. Scheme is about simplicity.

    (define (language? x)
    (eq? x 'scheme))
    1. Re:(define (language? x) (eq? x 'scheme)) by Piquan · · Score: 2, Informative

      Of course, that syntax wasn't guaranteed to work until R5RS, and even then it was done to conform with IEEE's doing away with optional ("non-essential") features in their own standard.

      Not to mention that even R5RS uses (define foo (lambda ...)) more often than (define (foo ...) ...)

    2. Re:(define (language? x) (eq? x 'scheme)) by brlewis · · Score: 1

      That's the syntax I was taught in spring 1987. Sure, it was technically allowed for a Scheme implementation to omit it and still claim conformance, but I don't think I ever encountered an implementation that omitted it. Certainly all the major implementations have supported it for a long, long time. I'm glad the 1998 standard (R5RS) requires it.

    3. Re:(define (language? x) (eq? x 'scheme)) by Piquan · · Score: 1

      I know, I was just yanking your chain. I started teaching myself Scheme from R4RS. At the time, I figured, "I want to write portable programs, so I'd better use only the essential syntax". I learned later that, in practice, you can use the "new" syntax.

  180. You missed some of the Perl ugliness by Black+Perl · · Score: 1

    $self->{groups}[HACKERS] is saying dereference that element as an array reference and give me the element numbered by the constant I've called HACKERS.

    But that constant is really a subroutine, either explicitly defined in the code or covered up by the use of Constant.pm.

    --
    bp
  181. What I hate about the C family (C, C++, Java, ...) by scruffy · · Score: 1

    I hate using = for assignment. It causes no end of confusion for teaching analysis. Please, let = just mean equality. I also hate being forced to have 0 as the 1st index. It causes no end of off-by-1 errors. When I learned to count, I started at 1, not 0!

  182. I give up by Anonymous Coward · · Score: 0

    Damn, not my brightest day. I los my clipboard in the process and I'm not in the mood to correct it.

    I'm just happy I'm not posting from my account.

  183. What's inelegant in C++ by iamsridhar · · Score: 1
    What I find inelegant about C++, is the syntax used for pure virtual functions.

    virtual void foo() = 0;

    It would have been much more elegant to add another keyword like pure instead of having this weird syntax.

    1. Re:What's inelegant in C++ by dubstop · · Score: 1

      I agree. It looks like a really awkward construction. The best way to deal with it, I've found, is to do this:

      virtual void foo() = NULL;

      To me, that says that the position for that method in the class vtable is NULL. Sort of making what's happening explicit. That wouldn't please the folks that prefer using 0 to using NULL, but it works for me.

      I also used to prefer using the void keyword to indicate that the function or method took no parameters, but I've been using Java for the last few years, so I've gotten out of that habit.

  184. Re:And watch your code magically quadruple in size by gatkinso · · Score: 1

    I am an OS athiest: I have no allegance to either Windows or Unix - I write code that compiles and runs on both.

    I find that VC++ .NET (ok, ok 7.x) is actually a better compiler then gcc (3.2.1). VC++ 6.0 - well that was a bit of a dog. With fleas.

    The VC++DN code is smaller, and faster, and I find that in most cases it has better compilance (still has some template problems admittedly).

    I am porting a fairly large class library from gcc to VCC right now - and I find that the same code runs about 20% faster under Windows XP using VC++ 7.1 than it does under Linux (RH 8.0) using gcc 3.2.1 - on the same machine.

    In a month I port to the Intel compiler on both Linux and Windows - it will be intersting to see which combo produces the best performance. I am suspecting Intel on Windows... but we'll see.

    --
    I am very small, utmostly microscopic.
  185. Re:And watch your code magically quadruple in size by gatkinso · · Score: 1

    Every source I find states that dynamically sized stack arrays are not allowed under ANSI C++.

    C++... not C.

    The last time I coded in C, K&R was still popular.

    --
    I am very small, utmostly microscopic.
  186. You are unfair to C++ by master_p · · Score: 2, Informative

    How about an array who's size you don't know until runtime?

    If 'vector' is not enough for you, you can always typedef it(parentheses are used for illustration purposes only):

    #include "vector";

    typedef std::vector(int) IntArray;

    IntArray intArray1;

    but alot of things just don't have really elegant solutions

    And what are those things ? you don't say. STL provides THE elegant solution. Remember, 'typedef' is your friend.

    and the standard libraries are too sparse for what modern apps do with modern languages

    I too wished that C++ had standards for gui, multitasking, databases, networking and other useful tasks. But... C++ is a language standard, it is not a run-time environment. If you want all this functionality, you can always use Qt(for example). C#, the specification is portable to other OSes, since it is an ECMA (?) standard, but the run-time isn't. So don't hold your breath taking your C# source code and compile it on Linux...on the contrary, any STL-based app will compile the same with almost every C++ compiler, and Qt is 100% source code compatible on every OS it supports.

    1. Re:You are unfair to C++ by Laplace · · Score: 1

      "typedef" is often not my friend. If I say

      typedef int NastyClass;

      I want assignments like this

      NastyClass aNastyObject;
      int notANastyObject = aNastyObject;


      to fail. C++ claims that it has strict type checking, but then provides half-assed langage constructs like typedef. How is my typedef example different from

      #define int NastyClass?

      --
      The middle mind speaks!
    2. Re:You are unfair to C++ by master_p · · Score: 1

      "typedef" is often not my friend

      But "typedef" does not define a new type. It is synonymous to 'alias' in ADA (for example). If you want assignments like that to fail, you can do the following:

      template class Number

      {

      public:

      bla bla constructors assignment etc

      private:

      T _value;

      };

      typedef Value Int;

      int a = 5;

      //will fail

      Int p;

      p = a;

      But why should it fail ? 'NastyClass' is an integer, it does not have other properties than an int. What you want is a new class based on int, with some extra properties.And that is what the above example does. And the above piece of code extends any type, including base ones.

      This is typical example of how people without good C++ knowledge (forgive me if it is not like that, it certainly seems so) are unfair to C++. You have heard something about 'not strong typing' of C++, you have mixed it with 'typedef' (which has nothing to do with defining a new type), and the result was a wrong argument. C++ is 100% strongly typed, just like ADA: make everything a class, and you will see.

    3. Re:You are unfair to C++ by Laplace · · Score: 1

      Right now I am dealing with a situation where using a typedef on an int and calling it something else is becoming a huge problem.

      If I want the behavior of ints, but want them to be logically different from ints, typedef is of no help to me. Likewise, why do I want to waste a bunch of time wrapping classes around existing functionality so I can obtain the exact same functionality at a performance penalty?

      The introduction of a typedef construction without an analagous type creation construction is not only an oversight, but allows for horrible programming style, especially when you have to work with junior programmers who don't completely understand when the language can bite you in the ass.

      The ability to easily spin off identical classes from existing subclasses (say, through a typecreate facility) would be invaluable. typedef allows for some very nice generic programming constructions (i.e., saying things like vector::iterator would be difficult without it), but in my experience is ignorantly abused.

      This is typical example of how people without good C++ knowledge (forgive me if it is not like that, it certainly seems so) are unfair to C++.

      This is a typical example of a language that has lots of good ideas, but forces programmers to have years of real world experience working with it to be passably proficient with it. Where do you suggest that these programmers get the real world experience?

      --
      The middle mind speaks!
    4. Re:You are unfair to C++ by master_p · · Score: 1

      If I want the behavior of ints, but want them to be logically different from ints

      This does not really make sense. Do you want integers or not ? If you do, use an int. If you don't, use something else. From the way you describe your problem, it is a design issue, not a C++ issue. Do you want a constrained int ? you should make a class. You don't care about int constraints ? use an int.

      . Likewise, why do I want to waste a bunch of time wrapping classes around existing functionality so I can obtain the exact same functionality at a performance penalty?

      How come there is a performance penalty ? it isn't. The compiler knows how to inline stuff pretty well, and if you are not sure your big method is inlined, the __inline keyword is your friend. And doing it with templates saves a lot of work: the class I mentioned above can be reused with floats, doubles, shorts, chars and whatever you like.

      Instead of giving credit to C++ for being able to do things not originally thought of, you are complaining. Something tells me that you don't really understand C++.

      The introduction of a typedef construction without an analagous type creation construction is not only an oversight, but allows for horrible programming style, especially when you have to work with junior programmers who don't completely understand when the language can bite you in the ass

      But the point of C++ is that is a powerful but advanced language. Firstly, it is not an oversight, since, as I told you earlier, you can always make a template class to make a different type. Secondly, there is a well-documented trade-off between power and biting-in-the-ass. If you have junior programmers, try Logo.

      Where do you suggest that these programmers get the real world experience?

      I will reply with a question: how hard is it to understand that 'typedef' means 'alias' ? The purpose of 'typedef' is to have aliases of big composite declarations. You certainly don't need years of experience to understand that. That's the same with any other C++ issue.

      Please, tell me what your problem is and I guarrantee to solve it in an elegant way.

  187. Not with experience like mine by brlewis · · Score: 1

    Forth was my first language after Basic. It was so much more expressive! A maze-generating algorithm that I couldn't wrap my head around when programming in BASIC suddenly became obvious when programming in Forth. Having recursion really helped.

    Plus, few people end up with jobs or projects that force them into Forth against their will, so there isn't much hatred out there.

    1. Re:Not with experience like mine by QuasiEvil · · Score: 1

      Plus, few people end up with jobs or projects that force them into Forth against their will, so there isn't much hatred out there.

      Nope, but where I work (as a Forth programmer), there is a great amount of time where we're forced NOT to work in Forth, against our will. Leads to dislike of management who wants us to program in the Infoweek-compliant language flavor of the month, rather than what's appropriate for the task.

  188. Brainfuck by hackrobat · · Score: 1

    Of course, brainfuck is the answer.

  189. Re:Perl by Randolpho · · Score: 1

    In Perl? Please, pass that pipe over here!

    --
    "Times have not become more violent. They have just become more televised."
    -Marilyn Manson
  190. My C++ gripes by dwsauder · · Score: 1
    One thing I hate about C++ is that you have so many C++ programmers who are preachy:
    • "Don't use malloc(). Always use new."
    • "Don't use stdio. Always use iostream."
    • "That code is not object-oriented." (And, of course, object-oriented is always the best. That's an axiom.)
    • "Don't use macros. Use inline functions."
    • "Don't use old-style casts. Use the new-style casts."
    • "Your code isn't very efficient." (C++ programmers seem to obsessed with efficiency.)

    Back in the good old days of C, there was pretty much the one point of contention: "Don't use goto." C++ takes the never-ever-use-goto-no-sometimes-its-okay argument to a whole new level.

    Of course, code reviews can get very personal. Everyone tries to be all object-orienteder-than-thou. Or maybe it's: "I use more C++ features than you." So then you find yourself wanting to use advanced C++ features so that you can impress your co-workers and be in that elite club, but your conscience tells you that if you do use all those advanced features, you will sacrifice portability, and you will produce code that requires a very advanced C++ programmer to maintain.

    Then there are the compiler problems. As the parent post mentions, all compilers suck. And one of the biggest compiler problems is that the error messages are often inscrutable -- nobody knows what they mean! So, those error messages mean nothing except to tell you that your program won't compile. I mean, finding a bug in program code is one thing. Sometimes you can find the bug by stepping through code in the debugger. But when you can't even get the code to compile, that's frustrating in a different sort of way.

    A co-worker of mine wrote a couple thousand lines of C++ code using GCC on Solaris. Later, we tried to compile the code using the Sun C++ compiler on the same machine. After a week of trying, we pretty much gave up. Such is the life of a C++ programmer.

    1. Re:My C++ gripes by avdi · · Score: 1

      Preachiness - I think this partly results from the twin facts that a) a lot of C++'s best features were added incrementally, and compiler support came even later; and b) a lot of C++ programmers are really C programmers who never bothered to learn C++ as a discrete language, and whose knowledge of C++ doesn't extend much beyond classes and new/delete. Which is fine, until you have one of these programmers working alongside someone who really knows C++, on the same project. At that point, it's time to adapt or die for the old-schooler, because certain bad old habits are not just ugly, they will actually cause bugs.

      As an example, they are right. You should never, ever, ever use malloc() in new code. That's on the level of "don't use goto". If anyone is "preachy" about this point, it is because your indiscriminate use of malloc() threatens their code with insidious, hard-to-track-down memory errors. This is on the level of using static variables inside a function, and requiring client code to call some init() function before every call in order to flush out old static data. I would be equally "preachy" if we were on a work site and you ignored basic safety regulations.

      On the other hand, those who preach about object-orientation always being the "right" way need to be smacked. And anyone who preaches to you about how you should write code that they themselves will never have to work with or call out to has too much time on their hands.

      --

      --
      CPAN rules. - Guido van Rossum
  191. C++ more maintainable? Garbage. by Stu+Charlton · · Score: 1

    "The result is a langauge that is so syntactically impoverished that it is actually less readable than C++"

    Ok, so MORE shorthand syntax makes a language easier to read? Somehow I don't follow -- isn't that the whole reason why many find Perl the equivalent to line-noise?

    C++ requires a lot of headspace for humans to parse it. You have to keep in mind the rules for references vs. pointers, heap vs. stack allocation, the two syntaxes for dereferencing, notoriously ambiguous compiler messages, instance vs. static operator overloading, etc. You also can only get bitwise copying, no built-in shallow cloning. You have to manage header files and module dependencies like a hawk -- circular references in a large system shoot your compile times to hell, reducing your productivity. RTTI is a poor-mans approach to reflection. Binary interoperability breaks whenever the vtables in your abstract base classes change, so you have to introduce ugly placeholder hacks to keep them aligned.

    C++ allows tremendous freedom in style, it *can* be as readable as Java, maybe in some cases more so. Unfortunately:

    a) writing readable C++ code usually requires a level of discipline not found in 90% of programmers.

    b) it doesn't have the level of turn-around time and feedback of languages like Java and C# that reduce binary interoperability to the class level, and provide a runtime linking model.

    c) it certainly doesn't have the level of feedback of purely interpreted scripting languages.

    Scripting languages, or modern OO languages like C# or Java, coupled with a reflective development environment like Eclipse or Visual Studio .NET, and you have a recipe for a tremendously higher level of productivity over C++.

    --
    -Stu
  192. Double sorting. by Gldm · · Score: 1

    What I really want to do is this: Reverse part of the sort later.

    That's right. I need to sort an array, do a bunch of stuff with the sorted array, and then be able to unsort some of the array values later. So far the only way I can think of doing that is tracking the original index value of each element during the sort, and then afterwards for the ones I want look that up so I can put it back where it was.

    I have no idea how map would work for this. Any examples?

    Oh and this is very memory sensitive. One byte per element is a huge memory bloat for this app. I have to free the original arrays after I cast them to a 2 int struct (1 value 1 index) or it uses too much ram. If I could do it without having to make the structs, i.e. just making the index arrays, I wouldn't need to free hundreds of megs and only to allocate it again after this process ends.

    --

    Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!

    1. Re:Double sorting. by johannesg · · Score: 1

      A map can be thought of as an associative array - you map from something (the key) to something else (the value). Since it is implemented as a tree, inserts are cheap and automatically keep the thing sorted. The downside is that it will use a significant amount of memory - I tried to use it for a data structure that stored huge amounts of data (time_t / double pairs) and found that overhead was huge, which was totally unacceptable to me. I ended up writing my own specialised datastructure for that case.

      I'll continue with this post since maps are still a brilliant tool when the amount of data is more managable.

      One thing you can do if you don't mind mucking around with pointers a bit is to use two maps as separate indices on your data. Something like this:

      map<yourkey,value*> firstmap;
      map<yourint,value*> secondmap;

      ...and then, whenever you have a new key/value pair, put it in both maps. You can then choose your sort order by selecting one map or the other for accessing.

      A quick example:

      #include <map>

      typedef map<int,int> EXAMPLEMAP;

      EXAMPLEMAP ExampleMap;

      // Inserting elements
      ExampleMap [10] = 20;
      ExampleMap [12] = 30;

      // Accessing all elements in order
      for (EXAMPLEMAP::iterator i=ExampleMap.begin (); i!=ExampleMap.end (); i++) {
      printf ("Key: %d; Value: %d\n, i->first, i->second);
      }

      // Same in reverse order

      for (EXAMPLEMAP::reverse_iterator i=ExampleMap.begin (); i!=ExampleMap.end (); i++) {
      printf ("Key: %d; Value: %d\n, i->first, i->second);
      }

      // Removing an element
      ExampleMap.erase (15);

      // Removing all elements
      ExampleMap.clear ();

      Hope this helps. Like I said, overhead is probably unacceptable to you, but it is useful for so many other cases that it is worth knowing about anyway.

      If you like this check out the rest of STL as well. There are plenty of other useful datastructures in there.

  193. Vector problems. by Gldm · · Score: 1

    Well first off, I've never heard of STL until it was mentioned here and I started looking it up. It wasn't covered or even mentioned in my education at all. I have no idea what typedef is, I'll look a that up later.

    I did however look up vector, and tried using it. I ran into problems.

    How do you do a 2D double dynamic array?

    vectorarray = new (std::vector )[count]; obviously does not work.

    vectorarray = new *(std::vector)[count]; doesn't work either so I can't get pointers to vectors so I can have a bunch of vectors later.

    vectorvector = std::vector ; also no go.

    Also, any idea if it works with memcopy? If not I don't know if I wanna throw a couple hundred megs into them and try copying it around.

    --

    Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!

    1. Re:Vector problems. by sw155kn1f3 · · Score: 1

      dude, do some fucken google for "STL tutorial"
      and btw after reading that tutorial do not forget to punch your C++ "guru" right in the face :)

      --
      - Arwen, I'm your father, Agent Smith.
      - Well, you're just Smith, but my father is Aerosmith!
    2. Re:Vector problems. by Gldm · · Score: 1

      Been reading up on it through books.

      std::vector > 2Dvector; eventually was the working answer.

      It turned out to be more trouble than it was worth, just too slow for what I was doing and a pain to copy with.

      I've been looking up alot of the other things in the STL and some look useful but the syntax is still bugging me.

      --

      Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!

    3. Re:Vector problems. by sw155kn1f3 · · Score: 1

      it's called generics - actually your vector turns to be just malloced or new'ed int*
      yes man, you read it right - it's just the pointer to raw array, but the point there is that STL completely hides all the implementation details from you, has range-checking at debug phase, etc
      you _have_ to know closer the STL and techniques it uses to be any successful C++ programmer, you do!
      read some Alecsandrescu books on C++, worth it

      --
      - Arwen, I'm your father, Agent Smith.
      - Well, you're just Smith, but my father is Aerosmith!
  194. C++ is a tragedy by Moe+Taxes · · Score: 1

    C is a great language for writing operating systems, device drivers, any program that has to be lean and fast. If the code is going to be excuted billions of times a day all over the world C is the obvious choice. It is so close to the target machine that I think of it as a portable macro assembler.

    It is such a great language that people began to worship it and came to belive it was the best language for every program that they needed to write. But better languages for application programming were developed. They had object orientation, could use design patterns, and could actually reuse code that had been written for other applications.

    The C worshipers could not be satisifed if C was only best for low level programming so they piled on a ton of crap and called it C++.

    It's like the hot chick that went to work in a dognut shop. A few years go by and not so hot anymore. C++ can still be used but the thrill is not there anymore. Bloated, messy, and covered with powdered sugar C++ just doesn't do for me.

    --
    It took a real world war to end the airplane's patent wars. - Fâché Rouge -
  195. Re:C++ more maintainable? Garbage. by avdi · · Score: 1
    Ok, so MORE shorthand syntax makes a language easier to read? Somehow I don't follow -- isn't that the whole reason why many find Perl the equivalent to line-noise?

    By this logic, assembly language should be be the easiest language of all to read, since it's such a simple, regular syntax. Syntax is added to languages in order to make them more expressive and readable, not less. Sometimes this can be done wrong, like in Perl's case, where a very expressive array of syntax is hobbled by a commitment to maximum terseness. Removing syntax for "simplicity's" sake often has the opposite effect, though.

    Examples of this in Java include:
    • The lack of enums, which leads to long, repetative lists of public static final ints which are maintenance nightmares because the entire list has to be updated if a new value is added in the middle, and which have none of the typesaftey of their C++ counterparts
    • The lack of default arguments to methods, which leads to long, repetative lists of constructors; another maintenance liability, and less readable than a single constructor with default arguments
    • The lack of switch statements, requiring the use of if/else instead. This makes the intent slightly less clear, and is yet another maintenance problem when the variable being switched on is changed
    • Operator overloading is important. While it can certainly abused, the fact that I can't define a new domain object and then compare it for a domain-specific definition of equality with thing1 == thing2 means that working with domain-level entities will never be either as concise or as intuitively readable as working with builtins.

    The only thing that makes coding in Java productive at all is a really clever refactoring IDE which automates a lot of those chores, along with a really enourmous set of standard libraries. Nearly everything I can express in Java I can express more quickly in C++ without any loss in readability, and often with in a way that better expresses my intent to the reader.

    It's really comparing apples and oranges though. In general, Java and C++ are applicable to two mostly orthoganal domains; but most of Java's domain is better served by less wordy dynamic languages like Smalltalk, Ruby, Python, or Scheme.
    --

    --
    CPAN rules. - Guido van Rossum
  196. never bothered to learn C++ as a discrete language by fizbin · · Score: 1

    There's a cure for that, by the way: Effective C++ by Scott Meyers. It really is exactly the thing to fix up one's C++ knowledge to what's current (I learned C++ back in 1995, using books that were already over a year old then, and compiler versions that were at least three years old).

    This reminds me that I should go ask the co-worker who's been borrowing it for six months now to return it...

  197. C done right. Or, as right as possible with C. :) by Tumbleweed · · Score: 1

    New _Apple_ code is C++? Yikes!

    Still, aside from Apple, _someone_ is buying all those new Obj-C and Cocoa books. I know when I get my Mac (waiting for the PPC970 train), I sure as hell won't be using C++. Blech. Obj-C99 seems about the nicest solution anyone's come up with yet, short of Python. I love the syntax of Rebol, but I wish it was lower level, compiled, & open source. Oh well.

    I'm still surprised by the # of people who complain about things lacking in C, without realizing that C99 addressed many of those issues. *shrug*

  198. Re:To everyone who whines about Python's indentati by Balinares · · Score: 1

    > Someone please explain: why does this feature make you so upset?

    I assume because it looks like Fortran 77 to them -- the same reason some dumbasses are upset about the Unix command line because it looks like DOS to them.

    Trust me on that one: just ignore the dumbasses, and do whatever -you- like.

    --

    -- B.
    This sig does in fact not have the property it claims not to have.
  199. Re:Firestarter - RAMBOTRAN ?? by Anonymous Coward · · Score: 0

    hmmm, search on google groups finds 2 references. I work in a fortran shop -- if you find this rambotran stuff pls post it somewhere!

    AC (posting as AC so no one knows I code in fortran)

  200. I have writen the because.... by oliverthered · · Score: 1

    unless you language is something like....
    "
    mr smith from jones &co asked me on 11/09 to take the orders from freds clients and transfer then to my.db;

    ignore the next line because kate reported bug 1234

    then he want's to totals of the clients in my.db to be printed in a report as per the format specified by billy on 10/09;

    instead

    take the totals of the transfered clients in my.db and print them using the format specified by billy on 10/09.
    " ....there ain't no way you code will be self commenting.

    --
    thank God the internet isn't a human right.
  201. "free" is important for technical reasons by g4dget · · Score: 1
    You are basically saying that people stopped liking Java when Sun went back on their promise to make Java free-as-in-Perl, and that people dislike VB because it's proprietary and from Microsoft.

    You are quite right.

    But that's not some gratuitous dislike of things commercial, it has concrete technical reasons. As long as Sun was going to go through a public standardization process, its many design flaws were fixable, its bloat could have been limited, and other people could have created better implementatiosn than Sun. As soon as Sun made Java proprietary-with-community-input, all that went out the window.

    As for VB, you are confusing the language and its environment. VB-the-language is pretty awful--some of Microsoft's main VB hackers have left the company over that. What has made VB succeed is the programming environment and the copious documentation, training, and marketing. VB-the-language succeeded because a big company kept spending on making it succeed despite the pretty awful nature of the language itself.

    So, "free" matters, because something that is "free" usually involves much more community input in its creation, and something that is "free" usually has to make it on its own merits. Java and VB are, and will remain, deeply flawed languages precisely because they are not free: as long as Microsoft and Sun can spend money to paper over the technical problems with those languages, and as long as the community itself doesn't have the final say in what happens to those languages independent of the corporate interests of their owners, those languages will remain sub-par.

    (As for VB-like environments for Linux, Python, Glade, and your favorite Python IDE give you equivalent functionality and a better language. What they don't give you is the documentation, standardization, and name recognition of VB.)

  202. ruby by SHEENmaster · · Score: 1

    If you want to learn ruby slowly by example, check out osnippets.org's ruby section.

    --
    You can't judge a book by the way it wears its hair.
  203. 99.99% of High School Kids Can't Read Perl by scubacuda · · Score: 1
    According to BBspot:


    Test Shows 99.99% of High School Seniors Can't Read Perl
    San Francisco, CA - Recent results from the standardized Perl Fluency Test showed that 99.99% of US high school seniors can't read Perl. This disturbing statistic shows that American students are painfully unprepared for life after graduation.

    "This shows that there is a real need for a Perl Monk in every classroom," said Perl Monk Kelly Adrity. "We've got computers in every classroom, now we need our kids to be able to use them, and what better way to learn about computers than to learn how to read and write in Perl. I'm glad the budget proposed by President Bush sets aside millions for Perl Monks. America will lead the way in Perl literacy."

    The four hour test had 2 sections, a simple translation section and a project section. The first part asked students to translate easy Perl phrases into their standard English equivalent, and the second section required students to produce a simple MP3 player in Perl. "I didn't know what the hell any of it meant," said one Senior, "it had lots of slashes and periods and brackets. It was so confusing. I'm feeling rather nauseous."

    Perl experts were astounded by the results. "I was amazed that none of the students were able to read this simple sentence:

    $_='while(read+STDIN,$_,2048){$a=29;$c=142;if((@ a=unx"C*",$_)
    [20]&48){$h=5;$_=unxb24,join"",@b=m ap{xB8,unxb8,ch r($_^$a[--$h+84])}
    @ARGV;s/...$/1$&/;$d=unxV,xb25 ,$_;$b=73;$e=256|(or d$b[4])>8^($f=($t=255)&($d>>12^$d>>4^$d^$d/8))>8^( $t&
    ($g=($q=$e>>14&7^$e)^$q*8^$q>=8)+=$f+(~$g&$t) )for@ a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval


    I mean, come on, that's so easy," said Paul Chen, Chairman of the Learn Perl or Die Association, which administered the test nationwide. "Teachers need to start with simple phrases like $RF=~tr/A-Z/a-z/; and work up from there. We really need to start teaching this in first grade if kids are ever going to understand this by high school."

    Not everyone shared Mr. Chen's view about the necessity of adding Perl to early elementary curricula. Programmers Against Perl (PAP) spokesperson, Keith Willingham said, "There's no better way to scare students away from computers than exposing them to Perl. Even experienced programmers are frightened and confused by it. The Perl lobby is just getting too powerful, and they need to be stopped."
  204. Re:To everyone who whines about Python's indentati by WWWWolf · · Score: 1
    Someone please explain: why does this feature make you so upset?

    "Lieutenant, bomb that indent line back about a hundred lines. Give me some room to breathe."

    I think I once described Python as a crammed language I can't breathe in. The whole code seems claustrophobic and somewhat... monolithic. It seems like it just sits there. It forms a structure. It sits in the file. Like a mountain built of small rocks and concrete. Once built, it won't move anywhere without a large effort. It just stands there.

    And I feel it's tricky that the code relies ONLY on the indent to store structure. Once you take away even a little bit of that structure, it all collapses. If you take a block of Python and paste it elsewhere, it may just not work. If you lose the indent, it won't work either. Losing indents is very possible and very real - one example was already given: quoting, printing long code on paper, or some such.

  205. Oberon-2 by Anonymous Coward · · Score: 0

    Oberon-2 is a great language (though I'm not a fan of the Oberon OS) - it's low-level like C, but with safety, objects, and GC. It is, in my opinion, much better than Pascal or Modula (and I used to be a Pascal fan).

    Anyway, quick links:
    POW! - Oberon-2 IDE/Compiler for Windows.
    OOC command-line compiler for Unix.
    Oberon home page at ETH

    Can't speak for Cobol, though. What school do you go to? I'm interested to know where they teach Oberon

    -rob

    1. Re:Oberon-2 by innerlimit · · Score: 1

      Actually, we use Oberon/F which is, of course, pretty much the same.

      I study in Antwerp (Belgium)

  206. HTTP Java Library by solprovider · · Score: 1

    Thank you.

    Our product is almost gold, so there is no chance of changing the platform in the near future. We hope to move to a much newer Java release for the next version. We integrate with Domino, so the options are limited unless we want to include a WebSphere license. But there should be better options when we move the product to Domino 6.

    We will test the library to see if we can set the HTTP USER CLIENT header. The Sun and IBM libraries from their JREs insist that it reverts to "Java 1.3". Since our servlet can act as a proxy, we want to pass the real clients' header, but we did not want to write our own HTTP classes for just this one feature.

    Our development team is too small. We knew adding this feature would not be difficult, but we cannot delay the release for any reason. Most servers return valid HTML regardless of the client used, but MS IIS 4 is awful. So it will be on the bug list unless we find a better library. We stopped looking for one about a year ago. May this one will work. Again, thank you.

    --
    I spend my life entertaining my brain.
    1. Re:HTTP Java Library by solprovider · · Score: 1

      Your code works. I tested it both stand-alone and using a Tomcat servlet called by Domino, and it works both ways. The latter is how our product is implemented, so that was what was important to us.

      I have no idea why this was a problem last Summer. We probably had a misspelling in the property name or some other simple error, but I remember we had spent quite some time on it. We finally marked the programming issue in the bug log as "Wait until we have a clue." The business managers consider this essential because a demo failed because of it. We HAD 3 issues left before we implement the product at a client that is waiting for it; now we'll have 4 if I mention that it can be fixed.

      Can I (or should I) keep my mouth shut? I know the managers will insist it is added. The code would be simple to implement, but QA will probably want to add a few weeks if that code is moved from "frozen".

      --
      I spend my life entertaining my brain.
  207. Re:Your sig by jcast · · Score: 1

    Note to moderators: what I quoted was (at the time I posted) the parents .sig. As such, my post was on topic. Please mod accordingly.

    --
    There are reasons why democracy does not work nearly as well as capitalism.
    -- David D. Friedman
  208. Re:I'd call it "Bush" by Crazy+Eight · · Score: 1

    But then wouldn't you risk alienating gay male programmers?

  209. Re:Firestarter - RAMBOTRAN ?? by Reziac · · Score: 1

    I don't remember that name, but "real men use fortran" brings up a bunch of hits of likely no relevants. Only direct result is http://developers.slashdot.org/developers/02/05/19 /2216233.shtml

    Typo'd it as robotran and found there IS such a program!

    --
    ~REZ~ #43301. Who'd fake being me anyway?
  210. See the pattern? by svb · · Score: 1

    Roman times: Gladiator Fights

    Medieval Times: Jousting

    Western Times: Dog Pit Fights

    Modern Times: Flamewars on Slashdot about bad programming languages!!

    /Sean/

  211. Re:Perl by Abreu · · Score: 1

    The best way to make readable code is to leave out the comments altogether :-)

    After all, the code should be self-explanatory :-)


    In Python maybe, but certainly not in Perl ...And even in python you should use comments in moderation, (read: "when you are using some fancy voodoo")

    --
    No sig for the moment.
  212. Re:What I hate about the C family (C, C++, Java, . by MonsieurX · · Score: 1

    You could try metacard. Start counting at 1 and assign variables with the pure prose of put "hello world" into x put x into field 1 People just dont get it! (MetaTalk pun intended)

  213. Re:HTTP Java Library (offtopic, but...) by fizbin · · Score: 1

    It's a darn shame that you can't send someone slashdot messages, but I have to ask - what are you trying to do that's failing? I couldn't remember java 1.3 being broken in this fashion, so I wrote a little test program, and it seems to work just fine:

    import java.net.*;

    public class printURL
    {
    static void main(String argv[])
    throws Exception
    {
    URL u = new URL(argv[0]);
    URLConnection urlc = u.openConnection();
    urlc.setRequestProperty("X-Whatever", "WhichEver");
    if (argv.length > 1)
    urlc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1; MultiZilla v1.4.0.3J) Gecko/20030425");
    java.io.InputStream is = urlc.getInputStream();
    java.io.Reader rdr = new java.io.InputStreamReader(is);
    int ch;
    for (ch = rdr.read(); ch != -1; ch = rdr.read() )
    {
    System.out.print((char)ch);
    }
    }
    }

    When I run this against a cgi script that just prints out what you send it (printenv.pl from a recent apache distribution), it clearly shows that the user agent is Java1.3.1 without that "setRequestProperty" line, and is what I say (I just copied what my browser says) with it.

    What are you doing?

    I'd take this off slashdot, but you give no way of contacting you in your slashdot profile.

  214. Monkey see, monkey do: PHP and Perl references by SimHacker · · Score: 1
    Here's a typical example of how PHP screwed up by mindlessly aping a feature of Perl that was horribly designed in the first place: references. This demonstrates my point that PHP is merely an anemic, mediocre, unenlightened knee-jerk reaction to Perl, which is an extremely foolish choice of a language to imitate without understanding.

    -Don

    PHP References Explained

    One of the most underused features of PHP is the ability to use references. The problem is that using references are rather troublesome in PHP. References was not part of the original syntax but has been added later on, thus leading to a somewhat confusing syntax. There's also little support for references in the native function set.

    References in PHP are simpler than the related mechanism found in C and C++, C and C++ uses pointers which allows for pointing to memory areas. C++ also has references which are less troublesome than pointers but not as versatile. By using references you can refer or point to the same data using different variables. This is useful when you want to avoid costly memory operations or want functions to access your data directly rather than copying it.

    References are created by assigning a variable with the reference operator &.

    $a = "data";
    $b =& $a; // Now $b refers to data in $a

    As I mentioned above the behavior is not as advanced as in C/C++, this means that you cannot create a reference to a reference. For instance let's extend the above example by create a new reference. [...]

    --
    Take a look and feel free: http://www.PieMenu.com
  215. Java comments by sgt101 · · Score: 1
    Well Shhhiittttt.


    "The inconsistencies between what the language allows and what the standard library actually does bother me. If operator overloading is so bad, why does the String class do it?"


    Yo! who cares, yeah, sooon you be decompiling string, yo! you neeeeeed work to do boooooy.


    "Interfaces get around part of the lack of multiple inheritance, but I'd like to be able to reuse common code in ways besides inheritance. Mixins that don't require inheritance would be a nice touch."


    Dat is why we have AspectJ my brother. Shit, if you need it, use it, ain't no one judging you. But you know, you be bringing that to my house and I'll put a cap in your ass. Straight.


    "The libraries and the interpreter aren't cleanly separated. There are ways (involving decompilers), for example, to get regex support in 1.3, but I'd prefer to upgrade the standard library and the interpreter separately sometimes, rather than in one big chunk."


    Ok, you have a point here. This badness can do some harm.


    "I like the idea of checked exceptions in some situations, but forcing every method to deal with (catching or throwing) all exceptions that its child calls or may call can be tedious. I'd rather be able to ignore an exception and let it propagate upwards. Sometimes, I'd rather not worry about exceptions at all."


    My man, you know shit.


    public Shit someMfkinMeth (Shit shitbooooy) throws throwable {

    //you is a fool

    ;

    //soon you is doing work as my bitch


    }

    --
    --------------------------------------------- "In the end, we're all just water and old stars."
  216. Kylix and VB by fm6 · · Score: 1
    I used to be on Kylix project. Early on, "Kylix is VB for Linux" became the marketing mantra. I was enthusiastic about the product, so I tried very hard to believe that this was an honest statement.

    But now that I no longer work for Borland, I have to admit to myself that this is just not true. Yeah, you can point to a lot of IDE features that are similar in the two products. But there are differences as well, And, more importantly, Object Pascal is a completely different language from any Basic dialect. There's the way variables are declared. There's language semantics (VB has one kind of string data type; OP has a lot more). There's a lot of other things.

    Which is not to say that Kylix isn't a reasonable migration path for VB programmers. Indeed, a lot of Delphi/Kylix enthusiasts seem to consider themselves "reformed" VBers. But that's simply because Delphi and Kylix are better designed than VB. If you want to abandon VB for something more powerful, you'll probably find that Delphi and/or Kylix is worth the effort it takes to re-educate yourself. But that effort is not minimal.

  217. Re:C++ more maintainable? Garbage. by Stu+Charlton · · Score: 1

    By this logic, assembly language should be be the easiest language of all to read, since it's such a simple, regular syntax.

    Actually, no, I was thinking more along the lines of Lisp or Smalltalk. Both are small languages with minimal use of symbolic shorthands, and make use of a large vocabulary.

    Lack of enums: Granted, in limited cases, such as parsing textual tokens, enums are useful. Pre 1.5 Java, type-safe enums are usually implemented using Josh Bloch's pattern from his book Effective Java. However, the typical use of enums is "type-coding" operations through a switch statement. This is a holdover from C and would be better written as polymorphic objects.

    Lack of default arguments: Granted, though a minor problem.

    Operator overloading. While I have seen examples where it's useful, they're primarily in terms of equality comparison, as is your example. I'm not in favour of general operator overloading, but I think the C# approach of allowing overloading of "==" but providing another (non-overloadable I believe) identity comparison operator is a good one. Having said that, the Java solution of marking a hard distinction between the semantics of "==" and ".equals" is a workable solution.

    The only thing that makes coding in Java productive at all is a really clever refactoring IDE which automates a lot of those chores

    The above chores you've listed have little to do with refactoring IDE's, and you have omitted the observation that most of the maintenance challenges that are simplified by refactoring tools are challenges that exist in C++ as much as they do in Java: renaming methods, re-ordering parameters, moving methods, pulling methods up or down a hierarchy, inlining or extracting methods.

    Not to mention the importance of managing dependencies through an IDE that can track them, which is arguably much more important in C++ because they can affect your compile times in horrible ways.

    a really enourmous set of standard libraries

    So you would prefer to write most standard features yourself? Or use one of several third-party libraries, some of which might be OS-dependent?

    Nearly everything I can express in Java I can express more quickly in C++ without any loss in readability, and often with in a way that better expresses my intent to the reader.

    I'm really happy that you write clean code, but most C++ programs are not written that way. Furthermore, not everything to do with a language's productivity has to do with its syntax.

    In general, Java and C++ are applicable to two mostly orthoganal domains;

    In practise, this isn't exactly what happened. Many businesses in the mid-90's tried developing business appliccations with C++, with very mixed results. It requires a level of discipline that isn't characteristic of most developers. This is what led to Java's widespread adoption in the enterprise.

    Furthermore, there are non-syntactical benefits to VM-based languages like Java or C#. The "safety net" of Java was a tremendous benefit -- the fact that it generally can't crash (save NullPointerException) with a segmentation fault due to programmer error in memory management.

    Let's also not forget that Java's reflective language model, where every component of the language can be inspected, where interoperability and linking occurs at runtime, all of this has conferred tremendous productivity benefits to the deployment and version management of applications. No more worrying about the brittleness of the C++ ABI.

    This brittleness led to the creation of standards like COM, which we all know put the COM in COMPLEX. So much so that Microsoft clued into the power of reflective languages and released .NET.

    but most of Java

    --
    -Stu
  218. "You know the thing I hate about my hammer... by flumps · · Score: 1

    .. is the way i seem to always bends screws when I hit them.."

    Moan Moan Moan.

    Come on, this is rediculous. Different programming languages, different applicable circumstances. One thing in one language is hard, in another its easy. Use the right tools, and bingo.

    --
    "So there he is, risen from the dead. Like that fella, E. T." - Father Ted Crilly
    1. Re:"You know the thing I hate about my hammer... by flumps · · Score: 1

      .. sorry "Come on, this is ridiculous".

      spelling it like this since 1981 cant be good.

      --
      "So there he is, risen from the dead. Like that fella, E. T." - Father Ted Crilly
  219. Re:To everyone who whines about Python's indentati by The+Pim · · Score: 1
    I don't write a lot of Python, so there may be some more subtle gotchas I haven't run across, but two flaws in its whitespace rules instantly jump out at me:

    1. Continuation lines suck. They're visually ugly and a pain when editing. Why can't Python assume a line is a continuation when it starts to the right of the previous line? NB: don't give me any "good programmers don't need long lines" clap-trap.

    2. Whitespace sensitivity is not optional. There is no "long-hand" to resort to when you want it "your way"--or want to protect your code against mangling in transit.

    I do regularly use another whitespace-sensitive language that does not have these problems: Haskell. So when I program Python, I feel acutely that Python got it wrong.
    --

    The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.