- 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
Yes, it's definitely not great code. String literals that are being converted into strings, chars being converted into strings that are being matched against single character strings, etc, etc... Classic rookie mistakes.
But hey, at least the author was decent enough to leave comments. (I'd rather spend my time deleting useless obvious comments than having to deal with variable names like 'data' or 'ID') It's more than obvious that the author that he (albeit truly misguidedly) took effort into writing this piece of code.
But then I noticed this:
catch (Exception) { return "error unknown".ToString(); }
...now THIS is the most infuriating part. Generally, I'm more than willing to refactor poorly written chunks of code (and even confront and educate the original author if he's still among the ranks!) but I'm absolutely sick of the "Let's sweep exceptions under the rug!"-school of thought countless of devs seem to be getting away with.
Admin
Admin
ITYM strcspn:
strtok changes s, which may not be what you want.
strcspn, on the other hand, calculates the length of the initial component of s which does not consist of the characters given in its second argument. If that is the same length as the length of the string, you don't have any vowels.
Admin
Admin
Yes?
Admin
Sorry. I just don't believe that this hasn't been made up. It is way beyond standard WTF level.
Admin
I already get a headache when end of line comments are actually used at the end of a line. It plays hell with formatting if I decide to refactor anything (never mind the fact that they may be placed behind or after the line).
Place them in front of the line please, not on the line itself. Preferably after an empty line.
Admin
"Hey" he yelled, as he would hew to these comparisons.
Admin
Admin
Believe it or not, I've worked with some developers who might have built this.
Admin
Okay, if this was C, I would probably do something like this:
But what is a good way of solving this in JAVA? I don’t use this language a lot but now I’m curious. Here’s my try, but regex feels like an overkill for this task:
Admin
prednisone 50 mg tablet cost: https://prednisone1st.store/# prednisone ordering online