- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Admin
I am also big fan of WWF. John Cena - The Champ is my favorite.
Admin
I think we need to wait for a few dozen more people to weigh in on the situation.
Admin
And, of course, there is no case conversion. If this is indeed C#, lets hope the user enters everything in lower case.
Admin
Neither has 'catch' nor the unfortunate village of 'Ynysybwl' etc...don't get me started on the amazing Georgian language with with consonantal clusters either!
ps: Actually Welsh has more vowel symbols than English: aeiouwy vs aeiou
Admin
And ask to see their code during the interview.
Admin
Comments aren't there to tell you which revision created the line. They are there to tell you what the purpose (the logical purpose) of the code section is. You know, the business cases, what inputs are expected, what edge cases are being handled or not, and so on.
When you write a program for the first time, you don't have a revision history. Where do you put comments like (I have done this a few times) "It may appear that optimization XYZ can help here, but in this case, you can't do that for reason ABC"? That doesn't belong in the revision history, it belongs in the code comments.
Admin
QED!
Admin
STRTOK DOES NOT WORK THAT WAY!
Admin
Admin
I have a chocolate lab (sitting at my feet as I type this). She has no problems coding (well, to be fair, having to use the shift key to get the curly brace is challenging, so she prefers to write in Visual Basic). But ask her to perform functional decomposition on even the most basic business process and all I get is her cocking her head at me and giving me a "you're kidding, right?" look.
Admin
Admin
The question was, why would you want to search for vowels in a word? I had to, when it was just 1980, when I had to tinker my own word processor on my 8-bitter, and wanted to have some help for hyphenation. In that procedure, finding a vowel is your first step.
But why only aeiou as vowels? That's missing a lot. In english, also y often serves as a vowel ("system"). In other languages, like my mother tongue german, there are a lot more: äöü. And please don't ignore accented vowels in french or italian (be aware that those umlaut dots before don't count as "accents").
Admin
The "developer".
Admin
Admin
Vowels, etc...
What is needed is a marriage between Hawaiian (vowels, we got 'em) and Polish (buy me a vowel). One has a surplus, the other has a deficit. As for the program, it's terrible!!
Admin
Admin
That doesn't mean much. I wouldn't have been able to twist my mind enough to produce that. Not enough hard drugs available on this planet.
Admin
I just want to know why everything that's already as string needs .ToString().
Is that too much to ask?
Admin
theword.toLowerCase().matches( ".[aeiou]." )
As for the special cases of 'y', simply do not certify this algorithm for use with Welsh. That should solve that.
Admin
Many companies (sensibly, to my mind) make the specification in their code standards that all switch constructs have a default branch. If you must use switches, then it's a good habit to have.
It can of course conveniently be used as a parameter range check: if your method / function / subroutine basically is a switch statement, then the "default" can conveniently be used as the sanity check on the input parameters.
There are other advantages to this approach, whose cataloguing I will leave as an exercise for the student.
Admin
Russian has several words which are vowel-less: "в" and "с" come immediately to mind (pronounced "və" and "sə") respectively.
Admin
Everybody was so bussy reading comments, so this almost left unnoticed ...
catch (Exception) { return "error unknown".ToString(); }
Briliant xD
Admin
This is an example of why unittesting is necessary in any language - so that at least you catch cases where a function does something completely different from your expectations
Admin
Of course, TRWTF in such a case would be an assertion on a string literal. Since the pointer isn't NULL, the code would keep happily chugging along!
Although a language in which a default branch in an if-statement existed, the behaviour of assert() would probably be defined as such:
Admin
[quote user="foo AKA fooo"]They'd love to have a default branch in an if statement, just so they could write:
[/quote]That assert is rather pointless. The pointer "should never get here" will be converted to a "true" value so that assert will do nothing. Much better to write
[/quote]Admin
Works great unless I pass in "aeiou" in which case it fails ...
Admin
return "error unknown".ToString();
Is there any point to this?
Admin
Surely any PEP8 checker would invalidate code without blank lines in the correct locations.
pep8.py for instance moans if two blank lines are not left before a class definition, and it one line is not left between methods.
Admin
He could tell whether Y was a vowel if he weren't looking at only one letter. Y is a vowel if it neither precedes nor follows a vowel (as in "crypts", "rely" and "Ylvis", and in French, "il y a"), and this is probably true in all languages with a Latin-based alphabet.
Admin
Admin
Admin
Comments aren't needed to tell me which revision created the line, the revision control software does that.
When I write a program for the first time, I don't have a revision history, but I don't have any functionality, either. My first commit will be either an empty project, or a project that contains a do-nothing program. Every piece of functionality that is added will be added as a separate commit, and the revision control software will link the changes that implemented that piece of functionality with the commit comment.
There are times comments are useful, or even needed. But I see that as primarily when there is something going on that wouldn't be obvious to a maintenance programmer reading through the code.
Admin
Admin
For completeness, in C++ it would be:
Admin
This guy has got to be trolling. Either that or he's a retard.
Admin
why did they take out Multi-byte character support from vc++? this is terrible. i am dying now.
Admin
snoıʌqo sı ןןoɹʇ snoıʌqo
Admin
Admin
There are languages that only ever use Y as a vowel.
Then again, with your algorithm it wouldn't matter, since it always returns true if it finds a Y in a word. "Rhythm" has a Y flanked by consonants, making it a vowel, but in "say" Y is preceded by an A, which is a vowel.
And I do disagree with your characterization of the Y in "say" as a consonant.
Admin
Compare the w sound in "no way" with the w sound in "vowel". Vowel's w sounds like a vowel.
Admin
How do you get that? The 'ow' in vowel is just the same as in now. The w is the, well, w sound on the end of the ow bit. Not as distinct as in 'no way' I'll admit, since the e is normally unstressed so the 'wel' gets all run together into one sound like cowl or howl.
Admin
However, if it isn't really known to be a word, then it may be unpronounceable, and your rule about Y being a vowel doesn't really apply.
Admin
Back at my favorite coding job, the "standard" for commenting was that they had to consist mostly of quotes from popular culture like song lyrics, Monty Python, and MST3K. Oh, and about 20% in German (it was in the States, and none of us were from Germany - but several of us took in in college and thought it looked good in the commentary.
I don't know how much use this commenting style was for maintainers, but we really enjoyed it.
Admin
When you work in a company that allows code like this, you have to ask, what's wrong with YOU that made them think you would be a good fit for their company?
Admin
I believe the article submitter got trolled, hard, by some stackexchange answer or something.
Admin
Admin
Sincerely,
Gene Wirchenko
Admin
Holy fucking shit - this has got to win the all-time worst code ever award.