Slashdot Mirror


Programmer's Language-Aware Spell Checker?

Jerry Asher writes "Not all of my coworkers are careful about spelling errors. Sometimes this causes real embarrassment as spelling errors creep into software interfaces. Does anyone know of spell checkers for programming languages? I don't want a text spell checker, I want a programming-language-aware spell checker. A spell checker that I can pass all of my code through and will flag spelling errors in function names, variable names, and comments, but will ignore language keywords, language constructs and expressions, and various programming styles (camel code, or underscores, or...). I want a spell checker that knows that void *functionSigniture(char *myRoutine) contains one spelling error. Does anyone have such a thing for Java or C++? Are there any Eclipse plugins that do this?"

452 comments

  1. Eclipse WTP 3.3 Europa seems to do this.. almost. by pringlis · · Score: 5, Informative

    The version of Eclipse I run, Eclipse WTP 3.3, does spell checking on comments as standard. Not for variable, function names and the like though. It's a decent first attempt though. In truth, I turned it off within the first few hours. It underlines any mistakes in red which I find really annoying when scanning code as I keep thinking I've seen syntax errors. More often than not my eyes are drawn to a spelling mistake, which in many cases isn't even really a mistake, which distracts me from what I'm actually trying to look at.

  2. How about the Built-in OS X spell checker? by Anonymous Coward · · Score: 0

    You can add common function names, types, etc to the custom dictionary -- but all variables, etc in English will be checked as-you-type. Works in any OS X application (simplest example: TextEdit)

    1. Re:How about the Built-in OS X spell checker? by BadAnalogyGuy · · Score: 5, Funny

      How about the Built-in OS X spell checker?

      We're talking about programming, friend.

    2. Re:How about the Built-in OS X spell checker? by gnasher719 · · Score: 1

      >> How about the Built-in OS X spell checker?

      We're talking about programming, friend.

      Actually, it works in XCode like everywhere else. Click at the beginning of the a comment, press cmd-; and it starts checking the spelling. Quite useful when you just typed in a lengthy comment, and found a few mistakes. And not completely useless when you just added things to a header file.

    3. Re:How about the Built-in OS X spell checker? by stickystyle · · Score: 1

      I can vouch for using the built-in spellchecker everyday while coding in TextMate.

      --
      Pluralitas non est ponenda sine neccesitate
    4. Re:How about the Built-in OS X spell checker? by mmarlett · · Score: 1
      It should be noted that some Mac programs, such as BBEdit, are also program-language aware. It not only uses the built-in OS spellchecker, but automatically doesn't mark properly spelled markup that would otherwise be caught in the spellchecker. So, code such as this:

      <body bgcolor="#FFFFFF" alink="#00FF00">
      will wind up with "bgcolor" and "alink" underlined in the standard system spellchecker, but not in BBEdit. I don't know how broad BBEdit is with that (the documentation only mentions html specifically), but one can also change the default dictionary to use Excalibur for TeX/LaTeX work.

      Note, however, that no spellchecker will catch homonyms or words that can be written in two words or one, such as "spell checker"/"spellchecker."
    5. Re:How about the Built-in OS X spell checker? by Random832 · · Score: 1

      OK, but is it smart enough to underline "bgcolr" if you typo for bgcolor?

      (yeah, that's what syntax highlighting is for - vim syntax highlighting, at least, isn't smart enough to catch if it's a valid attribute but doesn't belong to this kind of element, say, )

      --
      We've secretly replaced Slashdot with new Folgers Crystals - let's see if it notices.
    6. Re:How about the Built-in OS X spell checker? by Anonymous Coward · · Score: 0

      >> How about the Built-in OS X spell checker?

      We're talking about programming, friend.

      Actually, it works in XCode like everywhere else. I believe the joke is that no one programs on OS X, not that OS X can't spell-check code.
    7. Re:How about the Built-in OS X spell checker? by mmarlett · · Score: 1

      Yes, it is smart enough to underline bgcolr if you typo for bgcolor.

      It also color codes different parts of the tags. The default is blue for the tag itself (so "") and the properties in purple (such as "bgcolor=") and then a rust color for property values and gray for comments ... etc. And it handles much more than html, but it handles those things less rigidly. That is, if it is a php document and you use the function mysql_fetch_array() then it will color code to blue. PHP lets you make your own functions, but BBEdit may not know what those are but still must let those functions be created without fuss, so if you were to type mysqlfetcharray() instead, it would neither mark it as misspelled nor color code it as blue, which is a polite way of saying that it's neither wrong nor right. The problem comes in remaining flexible without sounding alarms all the time -- it's very easy to make typos in custom function names. Also, if one uses html in a php doc (for example) the above syntax spelling starts to break down and it treats html code more generically and fails to start pointing out typos in markup tags. It probably assumes that the tags are for anything-goes xml tags, but I don't know. And I also don't know how good it is for this sort of stuff outside of html/php/perl/mysql, but it's very nice for me.

  3. Visual Assist by Anonymous Coward · · Score: 3, Informative

    Visual Assist for Visual Studio does this.

    Next silly question, please.

    1. Re:Visual Assist by Anonymous Coward · · Score: 1, Informative

      No, it doesn't. See listed spelling features. It will spell check normal language (looks like only comments) and highlight *mistyped* symbols, not mispelled symbols.

      Next wrong answer, please.

    2. Re:Visual Assist by nietsch · · Score: 4, Funny

      Please don't use the names of the tools the beast of Redmond uses to stupify the world. This is /. after all, if you have to code on/for windos, then please be humble and shy about it.

      --
      This space is intentionally staring blankly at you
    3. Re:Visual Assist by somersault · · Score: 3, Funny

      Yes. You must not speak of the-one-who-rhymes-with-masturbates, or he will cast an unforgivable curse on your machine: puteulanus fenestra mortalis!

      --
      which is totally what she said
    4. Re:Visual Assist by shird · · Score: 1

      It points out spelling mistakes in "strings" but not variable names. ie, it won't point out that the variable lAnsIdx is spelt incorretly, like the submitter is asking for, that would be just stupid.

      --
      I.O.U One Sig.
    5. Re:Visual Assist by nietsch · · Score: 1

      please excuse my ignorance, but what would 'puteulanus' mean? Something with ladies of the night in it? (~puta*)
      Oh , it just blue...

      --
      This space is intentionally staring blankly at you
    6. Re:Visual Assist by gnasher719 · · Score: 2, Interesting

      '' It points out spelling mistakes in "strings" but not variable names. ie, it won't point out that the variable lAnsIdx is spelt incorretly, like the submitter is asking for, that would be just stupid. ''

      Comments like this make me wonder. Is it so hard to imagine a spelling checker for say the C language that finds words that were not written the way they were intended? Limiting yourself to correct English words for identifiers is stupid. Assuming that a spelling checker for a programming language would do that is about ten times more stupid.

      The problem is that the market for such a spelling checker is much smaller than the market for a spelling checker for natural language, so nobody bothered writing one. The other problem is that correction is much, much more difficult.

    7. Re:Visual Assist by shird · · Score: 1

      Well Visual Assist will 'squiggly red underline' variables that have not been defined. eg:

      int lAnsIdx(0);
      lAnsIndex++;

      the lAnsIndex will be marked as a 'spelling error'. I guess you could use something like a modified lint to ensure that your naming convetion is followed (for eg. hungarian naming convention).

      --
      I.O.U One Sig.
    8. Re:Visual Assist by Jugalator · · Score: 1

      True, but it's no wonder neither Eclipse nor VA does that though. It can't be too common that won't give a huge chunk of false positives... Often, variables are abbreviated in more or less funny ways to not become too long. I think language awareness only in comments is a good compromise here.

      --
      Beware: In C++, your friends can see your privates!
    9. Re:Visual Assist by R3d+Jack · · Score: 1

      Visual Studio has a lot of nice features, and you do well to point them out. But not everyone has turned to the Dark Side, frequently for business reasons. Therefore, your "silly question" comment reflects more upon you than upon the questioner.
      BTW, has M$ gotten around to adding code validation as you type to C#? I only have VS 2003, and the lack of that validation was beyond annoying.

    10. Re:Visual Assist by lanthar · · Score: 3, Informative

      It is important to note that with a large code base, Visual Assist is noticing any time you have a variable or function name that it can't find anywhere else, and highlighting it with the red underline. This is in addition to turning the various keywords, macros, #defines, class names, function names, member variable names, nonmember variable names, and other such things all into their own colors. Granted, if you misspell something everywhere, then it will highlight correctly, and not indicate a problem. It's still a simple thing to notice it and bulk find/replace a string in all files in your project/solution/directory/etc. If you are a walking spellchecker like me, you'll be glad you've made your whole group install it. Also the extra droplists it provides, the wonderful shift insert droplist of previous copy/paste entries, and a variety of other great features will all make you happy to pay the tiny registration fee for each programmer on your team. I'd say it saves me at least 30 minutes of digging through our 2 million lines of code to remember how someone capitalized something or which spelling or abbreviation to use. -A very satisfied VA customer who recommends it to every VS programmer he knows

    11. Re:Visual Assist by Jerry+Coffin · · Score: 2, Informative

      See listed spelling features. It will spell check normal language (looks like only comments) and highlight *mistyped* symbols, not mispelled symbols.

      Just FWIW, it checks typing in both comments and (perhaps more importantly) string literals. It's also "intelligent" enough to know (for example) that '%d' should not be treated as a problem in a string literal. It is true, however, that symbols that are misspelled don't get highlighted, provided the misspelling is consistent.

      --
      The universe is a figment of its own imagination.
    12. Re:Visual Assist by Anonymous Coward · · Score: 0

      Interestingly Visual Assist is not a tool produced by the Beast Of Redmond, it is a third party add-on to make Visual Studio a tad less unbearable.

      Mostly it provides features you would have hoped were in the IDE already!

    13. Re:Visual Assist by TheGreatGonzo · · Score: 1

      So what happens if you program in multiple languages on multiple platforms?? Does that mean you can not read /.?? I mean i write c#/c++, web, xml, sql etc during the day for my paid job and am active in Linux development (C, C++ and Ruby etc) in my own time so can I only comment on the Linux based development I do?? Grow up!! I am as much against Microsoft as the next "proper" developer but some of us got our break in MS development and haven't managed to escape yet!!

      --
      Oh, uh, good question. Now technically speaking, uhh, let's say, put me down as a... 'Whatever'?
    14. Re:Visual Assist by CastrTroy · · Score: 1

      Plus what happens when code is shared between developers. Does the ignore list on spellings get stored in the repository with the rest of the code? What happens with some developer checks in a list with some words added that shouldn't be there?

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    15. Re:Visual Assist by arkanes · · Score: 1

      Tools like VA actually tend to encourage spelling mistakes in some (many?) cases because when you spell it wrong the first time, VA (and other code completion tools) will faithfully repeat the mistake all the places where you use it.

    16. Re:Visual Assist by multipartmixed · · Score: 1

      > I'm not associated with Whole Tomato, but if anyone from WT sees this, can I have a free subscription :-)

      Sure thing. You'll need to send me your credit card number for, ah.. age verification.. though.

      --

      Do daemons dream of electric sleep()?
    17. Re:Visual Assist by Anonymous Coward · · Score: 0

      No, but theres always ReSharper...

    18. Re:Visual Assist by Anonymous Coward · · Score: 0

      Whoosh.

      How's that Aspergers working out for you?

  4. How about eyeball Mk 1? by uucp2 · · Score: 5, Funny

    Some people call using it a "code review". If you are really serious about it, post the code to /. - plenty of people here seem to have time to point out any spelling errors.

    1. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 5, Insightful

      Um, let me introduce you to the famous spelling mistake: HTTP Referer. How about we let computers and people each do what they're good at. Computers are good at comparing strings in a spell checker, and people are good at producing typos, spelling mistakes, and approving fixes. Discipline isn't the solution, better tools are. (I bet there's a spelling mistake in here -- which proves my point that Opera needs a spell check like Firefox!)

    2. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 0

      Some people call using it a "code review". If you are really serious about it, post the code to /. - plenty of people here seem to have time to point out any spelling errors. We tried to solve this problem by hiring a /. spelling nazi but he quit because he didn't couldn't handle having a lower social rank than the drones in the marketing department.
    3. Re:How about eyeball Mk 1? by iapetus · · Score: 5, Insightful

      You're aware of the concept that a bug is cheaper to fix the earlier you spot it? If it's flagged up as soon as it happens I have to rename that one variable in one place, and I can do it at virtually no cost. If it's flagged up after I've finished the work and committed it for review, then I'll need to change it across multiple files (sure, an IDE will do refactorings like that in most cases, but there can be side effects) and recommit. That's a far greater expense.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    4. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 0

      Sadly, Eyeball 1.0 is incompatible with Stupidity 1.0, unless you install the education hotfix. And you all know how diligent most people are with applying patches...

    5. Re:How about eyeball Mk 1? by jellomizer · · Score: 1

      I would think they are use to it by now.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    6. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 0

      I have to agree with you here. More often than not, bad programs are caused by errors in code (genetic, not computer).

    7. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 1, Insightful

      Some people call using it a "code review". 1) Yes, if he cares about others reading and using the code, perhaps he should get them involved in the review process earlier.

      2) If it is that big of a problem, he's probably writing too many LoC. Refactor, reuse, learn patterns. Learn a better language.

      3) Maybe he should document his API. It's pretty hard to get a spelling mistake through when your whole team has the whole API automatically documented in HTML on your intranet.
    8. Re:How about eyeball Mk 1? by asc99c · · Score: 5, Funny

      I bet there's a spelling mistake in here
      That's a good bet in a post explicitly pointing out a famous spelling mistake :)
    9. Re:How about eyeball Mk 1? by 19thNervousBreakdown · · Score: 1

      I have scar tissue in my brain from the number of fights occurring in my head over that one.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    10. Re:How about eyeball Mk 1? by SilentChasm · · Score: 2, Informative

      Opera does have a spell check in it. You right click on the text box and select "Check spelling". http://www.opera.com/support/tutorials/opera/spell check/index.dml

    11. Re:How about eyeball Mk 1? by Hal_Porter · · Score: 2, Funny

      Excuse me, as a National Socialist I find the term "spelling Nazi" offensive. Couldn't you say "spelling Jew" instead?

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    12. Re:How about eyeball Mk 1? by R2.0 · · Score: 1

      "which proves my point that Opera needs a spell check like Firefox!"

      I have to use IE at work , you insensitive clod!

      (And, before someone points it out, I'm too cheap to buy a flash drive)

      --
      "As God is my witness, I thought turkeys could fly." A. Carlson
    13. Re:How about eyeball Mk 1? by waterford0069 · · Score: 1

      Have you ever been in a "code review" with a spelling-Nazi, reviewing the code of a dyslexic? Cripes, they get all red in the face, and then you get a 1/2 hour long lecture on how they never make spelling mistakes, and all it takes is just a little concerted effort (i.e. the dyslexic is lazy) and they could be as perfect as the spelling-Nazi. (Note: Godwin's Law is not in effect here, because I have to likened the poster to a Nazi)

      It's just an exercise in pain. Build a spell checker into your IDE that can see word breaks for underscores, hyphens, and camel-case and you can relieve so much pain.

    14. Re:How about eyeball Mk 1? by PCM2 · · Score: 1

      Computers are good at comparing strings in a spell checker, and people are good at producing typos, spelling mistakes, and approving fixes.

      On the hole your write -- computers are better then nothing -- butte computers don't always sea every mistake. Humans are good it thinking. Sum should try it sum thyme. The best weigh to avoid spelling arrears is to reed more and improve you're vocabulary.

      --
      Breakfast served all day!
    15. Re:How about eyeball Mk 1? by MrR0p3r · · Score: 1

      "I mean, say what you like about the tenets of National Socialism, Dude, at least it's an ethos." - Walter Sobchak

      --
      Whatever man, I spelled it write!
    16. Re:How about eyeball Mk 1? by griffjon · · Score: 1

      HTTP Referer

      Yeah, they really meant; "HTTP Reefer-er"

      --
      Returned Peace Corps IT Volunteer
    17. Re:How about eyeball Mk 1? by lazybeam · · Score: 2, Insightful

      What? I seriously thought "referer" was how people in the US spelled "referrer". You guys drop double letters from other words so it makes sense. :) I'm talking about "canceled" looking like a funny version of "cancelled".

      --
      --
      no sig for you. come back one year.
    18. Re:How about eyeball Mk 1? by jtcm · · Score: 1

      Opera needs a spell check like Firefox!

      This post was spell-checked with the Opera spell checker. You have to install GNU Aspell separately (except on OS X where it Just Works(TM)), and the interface is rather mediocre, but it gets the job done.

      I like Firefox's spell checker better; it's one of the (very) few areas where Firefox is better than Opera.

      --
      @ASP.NET's parent-teacher meeting: "Little Johnny.NET is very bright, but he doesn't play well with others."
    19. Re:How about eyeball Mk 1? by gfxguy · · Score: 1

      It's the "real" Murphy's law... "Whatever can go wrong, will go wrong" is not an accurate representation of what Murphy really said. He basically said that if there's a wrong way to do it, someone will do it the wrong way.

      So yes, if you leave it entirely up to the programmers to be disciplined, you will always stumble across mistakes. But that's true even with highlighting... just because it's highlighted doesn't mean someone will find it or bother to correct it.

      The biggest problem is exposing your sloppiness to the world with typoes and mispellings in the UI, which is one of the problems the article poster mentioned. Surely any advanced editor can check quoted literals...

      Also, for any sufficiently large program (in size or scope), shouldn't the UI labels and so forth be referrenced in an external document that can more easily be checked and corrected?

      --
      Stupid sexy Flanders.
    20. Re:How about eyeball Mk 1? by kalirion · · Score: 1

      I know the feeling. The codebase I'm maintaining has plenty of spelling errors in the logs, and even in the reports it sends out to support teams. It's annoying, but to fix it you first have to open a ticket, get approval from QA that they can support it in the next release, etc etc. And its all internal software anyway, so the clients never see it. So the spelling errors remain.

    21. Re:How about eyeball Mk 1? by iapetus · · Score: 1

      Informal process here is that spelling mistakes get fixed if there are also other issues raised by the review or if they're sufficiently egreejuss [sic], but not if they're the only thing caught by the code review and they aren't that significant. Obviously this doesn't apply to open APIs. ;)

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    22. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 0

      We tried to solve this problem by hiring a /. spelling nazi but he quit because he didn't couldn't handle having a lower social rank than the drones in the marketing department.
    23. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 0

      I would think they are use to it by now.
    24. Re:How about eyeball Mk 1? by Anonymous Coward · · Score: 0

      Off-topic, but Opera *does* have spell checking functionality if you have Aspell installed on your system. Simply right-click on a text field (such as this comment textarea) and click "Check Spelling".

    25. Re:How about eyeball Mk 1? by cyborch · · Score: 1

      Aside from the obvious Opera plug, how does this relate to spell checking source code?

    26. Re:How about eyeball Mk 1? by papercrane · · Score: 1

      Ugh...I like the idea of a spell checker but I turned Firefox's off within a few hours. Have you ever tried pasting large amounts of code or XML into a slow spell checker? Not fun.

  5. Quick! by Anonymous Coward · · Score: 0

    Patent this idea!

  6. simple by Bizzeh · · Score: 0, Troll

    the easy thing to do, is to just spell things correctly in the first place.

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

      [...] If I was you, I'd kill myself. Please, don't let that stop you.
    2. Re:simple by Anonymous Coward · · Score: 0

      Better yet have your users to do what the code does in there head. Even simpler for you.

    3. Re:simple by YttriumOxide · · Score: 4, Insightful

      It's not so simple when you're not the one writing the code, but have to deal with the results. There's an SDK that I use as a part of my job, developed by our head office in Japan - it's a set of C# classes, and nothing annoys me more than typing "Connection foo = new Connection();", then noticing Visual Studio isn't highlighting it as I'd expect. Hunting around for anywhere up to a minute and eventually finding out it is actually "Conectin" instead of "Connection". If there were a good "programmers spellchecker", I may not need to use it myself, but I could give it to my Japanese colleagues to make MY life easier! (note: the above example is fictitious, but is an illustration of the type of error that I deal with that this would prevent)

      --
      My book about LSD and Self-Discovery
      Also on facebook as: DroppingAcidDaleBewan
    4. Re:simple by Anonymous Coward · · Score: 0

      If I was you, I'd kill myself.

      If I couldn't use the subjunctive properly, I'd kill myself.

      It's were, not was, you ignoramus!

    5. Re:simple by MagikGimp · · Score: 1

      By saying this am I right in also assuming that you never make mistakes with your coding either? Or are you trying to say that mastery of the English language is a much simpler skill than that of programming? Either way, I'm still a bad speller but I know I'd much prefer to brush up on good coding practice than start training for the next spelling bee... but that's just me.

    6. Re:simple by Anonymous Coward · · Score: 0

      There's an SDK that I use as a part of my job, developed by our head office in Japan
      The real WTF is right there.
    7. Re:simple by YttriumOxide · · Score: 1

      When you work for a business equipment (read: "Photocopier") manufacturer, having your head office in Japan tends to be pretty normal!

      --
      My book about LSD and Self-Discovery
      Also on facebook as: DroppingAcidDaleBewan
    8. Re:simple by Flwyd · · Score: 2, Insightful

      Remember... your code will run faster if you remove some, but not all, vowels from your variable names.

      To the original question: is strncpy misspelled? What about foo? sqrt? exp? Impl? Programese has an interesting linguistic history and its lexicon contains much not found in English.

      While misspelled variable and function names are annoying, a refactor tool and a compile make them relatively painless. Perhaps the best approach would be to take your API documentation, run a script to split CamelCase and words_with_underscores, then feed that document to the spell checker. If it's not in your public API, it shouldn't matter how it's spelled.

      Also, externalize your strings so that people with English writing training can write your field labels and error messages. Even programmers who spell check strings often misgrammarize them.

      --
      Ceci n'est pas une signature.
    9. Re:simple by Gutboy · · Score: 1

      What are you looking at while you are coding? Intellisense would have quit displaying anything as soon as you made your 'mistake', thus you'd know there was something wrong. "Hunting around for anywhere up to a minute" just makes it seem like you are either copying someone elses code (since you aren't looking at the screen) or have no idea how your IDE tool works.

    10. Re:simple by Mr+Z · · Score: 1

      Let me guess. Your approach to debugging is to write bug free code, and your keyboard doesn't even have a backspace key.

      ;-)

    11. Re:simple by Anonymous Coward · · Score: 0

      Clearly, what you need to do is wrap the Japanese SDK in an API of your own that translates your correctly spelled calls into the nonsense that comes from head office.

  7. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by monk.e.boy · · Score: 0, Troll

    WTF is this guy on? So now 90% of my code will have red squigglies under the variable names?

    i=0;

    So now the 'i' has a red underline?

    That is the most nuts thing I ever heard. The spell checker would need to be sentient to figure out the rules.

    Hey, I got a good idea - LEARN TO SPELL.

    monk.e.boy

    (all spelling mistakes in this post were intentional ;-P )

  8. May I suggest.... by mark-t · · Score: 2, Funny

    .... that if you want your code to read like english, you consider a language like COBOL? Not that it would help you with spell checking, per se... but if one is going to be so pedantic about making sure that their procedure names can be found in an actual english dictionary why not go the whole 9 yards and write the whole program that way?

    1. Re:May I suggest.... by DarkSkiesAhead · · Score: 5, Insightful

      if you want your code to read like english, you consider a language like COBOL? Not that it would help you with spell checking, per se...

      Responses like this entirely miss the point of the question. Same with the "just review your code" responses. It's not a matter of making the language more readable. It's a matter of making the code more usable. Certainly, correct spelling is pointless without other elements of good code practice. However, bad spelling can add a lot of frustration.

      I joined a project which already had a few misspelled class names. I'm a fast typer and often I've typed out more of a filename than is spelled correctly before hitting tab to complete the name. Needless to say, I've been trained to hit tab earlier for a few choice files. But it's certainly been an irritation. Similarly, I've been confounded more than once when a function or variable couldn't be found by the compiler, only to realize that I'd spelled a word correctly rather than how the actual name was spelled.

      We choose to use English words for our class, function, and variable names for a reason. That reason is mostly defeated by misspelling the English word. A dictionary is a great idea, even for coding languages that don't "read like English".

    2. Re:May I suggest.... by Splab · · Score: 3, Insightful

      Also people tend to miss that our brains are very good at correcting spelling mistakes as we read, doing code review trying to catch spelling mistakes can be very tough.

    3. Re:May I suggest.... by MythMoth · · Score: 1

      Hear hear.

      Incorrect spelling in code causes all sorts of minor confusion - I'd love an Eclipse plugin to address this.

      --
      --- These are not words: wierd, genious, rediculous
    4. Re:May I suggest.... by Bastard+of+Subhumani · · Score: 1

      our brains are very good at correcting spelling mistakes as we read
      But they're not so strong at spotting jokes, it seems.
      --
      Only three things are certain; death, taxes, and apocryphal quotations - Ben Franklin.
    5. Re:May I suggest.... by evanbd · · Score: 3, Insightful

      It strikes me that the problem is that most spell checkers try to check everything, and that a lot of code has things that really shouldn't be spell checked at all, mixed with things that should. I imagine that one way to start would be to only alert on those errors that are almost correct -- if it looks like garbage, ignore it, but if it's close, assume it should be right. Perhaps ignore prefixes / suffixes as well -- pSomething is fine, pSometihng isn't. Also, CamelCase ought to be easy enough to detect -- treat it as word boundaries, and spell check the individual words. Again, egregious misspellings probably aren't -- nextObjFoo is ok, even though Obj isn't a word -- it's so far from being a word that we assume the programmer meant it that way.

      Similarly, there should probably be a set of words added that aren't "English" but are used often enough to be worth adding to the dictionary. Things like Obj, Int, and Ptr.

      I think the reason such spell checkers don't exist already is fairly simple -- everyone just assumes they're impossible, and doesn't try. Couple that with the fact that a mediocre quality one would be so annoying as to be worse than useless, and you have a recipe for a program that won't get written. I don't think either of those would have to be the case if someone sufficiently clever decided to attack the problem, though.

    6. Re:May I suggest.... by jellomizer · · Score: 1

      Quite Ture^h^h^h^h^h True. Most of the time when I cam coding and I need to copy a variable name or a quite I just copy and paste it. Making all the spelling misstates consistent throughout the code.

      eror: 312 varible naim mispelled

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    7. Re:May I suggest.... by KiloByte · · Score: 1

      Or better, let people add such "words" with a couple of keypresses/clicks.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    8. Re:May I suggest.... by dan+the+person · · Score: 1

      Similarly, I've been confounded more than once when a function or variable couldn't be found by the compiler

      Why don't you right click on said function and choose Refactor -> Rename, or whatever the equivalent is in your IDE?

    9. Re:May I suggest.... by asc99c · · Score: 2, Insightful

      It's not about code reading like English, but more about it being easy for another coder to work with. One of my co-workers is a brilliant coder but poor at spelling. While customising a standard project component he had written I was thoroughly impressed by how well thought out and tightly coded everything was.

      Unfortunately when I tried to compile my customised version, there were hundreds of errors, the majority of which were where I had spelled words correctly. Mostly I fixed these by changing the spellings in my code, but there were a couple of places where I'd somehow ended up with compilable code that was using the wrong variable, resulting in run-time crashes.

      The difficulty is, any spell checker would have to realise that TcpRcv, TcpRcvr, probably even TcpRecvr are valid abbreviations, but TcpReciever is a spelling mistake. I think rather than looking at whole words, it would probably have to look for problematic sequences of letters, such as 'cie' which should almost always be 'cei'.

    10. Re:May I suggest.... by vtcodger · · Score: 1
      ***I think the reason such spell checkers don't exist already is fairly simple -- everyone just assumes they're impossible, and doesn't try.***

      I'm on your side. It seems to me that a compiler with no object output that flags syntax errors and passes comments and strings to a normal spell checker would do the job. Not a trivial thing to implement. May not too feasible with Interpreted languages and those that depend largely on run-time checks. But still, I think it could be done with C, Java etc.

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
    11. Re:May I suggest.... by R3d+Jack · · Score: 1

      You must write code only for your own use. My first job was with a software company that actually provide support and access to their source code. They were fanatic about everything, from formatting to spelling to writing comments using complete sentences. Their reasoning was that they sold their package to business executives, and they wanted everything about their product to be professional. Their customers also modified their code extensively, so it wasn't as if no one was looking. My point is in addition to the one made by others, that working with code filled with misspelled names is a pain in the aft.

    12. Re:May I suggest.... by Anonymous Coward · · Score: 0

      The whole idea is flawed from the start. For example in Java, they can't even spell colour properly. How am I supposed to honour my spelling responsibilities when they won't? So do me a favour and find a real problem to work on, like something to convert litres to hogsheads or such.

    13. Re:May I suggest.... by Anonymous Coward · · Score: 0

      Even the English have trouble spelling the American COBOL keywords right, and it's their language.

    14. Re:May I suggest.... by Anonymous Coward · · Score: 0

      As a Lisp programmer, this whole discussion is weird to me. Just add the Lisp builtins (defun, defmacro, ...) to your personal dictionary, and use a normal spell-checker.

      Why do you have *any* identifiers that "look like garbage"?

    15. Re:May I suggest.... by tknd · · Score: 1

      Perhaps ignore prefixes / suffixes as well -- pSomething is fine, pSometihng isn't.

      I'd say a better solution is to have the spell checker hook into the parser to add identifiers (function names, variable names, class names) and language keywords to the dictionary. The only time it would then fail is commented-out code blocks.

    16. Re:May I suggest.... by mark-t · · Score: 1

      The word colo[u]r can often be legitimately spelled either with or without the 'u', as long as one is consistent within the scope of a single work. Both spellings are found in an english dictionary, after all. The fact that Java uses the shorter form arguably reduces the number of keystrokes necessary to type it and shortens programs that might heavily utilize it without obfuscating the identifier's purpose or identity at all, which I would think makes it a very good choice for an identifier name.

    17. Re:May I suggest.... by Trillan · · Score: 1

      I think the reason such spell checkers don't exist already is fairly simple -- everyone just assumes they're impossible, and doesn't try. Couple that with the fact that a mediocre quality one would be so annoying as to be worse than useless, and you have a recipe for a program that won't get written. I don't think either of those would have to be the case if someone sufficiently clever decided to attack the problem, though.

      I think one of the flawed core assumptions is actually "a mediocre quality one would be worse than useless." Rather, one that generated a lot of false errors would be worse than useless. One that missed some misspellings - even, say, up to 90% - well, it would still be better than not having anything at all. I'm sure we could get better accuracy than 10% relatively quickly. The trick would be growing the accuracy from there.

    18. Re:May I suggest.... by Anonymous Coward · · Score: 0

      Although the next time I see somebody spell "kernel" in code as "kernal" I think I'm going to scream. Actually, I *know* I'm going to scream - the part I'm worried about is what *else* I'm going to do.

    19. Re:May I suggest.... by Televiper2000 · · Score: 1

      I think it's more a fact that spelling checking is only effective on a small portion of the source code. The compiler will pick up most of your errors, and after that your source code is internal and not subject to customer scrutiny. So you're left with comment code, and variable names that you managed to spell wrong consistently.

      I think it would make more sense to have something more advanced checking your variable names, and class names. Something that you can teach to check formatting, naming conventions and spelling. It seems that matching the prefixes, and suffixes is just as critical as spelling the variable name correctly. It would be nice to not have to debug code that has no prefixes.

      --
      New! Device Legs: These legs will help your poor OEM installed product escape any hamfistedness it may encounter. Ava
    20. Re:May I suggest.... by Anonymous Coward · · Score: 0

      must pepole do not use corect english 4 varible usaly they shorten them or do some other weird thing to them ;-)
      if u had a programing spell checher it should only chec coments and words betwen ""

  9. Sounds like a good idea by PhrostyMcByte · · Score: 4, Interesting

    And not too hard to implement - all you need is a lexer and a few functions to classify different naming styles. lexertl even comes ready with a full example for C++, so get to it ;)

    1. Re:Sounds like a good idea by Xiph · · Score: 1

      This could possibly make it a lot easier to change between different naming conventions.
      possibly even do cross convention linking.

      I now have a new uni-project i care about :) Though it would be a shame to end a perfectly good flamewar...

      maybe i should implement it in emacs.

      --
      Blah blah sig blah blah blah irony blah blah
    2. Re:Sounds like a good idea by Gordonjcp · · Score: 1

      Isn't that basically what syntax highlighting does anyway? A simple heuristic for a programming spellchecker would be "Did I highlight it? No? Well I'll spellcheck it, then" with a suitable syntax dictionary and language dictionary. Initially certain words wouldn't show up in the language dictionary, but you'd add "setDictPath" when you define it. A quick bit of code review to make sure that no mis-spelt words get into the dictionary, and you're done.

    3. Re:Sounds like a good idea by cartmans_trapperkeep · · Score: 1

      Every compiler I have ever used has a pretty good spell checker built right in--in fact, not only does it spelling matter, but the syntax must be correct too. A spell check for programming seems like a waste of time.

    4. Re:Sounds like a good idea by The+MAZZTer · · Score: 1

      But how will he spellcheck the code for his spellchecker before he's done writing it? :(

    5. Re:Sounds like a good idea by Jeremi · · Score: 1
      Every compiler I have ever used has a pretty good spell checker built right in--in fact, not only does it spelling matter, but the syntax must be correct too. A spell check for programming seems like a waste of time.


      The compiler only checks to see if the name in the code matches the name in the declaration. It won't catch any typos that are in both places (e.g. because the programmer can't spell). The suggestion here is to check the names against an English dictionary (somehow).

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    6. Re:Sounds like a good idea by sticky.pirate · · Score: 1
      I think the hardest part is not finding mis-spelled names, but badly chosen ones.

      Assuming they do the same thing, which declaration do you think is worse:

      void removeFiel (const char *fileName);

      or

      void function25(void *a);

  10. Good Idea by Anonymous Coward · · Score: 0

    But not, I think, significant enough to warrant a separate program or IDE plugin.
    It would certainly be a "pleasant surprise" addition in a new Visual Studio / Eclipse release, but I wouldn't hold my breath.

  11. Keep text in dedicated files by oliderid · · Score: 1, Insightful

    Anything that may appear in a user Interface should be kept in dedicated files. Use a standard format such as CSV, XML...It may be reviewed by non-technical people with built-in spell checker software such as excel. This is a trick mainly use for multilanguages project, but it really helps.

    1. Re:Keep text in dedicated files by Kjella · · Score: 1

      ...which is an interesting problem, but really a different one. If you look at his example, he's talking about botched function names etc. which really is code. User-visible text is usually spellcheckable in whatever format is being used to do translations. And if you hardcode English everywhere, then well... you're probably not interested in this kind of quality-enhancing tools to begin with.

      That said, I rarely see this as a big problem unless it's a very static internal interface. Pull the whole code tree, change function call and whatever's calling it, post a diff for "spelling correction". It's a function name, it's not even remotely important to the functioning of the code.

      --
      Live today, because you never know what tomorrow brings
    2. Re:Keep text in dedicated files by Roofus · · Score: 2, Informative

      If you maintain a library that is used by customers, that would be a *very* big issue. You just broke backwards compatibility for a spelling fix.

      Overall, the answers to the submitters question are absolutely horrible so far. If the tool he's searching for doesn't exist, it damn well should.

    3. Re:Keep text in dedicated files by pasamio · · Score: 1, Redundant

      The solution to this is simple, you use the Microsoft approach which is to keep old names of the functions around and wrapper them to the new names in the hope that people will start using the new name instead of using the old name. That said it shouldn't have been a problem anyway. I have translators who email me reminding me my English has mistakes from time to time (last one was writeable/writable, writable is supposed to be the right one but both come up as spelling errors in Safari anyway) so having a spellcheck intelligent enough to catch some things would be useful.

      --
      I always wondered where this setting was...
  12. vim 7.0 anyone? by Janek+Kozicki · · Score: 2, Insightful

    I particularly like the spelling feature in new vim, right-click menu (:set mousemodel=popup) to select a corrected word or remember current word as correct. Perhaps writing a vim plugin as you explain could be possible? I'd be very glad to use it too ;)

    --
    #
    #\ @ ? Colonize Mars
    #
    1. Re:vim 7.0 anyone? by eneville · · Score: 1

      z= if you have no mouse :-)

    2. Re:vim 7.0 anyone? by SolitaryMan · · Score: 1

      Yep, me too. Especially I like that it is aware of comments and text zones and spell checks them as you write the code. It can also check the spelling of function names, if you use underscore_to_separate_words. As for a code spell checker, it is pretty good.

      --
      May Peace Prevail On Earth
    3. Re:vim 7.0 anyone? by shoban · · Score: 1
      Not to start a flame war, XEmacs and possibly Emacs provides a lisp function

      isepll-comments-and-strings
      . Though not complete, it restricts itself to spell check your strings definitions and comments.
  13. Editors with a spell checker by Peter_JS_Blue · · Score: 1, Informative
    On most Linux or BSD distros there is an editor called Kate. This has a spell checker built-in.

    This isn't quite what you want because you have to select the text to be checked but its better than nothing !

    Hope this helps

    --
    Art Makers Just an excuse to show photos of naked women !!
    1. Re:Editors with a spell checker by Constantine+XVI · · Score: 1

      And for GNOME users, there is GEdit (aka "Text Editor"). It uses the GNOME spell checker, and has auto spell checking if you switch it on.

      --
      "I think an etch-a-sketch with an ethernet port would beat IE7 in web standards compliance."
  14. vim 7 does this by sashang · · Score: 1

    Vim 7 does this for c/c++ code. Just turn on spelling (something like :set spell) and it picks out spelling mistakes in comments and strings.

    1. Re:vim 7 does this by Arimus · · Score: 1

      I think the OP wants more than the text displayed as output to be spell checked, things like badly spelt function names - e.g. verifySigniture( * ) should be flagged...

      --
      --- Users are like bacteria -> Each one causing a thousand tiny crises until the host finally gives up and dies.
    2. Re:vim 7 does this by jj421 · · Score: 1

      Vim's on-the-fly spell checking is particularly well suited to programming. When syntax highlighting is enabled, it will only check the spelling of comments and strings. Try ':help spell' for more information.

    3. Re:vim 7 does this by Anonymous Coward · · Score: 0

      nobody cares about spelling of comments, since most people don't read them

      What the poster (and me too) cases is spelling of identifiers.

    4. Re:vim 7 does this by Random832 · · Score: 1

      Yeah, but the feature this post is asking for is for it to pick out spelling mistakes in _identifiers_.

      --
      We've secretly replaced Slashdot with new Folgers Crystals - let's see if it notices.
    5. Re:vim 7 does this by Anonymous Coward · · Score: 0

      Vim 7 does that too, and in a fully configurable way, for any possible language you may come up with.

      It's a shame that it doesn't know how to properly split wordsInCamelCase, though. A configuration setting to establish the naming scheme would be neat.

  15. should be fairly simple to implement by BoxedFlame · · Score: 2, Interesting

    A small script to split up camelCase into seperate words, then feed the result through a normal spell checker. Then after that just whitelist certain words like maybe "m" as found in "mSomeVariable".

    1. Re:should be fairly simple to implement by Anonymous Coward · · Score: 0

      A small script to split up camelCase into seperate words

      ...or even split them into separate words.

      (some mornings, I can be such a dick.)

    2. Re:should be fairly simple to implement by SpinyNorman · · Score: 1

      Agreed - should be a simple awk script.

      1) Generate (line number, identifier) pairs to pass to spell checker function

      2) Split identifiers into words based on chamgeOfCase or embedded_underscores [("chamge"), ("of"), ("case")]

      3) Do word lookup in standard dictionary first then private jargon/etc dictionary [("chamge", fail), ("of", pass), ("case", pass)]

      4) Use simple pattern matching to score results (e.g. [("m", fail), {(, pass}] -> OK

      5) Report errors in terms of source line (then use sed/whatever to fix them)

      If you can't implement this in a day then switch career.

    3. Re:should be fairly simple to implement by SpinyNorman · · Score: 1

      Just a brief follow-up:

      The pattern matchine step can be real simple - in practice the only place where you might want to allow non-words is as a prefix or suffix allowed by your naming convention, so you can just have a table of the ones that you will allow - can just put this in a text file and suck it into awk.

      You could also enhance it with an exceptions file of identifiers that would otherwise fail but that you are explicitly going to allow.

  16. It's a good question ... by YeeHaW_Jelte · · Score: 4, Interesting

    We've got code here that refers to 'insurrances', 'insurances', 'insurrences' and 'insurences', I'm not kidding.

    People here making fun of his request and saying that this should be set in stone in design documents, or be checked in peer code reviews are obviously not working in a run-of-the-mill software company where there's neither the inclination nor the time to do everything the formal way. Also, I have to see the first design document that correctly enumerates all the requirements for the software, let alone all the names for the variables to be used.

    --

    ---
    "The chances of a demonic possession spreading are remote -- relax."
    1. Re:It's a good question ... by Corporate+Troll · · Score: 5, Informative

      As a non-native English speaker, working in a non-native english speaking team (mainly french speaking people) it is a real problem. The biggest problem happens when you search something and don't find it because you wrote it right and your coworker wrote it wrong. (Or the inverse, I don't claim to be perfect in English)

      Sure, you might say, "Write your code in French", but that's not a solution. My mother tongue is Dutch, we have a German coworker, and you never know if the next guy will be Italian. There is also this team that has to maintain code written by Spanish people.... in Spanish.... and they don't know Spanish. Fun times, if you like to hear them curse....

      In multilingual environments this problem increases drastically.

    2. Re:It's a good question ... by Anonymous Coward · · Score: 0

      I once named a var sampleCunt instead of sampleCount, resulting in much mirth and out loud reading of code among my peers.

    3. Re:It's a good question ... by richie2000 · · Score: 1

      We've got code here that refers to 'insurrances', 'insurances', 'insurrences' and 'insurences', I'm not kidding. Obviously, you must ensure the correct spelling is used at all times, insuring yourself against the possibility of errors.
      --
      Money for nothing, pix for free
    4. Re:It's a good question ... by daeg · · Score: 1

      In the US we rarely run into any multi-lingual teams. I'm curious: do you write all of your code in English? I can't think of any languages that are designed to be written in a foreign language other than English ('pour i dans [1,2,3]:' instead of 'for i in [1,2,3]:'), so I guess it would always feel natural to me to write code in English. I've seen comments written in other languages and it seems very strange to read French comments and then go on to English keywords/constructs. Do the keywords of a language become natural when writing code in another language, e.g., does your brain adapt to writing 'for' instead of 'pour'? Curious indeed.

    5. Re:It's a good question ... by Corporate+Troll · · Score: 1

      Code typically is written in English because the syntax (=programming language) is always defined in English. So there is never a problem in the example you gave ("pour i dans" vs. "for i in"). However, function names can be whatever you want, so, yes, you can come across function names like "getAmortissement()", or "istFakturierbar()", or "doeIngewikkeldAlgorithme()".

      That said, I remember early VBA implementations that also translated the syntax. This resulted in incompatible sources and thus (for example) an English Excel file that could not be opened in a French Excel. That's a really long time ago.

      So, yes, people use function names and variable names in their own language, but, no, language constructs aren't translated. At least not in mainstream languages. Propitiatory languages like WinDev might...

      Most places I have worked, have the convention to code everything in English, but spelling mistakes creep in easily when it is a language that you don't know very well.

    6. Re:It's a good question ... by Corporate+Troll · · Score: 1

      :s/Propitiatory/Proprietary/g

    7. Re:It's a good question ... by Anonymous Coward · · Score: 0

      I once spelt 'Shutdown' as 'Shitdown'.

      The keys are like next to each other!

    8. Re:It's a good question ... by Anonymous Coward · · Score: 0

      names for the variables

      Variable names? Hell, how many labels and dialogs have you seen in software which had a misspelling? I've seen all sorts of comments about stuff that spellchecks my comments, but where the hell is the spellchecker for everything starting with " and ending with "? It's not that hard to figure out the difference between a string and a non-string.

    9. Re:It's a good question ... by parcel · · Score: 1

      :s/Propitiatory/Proprietary/g Looks like propitiatory might work in that context.
    10. Re:It's a good question ... by fmoliveira · · Score: 1

      I write comments, variables and functions in my own language. I think writing english, without any coherent reason, to be pretty lame. Like some people trying to show off they can write english, and usually a pretty ugly english.

    11. Re:It's a good question ... by Chrisq · · Score: 1

      That was a real problem for a dyslexic like me in early basics, which did not have "option explicit".

    12. Re:It's a good question ... by Jay+L · · Score: 1

      We've got code here that refers to 'insurrances', 'insurances', 'insurrences' and 'insurences', I'm not kidding.

      I believe it. A very early Q-Link programmer (or perhaps even a PlayNet programmer) couldn't spell "certificate" properly. As a result, all login and registration code for the next ten years had to access "cirtificate.db", because it was too embedded to change easily...

    13. Re:It's a good question ... by Nik13 · · Score: 1

      Not the GP, but I'll answer anyways, being in the exact same situation.

      Yes, the code itself is always written in english (things like like a "for" loop are never translated to "pour" -- the language stays the same). What changes is the naming of all the variables, functions and comments.

      We keep it all in english as well, because everybody knows it half decently -- all around the world (not just our shop, but also customers and anyone else who might eventually use it). I don't find french to be real good at technical stuff either, they generally try to translate some common computer terms, but they sound just weird to me, or sometimes they just seem devoid of any sense, or extremely verbose (e.g. "trackball driver" becomes "gestionnaire de peripherique de dispositif de pointage a bille" -- WTF?). Also, I always have my keyboard set to US-EN because the placement of the characters we always need (like ><[]{} and such) is very convenient compared to the FR-CA keyboard (slash becomes é, backslash is the right alt key + the key with the tilde on it, etc)

      I also find it very weird you never run into multi-lingual teams. I would assume you have a fair amount of citizens who speak spanish, and a fair number of Indian programmers (with all those H1B visa we keep hearing about) and what not. In Canada french/english is very common. But in many cities like Montreal, you also have lots of other ethnicities...

      Even just in english (Candian/US/British "variants" of it) you run into some problems, like Color/Colour and such.

      As for the string literals, that's easy, everything is in resource files already (for localization... or localisation), so spell checking of that is a non-issue.

      --
      ///<sig />
    14. Re:It's a good question ... by UbuntuDupe · · Score: 1

      I've always wondered what it's like for Germans (and I guess by extension, the Dutch) to use typical programming syntax. For example, you have to invert word order for a dependent clause in German. So, in speaking, you'd say "wenn int1 3 gleicht" ("if int1 3 equals"), but obviously your code has a different order ("if int1 == 3").

      You remind me also of something that slipped into the French-produced game Beyond Good and Evil. There was an item that was officially called something like, "an Invigorator". (That was its name in stores.) But then on the items-screen, it was called an "active principle", but whenever it was abbreviated, it would be called a PA, presumably because in the original French it's called a "Principle Active" due to their word order.

    15. Re:It's a good question ... by R2.0 · · Score: 1

      "My mother tongue is Dutch, we have a German coworker, and you never know if the next guy will be Italian. There is also this team that has to maintain code written by Spanish people.... in Spanish.... and they don't know Spanish. Fun times, if you like to hear them curse...."

      And so began the Third European Conflict, the first two being mislabeled "world wars".

      Don't worry, it's coming folks. Pass the popcorn.

      (Of course, so is another civil war in the US. As time approaches infinity, the probability of any given war approaches unity)

      --
      "As God is my witness, I thought turkeys could fly." A. Carlson
    16. Re:It's a good question ... by sholden · · Score: 1

      http://en.wikipedia.org/wiki/Referer sums it up completely, even in a formal system you get spelling errors.

    17. Re:It's a good question ... by Corporate+Troll · · Score: 1

      I've always wondered what it's like for Germans (and I guess by extension, the Dutch) to use typical programming syntax.

      It's no big deal really... Especially for the Dutch: I've never met someone Dutch who wasn't proficient in English. For the Germans, I can't say, but I've never met a German in IT that wasn't proficient in English. ;-)

      That said, while programming, I don't think the brain works in "language mode", it works in "logical mode". At least to me it seems that way. I easily read code in all human languages I know (5, if you really want to know) even when they are mixed up. It's no big deal, and I'm far from a language whiz. I know them out of necessity.

    18. Re:It's a good question ... by Corporate+Troll · · Score: 1

      While you're kidding, you're very far from reality. The French people talk English and some even a tad Dutch, the German guy knows English and he is learning French. I know all those languages, and talk whatever is needed at the moment. Actually, we all enhance ourselves by learning more languages.

      It brings the best out of us, but yes, there are sometimes misunderstandings....

    19. Re:It's a good question ... by Gorath99 · · Score: 1

      Actually, it seems to me that Dutch is more closely related to English than German is. Which I guess would make sense, as the countries are geographically nearer, and historically had a lot of interaction due to the fact that both were naval powers.

      Also, since there are fewer Dutch speakers, I expect that the language is easier corrupted/changed. I certainly have way more trouble reading 17th century Dutch documents than English documents, even though Dutch is my first language. But maybe English has just been very resistant to change... I dunno.

      Anyways, in your example the word order changes less in Dutch than in German. "if int1 == 3" would be something like "als int1 gelijk is aan 3" ("if int1 equal is to 3"). The syntax quite nicely matches the Dutch structure.

    20. Re:It's a good question ... by Anonymous Coward · · Score: 0

      You can translate if int1 == 3 as:

          Wenn int1 gleich 3 ist, dann

      in german. Translated back:

          if int1 equal 3 is then

      So only the is is moved around.

    21. Re:It's a good question ... by delphi125 · · Score: 1

      As an occasional Dutch-to-English translator, I've got to disagree with you. I grew up bilingual but my written Dutch isn't very good, yet when I went skiing some time before I was 10, I recall being able to read German comics (Tintin=Kuifje, so with more than kiddy dialogue) with no difficulty at all. Granted there were pictures to help, but the only question I had was why there was a B in their word for street!

      English is actually closer to Frisian from a historical perspective, whilst Dutch is very similar to Low German as spoken across northern Germany and even into Poland. Of course English has the additional influence of Norman French added to the Angle and Saxon dialects of 1000 years ago, whilst Dutch has been influenced much later (from the Burgundians on, in Southern NL, much of northern NL was presumably not considered prime land until about the Dutch Golden Age, and Zeeland and various polders such as Schiphol were still very very wet. That and you had waterlinies).

      Anyway, the vocabulary of Dutch is about halfway between those of it's neighbours to either side, but the grammar is essentially "German Lite". Pronunciation and intonation are also more like German than English.

      A German will be able to say "misschien is uw Schevenginse scheermesje niet scherp genoeg" before a Dutchman manages a perfect "dough faced plough boy who coughed and laughed his way through Scarbrough", tho'!

    22. Re:It's a good question ... by bitserf · · Score: 1

      For me, there's very little relation between the natural languages I speak and programming.

      Maybe it's because I've grown up having to speak two languages (now three). Which one of these languages would I take and try apply its word order and grammar to programming? It doesn't make sense.

      But even if I knew only one language - A programming language has its own rules, and confusing it with the language you speak? I can't see how that would happen, to be honest. It's not a big leap to understand that different contexts have different rules.

      I'm not trying to have fireside chats with the compiler, I'm trying to build software :)

    23. Re:It's a good question ... by Gorath99 · · Score: 1

      Heh, well, unless I misunderstand your post, I actually don't disagree with you at all :-)

      What I was trying to say in my previous post (apparently not very clearly) is that the difference between Dutch and English is smaller than the difference between German and English. Of course, they're still much closer to each other than to English; I'm not denying that.

    24. Re:It's a good question ... by 1110110001 · · Score: 1

      "wenn int1 3 gleicht" You're trying to make a novel out of a mathematical expression. Let me give you an example what we say in math in German:

      1 + 2 = 3

      That's "1 plus 2 ist gleich 3" - or shorter "1 plus 2 gleich 3". You see, it's the same as in English only equals is gleich in German. Now take this:

      y + 5 = 10

      That's "y plus 5 gleich 10". And now the same as you would use it in a programming language:

      if (y + 5 == 10) then ...

      That's "wenn y plus 5 gleich 10 dann ..." or in English "if y plus 5 equals 10 then ..". It's very easy for someone with German as his native language to think with "English words" and should be vice versa.
    25. Re:It's a good question ... by UbuntuDupe · · Score: 1
      That's "wenn y plus 5 gleich 10 dann ..." or in English "if y plus 5 equals 10 then ..". It's very easy for someone with German as his native language to think with "English words" and should be vice versa.

      Yes, but when you say, "wenn y plus 5 gleich 10 dann ..." you are no longer using proper German word order. The problem isn't that you're using English words, but that the order of the symbols is different from the order of ordinary speech.

      That's my biggest problem in speaking German: you can't actually take the inverted word order seriously. Any time it gets complicated, you have to break the rules in order to avoid forgetting the parts of the sentence before you finish. Look at the first sentence of my response: in German -- if I actually followed the rules -- I would have to say:

      Ja, aber wenn man "wenn y plus 5 gleich 10 dann ..." sagt... I have to translate the quote in my mind, *then* remember what verb I was using with it. Aua!
    26. Re:It's a good question ... by chris_sawtell · · Score: 1

      Just learn Latin.

    27. Re:It's a good question ... by Corporate+Troll · · Score: 1

      Wouldn't Esperanto be better? ;-)

    28. Re:It's a good question ... by 1110110001 · · Score: 1

      Yes, but when you say, "wenn y plus 5 gleich 10 dann ..." you are no longer using proper German word order. The problem isn't that you're using English words, but that the order of the symbols is different from the order of ordinary speech. Math doesn't always follow proper German to make it easier to distinguish the terms. If you'd say "Die Aussage ist wahr, wenn y plus 5 10 entspricht" it's very hard to write down the left and right part of the equation. You can read it out loudly and you might unterstand "... y plus 15 entspricht". That's why you mostly say the operators in order "Die Aussage ist wahr, wenn y plus 5 gleich 10".
    29. Re:It's a good question ... by MonkeyCookie · · Score: 1

      When I worked in Germany, it seemed to be common to write code in English. The keywords (this was C++) were of course the same, but where I worked the variable and function names were also in English. The comments that explained what was happening, however, were in German. That was the way I coded as well. I'd write code like I normally did, but I would write my comments in German.

      I did see some code written in Germany that used German variable names, but English seemed to be much more common.

      As for word order, I never heard of any problems with programming languages. My coworkers would sometimes get word order wrong when speaking English, but I never saw any programming-related problems. I think that natural languages are much more difficult to get right than programming languages.

    30. Re:It's a good question ... by MonkeyCookie · · Score: 1

      When I worked in Germany, we wrote all our code using English variable and function names, even though I was the only one there whose first language was English. I think that was because English is pretty standard when it comes to programming. Major programming languages all use English keywords, and much documentation is in English. I think a programmer would have a difficult time not knowing any English. Some of the people I worked with had better English skills than others, but they all knew at least enough to get by. I did see a good amount of code (unrelated to work) that used German variable and function names, but it was definitely the minority.

      Interestingly enough, we wrote all our comments in German. I thought this was a pretty good balance. I could code like I normally do with English names, and explain what was happening in German. It lead to pretty readable and standardized code with useful explanations in the native language.

  17. Instead of putting the text in a program code by Anonymous Coward · · Score: 0

    How about using a language tag like system( something similar to gettext http://www.gnu.org/software/gettext/ )? And spellchecking those files. Makes it easier to make an application support multiple languages as well.

    1. Re:Instead of putting the text in a program code by wikinerd · · Score: 1

      He dosn't only want to spellcheck software interface messages etc, he also wants to spellcheck function names containing natural language.

    2. Re:Instead of putting the text in a program code by skrolle2 · · Score: 1

      The parent of your post understood that perfectly, unlike the vast majority of comments to this story. I think your remark should have been a reply to one of those, and not to this... :-)

    3. Re:Instead of putting the text in a program code by skrolle2 · · Score: 1

      What the... I'm an idiot, I could have sworn your comment was attached to #20461667

      *searches for the delete button*

    4. Re:Instead of putting the text in a program code by xof · · Score: 1

      I don't understand the '0' score... using gettext() is a good idea (unless you come with a better mecanism for internationalization).

    5. Re:Instead of putting the text in a program code by skrolle2 · · Score: 1

      RTFA. The author isn't interested in getting various strings correct, he's interested in getting class names, variable names and function names correct.

    6. Re:Instead of putting the text in a program code by Riktov · · Score: 1

      You mean RTFS. There is no FA, only a summary!

  18. Use Text Files by Crispin+Cowan · · Score: 0, Offtopic

    If you want your software to be internationalizable, then you are going to need all your interface text in external text files anyway. Just spellcheck that. Your programmers really shouldn't be embeddeding any message text in the software itself, so you can just use grep to search for " marks :)

    1. Re:Use Text Files by Corporate+Troll · · Score: 1

      It's not what he means. He talks about problems like getBussinessObjekt() instead of getBusinessObject(). Apart from that, you're 100% right and it should even be that way if you don't want to internationalize it.

    2. Re:Use Text Files by Anonymous Coward · · Score: 0

      You do the same for functions, then separate out the function names

      So rather than getBusinessObject() you would have mx3qz4m()

      And at the end you have the translations list, where;

      mx3qz4m = csvfile(1,39) (where the 1 is for English) and obviously furthermore,

      csvfile(1,39) cell content = getBusinessObject

      This would also make localization of code much easier

  19. Write your own...? by Anonymous Coward · · Score: 0

    1. I'm a programmer
    2. I want a program that does exactly X, Y, and Z
    3. ????
    4. Profit!

  20. how soon do you need it? by indraneil · · Score: 1

    I am currently working on a java-based universal spell checker (the kind that can do a decent job without involving knowledge of that language). By language, I mean, English, Hindi etc.
    I am amused by the idea of being able to extend that to programming languages.

    The most significant problem that I am facing has nothing to do with coding the spell-checker. Its about getting a sizable dictionary of words (finding one, converting to UTF-8 etc.)

    The trouble is that programming comes with a very different set of words that are not common in a normal dictionary
    - acronyms (XML, JRAD etc.)
    - weird keywords (foreach, esac etc.)
    - regex
    - portmanteau words like regex
    etc.

    I have a feeling that if some one can take the pain and build a dictionary of such things, it can be done. I am not much of a lexicographer. If you can find such a dictionary, get back to me, and I will see if I can get this to work for you

    1. Re:how soon do you need it? by Anonymous Coward · · Score: 0

      Its about getting a sizable dictionary of words

      Dude, you need to step outside of the world of proprietary Windows and Java development. Near-complete word lists have been available on *BSD systems for decades!

      http://www.freebsd.org/cgi/cvsweb.cgi/src/share/di ct/

      The web2 and web2a files contain many, many words. The freebsd file contains a number of technical terms and acronyms. The propernames file contains a list of proper names.

    2. Re:how soon do you need it? by indraneil · · Score: 1

      I am not sure if you are ignorant or illiterate.
      exactly when did i say that i code in windows (and if i do, so what?)
      and are you upset that java is not being released in the BSD license?

      I never said that I could not find a dictionary of english words. if you had read my post, you would know that I talked of dictionaries in multiple languages. Of all the languages in the world, English is just one of them. It might help to remember that much.

    3. Re:how soon do you need it? by Anonymous Coward · · Score: 0

      I am not sure if you are ignorant or illiterate.
      exactly when did i say that i code in windows (and if i do, so what?) He was assuming that if you used free software then you'd know you already had access to these things - and probably already had such a word list installed with your Linux distribution or Kde/Gnome or OpenOffice.

      You can get free words lists in any language you can think of. They're easy to find.
    4. Re:how soon do you need it? by Zwets · · Score: 1

      I have a feeling that if some one can take the pain and build a dictionary of such things, it can be done.

      Why don't you run the code to some open source projects through your spell checker and see which unrecognized "words" crop up most often? If it occurs often in different projects, it must be considered "correct" to programmers. Of course this doesn't get you everything, but stuff like "ptr", "obj" and language keywords would show up. You could do it on a per-language basis if you want.

      --
      One of the lessons of history is that nothing is often a good thing to do and always a clever thing to say. - Will Duran
    5. Re:how soon do you need it? by mwvdlee · · Score: 1

      In a normal development shop, you could probably make such word lists on the fly.
      Just appoint one "spelling guru" who is the only one allowed to edit the list and add new words to it as you go. It's probably better to strictly manage the list anyway, considering the various number of ways some words can be written, i.e. color vs. colour. You'd probably want only one of those variants allowed.

      You could probably use a simple lexer to detect function and variable names and (customizable) regex to extract the checkable words from the names.

      Then perhaps use multiple dictionaries; a limited one for code names and a full one for comments and strings.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    6. Re:how soon do you need it? by Anonymous Coward · · Score: 0

      I am not sure if you are ignorant or illiterate.

      I am neither, my good Indian sir!

      exactly when did i say that i code in windows (and if i do, so what?)

      Your entire post says that you're ignorant of anything and everything beyond Windows. For if you actually did have some breadth to your knowledge, you would have known about the availability of such word lists on nearly every UNIX system today. And such lists are available for many languages, not just English.

      and are you upset that java is not being released in the BSD license?

      Seeing as Python offers better programmer productivity, better memory usage, better language features, better libraries, and faster execution, I really don't give a fuck about Java.

  21. Re:Quit employing idiots? by Double+Entendre · · Score: 1

    Why idiots? A great developer may not necessarily have a commanding grasp of English, especially if it's a second language for them. That doesn't make them stupid.

    Other than that, I agree with everything else you wrote. Planning things out through proper software development techniques should isolate those issues in advance.

  22. FxCop by W3bbo · · Score: 2, Informative

    Okay, so it's only for Managed Assemblies (C#, VB.NET, J#, etc), but it does spell-checking, acronym-checking, and case-checking, which is nifty. Along with the other slew of introspection rules (some of which are a PITA to implement, even if it does increase the quality of the finished product).

    The $$$ version of Visual Studio (the Team Suite version) comes with an introspection engine for VC++ though, it's not as flexible as FxCop but does the basics.

    Then there's the countless "Spellchecker" plugins available for IDEs everywhere, VS, Eclipse, NetBeans, etc...

    1. Re:FxCop by ruleant · · Score: 1

      I used FxCop too. It checks your code on many things, including spelling of function/variable/class names. You can turn most of the default rules in FxCop off, if you only need spellchecking, but the other rules are also very useful.
      I'm not sure if FxCop checks the spelling of strings, used for messages and captions on the GUI, but it probably does.

  23. Compile! by Anonymous Coward · · Score: 0

    Compile your code and the compiler will find spelling errors in variables etc.

  24. TextMate does some... by NNKK · · Score: 2, Interesting

    TextMate on OS X has spell checking functionality that is semi-useful, but it's not really "aggressive" enough, and there doesn't seem to be a way to make it such with prefs/configuration.

    You can right-click on any "word" (variable name, subroutine name, whatever, just generally a whitespace-delimited group of characters) and it will check the spelling and present alternatives in the context menu. It also recognizes things like perl's sigils so correcting '$teh' turns into '$the', not 'the'.

    It _won't_ automatically check spelling except in strings (so e.g. if I have '$teh = "This is a tset.";', 'tset' will be underlined, '$teh' won't). It doesn't include comments in its automatic checking either, which is probably the most annoying part about it.

    Overall I typically just don't bother with it, but someone _has_ thought along these lines, at least.

    1. Re:TextMate does some... by jacobolus · · Score: 1

      You can trivially enable spell checking for any scope selectors you desire in TextMate: comments, variable names, you name it. See http://macromates.com/textmate/manual/working_with _text#spell_checking

  25. Syntax Highlighting by ajs318 · · Score: 0, Offtopic

    What you're wanting is something that is very difficult for a computer but very easy for a human being. You want to be able to discern which parts of your text file constitute machine-readable instructions (which have to be spelt the way the machine expects them when it's running the compiler/interpreter) and which parts constitute human-readable messages (which have to be spelt the way a human would expect).

    The real point is, you shouldn't have user interface messages hard-coded right there into your program at all! It will make it much harder to produce a foreign-language version three years down the line when your company expand and open their first offshore branch. Instead, you should abstract all messages out into a separate file of their own, which can then be spell-checked separately; refer to them only by means of meaningful constants within the code (e.g. if message 6 happens to be "number too small" then use something like NUMTOOSML for 6). This will make the task of internationalisation much simpler -- it can be handed off to anyone who speaks both the current and target languages, not necessarily a programmer.

    If your program really is one that you will never need to internationalise, then your users probably will be able to deal with the odd mis-spelt message.

    --
    Je fume. Tu fumes. Nous fûmes!
    1. Re:Syntax Highlighting by adnonsense · · Score: 1

      The OP's question was about spell-checking the source code itself (for consistency in variable names), not any UI messages that might or might not be contained in it.

    2. Re:Syntax Highlighting by BasilBrush · · Score: 3, Insightful

      The question wasn't about user interface strings. It was about spelling in APIs. e.g. One issue at my last company, which was British, is that they standardized on US spelling, but some British spellings crept in too. So sometimes you'd get a function containing "Initialize" and sometimes "Initialise".

    3. Re:Syntax Highlighting by Corporate+Troll · · Score: 1

      What you're wanting is something that is very difficult for a computer but very easy for a human being. You want to be able to discern which parts of your text file constitute machine-readable instructions (which have to be spelt the way the machine expects them when it's running the compiler/interpreter) and which parts constitute human-readable messages (which have to be spelt the way a human would expect).

      Bollocks, what you describe is absolutely possible, otherwise syntax highlighting would not be possible. In Java, everything between /* and */ and everything starting with // are comments and thus should be spellchecked. Everything between two ", should also be spellchecked since those are literal strings.

      Of course, you're right that literal strings have no place in source code, but that was not the question.

    4. Re:Syntax Highlighting by Bloke+down+the+pub · · Score: 1

      I almost wrote exactly the same thing as you. Luckily, I decided to RTFA first and avoid making a total berk of myself.

      --
      It's true I tell you, feller at work's next door neighbour read it in the paper.
    5. Re:Syntax Highlighting by Anonymous Coward · · Score: 0

      What you're wanting is something that is very difficult for a computer but very easy for a human being. I understand what you are saying, but if your boss sees that you are outsourcing the spellchecking of your code to India then might he also get the idea of outsourcing the actual coding as well?
    6. Re:Syntax Highlighting by ajs318 · · Score: 1

      Ah. Well, compilers generally tend to report errors like misnamed functions and variables when you try to compile the program.

      Anyway, it's hardly worth getting your knickers in a twist over. Either the code is going to be open, and everyone will get the ability to change the variable and function names to whatever they want if they so desire; or it'll be caged up, and nobody in the real world will ever so much as see them. If I had enough mind left to pay to petty stuff like function names, I'd be wondering what big stuff I'd missed .....

      --
      Je fume. Tu fumes. Nous fûmes!
    7. Re:Syntax Highlighting by Anonymous Coward · · Score: 0

      A few years back, I worked on an implementation of an industry-standard Java API. Naturally, all our exception messages were properly internationalised and translated. However, the nature of Java (and most other programming languages) means that class and method names are not translatable, and (for this API at least) are based on English. As is the Java language itself, of course.

      A colleague pointed out that this must be really confusing for non-native English speakers. They'd have to think in English when writing code, but in their local language when understanding the error messages that came out. Since then I've wondered whether anybody actually uses the translated messages.

      Similarly, I've heard of some users who won't read our non-English translations of documentation, saying they'd rather trust their own understanding of technical English than the translator's understanding.

    8. Re:Syntax Highlighting by Zelos · · Score: 1

      It's not a major problem, but it's annoying to work with code containing mispellings. I've seen things like appendToQue or serie (used as the singular of series) in code I've worked in, it adds to the number of things you have to remember.

      Autocomplete helps, but not every platform has it and it frequently breaks on VC++ IME.

    9. Re:Syntax Highlighting by Anonymous Coward · · Score: 0

      Ah. Well, compilers generally tend to report errors like misnamed functions and variables when you try to compile the program.


      float kalkulateVAT(float prise) {
            float VATprise;
            VATprice=VATrate*prise;
            return VATprise;
      }

      Name one compiler that reports this misnamed function, parameter and variable.
    10. Re:Syntax Highlighting by Anonymous Coward · · Score: 0

      What the hell? How on earth is this hard for a machine to do? I have a feeling that the "machine" "discerns" which parts of my text file constitute machine readable instructions, and which parts do not every time I run the compiler. Otherwise having "machine-readable" instructions would be completely useless (and rather mis-named at that).

    11. Re:Syntax Highlighting by Anonymous Coward · · Score: 0

      My company did the same thing. Our American customers would whine like bitches if we used UK spelling, but the British (being well used to American software which is never UK localized) didn't care.

      However, it's a myth that "initialize" is an American thing. Have a look at an OED. For words that can be spelt with an "-ise" or an "-ize", the latter is the principal entry.

    12. Re:Syntax Highlighting by kailoran · · Score: 1

      I hate internationalized error messages. Unless someone reported the problem in your language, which is usually not the case, you have to first figure out what the error was in English before you can google anything.

    13. Re:Syntax Highlighting by dbIII · · Score: 1

      Good point - this could be a colourful debate. Standardize on American or standardise on English? We need a few comments to gauge a reponse.

  26. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by iapetus · · Score: 2, Informative

    For the record, 'I' is a word. Also plenty of spellcheckers will ignore one or two letter words.

    The idea isn't anywhere near as nuts as you think it is, provided you make a habit of using meaningful variable/class names.

    --
    ++ Say to Elrond "Hello.".
    Elrond says "No.". Elrond gives you some lunch.
  27. Learn to spell by frisket · · Score: 0, Offtopic

    Such a spellchecker might be useful and might even be possible, but it would be much more valuable if QA caught spelling mistakes in the user interface (menu labels, error messages, etc). "An error has occured" is far to common.

    1. Re:Learn to spell by fgaliegue · · Score: 1

      I must violently disagree with the Offtopic moderation to the above post.

      Spelling is a very common problem in the so-called "developed countries" (hahahaaa.. *hrm*) today, to an extent that I, a non native English speaker, can even spot spelling or even grammar errors in comments on Slashdot. You should be ashamed, period.

      Really, "learn to spell" is not offtopic, quite the opposite, it's dead on.

      Some time ago, I was operator on a French IRC channel and we have decided to apply a "mode Pivot" (from Bernard Pivot, a renowned French TV presenter of a cultural program named "Apostrophes"). We were five ops and had a hard time to keep up kicking the people making spelling/grammar errors. I lurk on IRC from time to time now, and it's even worse: people there just CAN NOT SPELL PROPERLY. Heck, IRC is not limited to 160 chars per message. "Kestu fé" is NO equivalent to "Que fais-tu", neither is "wt r u doin" to "what are you doing".

      While typos can be "pardoned", plain mispelling from the start is a simple lack of proper education.

    2. Re:Learn to spell by Anonymous Coward · · Score: 0

      Why r u ragging/ about abrevs? Are you really helping the computer by spelling things correctly? Absolutely not. The computer wants non-volwed abrev'd and sometimes just unique-more spelling in order to compile faster. shame on you for preventing the computer from compiling in it's prefered form. here are some recomendations that actually occur in our own company's source code to get you starts: Recomend, cordinate, lo (for low). and how else are you going to easily distinguish between sets of number then by calling ints "i4n1"? I suppose you would want "integerwholeset4number1"? Eck, what a waste of the compiler's time.

  28. What is wrong with people? by Anonymous Coward · · Score: 0

    I know I'm going to get flamed for this, but what is so difficult about learning to spell? Ignoring obvious developmental deficiencies, nothing is stopping you from going to the library and getting out a big fat vocab book designed for foreigners or child natives.

    There is a great emphasis today on offloading skills to machinery. Sometimes this is a good thing; sometimes it's no better than crying out for a wheelchair because you have never bothered to learn to walk.

    Why don't more software developers take a leaf out of Knuth, who "only proved it correct, not tried it" [grammar]? He made the effort to develop his mind such that he could be confident in his own ability to combine memorised results with logical deductions - the key skills of programming, spelling and pretty much any other ability you'll ever attempt to acquire.

    1. Re:What is wrong with people? by LarsWestergren · · Score: 1

      Why don't more software developers take a leaf out of Knuth, who "only proved it correct, not tried it" [grammar]?

      Yeah, that's great and all, but this is something you can only do for small algorithms. Proving correctness of large systems takes huge amounts of time and resources, so for most developers this is just not feasible. Also a while ago, someone notable in the Java world (Gafter? Bloch? Can't seem to find the link) blogged about how he had discovered that one of the core textbook examples taught the last 30 years in the courses about proving code was in fact incorrect... The assumptions no longer held for 64 bit systems. If the experts can't get 5 lines of code right, what use is it in practice?

      He made the effort to develop his mind such that he could be confident in his own ability to combine memorised results with logical deductions - the key skills of programming, spelling and pretty much any other ability you'll ever attempt to acquire.

      Oh, so the easy solution is to become a genius, then all problems will be trivial. That's very smart of you AC, wonder why no one thought of that before?

      --

      Being bitter is drinking poison and hoping someone else will die

    2. Re:What is wrong with people? by LarsWestergren · · Score: 1

      Also a while ago, someone notable in the Java world (Gafter? Bloch? Can't seem to find the link) blogged about how he had discovered that one of the core textbook examples taught the last 30 years in the courses about proving code was in fact incorrect...

      Found it... Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken. I like his final paragraph:

      "We programmers need all the help we can get, and we should never assume otherwise. Careful design is great. Testing is great. Formal methods are great. Code reviews are great. Static analysis is great. But none of these things alone are sufficient to eliminate bugs: They will always be with us. A bug can exist for half a century despite our best efforts to exterminate it. We must program carefully, defensively, and remain ever vigilant."

      --

      Being bitter is drinking poison and hoping someone else will die

    3. Re:What is wrong with people? by Anonymous Coward · · Score: 0

      Fuckin right you are my son!

      I hate these fuckin stupid ass fuckin little pussies having a fuckin cry about not being fuckin able to fuckin spell.

      Read a fucking book, shit for brains. How fuckin dumb do you fuckin have to fuckin be not to be able to fuckin spell right.

      Stop blaming your fuckin environment for your fuckin problems and learn to fuckin spell ya fuckin cunt.

    4. Re:What is wrong with people? by Nazlfrag · · Score: 1

      Well, all that he found was that it is easy to overflow a 32 bit signed int value, which is nothing new. The concept of an array of 2^30+ bytes is what broke this code - recompile the code on a 64 bit platform and it just works, bug free (up until 2^63 arrays, but still..). The fact that 'nobody will ever need more than 2^30 (over 1 billion) array entries' isn't a bug in the software per se, just a bug in the specification.

    5. Re:What is wrong with people? by Anonymous Coward · · Score: 0

      Oh, so the easy solution is to become a genius, then all problems will be trivial. That's very smart of you AC, wonder why no one thought of that before?


      Natural talent may come into it, but it's also about hard work. I can spell not just because I was born fairly able but because, as a child, I learnt huge vocabulary lists every week. That doesn't involve learning random strings of letters - it means learning rules and exceptions, just as in programming. And it's an exercise with purpose beyond its own sake: by becoming intimate with your language's lexicon you will absorb what you read with greater ease and communicate more effectively.

      By contrast, the context-ignorant automaton that is the average spellchecker does toe-curling things to the documents of people who don't really understand the words they're putting down to paper. Were is you're brain witch mite right hurrahs grater then this?
    6. Re:What is wrong with people? by skrolle2 · · Score: 1

      the key skills of programming, spelling and pretty much any other ability you'll ever attempt to acquire. In English enumerations, you have a comma before the last and. You should have written:

      programming, spelling, and pretty much any other ability Oh beautiful irony. Now go to a library and pick up a grammar book. Or maybe, just maybe, realize that everyone isn't perfect and that spelling isn't viewed as really important by that many, and that a spellchecker is a really useful tool.
    7. Re:What is wrong with people? by Anonymous Coward · · Score: 1, Informative

      In English enumerations, you have a comma before the last and.


      No, you do. Fowler's asserts "no agreement" and advises your approach in cases of ambiguity. To be specific: the comma would have been obligatory had there been a possibility of reading "spelling and pretty much any other ability..." as two items that make up "programming". This misinterpretation is impossible by virtue of the implied "etc." in the final item.

      It is quite possible that your remark applies to the simplified version of English spoken across the pond ;-), the adherents of which have attempted to codify matters of style as law. But thank you for casting a critical eye on my use of language - I always appreciate educated human feedback! (and rarely appreciate dumb computer feedback, as you might have noticed :-)

      realize that everyone isn't perfect and that spelling isn't viewed as really important by that many, and that a spellchecker is a really useful tool.


      And they might carry on being misunderstood when the spellchecker ignores context or is not available. Every man has his own set of priorities, but only the most arrogant offloads the responsibility of making his language easily decipherable.
    8. Re:What is wrong with people? by Anonymous Coward · · Score: 0

      I know I'm going to get flamed for this, but what is so difficult about learning to spell? Because sometimes you make mistakes. It's useful to catch those mistakes.

    9. Re:What is wrong with people? by Eivind · · Score: 1

      "nearly all" is an overstatement.

      The bug is a consequence of integer overflow. Which is a perfectly common type of bug in languages where "int" and thelike overflow. But really, in most cases it's insane to expose messy internal details of the representation and computer to the programmer.

      Yes, sometimes you need to. But most of the time you should be using a language and/or library that encapsulates details like that so that you can say "some integer" and have the language and/or library take care of whatever mess needs to be dealt with to present the abstraction: an integer.

      In C, when you say "int", the thing you get only vaguely behave like the stuff called "integer" in maths. integers don't "overflow", and you sure as hell don't get a negative result if you add two positive parts.

      So, nearly all binary searches and mergesorts that are written in a language that exposes the guts of the machine, without properly abstracting even simple stuff like integers, are broken. I bet most mergesorts and binary searches written in any saner language, or using any sane library, is free of this bug. And the next half-dozen bugs to be discovered in the C one.

      Meanwhile, mergesorts and binarysearches written in Python, Ruby, Perl, or any other higher-level language are immune to this, and many other classes of bugs that has literally been haunting the low-level messies for half a century.

    10. Re:What is wrong with people? by Anonymous Coward · · Score: 0

      The serial comma is not as standard as you think it is:

      http://en.wikipedia.org/wiki/Serial_comma

    11. Re:What is wrong with people? by Riktov · · Score: 1

      Use of last comma is not universal, ubiquitous or absolutely necessary.

      http://en.wikipedia.org/wiki/Serial_comma

    12. Re:What is wrong with people? by Estanislao+Mart�nez · · Score: 1

      I know I'm going to get flamed for this, but what is so difficult about learning to spell?

      That's a serious question that deserves a non-rhetorical answer, which you are obviously disqualified from providing.

      Ignoring obvious developmental deficiencies, nothing is stopping you from going to the library and getting out a big fat vocab book designed for foreigners or child natives.

      And what makes you think that's going to help? Have you considered the possibility that somebody without "obvious developmental deficiencies" may simply still be doomed to bad spelling? Also, what standard are you using to decide what counts as a "developmental deficiency," and does that standard fly in the face of actual average spelling skills? I.e., have you considered that perhaps you're expecting everybody to be above average?

      Spelling only appears to be a trivial skill to those who master it. The relationship between the written representations of words and their phonological representations is very hard to unravel, and is typically only rational when you compare it against archaic stages of the language (i.e., when you compare it to the way people spoke 600 years ago).

    13. Re:What is wrong with people? by Anonymous Coward · · Score: 0

      Have you considered the possibility that somebody without "obvious developmental deficiencies" may simply still be doomed to bad spelling?
      Yes, I have. You have made an extraordinary assertion: that the "average" mind can be "doomed" to bad spelling; or, to generalise, that the "average" mind can somehow find a particular instance of the general act of learning (memorisation and deduction) close to impossible, no matter what method its owner applies.

      I was too vague with "obvious developmental deficiency" - I was really considering mental retardation (in the clinical sense, not the schoolboy "u r a retard" sense). Contrast such conditions as dyslexia, which are usually tackled not by throwing one's arms up in the air and announcing "it's too hard :-(" but by changing the methods used to learn.

      I'm trying to get across that, given a complex problem, n successful solutions may exhibit up to n different approaches. We've all met people with eidetic memory (I wish..), yet it's not a prerequisite to making great progress in any discipline. The rest of us must be more creative in harnessing our brain's pattern-matching power, always asking questions to improve our skills: Do I seem to have any natural talents? Do I take in better what I see or what I hear? Does it help to write down what I must learn rather than passively read? How can I apply the knowledge regularly to ensure I understand it and don't forget it? Can I spend time distilling rules and strategies? Have I read Polya's How to solve it?

      (No, that's not one of those horrible life-coaching books, but on generic approach to solving mathematical problems. Even to the non-mathematician and non-scientist it illustrates the importance of having the right frame of mind.)

      Spelling only appears to be a trivial skill to those who master it.
      Whoever said it was easy?

      The relationship between the written representations of words and their phonological representations is very hard to unravel, and is typically only rational when you compare it against archaic stages of the language (i.e., when you compare it to the way people spoke 600 years ago).
      Learn some Latin and Greek. Read some Shakespeare. Study some scientific texts written in the vernacular between 1400 and 1800 (textbooks of the period or carefully selected extracts are fine; no-one's expecting the average high school kid to master the Principia). There is no need to completely unravel anything, but the greater your exposure to language evolution, the more patterns you'll recognise and the fewer special cases you'll have to remember.

      [rant]I'd argue that all these things should be done as part of childhood education; the improvement in your vocabulary will be incidental to your study of classics, great works of literature, (;-) and science. I sympathise with anyone who replies "but my school sucked" - thanks to the National Curriculum and the privatised exam system in the UK, the state school student whose teacher sticks to what the government thinks he should learn will have learnt almost nothing at school by his 16th birthday. Worse, he will have been examined so ineffectively that his grades will not reflect his mastery of the subjects. But he has the capacity to make up for it.[/rant]
    14. Re:What is wrong with people? by Anonymous Coward · · Score: 0

      I'd say prooving it correct IS sufficent, it's just the translation from code to formal prooving axoims has to take into account overflow conditions and all the other riders of the operators that people just usually ignore or consider chaff.

      (In other words, the prooving system has to check through and realise what constraints are placed on low and high to avoid overflow and then put that as a precondition to the whole method.)

      Formally prooving code is very difficult and takes abosultely ages.

  29. Good Idea by aug24 · · Score: 0

    Seriously, I think this is a terrific idea.

    I have a real problem with coders who can't spell (even in code review, either Eyeball Mk1 is fallible or neither coder can spell). Functions called "markOrderRecieved" (for example) are just harder to find when I'm looking for some functionality that I know is there, and are a bump on the road when reading.

    I'm primarily a java coder these days, so (1) there's no need to abbreviate for the language (2) All decent IDEs offer auto-complete, so there's no "but I hate typing long names" excuse.

    An Eclipse plugin which checks all function and variable names for camel-case delimited real words would be a Good Idea.

    That said, I've never heard of such a thing. Anyone not currently with a deadline (although reading /. counts as R&R ;-) care to write one?

    Justin.

    --
    You're only jealous cos the little penguins are talking to me.
  30. Yes, you have .... by Anonymous Coward · · Score: 0

    ... it's called a compiler.

  31. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Bastard+of+Subhumani · · Score: 5, Funny

    Also plenty of spellcheckers will ignore one or two letter words.
    So if you use fortran, you're screwed? No change there, then ...
    --
    Only three things are certain; death, taxes, and apocryphal quotations - Ben Franklin.
  32. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by thetartanavenger · · Score: 2, Informative

    More like WTF are you on man?? If a compiler is able to work out what a variable is, what piece of code does what, which bit's of text are going to be displayed, then another spell checking program can be written to recognise this too!! It would be tricky, and there are many circumstances where it could be circumvented but why not still use it to prevent a possible spelling error, and the circumstances where it cannot tell what the word is, so what. Those circumstances you learn to spell but there's nothing wrong with another program to help prevent it!

    This is a good idea, and one that can be implemented. Just because it's hard to do it right, and would need to be done seperately for different languages doesn't change the fact it would still be useful and help prevent errors.

    --
    Who need's speling and grammar?
  33. You can have the benefit of the doubt... by plierhead · · Score: 1

    I'm guessing that your "far to common" is a subtle easter egg?

    --

    [x] auto-moderate all posts by this user as insightful

  34. Can it also spelll check slashot polls? by moderators_are_w*nke · · Score: 1

    Cos I don't know what a Space compnay is.

    --
    "XML is like violence. If it doesn't solve your problem, use more." - Anonymous Coward
    1. Re:Can it also spelll check slashot polls? by moderators_are_w*nke · · Score: 1

      Or even Slashdot posts?

      --
      "XML is like violence. If it doesn't solve your problem, use more." - Anonymous Coward
    2. Re:Can it also spelll check slashot polls? by Headcase88 · · Score: 1

      Oh God, it's a spelling nazi (sort of) attacking a joke post full of spelling errors. This is why /.ers live in their parents basement. It's a survival instinct. Otherwise we'd jump out of a window and kill ourselves after reading posts like this.

      --
      "When the atomic bomb goes off there's devastation...but when the atomic bong goes off there's celebraaaaation!"
    3. Re:Can it also spelll check slashot polls? by moderators_are_w*nke · · Score: 1

      Speak for yourself. My parents never had a basement.

      --
      "XML is like violence. If it doesn't solve your problem, use more." - Anonymous Coward
  35. gcc spell-en by stdazi · · Score: 1

    I simply use my gcc's spellchecker : gcc foo.c -spell=en la.c: In function 'main': la.c:15: warning: ambigious string value 'hellp'. Did you mean: 'help' ? la.c:17: warning: ambigious variable name 'i'. Did you mean 'index' ?

    1. Re:gcc spell-en by Anonymous Coward · · Score: 0

      Which version of gcc are you using? (Or did I just hear a "whoosh" sound?)was that a

    2. Re:gcc spell-en by SkunkPussy · · Score: 1

      well he's spelt ambiguous wrong....

      --
      SURELY NOT!!!!!
    3. Re:gcc spell-en by Anonymous Coward · · Score: 0

      Heh, didn't see that. I guess I really do need the mythical spellchecking version of gcc! (I hear it also prints an error if your program will never halt...)

  36. Slightly Off Topic, But.... by bhima · · Score: 0, Offtopic

    OK I know this is a little off topic but why is it that Microsoft's spell checker guesses for what my English & German misspellings are, are far better than MacOS, Firefox on MacOS, and iSpell on OpenBSD?

    Is this that hard of problem?

    --
    Nothing in the world is more dangerous than sincere ignorance and conscientious stupidity.
  37. Re:Quit employing idiots? by Anonymous Coward · · Score: 1, Funny

    Review your code, review their core, spell check everything by hand

    I think you meant, "review their code"...

    (Although clearly no automated spell checker would have caught that.)
  38. aspell? by atlep · · Score: 3, Insightful

    I remember from spellchecking some html documents a while back ago that aspell is at least aware of html. I do not know how well it works with other kinds of documents.

    1. Re:aspell? by Anonymous Coward · · Score: 0

      It is quite possible to make a set of rules for aspell that make it blind to a given programming language. Such things have already been done for applications like TeX/LaTeX, HTML, etc. Indeed, the work is quite trivial. Please post to the aspell-devel mailing list, ( see http://aspell.net/ ) and maybe volunteer to do some of the setup work for your favourite programming language.

  39. the problem is really prevalent by wikinerd · · Score: 1

    The idea is nice and I think the problem is really prevalent. I have seen large portions of source code, much of it commercial, containing not one or two but hundreds of spelling mistakes. I also believe the problem must be more prevalent in closed source and in small businesses than open source and Free software. Another thing is that developers from countries with non-English languages often mix English with their first language in code, making it hard to maintain by other nationalities.

    1. Re:the problem is really prevalent by codeshack · · Score: 1

      Agreed. Nothing makes me crazy like an interface at work with a spelling error in a function name, preventing me from AutoCompleting (the one damn reason I put up with Eclipse). If I go back and fix the error, I end up having to refactor 4000 source files and end up getting phone calls like "Hey, why did you mess with my code?" from people that grasp the concept of "svn log" but not "svn blame"...

    2. Re:the problem is really prevalent by Hognoxious · · Score: 4, Funny

      I have seen large portions of source code, much of it commercial, containing not one or two but hundreds of spelling mistakes.
      Man, I was digging around in some SAP code recently and none of it made sense. Half of it didn't even look like English!
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  40. Re:Quit employing idiots? by Nazlfrag · · Score: 1

    I expect my artists to have spelling mistakes. I expect my coders to know the semantics of a language that they are using. If they don't I question their ability on the semantics of the language the project is coded in.

  41. Re:Quit employing idiots? by SLi · · Score: 1

    The funny thing is, in my experience the most spelling errors (compared to e.g. poor grammar in comments) in code are made by those coders who speak English as their native language.

  42. It's easy by mhannibal · · Score: 0

    Get new coworkers... Preferably someone who's passed fifth grade.

  43. Eclipse plugin by mlk · · Score: 1

    I'm sure I've got a plugin at work that does this. It covers my code in yellow squiggly lines.

    --
    Wow, I should not post when knackered.
    1. Re:Eclipse plugin by mlk · · Score: 1

      It is called eSpell
      http://www.bdaum.de/eclipse/

      --
      Wow, I should not post when knackered.
  44. No one's offering solutions... by Chaset · · Score: 2, Interesting

    Well, I'm a total newbie in terms of compiler architectures and such, but throwing it out there for the purpose of discussion...

    I assume a compiler will parse the source and in the process identify which tokens are key words and literals, and which are programmer-defined identifiers in the code. The spell checker would either use the same algorithm, or latch into that part of the algorithm to get at all of the identifiers. There are two possible word separators in typical code--either capital letters or underscors. (If you have something more bizarre, then I think it's a lost cause). So pass those identifiers through a filter that chops them up at each capital letter or underscore (with some exceptions, say, if the identifier is all caps). So, now you've got a pile of strings which are either oddball programming convention stuff, like "p" and "g" for pointers and globals, and things that should generally be words. The rules can include "toss out single character identifiers", "toss out everything up to first capital or underscore", etc. If you have coding guidelines that enforce variable naming conventions, this should get you most of the way.

    Now you have English words that you can pass through your standard spelling engine, possibly with a dictionary tweaked for your field of endeavor to decrease false positves and escapes.

    --
    -- "This world is a comedy to those who think, a tragedy to those who feel."
    1. Re:No one's offering solutions... by mlk · · Score: 1

      I othered a solution. Just one post below your post. ;)

      --
      Wow, I should not post when knackered.
  45. I don't think what you want is possible by JoelKatz · · Score: 1

    The spelling error is that "functionSigniture" is not a word? Or are you suggesting that it should recognize mixed case and check each word individually? I just looked at some random code of mine, and it contains so many things that are perfectly legal that aren't English words, aside from language keywords.

    For example, I have a function that provides a pretty-printed time called 'Gmtime'. The function that produces a GUID in BER form is called 'BERGUID'. In lots of places, "clear" is abbreviated as "clr". A few "Init*" functions are matched by corresponding "Deinit*" functions. An "operator new" assistant is called "OpNew".

    C++ requires that a parameter passed to a function have a different name from the same class member. So it's not unusual to have two variables that do the same thing logically but must have different names. Deleting a letter from one variable name is not uncommon, like "first" and "frst".

    A static version of a class member function that's used to hook into an API that doesn't support C++ natively often has an 'S' before it's name, so you may have 'ShutDown' and 'SShutDown'.

    I believe that most other languages have similar issues.

    You'd either have to have one crazy set of coding standards or you'd have to expect your programmers to pick the legitimate errors out of pages and pages of nonsense.

    1. Re:I don't think what you want is possible by Anonymous+Conrad · · Score: 1
      No, Microsoft's FXCop actually does all of this for .NET. It can be configured to solve all of your examples, I think, through global and per-project custom dictionaries although it does assume CamelCase and will complain if you use too long strings of all CAPS. (But you can turn that warning off.) It does more than spell-checking, e.g. you can tell it to warn when people use "LogIn" and you prefer the term "LogOn".

      C++ requires that a parameter passed to a function have a different name from the same class member. I don't understand this - are you saying you can't have

      class foo
      {
      public:
          foo(int first) : first(first) {}
      private:
          int first;
      };
      Comeau C++ accepts this in strict mode. I've never seen the delete-a-letter convention though, I've always seen prefix-members-with-m (non property members) or prefix-input-parameters-with-something to solve this.
    2. Re:I don't think what you want is possible by JoelKatz · · Score: 1

      The problem is when the initialization is not quite so simple. In any event, I wouldn't use 'first(first)' under any circumstances. I agree that prefixing the inputs with 'i' (if they start with a capital letter) is better than deleting a letter.

      The problem is, though, to make a tool like this useful, all your coding conventions would have to be tweaked to accommodate the tool. Abbreviations would have to be banned.

      I just don't see how it's worth it.

  46. Tags by starwed · · Score: 1

    Wow, I'm glad there's such agreement between those who read the article and left comments, and those who just tagged it. :)
    I tagged this article badlytagged

  47. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by KiloByte · · Score: 2, Interesting
    In fact, there are only two kinds of things to look at:
    • string literals (not what the poster wanted, but this is what needs spelchekars the most)
    • identifiers
    The former can be done by a simple regexp, the latter... you can do a LALR parser, but why even bother? Just look for _any_ potential identifier; in most languages, that's [a-zA-Z_][a-zA-Z_0-9]+; and simply add the few keywords which are not English words to your dictionary. In fact, this would be nearly programming language agnostic.

    When it comes to StudlyCaps, anything identified as an identifier can be split _before_ any uppercase letter. This would produce a lot of single-letter tokens for ALL-CAPS #defines and the like, but as a nearby post said, you're going to ignore one-two letter tokens anyway. The usual conventions say XMLHttpRequest or XML_http_request so I wouldn't bother with XMLhttpRequest (and thus "lhttp").

    --
    The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
  48. gedit has a hiliteing tool by Anonymous Coward · · Score: 0

    Gedit has a highlighting tool, that shows mistacs by not cuoloring them and or by giving them a reb backround (for insance is you foget a ; " the end of a line it will mark the nexed thing red,) and if you (due to fast typing misspell viod or float or another other comand it will not couldre the texed!!!!

  49. How about this by Ed+Avis · · Score: 4, Interesting

    Yes, this is a legitimate problem. I work on code that has spelling mistakes embedded into interfaces and it's very annoying. The fashionable use of StudlyCaps in programming (why? who decided that TextLikeThis is more readable than text_like_this?) makes the job a little harder but not impossible, as long as you follow the sane rule of making each word start with capital and continue lowercase, even if an acronym (so XmlParser not XMLParser or, God forbid, XMLparser - though of course XML_parser would be better than any of those).

    Enough rant. How about this:

    perl -ne "s/([a-z])([A-Z])/$1 $2/g; tr/A-Za-z/ /c; foreach (split) { print qq{$_\n} unless $seen{lc $_}++ }" source_file...

    That will give a list of unique words in your source code (use find and xargs to scan the whole source tree). Then you can run that list of words through an ordinary spellchecker such as ispell. Unfortunately when you find a mistake you have to go back and grep for it to find where it occurs. You would also need a personal dictionary for things that are not English words but nonetheless appear in code.

    I would probably keep the private word list containing things like 'foreach' and 'const' with the program source code, and have a makefile target 'make spellcheck' that runs a command like the above and then prints out all words found that are not in /usr/share/dict/words or in the private word list. Indeed, why not this:

    find . -type f -name '*.c' | xargs perl -ne "s/([a-z])([A-Z])/$1 $2/g; tr/A-Za-z/ /c; foreach (split) { print qq{$_\n} unless $seen{lc $_}++ }" >found_words
    sort -u private_word_list /usr/share/dict/words >allowed_words
    diff -u allowed_words found_words | grep -E '^[+][^+]'

    The private word list can be kept under version control and checked in whenever you add a new non-English word like 'Frobule' to your source code.

    Adding filenames and line numbers to the output is left as an exercise for the reader. You might also want to change the perl command to ignore words with length < 5.

    --
    -- Ed Avis ed@membled.com
    1. Re:How about this by yerM)M · · Score: 1
      I was thinking along the same lines. I'm assuming that by "interface" we are talking about a scripting interface here since (as several other posters have noticed) text that appears on an inteface should be kept in seperate files for various reasons.

      We have a programmer who even gets to write his own business cards. He ended up being our "princapal developer" so apparently we get to loan him out on occasion.

      My solution was along the lines of "strings *.so | aspell" you might need to use c++filt to demangle c++ names.

      aspell 0.5 handled compound words, but apparently doesn't anymore. However, during a quick search I found this which has the most obvious patent abstract I have ever seen and probably means that any solution to this problem will violate a patent!

    2. Re:How about this by Ed+Avis · · Score: 2, Informative

      I should add that if you do use underscores to separate words, just put 'tr/_/ /' in the perl code instead of that [a-z][A-Z] stuff.

      --
      -- Ed Avis ed@membled.com
    3. Re:How about this by Anonymous Coward · · Score: 2, Funny

      who decided that TextLikeThis is more readable than text_like_this?

      perl -ne "s/([a-z])([A-Z])/$1 $2/g; tr/A-Za-z/ /c; foreach (split) { print qq{$_\n} unless $seen{lc $_}++ }" source_file... If you are concerned about readability, perl may not be your first choice.
    4. Re:How about this by Anonymous Coward · · Score: 0

      The reason StudlyCaps are used is that they are easier to seperate into words than loadsofsmallcharacters. The reason it was capsification rather than underscore-seperation is probably because of an aesthetic viewpoint (read: opinion) of people who wrote recently popular programming languages (Java for one).

      There is also the slightly ludicrous excuse that underscore-seperation actually increase the length of a reference, whereas StudlyCaps preserve the length.

      That said, it's just a naming standard, neither sacrosanct and protected from change nor an unholy profane mess to be exorcised with blade and fire.
      Besides, StudlyCaps sound funny.

    5. Re:How about this by Ed+Avis · · Score: 1

      I believe the convention comes from Smalltalk, and it came about because the keyboard of the machine where Smalltalk was first implemented did not have an underscore character! From there the StudlyCaps convention spread to other languages because it looks kool and Wired-magazine-esque to have capital letters in the wrong place.

      What puzzles me is not that there's a disagreement on which of the two is more aesthetic. It's that while lots of people criticize the ICantReadThis style, I haven't seen anyone argue that it is better and gives more readable code than using underscores to separate words. The debate seems very one-sided.

      --
      -- Ed Avis ed@membled.com
    6. Re:How about this by Anonymous Coward · · Score: 1, Interesting

      underscores are hard to type

    7. Re:How about this by BrotherAias · · Score: 1, Troll

      I get: $ perl -ne "s/([a-z])([A-Z])/$1 $2/g; tr/A-Za-z/ /c; foreach (split) { print qq{$_\n} unless $seen{lc $_}++ }" somefile.h Can't modify single ref constructor in postincrement (++) at -e line 1, near "}++" Execution of -e aborted due to compilation errors. Running Perl 5.8.6

    8. Re:How about this by Ed+Avis · · Score: 1

      Argh... I am running Windows... replace the double quotes with single quotes. Sorry ;-p.

      --
      -- Ed Avis ed@membled.com
    9. Re:How about this by Blakey+Rat · · Score: 1

      as long as you follow the sane rule of making each word start with capital and continue lowercase, even if an acronym (so XmlParser not XMLParser or, God forbid, XMLparser - though of course XML_parser would be better than any of those).

      You reminded me of my favorite Javascript-ism:

      "XMLHttpRequest()" Who decided that the acronym "XML" should be in all-caps while the acronym "HTTP" right next to it shouldn't? WTF!

    10. Re:How about this by zippthorne · · Score: 2

      who decided that TextLikeThis is more readable than text_like_this?


      I suspect that they actually decided that TextLikeThis was easier to type, and sufficiently readable that the typing ease benefit was worth the switch. Of course that's because no one thought of making shift-<space> map to _.
      --
      Can you be Even More Awesome?!
    11. Re:How about this by The+Raven · · Score: 1

      textLikeThis is easier to TYPE than text_like_this. text-like-this might be easier, but most programming languages don't like dashes in identifiers.

      "t e x t SHIFT-L i k e SHIFT-T h i s" requires fewer keystrokes, and less movement from the home row, than "t e x t SHIFT-_ l i k e SHIFT-_ t h i s". It's really the lack of leaving the home row that is the big benefit. I prefer camelCase personally. You like underscores. Good for you. I won't impose my preferences on you, if you don't whine about my preferences.

      --
      "I will trust Google to 'do no evil' until the founders no longer run it." Hello Alphabet.
    12. Re:How about this by sootman · · Score: 1

      who decided that TextLikeThis is more readable than text_like_this?

      AFAIK, there actually have been studies done that found camel case to be easier to read than words separated with underscores. It's certainly easier to type. However, "found to be better by most" = "always better for everyone" so if you prefer to code like_this, by all means, do so.

      I use lowerCamelCase instead of UpperCamelCase so my single-word variables can be lowercase and not look out of place, and I value readability by humans more than absolute consistency* so I would indeed use 'XMLparser' instead of 'XmlParser'.

      * I typically work alone, so I can do that. Anyone working on big projects should probably create an absolute set of rules and follow them. This PDF (120k) is a fun read and a good example.

      --
      Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    13. Re:How about this by RAMMS+EIN · · Score: 1

      ``underscores are hard to type'' ...as are caps. Which makes me happy I do a lot of programming in languages where everything is written in lowercase, with words separated by dashes. I do type lots of parentheses, which is why I've remapped them to not require pressing the shift key.

      --
      Please correct me if I got my facts wrong.
    14. Re:How about this by RAMMS+EIN · · Score: 1

      ``My solution was along the lines of "strings *.so | aspell" you might need to use c++filt to demangle c++ names.''

      In that case, why not use "nm -D -C *.so | aspell"? (shouldn't that be "aspell -a", by the way?)

      You would probably also want to use a custom dictionary.

      --
      Please correct me if I got my facts wrong.
    15. Re:How about this by Anonymous Coward · · Score: 0

      I personally participated in one such study at my alma mater. (Done by a student, so there's really not much point in trying to find a cite; feel free to look for the full-time professional versions.) Mixed case was found to be more readable than either upper or lower, whether with underscores or spaces (though this later would be tough for a programming language as opposed to text), as measured by both reading time and later retention.

      So, yes, there is some evidence -- not that it will ever convince those that hold that their personal style is the One True Way, and that anyone that disagrees is at best miguided on a point that really makes no difference or at worst is an idiot.

    16. Re:How about this by Anonymous Coward · · Score: 0

      We have the same preferences! ;)

      I was reading the Joel PDF, until the section on Apps-Hungarian. ( At least it's Apps and not System, though )

      Why someone needs or wants the extra verbosity in a language such as C# and with tools like Visual Studio is beyond me. Even MS discourages it's use.

      ESPECIALLY the use of oApple or objOrange, like duh!

  50. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by somersault · · Score: 5, Funny

    His next project is to have a handy little helper with a RAM chip avatar. His name is chippy and he comes out with helpful phrases like:

    "You appear to be creating an infinite loop. Would you like me to increment your counter variable?"

    "You appear to be writing a virus, would you like a list of the latest Windows Vista sploits?"

    --
    which is totally what she said
  51. Re:Quit employing idiots? by KiloByte · · Score: 1

    The biggest fuckin misspelling fuckin idiots I've come the fuck across in my fuckin travels are dumb fuckin ass native English speakers.

    Learn your own fuckin language ya dumb fuckin cunts.
    s/fuckin/fucking/g

    "Ya" is clearly intentional and comes from a dialect, so that's ok.

    (I'm not a native speaker).
    I'm not one either, so this means I get to shout at you, right?
    --
    The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
  52. FxCop by Koyaanisqatsi · · Score: 5, Informative

    For .net languages, FxCop does some of this checking, even understanding camel casing and underscores in tokens. And a bunch more, since it is a static code analysis tool.

    http://www.gotdotnet.com/Team/FxCop/

  53. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by KiloByte · · Score: 1

    In fact, there are only two kinds of things to look at:
    • string literals (not what the poster wanted, but this is what needs spelchekars the most)
    • identifiers
    Ook... and
    • comments
    but I hardly use these anyway :p
    --
    The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
  54. Visual Assist by soundman32 · · Score: 2, Interesting

    Doesn't Visual Assist from Whole Tomato do this? I've used it in the past and I'm sure spelling mistakes (and a whole host of other things) were pointed out.

    I'm not associated with Whole Tomato, but if anyone from WT sees this, can I have a free subscription :-)

    --
    No sharp objects, I'm a programmer!
  55. It's not your job by Dekortage · · Score: 1

    Nothing personal, but it's not actually a programmer's job to make sure everything is speelled correktly. This is part of the QA process before a product rolls out the door. Sure, you should do your best, but you need another pair of eyes (or several pairs of eyes) looking at the UI in addition to your own. You can easily miss the forest for the trees.

    --
    $nice = $webHosting + $domainNames + $sslCerts
    1. Re:It's not your job by Lars+Clausen · · Score: 1

      Nothing personal, but it's not actually a programmer's job to make sure everything is speelled correktly. This is part of the QA process before a product rolls out the door. This has nothing to do with when the program rolls out the door, it won't (shouldn't) be visible to the users. It's about code comprehensibility and maintainability, and all part of a programmer's job. A plug-in that makes it easier to do this would be a help, as long as it doesn't get in the way of coding.

      -Lars
    2. Re:It's not your job by Dekortage · · Score: 1

      You're right. My apologies for a classic knee-jerk reaction to the opening lines of the discussion: "Not all of my coworkers are careful about spelling errors. Sometimes this causes real embarrassment as spelling errors creep into software interfaces." As you've noted, UI is a wholly separate issue from spelling errors in the code itself (function names, variable names, etc.).

      --
      $nice = $webHosting + $domainNames + $sslCerts
    3. Re:It's not your job by seanellis · · Score: 1

      Taht's grate. If i dont hav to spel check my code, their is no way taht my colleags can get up-tite when they hav dificulty undertsanding what itis Im trying to convay. This willl save me litrally minute severy day. And the peopel who are useing my interface com.MyCmopany.MyProdduct.CheckAcount will have no trouble neither.

  56. FxCop by soundman32 · · Score: 1, Redundant

    I'm sure you aren't using .NET, but if you were, FxCop will check for spelling mistakes in code and comments and strings, along with 1M other coding issues (like malformed variable names, parameters).

    --
    No sharp objects, I'm a programmer!
  57. Create a dictionary for your project by thaig · · Score: 2, Interesting

    I had your problem once because I was working with people whose first language was not english. I don't write US English either and I always left English spellings in by mistake.

    I used aspell and went through huge parts of the source, telling it what wasn't misspelled. It was an incredible pain in the neck because it got confused over all the variable names, bits of C syntax etc etc.

    Once I had a dictionary, though, I could recheck the source periodically and although there were a lot of false warnings, we still caught a lot of problems that would have gone into the production release.

    As you can work out, I didn't restrict the test to strings - this is because misspelled variable names can cause bugs too so I checked for them as well.

    Cheers,

    Tim

    --
    This is all just my personal opinion.
  58. I made one (open source) by hypersql · · Score: 1
    Hi,
    I made one and use it for my open source Java database. It is very simple so far, based on a word list. Supports camel case and so on. It is here: H2 Database Engine, src/tools/org/h2/tools/doc/SpellChecker.java. Or here: SpellChecker.java. It can also check XML, HTML, JSP,... Words shorter than 2 or less characters are ignored. If you want to spin off you own project go ahead, I can help you.

    I have included it in the build script: Whenever you write more than a few lines of new code (or documentation) the spell checker will bark because it doesn't know the word. Maybe I should add an automated 'word list expander' that checks unknown words on the internet... Anyway, the hard part will be to convince your coworkers to use it.

    1. Re:I made one (open source) by hypersql · · Score: 1

      Some more details about my own spell checker:

      - Custom code solving my problem (not 'general purpose' yet)
      - Text starting with 'abc' is ignored (for random test data)
      - Some files are ignored (Japanese documentation for example)
      - There is one word list, you have to extend it yourself
      - Checks all files in a directory and all subdirectories
      - Some file types are ignored (unknown file types are listed)
      - Some directories (SVN, CSV) are ignored
      - CamelCase and UPPER_CASE: each word is checked individually
      - Java, quite fast, but not optimized yet
      - Just one class (plus one utilities), no other dependencies

      I hope this helps,
      Thomas

  59. Wow by ShakaUVM · · Score: 0, Redundant

    Wow, first good question I've heard asked on Slashdot in a long time.

    Very interesting idea.

  60. EASY by color · · Score: 1

    Don't ever put interface text messages in your code! use a separate messages file. Not only that it helps a lot with internationalization, but it makes really easy to spot and correct spelling errors. Also useful for logging.

    --
    -- EOF
    1. Re:EASY by Zelos · · Score: 1

      You're answering the wrong question. He's asking about spelling errors in code, not interface text. I doubt any serious developer is dumb enough to hardcode interface text in code.

  61. Resource Files by bizerk44 · · Score: 1

    I had a problem similar to this when I had to work with an offshore development team a few years ago. The solution we used (as did other people responding to this post) was to ensure that all the UI visible strings were moved to a resource file and we spell checked that instead of the source code. It allowed us to port to other languages quickly and cheaply too.

  62. Re:May I suggest.... ctags & aspell? by Anonymous Coward · · Score: 1, Interesting

    "Similarly, there should probably be a set of words added that aren't "English" but are used often enough to be worth adding to the dictionary. Things like Obj, Int, and Ptr."

    Or they are "English", such as a function that flags "setColour" as incorrect because it is a US English dictionary and British spelling.

    This is a non-trivial problem to do right. The spell checker has to be not only familiar with CamelCase, word fragments that might be added (like the Obj, Int, Ptr or various prefixes), and the programming language syntax, but it would also need to be familiar with the native spoken language.

    One strategy might be to strip out all the programming syntax fluff (something like ctags) and then run a spell checker on that with a custom dictionary and a script to split up such things as CamelCase. You'd have to do the same for comments (which ctags normally ignores).

    In any case, with ctags, something like aspell, and a bit of custom scripting and dictionary fiddling, it looks tricky but doable as a batch process. Doing it interactively in the editor would be slightly trickier, but if your editor can invoke programs, not hard.

  63. Re:Quit employing idiots? by dwarfsoft · · Score: 1

    Does that mean that we need an automated grammar checker for our code too?

    --
    Cheers, Chris
  64. What's the problem exactly? by DerCed · · Score: 0

    After you've tried to use functionSignature and study the compiler output, the spelling error will immediately become clear.
    I don't understand the problem. Most often you need variables, objects etc. more than once.

  65. Re:What the fuck is the OP on? by IDontAgreeWithYou · · Score: 1

    Well, yeah, unless you misspell it the same way every time.

    --
    Finding other idiots on /. that agree with your opinion doesn't make it any less stupid.
  66. Re:What the fuck is the OP on? by VagaStorm · · Score: 1

    What? Since when in what language will a function fail to compile if you have spelled it incorrectly? As a matter of fact, it will compile and most editors will pick up the spelling error as a legit function to be called from elsewhere in the code and will add it to list of autocompletable functions which will spread the error!

  67. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 1, Informative

    For the record, 'I' is a word.

    Not exactly. I is a word. Lower case I should get a red line still.

  68. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Nullav · · Score: 1

    It's not like comments matter much. If someone makes a few errors in a comment, it can still be read, if someone makes an error in the code, well...they cause an error.

    --
    I just read Slashdot for the articles.
  69. It's not your editors job by Anonymous Coward · · Score: 0

    "Nothing personal, but it's not actually a programmer's job to make sure everything is speelled correktly. "

    Apparently not. Good thing it's not a programmers job to do math right either.

    "This is part of the QA process before a product rolls out the door."

    Programmers are good at buckpassing, much like managers.

    "Sure, you should do your best, but you need another pair of eyes (or several pairs of eyes) looking at the UI in addition to your own."

    Yes, but are they really "doing their best"? One has to wonder sometimes when reading this forum.

    "You can easily miss the forest for the trees."

    Now when someone on slashdot complains about book publishers and the cost of books, remember why editors exist. Someone else "doing your job" is going to add to the bill.

  70. Annoying perhaps but by Taagehornet · · Score: 4, Interesting

    True, identifier names containing spelling errors can be a real annoyance, but I somehow doubt you'll ever find a usable solution, at least not as long as you'll need to interface to code beyond your control. What spell checker wouldn't choke on regular C++? Just picking a random declaration from MSDN (feel free to choose any other API, it won't change anything):

    HRESULT MFGetService(
    IUnknown* punkObject,
    REFGUID guidService,
    REFIID riid,
    LPVOID* ppvObject
    );


    You'll probably just end up spending all your day removing false positives.

    1. Re:Annoying perhaps but by Fnkmaster · · Score: 2, Insightful

      Just looking at that declaration makes me want to claw my eyes out. Bad C++ is almost (but not quite) as bad as Perl.

    2. Re:Annoying perhaps but by RogerWilco · · Score: 1

      I agree, it's not possible, given code examples like the one above.

      What I do think is important, is having all strings that the user sees in separate files, and run the spellchecker on those. It has the added benefit that translating your application in another language is now a lot easier.

      --
      RogerWilco the Adventurous Janitor
    3. Re:Annoying perhaps but by Anonymous Coward · · Score: 0

      Just looking at that declaration makes me want to claw my eyes out. Bad C++ is almost (but not quite) as bad as Perl.

      It's just a declaration! And it doesn't even involve STL in any way... You must have some serious allergies.

      IUnknown* punkObject,

      You punk objects! Get offa my pointer to lawn!
  71. Re:Quit employing idiots? by gazbo · · Score: 1

    Is it ironic that you don't know the meaning of the word "semantics"? Why yes. Yes, I do believe it is.

  72. visual assist by Anonymous Coward · · Score: 0

    visual assist by http://www.wholetomato.com/ for visual studio

  73. Job security? by WPIDalamar · · Score: 0

    I thought slight mispellings of words in code was a form of job security?

    class blah
    {
        private var wokrDay:Date;

        public function testDate(workDay) : Boolean
        {
            return wokrDay.isValid();
        }
    }

    Or at least a way to punish maintenance developers.

  74. MyEclipse 6.0 Has Spell checker by curmudgeon99 · · Score: 1

    The newest version of MyEclipse 6.0 has a spell checker. Now, if that's what you want, you can have it pretty cheaply. Personally, I think it's a question of education in general. If your co-workers are so poorly educated that they can't spell, then a spell checker is only going to solve the surface problem. Usually, bad spelling goes along with bad grammar and bad writing--which equates to bad thinking and logic. There are no absolute requirements for a bad speller to be an idiot, but I regret to say the two are correlated. I work in a large corporation and it is daily that I get some illiterate email from a co-worker that informs me that my collegue is really not that bright. So, with all respect, your peer's problem is larger than a spell checker could solve.

    1. Re:MyEclipse 6.0 Has Spell checker by skrolle2 · · Score: 1

      It obviously never occurred to you that there are a lot of programmers who are not native English speakers?

    2. Re:MyEclipse 6.0 Has Spell checker by curmudgeon99 · · Score: 1

      Yes, it has. But if you haven't noticed, slashdot is written in English. That generally implies that the persons reading it know and write in English. And if the programmer in question seeks to write code that will be worked on by other English speakers--for a site that is for English users--I think the expectation of being literate in English is reasonable. How many of us have gotten correspondences from non-native speakers of English that are entirely illiterate? I know I have received a lot. I myself speak Russian but I would not expect Russian speakers to accept crappy Russian. If I were expecting myself to code a Russian website, then I would expect that my internal code comments as well as the user-visible portions were literate. I don't see why that is such a high expectation.

  75. Flyspell by hatrisc · · Score: 1

    If you're an emacs users, just turn on the flyspell minor mode.

    --
    I write code.
    1. Re:Flyspell by jsled · · Score: 1

      ...and quickly watch it tag nearly everything as misspelled. You really want flyspell-prog-mode, but it only checks strings and comments.

    2. Re:Flyspell by Purple+Screws · · Score: 1
      Flyspell (along with Emacs's other spell-checking functions) doesn't work right with camel case. Here's a modified flyspell-get-word and flyspell-region which will handle camel case if ps-flyspell-check-subwords is set (copy this into your .emacs if you like.)

      (require 'flyspell)
      (require 'cc-subword)

      (defvar ps-flyspell-check-subwords nil
      "*Non-nil if Flyspell should check subwords separately.

      If this variable is set to non-nil, an identifier such
      MyLongFunctionName will be treated as four separate words (My,
      Long, Function, Name) for the purposes of Flyspell.")

      (defadvice flyspell-region (around subword-checking (beg end))
      "Check individual subwords if ps-flyspell-check-subwords is set."
      (if ps-flyspell-check-subwords
      ;; mostly copied from flyspell-small-region
      (save-excursion
      (if (> beg end)
      (let ((old beg))
      (setq beg end)
      (setq end old)))
      (goto-char beg)
      (let ((count 0))
      (while (< (point) end)
      (if (and flyspell-issue-message-flag (= count 100))
      (progn
      (message "Spell Checking...%d%%"
      (* 100 (/ (float (- (point) beg)) (- end beg))))
      (setq count 0))
      (setq count (+ 1 count)))
      (flyspell-word)
      (sit-for 0)
      (let ((cur (point)))
      (c-forward-subword 1)
      (if (and (< (point) end) (> (point) (+ cur 1)))
      (backward-char 1)))))
      (backward-char 1)
      (if flyspell-issue-message-flag (message "Spell Checking completed."))
      (flyspell-word))
      ad-do-it))

      (ad-activate 'flyspell-region)

      (defun flyspell-get-word (following &optional extra-otherchars)
      "Return the word for spell-checking according to Ispell syntax.
      If optional argument FOLLOWING is non-nil or if `flyspell-following-word'
      is non-nil when called interactively, then the following word
      \(rather than preceding\) is checked when the cursor is not over a word.
      Optional second argument contains otherchars that can be included in word
      many times.

      Word syntax described by `flyspell-dictionary-alist' (which see)."
      (let* ((flyspell-casechars (flyspell-get-casechars))
      (flyspell-casechars-non-initial (if ps-flyspell-check-subwords
      (downcase flyspell-casechars)
      flyspell-casechars))
      (flyspell-not-casechars (flyspell-get-not-casechars))
      (ispell-otherchars (ispell-get-otherchars))
      (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
      (word-start-regexp (if ps-flyspell-check-subwords
      (concat flyspell-not-casechars
      "\\|"
      (upcase flyspell-casechars))
      flyspell-not-casechars))
      (word-regexp (concat flyspell-casechars
      flyspell-casechars-non-initial
      "*\\("

    3. Re:Flyspell by dollargonzo · · Score: 1

      that doesn't seem to work properly for me. here's mine (a minor modification)

      it also ignores all words less than 5 characters long; this seems to work well with code. i built up a private aspell dictionary using all stdlib functions and reserved c/c++ keywords


      (defadvice flyspell-region (around subword-checking (beg end))
      "Check individual subwords if ps-flyspell-check-subwords is set."
      (if ps-flyspell-check-subwords ;; mostly copied from flyspell-small-region
      (save-excursion
      (if (> beg end)
      (let ((old beg))
      (setq beg end)
      (setq end old)))
      (goto-char beg)
      (let ((count 0))
      (while (= (length (car (save-excursion (flyspell-get-word nil)))) 5)
      (flyspell-word)) ;; (flyspell-word)
      (sit-for 0)
      (let ((cur (point)))
      (c-forward-subword 1)
      (if (and ( (point) (+ cur 1)))
      (backward-char 1)))))
      (backward-char 1)
      (if flyspell-issue-message-flag (message "Spell Checking completed."))
      (if (>= (length (car (save-excursion (flyspell-get-word nil)))) 5)
      (flyspell-word) 'nil))
      ad-do-it))

      (ad-activate 'flyspell-region)

      (defun flyspell-get-word (following &optional extra-otherchars)
      "Return the word for spell-checking according to Ispell syntax.
      If optional argument FOLLOWING is non-nil or if `flyspell-following-word'
      is non-nil when called interactively, then the following word
      \(rather than preceding\) is checked when the cursor is not over a word.
      Optional second argument contains otherchars that can be included in word
      many times.

      Word syntax described by `flyspell-dictionary-alist' (which see)."
      (let* ((flyspell-casechars (flyspell-get-casechars))
      (flyspell-casechars-non-initial (if ps-flyspell-check-subwords
      (downcase flyspell-casechars)
      flyspell-casechars))
      (flyspell-not-casechars (flyspell-get-not-casechars))
      (ispell-otherchars (ispell-get-otherchars))
      (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
      (word-regexp (concat flyspell-casechars
      flyspell-casechars-non-initial
      "*\\("
      (if (not (string= "" ispell-otherchars))

      --
      BSD is for people who love UNIX. Linux is for those who hate Microsoft.
    4. Re:Flyspell by dollargonzo · · Score: 2, Informative

      hate replying to myself, but it missed what they key part...

      (require 'flyspell)
      (require 'cc-subword)

      (defvar ps-flyspell-check-subwords nil
      "*Non-nil if Flyspell should check subwords separately.

      If this variable is set to non-nil, an identifier such
      MyLongFunctionName will be treated as four separate words (My,
      Long, Function, Name) for the purposes of Flyspell.")

      (defadvice flyspell-region (around subword-checking (beg end))
      "Check individual subwords if ps-flyspell-check-subwords is set."
      (if ps-flyspell-check-subwords
      ;; mostly copied from flyspell-small-region
      (save-excursion
      (if (> beg end)
      (let ((old beg))
      (setq beg end)
      (setq end old)))
      (goto-char beg)
      (let ((count 0))
      (while (< (point) end)
      (if (and flyspell-issue-message-flag (= count 100))
      (progn
      (message "Spell Checking...%d%%"
      (* 100 (/ (float (- (point) beg)) (- end beg))))
      (setq count 0))
      (setq count (+ 1 count)))
      (if (>= (length (car (save-excursion (flyspell-get-word nil)))) 5)
      (flyspell-word))
      ;; (flyspell-word)
      (sit-for 0)
      (let ((cur (point)))
      (c-forward-subword 1)
      (if (and (< (point) end) (> (point) (+ cur 1)))
      (backward-char 1)))))
      (backward-char 1)
      (if flyspell-issue-message-flag (message "Spell Checking completed."))
      (if (>= (length (car (save-excursion (flyspell-get-word nil)))) 5)
      (flyspell-word) 'nil))
      ad-do-it))

      (ad-activate 'flyspell-region)

      (defun flyspell-get-word (following &optional extra-otherchars)
      "Return the word for spell-checking according to Ispell syntax.
      If optional argument FOLLOWING is non-nil or if `flyspell-following-word'
      is non-nil when called interactively, then the following word
      \(rather than preceding\) is checked when the cursor is not over a word.
      Optional second argument contains otherchars that can be included in word
      many times.

      Word syntax described by `flyspell-dictionary-alist' (which see)."
      (let* ((flyspell-casechars (flyspell-get-casechars))
      (flyspell-casechars-non-initial (if ps-flyspell-check-subwords
      (downcase flyspell-casechars)
      flyspell-casechars))
      (flyspell-not-casechars (flyspell-get-not-casechars))
      (ispell-otherchars (ispell-get-otherchars))
      (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
      (word-regexp (concat flyspell-casechars
      flyspell-casechars-non-initial
      "*\\("
      (if (not (string= "" ispell-otherchars))
      (concat ispell-otherchars "?"))
      (if extra-otherchars
      (concat extra-otherchars "?"))

      --
      BSD is for people who love UNIX. Linux is for those who hate Microsoft.
  76. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 1, Interesting

    It's actually impossible for the computer to know whether you're creating an infinite loop.

  77. Visual Studio and other IDEs by Veretax · · Score: 0

    The closest thing I've ever seen in a IDE to a spellchecker are the intellisense functions that essentially allow you to type the first few letters of a namespace, class, member, or function and have it type out the rest of the words to you. I know this isn't exactly what you are looking for, but if spelling is something you want to work on, its time to break out the old noodle.

  78. Textmate can do it by Anonymous Coward · · Score: 0

    I'd like to reiterate that Textmate can do exactly what the OP is asking for. You can set spellchecking on or off for any scope in a language definition. What the parent post is describing is just the out-of-the-box setup. You need to jump in to the "bundle editor" and add some preferences. You could, for example, turn spellchecking on for comments, literal strings, function definitions and function calls, but off for variables and function arguments.

    1. Re:Textmate can do it by BrotherAias · · Score: 1

      TextMate can check any scope, this is true (including comments, which I've turned on and it's saved me some pain from my team)... but the spell checker doesn't handle CamelCase. Oddly enough it does handle underline_vars.

  79. solution by nazsco · · Score: 1

    1. post to /.
    2. use title "Sony rootkit source code 1/200"
    3. read grammar nazi comments
    4. profit!

  80. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by bytesex · · Score: 2, Informative

    Yeah, not to nitpick but, you see; 'i', being a variable-name, would be a properly camel-cased 'I' from the point of view of the spellchecker.

    --
    Religion is what happens when nature strikes and groupthink goes wrong.
  81. Man Dies Waiting for Eclipse to Launch by Anonymous Coward · · Score: 5, Funny

    Man Dies Waiting for Eclipse to Launch

    A software engineer in San Jose, CA was found dead at his desk yesterday, apparently having died while waiting for his Java editing program, Eclipse, to finish its boot process. Coworkers say the engineer came in that morning vowing to "get Eclipse working on his box or die trying." The last thing anyone heard him say aloud was the cryptic comment: "I see the splash screen is appropriately blue." Nobody knows what he meant. The man was then thought to have fallen asleep, but hours later it was discovered that the engineer had died suddenly of apparent natural causes. The forensics team's investigation that evening was reportedly interrupted unexpectedly when the dead man's Eclipse program suddenly finished launching. The team tried to interact with it to see if they could find clues about the man's death, but the program was unresponsive and the machine ultimately had to be rebooted. At this time, the police commissioner says there is no evidence of foul play, and they currently believe the man simply died of either boredom or frustration.

    1. Re:Man Dies Waiting for Eclipse to Launch by ravenlock · · Score: 5, Informative

      Credit where credit is due -- this is an excerpt from Stevey's Tech News, Issue #1.

    2. Re:Man Dies Waiting for Eclipse to Launch by Jaffa · · Score: 1, Informative
      Moderators: this is blatant plaigarism of a Steve Yegge post.

      And it wasn't that funny or topical when he first posted it, earlier this week.

    3. Re:Man Dies Waiting for Eclipse to Launch by Anonymous Coward · · Score: 0

      Score: -1 Tattle Tail

    4. Re:Man Dies Waiting for Eclipse to Launch by Anonymous Coward · · Score: 0, Informative
    5. Re:Man Dies Waiting for Eclipse to Launch by kalirion · · Score: 3, Interesting

      Here's one way to ensure an Eclipse launch takes enough time for you to go grocery shopping:

      Work in a windows environment in Virginia. Access the Eclipse workspace directory through a mounted drive pointing to your home directory on a UNIX box in Montana. On the UNIX machine, your home directory is actually mounted on a Windows box back in Virginia.

      God help you if you have the "compile on save" option enabled. And don't even THINK of rebuilding the workspace.

      And yes, I know this from experience.

    6. Re:Man Dies Waiting for Eclipse to Launch by laffer1 · · Score: 1

      It was done AC. How do we know it wasn't the guy who wrote it to begin with?

    7. Re:Man Dies Waiting for Eclipse to Launch by hobo+sapiens · · Score: 0, Troll

      Or, just try to use Eclipse out of the box without turning off everything that you don't need. Which of course, everyone has to do at least once. But then again, what do you expect? Eclipse is, after all, Java based. What, do you actually expect good performance?

      And yes, I know this from experience.

      --
      blah blah blah
    8. Re:Man Dies Waiting for Eclipse to Launch by Anonymous Coward · · Score: 0

      Java dose get good preformence!
      what year are you living in?

    9. Re:Man Dies Waiting for Eclipse to Launch by Daychilde · · Score: 1

      The same way I know that lottery ticket I bought earlier today isn't going to win me a million dollars.

      --
      A cheerful little bird is sitting here singing.
    10. Re:Man Dies Waiting for Eclipse to Launch by dbIII · · Score: 1

      It was done AC. How do we know it wasn't the guy who wrote it to begin with?

      This is slashdot - people here have worked out what "boot" means in the context of computers.

    11. Re:Man Dies Waiting for Eclipse to Launch by Anonymous Coward · · Score: 0

      Java. Good performance. Since when?

    12. Re:Man Dies Waiting for Eclipse to Launch by patio11 · · Score: 1

      Yes, and if you proxy all your connections through Simple Pigeon Protocol, then downloading new plugins takes forever. Silly Eclipse developers making totalizing assumptions about things like "hard disk seek times are probably not measured in seconds due to overly convoluted network setups" and "the Internet is accessed through a series of tubes, not via specially trained animals".

  82. One word for you: by benhocking · · Score: 1

    When it comes to StudlyCaps, anything identified as an identifier can be split _before_ any uppercase letter.
    LaTeX
    --
    Ben Hocking
    Need a professional organizer?
    1. Re:One word for you: by KiloByte · · Score: 0

      ExCePt ThAt LaTeX Is An OnE-ShOt ExCePtIoN, MaDe BeCaUsE ItS CrEaToRs WaNtEd To UsE A PsEuDo-GrEeK LeTtEr. AnD As WiTh AnY ExCePtIoN, ThEy'Re SoMeThInG YoU DuMp InTo YoUr UsEr DiCtIoNaRy.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    2. Re:One word for you: by Anonymous Coward · · Score: 0

      Knuth was a genius of course... but I still think that calling it 'TeX' was really stupid. It looks dumb, it's annoying to type, it breaks the flow, and... there's no redeeming properties that make that okay. (The typeset version's no better.)

      </rant>

  83. Re:Quit employing idiots? by Anonymous Coward · · Score: 0

    Yes, it's called a "compiler"

  84. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by somersault · · Score: 1

    There are some simple things that it could do as 'warnings' though, checking if the test variable is being referenced in the loop, or if it's a global variable it could check if it's modified in any functions being called etc.. you could have a poorly constructed loop that will only repeat infinitely in weird conditions, but the computer won't know that that isn't intentional of course.. and in certain programs you want 'infinite 'loops anyway, or loops that will run until you kill the app..

    --
    which is totally what she said
  85. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by kristoferkarlsson · · Score: 2, Informative

    Sure, it's the halting problem. We all know that. But there are several common cases where you can deduce that there is an infinite loop in the code. It won't catch all infinite loops, but that doesn't make it useless.

    (Suns Java seems to be good at detecting some of those by default when it complains about unreachable return statement)

  86. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by rspress · · Score: 2, Insightful

    Spell checkers are fine but they make mistakes as well. The best thing I have found, and this goes for any project, software or printed word, is to have someone who is not connected to the project or better yet not even connected with the subject proofread what the public sees. They will often catch mistakes that jump off the page but people working on the project just don't notice. I have made some really stupid mistakes that I never saw but were on the cover of a book I was publishing. I am SO glad it was proofread before it went to press.

    Attempting to tell programs the correct grammar or spelling does not always go well. While most will thank you for your input on catching their mistakes, others take it like you step on their babies head.

  87. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by cooley · · Score: 1

    So if you use fortran, you're screwed? No change there, then ... Of course, but we're talking about spell-checking here.

    (I keeed, I keeed)
    --
    Just then the floating disembodied head of Colonel Sanders started yelling Everything You Know Is Wrong!-Weird Al
  88. Word Lists by Bill+Dimm · · Score: 1

    You can find lists of words in various languages here:
    ftp://ftp.ox.ac.uk/pub/wordlists/
    I don't know anything about the quality or copyright status of this.

  89. Use any Spell Checker by Anonymous Coward · · Score: 0

    Just add all of your "Key Words" into the Spell Checker's locally recognized list.

    e. g. Add strlen, memset, alloc and you other favorite commands to the Spell Checker's list of recognized words.

    You can also add any of your Variable Names (whether or not they are spelled correctly).

  90. kdevelop by SolusSD · · Score: 1

    KDeleveop uses kwrite as an internal editor, which offers autocompletion of words-- so if you have a function, MyFunc, defined it will autocomplete it after you type Myf. This cuts down considerably on fat fingering function/object/variable names.

  91. Re:What the fuck is the OP on? by GNUALMAFUERTE · · Score: 0

    What GP meant is that if you misspell a function call (Not a function definition) You will get a compiler error stating you called an undefined function. Technically speaking, there is no way to misspell a function definition. That is, You are creating the function, any name will be OK. You can make grammatical or syntactical mistakes anyway.

    The Problem here is the assumption that a function name is english/spanish/whatever. W R O N G. When you code, you are writing in a language, a programming language. If a function name is a reference to a word from another language (For example, MyCounter is a reference to the English word "counter") That is Intertextuality, and a spellchecker is not supposed to understand it.

    Taking this into account, there is an spell checker for programming languages, It's called a Compiler.

    --
    WTF am I doing replying to an AC at 5 A.M on a Friday night?
  92. Re:Quit employing idiots? by dwarfsoft · · Score: 1

    Ah, but will the compiler fix the grammar in your comments?

    --
    Cheers, Chris
  93. ego != good_open_minded_programmer by MindKata · · Score: 5, Insightful

    "Any douche who doesn't realise a misspelt function name will fail to compile clearly hasn't written any code yet."

    You clearly fail to see a programmer can also create their own function names, as well as use other peoples functions. So you prove you are a very inexperienced programmer, (and close minded), which adds weight to the idea you are either young or just arrogant. Also your very apparent need to show hostility, shows a degree of insecurity, where you are over compensating, by verbally hitting out at others, in an attempt to appear to be more knowledgeable than you really are.

    The easiest way to become a better programmer, is to be more open minded. So far you have failed to demonstrate this.

    As a side note, (back in the DOS days of programming), I found the the spell checker in Multiedit very useful (especially when having to work very late at night, after the coffee stopped working! ;)

    --
    There are 10 kinds of people in the world... those who understand binary and those who don't.
    1. Re:ego != good_open_minded_programmer by SausageOfDoom · · Score: 2, Funny

      Your ideas are intriguing to me and I wish to subscribe to your newsletter.

    2. Re:ego != good_open_minded_programmer by KavyBoy · · Score: 5, Funny

      From the GP's website when view without Flash:
      We're the do-anything team that specialises in imaginging new ways for you to reach your audience.

      The word "pwned" doesn't spell check correctly either, but it is applicable.

    3. Re:ego != good_open_minded_programmer by kalidasa · · Score: 1

      It looks like somebody doesn't understand that there's "mis-spelled under the domain of English" and "mis-spelled under the domain of the existing functions in this program" and that while a compiler can manage the latter quite easily, it's usually not smart enough to figure out the former.

    4. Re:ego != good_open_minded_programmer by Anonymous Coward · · Score: 0

      Or you could just see that he was joking and laugh... but that's just TOO OPEN-MINDED FOR YOU!!!!!!!1111

    5. Re:ego != good_open_minded_programmer by Anonymous Coward · · Score: 0

      For the programmers, there are two senses of the word misspelled. First, an identifier can be misspelled in the sense that it does not match the identifier they intended to use (whether this results in a compile-time error or the unintentional instantiation of a new variable depends on the programming language). Second, an identifier can be misspelled according to the norms of the natural language the code is being documented in. It is aggravating when I am using someone else's code and some identifiers are misspelled whereas others are spelled correctly; this makes it burdensome to remember the typo/misspelling of the identifier. Consistency is king.

  94. code yourself one!!! by dskhidia · · Score: 1

    Its actually simple , code a lexer and the feed all the variable names to a dictionary.You can also use standard lexers like Flex.

  95. linkers/loaders used to generate lists of names by AncientWarrior · · Score: 2, Informative

    how about hacking the linker map file to generate a list of function/variable names? ie, "ld -M". then run the resulting word list through a standard spell checker. the thing is, all you really need is a way ti generate a list of names...

    1. Re:linkers/loaders used to generate lists of names by jgrahn · · Score: 1

      how about hacking the linker map file to generate a list of function/variable names? ie, "ld -M".

      Seems to me the following would be good enough for many purposes (assuming C, C++ or similar source). When spellchecking a set of source files:

      • "make all" and use nm(1), the linker or similar to extract some frequently used symbols into file E.
      • Use ispell (or whatever your favorite spell checker is) with the normal english word/spelling database
      • ... but also add file E as a list of spelling exceptions
      • ... and configure it so that your private dictionary is the file P, local to this set of source files
      • if you like CamelCase, consider options like "ispell -C".

      Or, you could just use aspell:

      tuva:~> aspell --help | grep C++
      ccpp mode for checking C++ comments and string literals
  96. mho by Caesar+Tjalbo · · Score: 0

    I see, the problem is that function and variablenames often aren't normal words. I can't think of a way to solve the issue 100% but I can suggest an approach that may cover a large and important part.
    - first you'd want to have coding standards with naming standards. From this it should be possible to extract a set of acceptable abbreviations, nameparts and pre & postfixes.
    - then look at the problem domain. Ideally there's a dictionary already of domain related verbs and nouns with their definitions, if only to improve communication between designers and programmers. Additionally you probably have a sort of general system wide design with items like classes, relations, files, devices, etc needed by several projects. These can be in plain language and therefore subjected to an ordinary spellchecker.
    - both then lead to a project dependent collection of words. A context sensitive (able to recognize functionnames etc) word chopper breaks your variablenames in parts and compares them to that collection like a spellchecker. It's not necessary to break according to capitalization or underscores but it would make things a little easier. I think it's do-able up 'till here but it gets tricky when you want to leave language words out. Keywords aren't the problem of course, difficulties will arise with libraries which don't adhere to your standards. Perhaps it's possible to identify names and add them to an exceptions list.
    - it'd be great when this works at least to the point where the main coding parts (APIs, classes, public methods/functions, etc.) are correct because too much detail will get too expensive (to develop, run and use) and your coders won't like it. If the 'outside' is correct then only a maintainer will see misspellings in the code and it'll be so local that it can be corrected if desired.

    --
    "I'm not much interested in interoperability. I want substitutability. I want to be able to throw your software out."
  97. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by PJ6 · · Score: 1

    In 2007, providing a development tool that does not auto-correct and point out misspellings, syntax errors, etc, is like providing a car without a windshield because the first cars didn't use them, and technically the driver doesn't need it. How many years - what is it, now, well over a decade? - that Visual Studio has had "Intellisense", that does exactly what the poster describes. I just don't understand this anti-MS holier-than-thou attitude when non-MS developers ask questions like these.

  98. EditPadPro can do this to some degree by KutuluWare · · Score: 1

    EditPadPro (www.jgsoft.com) is not free, in either sense, but it's very cheap for what it does. I have turned most of the development teams at my last three jobs onto it. One of its key features is configurable, user-extensible syntax highlighting. The highlighter includes the option to exclude matched language tokens from spellchecking. In the built-in highlighting schemes, for example, it will usually spellcheck inside comments but not much else, but as mentioned, you can easily take their color scheme and change it to suit.

    --K

  99. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Brian+Gordon · · Score: 0

    Why don't they just use an IDE? Visual Studio autocompletes variable and function names, and of course in most cases a misspelling in a string literal wouldn't cause an error.

  100. Re:Quit employing idiots? by NekoXP · · Score: 1

    How wonderfully ironic :)

    Still, the point stands; if your developers can't form a coherent sentence using well-spelled function names I'd fear for their code in the first place. It only takes a couple of typos to make code readability drop through the floor. You don't want automated tools you want to hire developers who can write.

    But, the quality of education seems to have declined in recent years. I remember writing stuff for English class at school and you'd get your work scribbled in red ink for making spelling mistakes, all the time. I've looked at my brother's marked English homework (he's 15) and even the glaring mistakes are missed. Having to type everything rather than hand write it seems to be the source.

    People need to be able to write, and not just trust a spell checker. But then again, this ALSO falls down when you don't have native English speakers on staff.

    I've got a couple of projects on the radar right now where tiny spelling mistakes are in production code - API definitions, symbols that are exported - that just appear in every version. If someone had been reviewing and had an eye for it they would be fixed. What doesn't help is none of the guys on the projects are English or American besides me..

  101. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 0

    Eclipse sucks ass because I can't split the display window - something I could do with Emacs say... 20 years ago...

  102. Wrong solution. by Ant+P. · · Score: 1

    I want a spell checker that knows that void *functionSigniture(char *myRoutine) contains one spelling error. What you want here is something that realises the function is only referenced in either one definition or one call because of the typo and flags it as an error. Most interpreters/compilers can already do this.
    If you mean you've made the same typo everywhere, either it wasn't noticeable enough to matter or you can just do a global find/replace on it.
    1. Re:Wrong solution. by Riktov · · Score: 1

      The problem isn't typos -- words that the writer would know are misspelled if he saw them. It's words which the writer mistakenly believes to be spelled correctly. Then another coder comes along, skims over the API docs, tries to call functionSignature(), and finds that for some reason the function isn't defined.

      Or maybe the code makes it into a release, and now the API reference has to list the function as functionSigniture(), which looks bad and probably causes headaches for the documentation writers and proofreaders.

  103. Re:Quit employing idiots? by NekoXP · · Score: 1

    They're not so much idiots, but I would find it INCREDIBLY difficult to name a function "functionSigniture". It's just WRONG.

    There is absolutely no reason for spelling it that way, even if you're Hooked On Phonics, it isn't pronounced that way in any language approaching English.

    If this is an exported API function then it would cause a huge problem. Now, consider that a guy who is writing a function which calculates some kind of signature (perhaps a hash or a certification routine) cannot even spell the word which describes what he is doing. Does that give you confidence that the signature function is correct?

  104. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 0

    I use the Eclipse spell check but with a custom dictionary. I just add my idiosyncracies into the dictionary. THat's on Ecliopse 3.2.2 You need to download the dictionary I think, at least I did cos I wanted UK spelling... (am with Henry Higgins on english use in the US)

  105. Re:What the fuck is the OP on? by cyclop · · Score: 1

    Technically is a lint.

    --
    -- Patent no.123456: A way to personalize /. comments with a sig attached to the end.
  106. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by ravenlock · · Score: 1

    Spell checking variable names isn't exactly what IntelliSense does, and Eclipse is actually better than vanilla VS.Net at producing red squigglies under your code (I'm told that VS does it for Visual Basic, but for C# you need something like ReSharper).

    I don't see this as a "MS bad" kind of thing, rather just a really low-impact "problem" that would be less than trivial to fix.

  107. Create your own Programming Language Dictionary by MrNobodyOne · · Score: 1

    Why not simply create your own custom.dic file and use it with a text editor. Although my work is not with programming languages, I've found that having a 'legal.dic' containing legal terminology and 'audit.dic' containing auditor terminology has been invaluable with my work. I can't imagine not being able to do the same for program code, since much of the codes are predefined in a lexicon and easily transferred to a dictionary file.

  108. Re:What the fuck is the OP on? by VagaStorm · · Score: 1

    Yeah, but article poster stated that he wants a spell checker that fill note that thers an error in "void functionSigniture(some)" which dos makes kinda sense in a shared project where others will have to work with an existing error and fixing it can be tedious. My guess is that using aspell and just divide function names on capital letters and _ it should be little problem to implement. It will however demand some structure to your function names, so no calculateWhereYuoarerightNow(), but that should usually be mildly inconvenient. The compiler however is great at interpreting a programing language, but dont give a rats arse if the function names are readable and correctly spelled....

  109. spell checking the kitchen sink by Anonymous Coward · · Score: 0

    I wrote i source code parser in PERL that did exactly this as just one of it's many functions....
    Clean code, pretty structure, correct English spelling, consistant naming conventions....
    PERL is every man's friend.

  110. Check for typos instead by fgouget · · Score: 2, Interesting

    I'm not sure spell-checking can really be made to work because, by definition spell-checkers flag anything that is not in the allowed list (also called dictionary) as an error. But source code always contains tons of identifiers that are not real words, like pid, ret, req, riid, etc. The problem is that there are hundreds if not thousands of them in a large project and that you get a ton of new ones making the maintenance of a custom directory a pain.

    But I've been annoyed by spelling errors too and what I noticed is that the same errors come over and over again. So what I did is write a script that specifically checks for common typos. And I've very imaginatively called it 'typos'.

    What's great with this approach is that, no matter whether you're writing a C, Perl, PHP or HTML file, 'seperate' is never going to be a real word. So we can identify these with no cumbersome custom dictionary, and a very very low false positive rate.

    Typos is open-source (GPL) and has no dependency that I know of (besides perl). So you can try it out just by downloading it, making the script executable, and running it with no argument on your source:

    1. Re:Check for typos instead by gnasher719 · · Score: 1

      >> I'm not sure spell-checking can really be made to work because, by definition spell-checkers flag anything that is not in the allowed list (also called dictionary) as an error.

      That's not what a spelling checker does (I think you mean spelling checker, not spell checker. Unless you are Harry Potter or one of his friends, you don't need a spell checker). For example, there is no dictionary in the world containing all German words. It is not possible, because words can be constructed from other words. For example, what you wrote would be a Wörterbuchrechtschreibeprüfungsunbrauchbarkeitshyp othese and is both false and not present in any dictionary.

      A spelling checker checks whether a word is written correctly or incorrectly. The rest is implementation detail. A spelling checker for a programming language would obviously have to have some good knowledge of conventions used to determine whether an identifier is written correctly or not; this would be very much algorithmic and not dictionary-based.

      An advanced spelling checker would also know about different conventions for different kinds of identifiers (like macro names must be all uppercase, different styles for local, static and global variables, etc. ). A difficult problem, but far from impossible to solve.

    2. Re:Check for typos instead by fgouget · · Score: 1

      (I think you mean spelling checker, not spell checker. Unless you are Harry Potter or one of his friends, you don't need a spell checker). Hehe. Good point. Lame excuse: Slashdot's title made me do it!

      For example, there is no dictionary in the world containing all German words. It is not possible, because words can be constructed from other words. For example, what you wrote would be a Wörterbuchrechtschreibeprüfungsunbrauchbarkeitshyp othese and is both false and not present in any dictionary.

      A spelling checker checks whether a word is written correctly or incorrectly. The rest is implementation detail.

      Still, all those that exist are based on a list of allowed words, together with algorithms for generating valid prefixes and suffixes to reduce the size of that list. But that is an implementation detail. And yes, for some languages taking into account composed words is one of those necessary optimizations.

      But composed words are easy. The hard thing is abbreviations because they should not be flagged as errors... unless you want to make your programmers crazy. How will a spelling checker know that 'ofs' (old file size), ptb (a pointer to data in the Teb), pfdesc (poll file descriptor), uaddrlen (length of the Unix structure containing an ip v4 address) are all valid, but pfildesc or uadrlen is not? Making this determination requires understanding the meaning of the abbreviations which is not something computers are capable of doing (yet anyway).

      So you'll be forced to use heuristics which will either have tons of false positives and be rejected by programmers, or which will have tons of false negatives, at which point I would not consider it a true spelling checker anymore.

  111. Semantic checker for method names in Java by einarwh · · Score: 1

    I'm working on an Eclipse plug-in that aims to go beyond spell-checking (although it will implicitly do that too), into verifying that the name you choose for your method fits the implementation. This is possible to do since you can extract the approximate semantics of method names from a large set of implementations -- in short, since most get methods tend to do roughly the same stuff, you can capture the essence of what "get" means. A nifty feature that I'd like to work in as well is the ability to automatically generate a reasonable name when performing an "extract method" refactoring. See my papers for details.

  112. Re:Quit employing idiots? by Double+Entendre · · Score: 1

    In principle, I'm with you on notion of spelling. I think that proper diction is essential to properly communicating and how people perceive you. Let's face it - a well worded reply, for example, is likely to be viewed more favourably than one that is littered with mistakes even if the actual message is the same. Similarly, properly worded code is going to inspire more confidence than one that looks like it was written by children.

    But I can foresee situations in which the developers do make genuine mistakes. "Signiture" is probably a poor example because it relates to a very specific task if you're talking something like encryption. But with other less critical tasks, these can bubble up. Ultimately, developing is coming up with solutions to known problems - spelling has little to do with that core exercise. Of course, there's the issue that the commenting may likely follow suit, but that's another story.

    I think that truly superb developers should have both qualities but ideal characteristics are rarely easily found. That's why it's necessary for people with different proficiencies are required to spot such mistakes early on. Like the original parent said, a system design document (SDD) would easily nail this from the get-go, especially if multiple people are collaborating on a project. After all, a software development project really shouldn't have only one person involved.

  113. Re:Quit employing idiots? by SQLGuru · · Score: 1

    Apparently you haven't lived in the south much. I know plenty of redneck hicks that would pronounce it sig-ni-chure and half of them would probably spell it that way.......how many of them are smart enough to be programmers is up to debate, but based on some of the contractors that have been sent to us that we wind up rejecting, I wouldn't be surprised if it was twice what should be......

    Layne

  114. How about a spellchecker preprocessor? by mtgradwell · · Score: 1
    Since the purpose is to fix embarrassing errors before users get to see them, there's no need for an as-you-type checker. Instead the code could be fed as a whole through a batch spellchecker. This could be a normal spellchecker with a preprocessor which converts "CamelCode" to (non-) "camel code". The preprocessor could then discard any resulting fragments which are just one or two characters long. Known keywords could either be filtered out by the preprocessor or just added to the spellchecker's dictionary.


    This leaves the problems of ubiquitous abbreviations in code, e.g. QuatMult for quaternion multiplication, and non-English function names in pre-existing libraries over which we have no control. These problems can be solved by counting the occurrences of candidate errors and seeing if the count exceeds some threshold. If "quat" occurs 100 times in your code then it's a safe bet that it's a valid abbreviation and/or part of some widely used library. In that case we could consider automatically adding it to the dictionary. It's only likely to be a misspelling of quit if it occurs just three or four times (I'm assuming that the spellchecking operation is performed frequently enough to catch all such errors "in the bud" before they propagate wildly. If not then it's likely to be a case of StabulDoorHorseBolted.)


    If widely-used character sequences are automatically added to the dictionary, we could rely on this same process to add the keywords of the language to the spellchecker dictionary automatically, saving some manual effort. It would then be easy to add the few remaining false positives (rarely used keywords) to the dictionary by hand. Of course there's probably some code somewhere that does all this already.

  115. A rough algorithm by Riktov · · Score: 1

    Only check words greater than 6-7 letters long. Find all dictionary words that are the same length +/- 1 and start with the same letter (nobody gets that wrong). From those, find all words that have almost all the same letters in the same place. (Search from both ends, and if you've covered 80% of the word by the time both searches find a difference, it's a hit.)

    Flag if the difference is:
    A single vowel replaced by another incorrect one - signiture, independant, definate, seperate
    Repeated consonants where there should be only one, or vice versa. - bussiness, occurence

    I bet that would catch 95% of these sorts of misspellings with very few false positives.

  116. ISAGN... by Tiger · · Score: 1

    It's really awful to have to write a very diplomatically phrased email to a team leader to explain that one of his coders has created an API in which they have consistently and unfailingly used the word "Recieve", and that some day that API will probably be part of what we expose externally, and that you'd really appreciate it being fixed before people actually start using it. But it's even worse when the API is specced in a Word doc and the misspeelings are in there, too.

    Worst of all, though, is trying to use the damn API while your brain is distracting you with fits of "I before E except after C!"

    None the less, the shame I felt in raising the issue at all was matched only by my disappointment that no one else had caught it already.

  117. Priorities by Anonymous Coward · · Score: 0
    There are a few priorities / optimizations one might follow when implementing a spell checker:
    • Proper Upper/Lower case according to the project standards should be easy to check
    • Public interfaces (class names, method names etc.) are more important than local variables
    • In our company we rarely use abbreviations in (public) class and method names, so at least these could be checked easily
    • Some typos are typical for fast writers, e.g. I've been typing "statefule" instead of "stateful" for two weeks... So there are definitely some good candidates for blacklists
  118. Re:What the fuck is the OP on? by Anonymous Coward · · Score: 0

    I'm surprised that in all your arrogance you didn't bother to spell check your own post. `misspelt` is not a word. The correct spelling is 'misspelled'.

  119. You are not a good programmer if you can't spell by Anonymous Coward · · Score: 0

    Being a good programmer requires, DEMANDS, a meticulous and thorough approach, as well as dedication to doing things right. If you have those qualities, you don't make spelling errors to begin with. If you don't have them, or would rather use a crutch (spell checker) instead of developing them, get the fuck out of my profession and go flip burgers or something. I'm serious.

  120. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by aichpvee · · Score: 1

    While most will thank you for your input on catching their mistakes, others take it like you stepped on their baby's head. Good point.
    --
    The Farewell Tour II
  121. Re:What the fuck is the OP on? by brusk · · Score: 2, Interesting

    You have one again confirmed Hartman's Law (or Skitt's, depending on preference; see http://en.wikipedia.org/wiki/Hartman's_law).

    "Misspelt" is a legitimate spelling in British English. It's in the OED, with examples from 1762 to 1990.

    Since I have just corrected you, I assume I have made an error somewhere in this post, though I haven't managed to find it.

    --
    .sig withheld by request
  122. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 0

    Sounds sort of like what goes on in my code editor of choice.

  123. I created something for this by coldtone · · Score: 1

    A long time ago i created a spell check task for ant to do just this.
    http://code.google.com/p/antspell/

    It looks like it has been forked http://code.google.com/p/bspell/ seams to be in active development.

  124. Re:What the fuck is the OP on? by Anonymous Coward · · Score: 5, Funny

    It's in the third word. You missed a letter.

  125. Customer Facing Code? by Greyfox · · Score: 1
    Seems like you'd want a team for that. You send them your strings and they proofread and translate into three or four other languages for you. Having to send your strings to a translation team whenever you make a change to the interface is kind of a pain, but they do tend to be very good at catching spelling and grammar errors.

    For internal use code, everyone should know what "Whch option are you having the most of?" means, anyway. Heh heh heh.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  126. Custom dictionary by foniksonik · · Score: 1

    For a big project that has time budgeted for this sort of thing, you could adapt any number of spell checking text editors which accept custom dictionaries that can have words added on the fly. The only requirement would be that it could read a plain text file without needing to convert it to some other format first. On OS X I use BBEdit for this type of thing.

    In general the idea is to create a custom dictionary with your known set of function names, variables, etc. and have your QC team add new ones as they are doing the check each day. It would probably help to start with a library pre-populated with words of your chosen programming language of course.

    --
    A fool throws a stone into a well and a thousand sages can not remove it.
  127. Actually, I'm pretty sure that LaTeX... by benhocking · · Score: 1

    Actually, I'm pretty sure that LaTeX gets its unusual capitalization from TeX, which is capitalized that way based off its logo emphasizing its typesetting abilities. Of course, there are also quite a few derivatives: ConTeXt, TeX-XeT, MiKTeX, TeXeT, BibTeX, and others. And, lest you think you can screen for the existence of "TeX", there's also LyX. Still, dumping them into a user dictionary is a relatively painless way of dealing with them.

    --
    Ben Hocking
    Need a professional organizer?
  128. Re:What the fuck is the OP on? by drig · · Score: 1

    $ man creat

    --
    Citizens Against Plate Tectonics
  129. An old story to support you by Anonymous Coward · · Score: 0

    I had a old professor who is a German, he got his Ph. D. in US. And when he was a graduate student, he wrote a Fortran program once, but it didn't compile. He read through the code several times and could not find any problem. Then he called a TA from sort of CS department at that time. The TA couldn't figure out the problem either. After several hours, they got tired and gave up. At that night, my professor suddenly realized on his bed, at all the places he should write "Function", he wrote "Funktion", which was German. So even the program doesn't compile, we can't really tell what's the problem.

    1. Re:An old story to support you by porges · · Score: 1

      I was doing a summer program in Brooklyn many years ago, and some of the people were having trouble with their Fortran declarations because the compiler wouldn't accept INTERGER. Sounds like a joke, but true.

  130. Code Reviews by pev · · Score: 1

    Um... Don't you do code reviews before code becomes mainstream or gets released?

  131. Re:You are not a good programmer if you can't spel by funwithBSD · · Score: 1

    Hey now, no need to be like that.

    They can come be a SysAdmin, where we value practicality over chisling code on a card punch because "That is the way REAL programmers do it."

    --
    Never answer an anonymous letter. - Yogi Berra
  132. Watt wood-eyed dew width aught mine ice bell Czech by The+Monster · · Score: 1
    So when is it "I", and when is it "i"?

    A spell-checker either sees the word as being in its dictionary or not, but doesn't know in what contexts it is valid. It doesn't know that a possessive pronoun doesn't have an apostrophe in it, but a contraction or possessive noun does; that there are pairs and triplets of homophones; and other ways in which words can be used incorrectly, yet still be valid spellings in other contexts.

    Their having trouble with there server they're. I knew on cite that the sight was hosed, but I can't site the exact reason why. Allot of coders thing grammer and spelling isn't important anyways; they don't want to here about it, but it has an affect on the work they do. I must of been razed by weird parents to grow up knowing the difference between and article an a conjunction.

    Watt wood-eyed dew width aught mine ice bell Czech her?

    And don't forget 'referer', 'umount', and similar misspelled words that are correct when dealing with computers.
    --

    [100% ISO 646 Compliant]
    SVM, ERGO MONSTRO.

  133. A way this could work for variable names by Headcase88 · · Score: 1

    All right, I don't have any answers for you, and I'm not even a programmer (outside of QBasic games), but I thought I'd share this idea with how a programming spell-checker could work. It seems too simple so there's probably flaws with it, or someone would have done it by now, but anyway:

    First, as normal, a syntax checker looks for issues when you enter a new line. If it sees what should be a variable* name, a little icon appears next to it which means "new". The programmer seems the icon and is satisfied as this is, indeed, the first time they used the variable.

    Also at this point, the computer adds the variable to a variable list

    Ok, so on subsequent uses of the variable, the computer looks it up on the list, sees it there, and so doesn't display the "new" icon.

    And of course, if you see the new icon when you've used the variable already, then you either made a spelling mistake now, or you did when you first made the variable. Either way, it's brought to your attention (assuming you remember using the variable before). If you clear the line with the "new" icon, it's removed from your variable list automatically.

    *Variable is used in this example, there can be other lists for other stuff such as sub-routine, function, constant, etc.

    --
    "When the atomic bomb goes off there's devastation...but when the atomic bong goes off there's celebraaaaation!"
  134. Parent is NOT redundant. by Anonymous Coward · · Score: 0

    No, that was not "redundant"... Come on mods, do it right, or don't bother.

  135. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by cnettel · · Score: 1

    The problem is that very autocompletion. That means that you are getting used to long function names where you only skim over the exact letters, so you can in fact get a spelling error in a public class, use it and release it only to actually find the error and fix it too late. And then you can't fix it, because you're breaking your interface!

  136. A painful experience by Tom+DBA · · Score: 2, Funny

    I was doing work at NASA. NASA was still into punch cards years after very powerful text editors came into existence. I remember the day my girl friend offered to key punch the PDP-11 code I had written onto coding pad to cards. "Honey, you sure can't spell very good. Good thing I caught it. Move is spelled with an 'e'." :-(

  137. stop offshoring by Anonymous Coward · · Score: 0

    Stop offshoring your code and you'll get much better spelling. This is from experience.

  138. False Positives by jeff_schiller · · Score: 1

    I agree that it seems like you'd spend most of your time removing false positives. I'm not totally adverse to the idea, but like a lot of people posting I just don't see how it could be done effectively - maybe that means I'm getting old...

    Programming is different than languages that we use to speak - vocabulary and style are nearly unbounded, abbreviations are common-place, etc. You can make up the words as you go along...

    Is "refererr" a spelling mistake? Maybe it refers to some error? Maybe they were trying for "referrer"?

    What about "Srvc"? "Servc"? "Servce"?

    What about "funcy" ? Is it a function pointer or the word "fancy" or the word "funky" ? Does "funCy" make a difference?

    To get this anywhere near effective, it seems like you'd have to impose some restrictions on style and variable naming, and yes - I consider that restriction a bad thing.

  139. Ken Thompson and creat() by Maximum+Prophet · · Score: 4, Interesting

    Wow, 240 comments about spelling and programming and no-one's mentioned the famous Ken Thompson quote:

    "If I had to do it over again? Hmm... I guess I'd spell 'creat' with an 'e'."

    --
    All ideas^H^H^H^H^Hprocesses in this post are Patent Pending. (as well as the process of patenting all postings)
    1. Re:Ken Thompson and creat() by 808140 · · Score: 2, Interesting

      This is completely off the top of my head, but do you remember how early C compilers used to only recognize the first six characters of a function name? So, for example, create_foo() and create_bar() were recognized the same way.

      Now, in essentially every program in the world there is a function named 'create_something' or alternatively 'createSomething'. Had Ken Thompson's creat() function been spelled create(), early C compilers would have treated them the same way, thus making any function starting with "create" useless (not to mention resulting in error-prone behavior: which function actually gets called? It varies by compiler...)

      By naming the function 'creat', KT neatly sidestepped the whole problem. I wonder if that's why he did it? Either way, if he did it all over again, and this time named the function create(), no early programs would have been able to have any function that started with those six letters. Our programming habits would thus be quite different. Perhaps we'd have to say creat_foo() instead...

      I never use the creat() function anyway (it's just an alias for open()) so frankly I prefer it this way. Of course, today's compilers no longer have the silly 6-character rule, but if you're aiming to write über-portable code, it's still advisable to have all your function and global variable names unique in the first six characters. There are utilities that will verify that this is the case for you.

      By the way, do you have a source for that quote? I've heard it too, but I'd be interested in knowing where KT said it.

    2. Re:Ken Thompson and creat() by Kupek · · Score: 1

      I imagine if he used create instead of creat, early C compilers would have recognized the first 7 characters. C and UNIX grew up together.

    3. Re:Ken Thompson and creat() by optimusNauta · · Score: 1

      Well then you'd have to use CamelCase. create_foo would still be the same as create_bar.

      Doh!

    4. Re:Ken Thompson and creat() by Maximum+Prophet · · Score: 1
      According to this website: http://c2.com/cgi/wiki?MeaningfulName

      When Ken Thompson and Dennis Ritchie received the 1983 Turing Award, after their respective acceptance speeches, someone in the audience asked Ken what he would do differently with Unix if he were to do it all over again. He said, "I'd spell 'creat' with an 'e'."
      --
      All ideas^H^H^H^H^Hprocesses in this post are Patent Pending. (as well as the process of patenting all postings)
    5. Re:Ken Thompson and creat() by 808140 · · Score: 1

      Maybe, but you know -- something as annoying as the 6 character restriction probably didn't come about arbitrarily. They were using an old PDP here, lest we forget -- there may have been space constraints. (I have no idea, I'm just hazarding a guess).

  140. Emacs - ispell-check-comments by SuperKendall · · Score: 2, Informative

    Still a great IDE after all these years...

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Emacs - ispell-check-comments by frazer2669 · · Score: 1

      ispell-comments-and-strings actually (at least in Emacs 22). The 'strings' part is what really helps avoid embarrassing user-facing errors.

    2. Re:Emacs - ispell-check-comments by SuperKendall · · Score: 1

      Thanks, I must have been using an older version of the iSpell library when I was using that feature... I agree that checking strings would be quite handy as well.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
  141. KDE uses one by tricasse · · Score: 1

    Have a look at Krazy, the EBN's code quality checker if you want more info. It detects common spelling errors and suggests the appropriate spelling (US English); it's done via a Perl script IIRC with different modules for the various check types.

  142. Quick Answer by gatesvp · · Score: 1

    Not really, this is pointless. It may be nice to fix comments, but the very code itself will be rife with specific jargon that no spell-checked will appropriately handle.

    Anyone who's worked with a POS system knows the definition of PO. The spell-checker won't pick up on this, but everybody (users, analysts, programmers, testers, support staff) will refer to this object as a PO. So then you'll also need to make the dictionary jargon-aware. Don't know if you've ever been on a government or large-business project, but this is an issue in and of itself. It's typical for big companies to actually have an on-line list (wiki-style) of the "commonly-used" acronyms in the company, and they're not all 3 letters.

    I mean, is this function name incorrect? TransferUrisPOToJiruSofToPrint. That means something to people I worked with, but means absolutely nothing to the spell-checker. So even if you or someone else has "the solution", this is definitely not some type "hey, just add spell checker" problem, you're also pumping in 4 different acronyms just to make this function pass.

  143. M-x ispell-comments-and-strings by Anonymous Coward · · Score: 0

    works for me. Does not cover identifiers though

  144. Should also exclude library functions by Random832 · · Score: 1

    Hardly any C library functions are real words. Plus, matching the actual name of a function is more important than being "spelled right", so far from checking actual code, it could essentially ONLY check function prototypes and variable declarations, and tell you to refactor-rename them.

    --
    We've secretly replaced Slashdot with new Folgers Crystals - let's see if it notices.
  145. I Have One by DynaSoar · · Score: 1

    I have a spell checker that's extensable. It's in AppleWorks. I put in all the commands and some commonly used variables and arguments like D$ = CHR$(4) from AppleSoft BASIC. Works great. It'd do assembly too if I put in the 6502/65816 op codes.

    As for "I don't want a text spell checker, I want a programming-language-aware spell checker", put down the bong and get away from the keyboard for a while. All spell checkers check text no matter what the content, as long as it's made aware of the text to be tested (ie. can be extended via typed additions, linked text files containing the terms, or extended by asking if terms from proven programs that are marked wrong really are and asks if you want to add it to the dictionary). If you're doing your editing in an unextensable closed and proprietary editing routine built into a programming software package rather than linking to an external editor, you're hosed; stop it.

    --
    "I may be synthetic, but I'm not stupid." -- Bishop 341-B
  146. lint? by whitroth · · Score: 1

    With enough flags?

              mark

  147. Re:READ THE FUCKING ARTICLE by Random832 · · Score: 2, Funny

    no, clearly he meant you need to keep all your _identifiers_ in external files too, by "interface" he means API

    --
    We've secretly replaced Slashdot with new Folgers Crystals - let's see if it notices.
  148. Intelligent "replace" rather than spell check! by phamlen · · Score: 1

    It's not free but IDEA by IntelliJ can help solve your troubles (if you're using Java). It supports "rename functionality" with intelligent search and replace in Java. It will replace all uses of the code and even rename getters/setters if you're changing an internal variable. So while we can't stop the spelling errors when we make them, we can easily remove them.

    There's also a spellchecker plugin for IDEA but it only checks String literals and comments.

    -Peter

  149. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by DimGeo · · Score: 2, Informative

    1. The stop-problem is undecidable only on a device with infinite RAM, if you put an upper bound on the RAM, you get a decidable problem (in theory only).
    2. There are some practical ways to construct proofs that a loop ends (remember the CS lectures). Sure, it's not a perfect solution, but if you can't construct a proof that the loop ends, you'd better rethink the loop, and possibly rewrite it.

  150. Lazy Bones by Anonymous Coward · · Score: 1, Insightful

    You're a programmer. You want a programming spell checker. YOU'RE a PROGRAMMER.

    So write one, lazy bones.

    1. Re:Lazy Bones by /dev/trash · · Score: 1

      Odds are he's a Visual C++ programmer.

  151. eSpell by The_Eric_V · · Score: 1

    So far the best spell checker for Eclipse I have found is eSpell, http://www.bdaum.de/eclipse/
    eSpell can do C++ and java, I use it for C++. For some reason the main download page above does not list C++, but http://www.bdaum.de/eclipse/eSpell3/index.html does. It does work pretty well, though on large source files I have had it make eclipse a bit sluggish.

  152. i did this years ago by elliotth · · Score: 1

    here's a paper i wrote for sigplan notices in 2004 talking about the options, and how it works in practice: http://www.jessies.org/~enh/publications/checking- code-spelling.pdf plus the editor i wrote http://software.jessies.org/evergreen/ has this functionality.

  153. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by scaverdilly · · Score: 1

    'I' is a word, but 'i' isn't. And most spell checkers will catch that error.

  154. HTTP_REFERER by rjamestaylor · · Score: 1

    Someone (TBL) was maybe enjoying a bit of the refer when codifying the HTTP specification...

    Errors in programming (and technical documentation) become standards because the act of programming is creation and invention. Spell it "umount" and forever the act of "unmounting" is done via umount. No one bats an eye. When you define a variable everyone else must follow your lead.

    If you say, "Hey, one who refers is not "REFER" but "REFERRER" your code will not work. HTTP_REFERER will forever be spelled that way until HTTP/1.0 and HTTP/1.1 retire. However, referring to the meaning of that key must be spelled correctly to be proper English. E.g.: "Check the referrer of the requested link with the optional HTTP_REFERER variable."

    Don't want spelling mistakes in your Hungarian variable names? Be the first to create them.

    --
    -- @rjamestaylor on Ello
  155. There are tools for static code analysis. by Lethyos · · Score: 1

    You might enjoy FindBugs. The project also offers an Eclipse plugin.

    --
    Why bother.
    1. Re:There are tools for static code analysis. by somersault · · Score: 1

      Nah I don't need it, I've been fairly proficient at tracking down bugs since before I went to Uni. :P I've just been using a text editor and the apache error log recently (been learning Perl to do some HTML/DB stuff), and Delphi CodeGear for my Windows apps.

      --
      which is totally what she said
  156. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by DragonWriter · · Score: 2, Informative

    It's actually impossible for the computer to know whether you're creating an infinite loop.


    Its impossible for a computer program to be constructed which can do so for all cases (hence, the halting problem), but that doesn't mean that its impossible to detect some infinite loops, or to detect constructs which are particularly likely to be infinite loops, either of which could, in theory, be useful features in an IDE.

    Spelling/grammar checkers for human language aren't flawless, either, but they still have utility. The fact that perfection in a task is impractical or even provably impossible doesn't rule out useful applications.
  157. Wrong "Department" by Pasquina · · Score: 1

    Shouldn't this be from the HandsOffMyCamelCase department?

  158. Semantics vs. Syntax by danlock4 · · Score: 0

    Semantics
    In linguistics, the study of meanings. In computer science, the term is frequently used to differentiate the meaning of an instruction from its format. The format, which covers the spelling of language components and the rules controlling how components are combined, is called the language's syntax. For example, if you misspell a command, it is a syntax error. If, on the other hand, you enter a legal command that does not make any sense in the current context, it is a semantic error.
    --
    To .sig or not to .sig, that is the question.
    1. Re:Semantics vs. Syntax by gazbo · · Score: 1
      That you took the time to reply to me suggests you're correcting me, and yet the text you pasted explicitly agrees with me.

      This confuses me :(((((((((((((((

    2. Re:Semantics vs. Syntax by danlock4 · · Score: 0

      I was supporting you, not correcting you... :-)

      --
      To .sig or not to .sig, that is the question.
  159. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by sootman · · Score: 1

    I need one that says...

    "You appear to be creating an infinite loop. Would you like me to change if ($b=$a) to if ($b==$a)?"

    (I did that the other day.)

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  160. os by Anonymous Coward · · Score: 0

    someone should start the open source project. Maybe the checker could compare words within the document to see if a word is similar to other common code. it could follow the standard for code practice. Shot in the dark from a newb

  161. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by rspress · · Score: 1

    I was wondering when someone would catch it!

  162. Re:Watt wood-eyed dew width aught mine ice bell Cz by Stefanwulf · · Score: 1

    Context is a huge problem when dealing with natural language. The great thing about spellchecking a program, however, is that context is made perfectly clear by the strict syntax. Otherwise, finding a reliable compiler would replace spellchecking as your top concern.

  163. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Kaetemi · · Score: 1

    In Visual Studio (C#) you get:

    "Assignment in conditional expression is always constant; did you mean to use == instead of = ?"

    --
    Kaetemi
  164. I'm sorry... by DragonTHC · · Score: 2, Interesting

    If you are too damn lazy or too stupid to type your language properly, then you shouldn't be a programmer. Become an insurance adjuster or something less demanding.

    I don't think I'd like to hire someone who can't spell. It shows volumes about you.

    Intelligence starts with a keen understanding and application of your language.

    if you simply must have it, editplus has syntax highlighting and offers spellchecking dictionaries.

    --
    They're using their grammar skills there.
  165. I would rather have a spell checker that by alexfromspace · · Score: 1

    I would rather have a spell checker that checks contents of strings in my source code, but ignores words that do not have suggestions in the spell checker. The latter would make sure I do not get annoying notifications for non-specified acronyms or words that are not meant to be spelled correctly.

  166. Editpad Pro ... by n-carro2 · · Score: 1

    ... seems to do this well for a good price. http://www.editpadpro.com/index.html

  167. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by adamofgreyskull · · Score: 1

    In PHP at least there is a function: <a href="http://www.php.net/manual/en/function.token- get-all.php">token_get_all</a>. This will return an array of tokens contained within a string, which you can then loop through and do magick upon.<br />
    Please note...this is a very naive and hacky example<br />

    Like so:
    function getFunctionNames($source_file){
        $source = file_get_contents($source_file);
        $tokens = token_get_all($source);

        $function_started = FALSE;
        foreach($tokens as $token) {
            if(is_array($token)){
                if(token_name($token[0])==="T_FUNCTION"){
                    $function_started = TRUE;
                }
                if(token_name($token[0])==="T_STRING" &&
                     $function_started == TRUE){
                    $function_name = $token[1];
                    echo $function_name,"\n";
                    $function_started = FALSE;
                }
            }
        }
    }

  168. This is fine, but .. by ignavus · · Score: 1

    The general idea is fine, and I agree that misspellings are a problem.

    Now I spell words the Australian way (mostly like the Brits): honour, colour, centre, kilometre, etc.

    Also, I would naturally call a library of mathematical routines libmaths.so and its header maths.h

    I find the term "math" foreign and unsightly, like "creat" instead of "create".

    So what we really need is some kind of internationalisation in code.

    A German-speaker should be able to read German keywords, a Spanish-speaker Spanish keywords, etc. A good source control package should be able to arrange this.

    Maybe one day?

    e.g. a German-speaking programmer might see:

    DATEI *quelle = ...

    and the English-speaking programmer sees:

    FILE *source = ...

    Wouldn't that be nice. Or else we translate all the keywords into Esperanto or Interlingua or suchlike.

    --
    I am anarch of all I survey.
  169. Respelling by cumin · · Score: 1

    I probably took an hour the other day going through and pounding the L everywhere I put fufill where I meant fulfill. *sigh* Same way every blasted time! (I can't seem to hit the Q lately either.)

    --
    Back in my day when we chiseled our bits into stone and sent them by mule train from village to village...
    1. Re:Respelling by Anonymous Coward · · Score: 1

      Ever heard of find-replace?

  170. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 0

    I think he's on http_referer :)

  171. Re:What the fuck is the OP on? by Anonymous Coward · · Score: 0

    in java if u type
    verible berd;
    and then u call
    bird = 1;
    it will not compile

  172. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 0

    a spell checker would be very hard to wright as there are mant diferent ways of spelling variles eg
    VaribleOne,
    Varible_One,
    Varible_one,
    Varible1,
    varible1,
    varibleone,
    varibleOne,
    VARIBLE_ONE,
    VARIBLEONE,
    ectra

  173. It's much harder than it seems by one-egg · · Score: 1

    Other then dealing with camel case, there's no need to stand on your head in Perl; ispell can already spell-check software by using the "external deformatter" feature. It even comes with sample deformatters that handle C, C++ (in two ways), and sh/bash. In fact, one of the reasons I added the capability for external deformatters was to be able to spell-check program comments. To deal with camel case, one might change Ed's Perl script so that instead of converting "camelCase" to "camel Case" and downcasing the result, you instead converted it to something reversible like "camel___Case". Write that to a temp file, ispell it with the appropriate external deformatter, and convert it back to the original form. That said, when I tested the C deformatter on my own code (I think it was the ispell source), the results quickly convinced me to give up. Look through your code again, and note all the variable names that contain unusual abbreviations ("ch", "cp", "ptr", etc.). Note the line comments that have been abbreviated to make them fit. Note the application-specific terminology in the comments, and the huge list of odd library function names. The first time through, you're going to get very tired of adding all those things to your personal dictionary, even if you remember to make a dictionary specific to the application. Yes, there are ways to mitigate the problem, such as providing a predefined dictionary for popular libraries (but have you done ls /usr/lib | wc lately?). But even that's a problem, because a lot of libraries can have function names that will hide legitimate misspellings. I'm not saying that it's an impossible wish. But it's nontrivial to get it right.

    1. Re:It's much harder than it seems by Ed+Avis · · Score: 1

      You're right - and the perl oneliner I wrote is suitable for use as an external deformatter. The hack with sort | diff | grep is just to demonstrate that a simple spellchecker can be done using ordinary Unix tools.

      As I mentioned you can mitigate the problem of nonwords like 'ch' and 'ptr' by filtering out all words shorter than 5 letters. Indeed I would probably make the spellchecker just report the ten longest misspellings found rather than all of them.

      --
      -- Ed Avis ed@membled.com
  174. English (or $YOUR_LANGUAGE_HERE) by sohp · · Score: 2, Insightful

    Yep. Programmers should know how to spell correctly in their native language. But hey, all through school those technonerds where likely the same ones who never missed a chance to whine about how they hated their English (or whatever) classes and thought that learning grammar and spelling were a waste of time when they could be doing cool geek stuff. The rise 1337-speak and txtspeak hasn't helped.

    At least in the real writing business there are editors trained and paid to catch these errors.

    Being unable to spell correctly makes you look really stupid to most people.

    Just FYI, if you have a decent programming environment, it should at least flag cases where you've mistyped an existing identifier. If there's an ImmediateFlag in your code, you'd get a warning if you typed ImediateFlag or ImmediateFalg or whatever. Not much help when the programmer is creating new identifiers, of course. Although I've seen cases where the programmer in question for whatever reason decided that because ImediateFlag was undefined then they would just define it, even though ImmediateFlag existed and was what they meant. That ought to get you fired in my book.

    Hey by the way, pair programming is a great way to have continuous code reviews and a check on some of the more typical fumble-finger errors.

  175. Externalize your interface strings by Anonymous Coward · · Score: 0

    Sometimes this causes real embarrassment as spelling errors creep into software interfaces. Does anyone know of spell checkers for programming languages?


    You're asking for the wrong feature.
    All of your interface strings should be externalized as resources.
    (Why you are not doing this is the bigger question...)

    Once this is done, you have a list of strings without any programming language dependencies.
    Pass it through to your favorite spell checker.

    Code comments, though, is another issue. However, your customers should not be reading it.
  176. Slickedit (NT) by Anonymous Coward · · Score: 0

    (NT)

  177. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by somersault · · Score: 1

    Heh yes. "You appear to think this is Pascal/BASIC, would you like me to temporarily erase that part of your memory?"

    --
    which is totally what she said
  178. Vim 7.0 - Syntax Plugin! by krischik · · Score: 1

    Yes it works in Vim 7.0 - It is job if the plug-in handeling Syntax Highlight. The Plugin should should switch the spell checker on and off depending on which language construct was detected.

    Martin

  179. Vim 7.0 can do better then that by krischik · · Score: 1

    In Vim the Spell Checking is handled by the Syntax-Highlight Plugin which can switch spelling on an of depending on which highlight is used.

    But then: All the programming language plug ins I have seen so far do what xemacs does: strings definitions and comments. But HTML and Wiki plug ins tend to use more complex rules.

    Martin

  180. hmm by Anonymous Coward · · Score: 0

    well personally although I don't do a lot of programming in my role (I work across the street, networking) I've always found a good notepad based editor does the trick - personally I use editplus which highlights all of the code and when I get something wrong, it's usually pretty obvious straight away. Still won't help you with naming your functions wrong (because that's really the crux of this /. article) but hey that's why you have to doublecheck and make sure you've got those right the first time!

  181. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Anonymous Coward · · Score: 0

    The version of Eclipse I run, Eclipse WTP 3.3, does spell checking on comments as standard. Not for variable, function names and the like though. It's a decent first attempt though.
    So, uh, the very latest version of Eclipse is finally catching up with another bit of trivial functionality Emacs has had for years?

    Boy, I love these cool eye-dee-ee things. They really make text editors look primitive!
  182. Re:Quit employing idiots? by Haeleth · · Score: 1

    No, but neither will an automatic grammar checker - their great toys to play with if you want a laugh, but I have yet to see one that was actually capable of telling the difference between good and bad grammar.

    (For example, Word's grammar checker completely missed the misuse of "their" for "they're" above - as trivial and glaring an error as can imagine. Oops, it didn't notice the missing subject in the previous sentence, either!)

  183. Re:Eclipse WTP 3.3 Europa seems to do this.. almos by Hognoxious · · Score: 1

    For the record, 'I' is a word.
    It's I am. You are. He is.
    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  184. Spell checking source code by Anonymous Coward · · Score: 0

    Your story about that man's death is somewhat funny (poor man!), but please stay on topic!
    I am really interested in spell checking my programs.

    On topic: Checking comments is nice, but the next step should be checking words in strings/ (and XML properties for programs supporting i18n).

  185. *groan* by turgid · · Score: 1

    It's actually impossible for the computer to know whether you're creating an infinite loop.

    Oh really? My computer in Aleph-1. Stop being pedantic, dad, and get back to your Delphi coding.

  186. Re:Respelling - find/replace by cumin · · Score: 1

    Yup, but I still had to do it for several programs and interfaces built on top of them. I blame it on the UI, but it could be due to inline scripted replacement cowardice as well.

    --
    Back in my day when we chiseled our bits into stone and sent them by mule train from village to village...
  187. Why not? by Vedanuzal · · Score: 0

    Wouldn't it be simpler to encapsulate the spell checker within the syntax highlighter, or call it from the syntax checker. That way you could define a list of do not spell check words for the language and use the syntax checker to define what needs to be checked for spelling. The syntax checker would do most of the string analysis that would be needed to identify what should be spell checked and what shouldn't, I am assuming?