- 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
In almost all programming languages the construct
should be exactly the same as
because it boils down like this:
-- Talking out of his ass since 1764.
Admin
[quote user="Wizard Stan"] So are you saying that it's easier when you talk to people to say "Moses did that action that applied to an object creates several subparts of that object to the waters" instead of "Moses split the waters"?[/quote]
I'm pretty sure he's making the case that there are instances where using the description is faster, easier, and better than the simple word itself. Whether "split" is one of those instances was not part of his argument.
Honestly, for a bunch of people that occasionally call themselves programmers, there's a lot of closed minded attitude going around. And it's not just you and your post; I've noticed a disturbing trend the last few weeks of posts that take someones argument-via-analogy and interpret it literally, in an apparent attempt to counter that argument, instead of generalizing said analogy to understand other instances where it may be true.[/quote]
Honestly, for a bunch of people that occasionally call themselves "why can't we all get along" people, there's a lot of closed minded attitude going around. And it's not just you and your post; I've noticed a disturbing trend the last few weeks of posts that take someone's argument-via-common-sense and interpret it analogically, in an apparent attempt to counter that argument, instead of keeping to the point and not wandering off in useless analogies that may or may not be true.
It's the word "split" for crying out loud. I'm pretty sure that guy with the "acnesis" was just splitting hairs in that comment to show off. Haha, seen that? "Splitting hairs", so funny...
Admin
Looks like you 'split' your quote tags.
Admin
No, I'm not saying that at all.
However, if you were talking to someone who wasn't a Christian, you'd probably have to explain who Moses was and why he DIVIDED the waters. (not SPLIT the waters, you see, YOU used the wrong word there too...the irony, huh?) you are communicating assuming you have a base common culture and language, which is quite clearly not always true.
Ignorance of a particular function in a language isn't a WTF, it's just a lack of knowledge. Implementing a version of a function which you didn't know existed isn't a WTF. As far as I can make out the code will work, so THAT isn't a WTF.
The only WTF here would be a lack of code review/QA procedures by a senior developer or whoever was responsible for the code produced by the developer.
Admin
Admin
Admin
Admin
Why does someone want to split emails? Are you sure they don't want to split email addresses ?
(and : and ; are valid characters in email addresses, like ,, if you just quote them properly)
Admin
Admin
If you are going to be like that I don't think Moses split or divided the waters given that the English text is a translation. YOUR translation might well say "divided" - but that is just one translation of the word.
Admin
So, you're saying that if a system uses a non-zero value for "false", you should use "while (KeepGoing == true)". Well then I have a surprise for you:
Suppose KeepGoing is false, then (KeepGoing == true) is of course false, which (according to our working assumption), would not work!
You would need to write "while ((KeepGoing == true) == true)"!
Of course, in the example case this value is false. So (according to our working assumption) it won't work!
You would need to write "while (((KeepGoing == true) == true) == true)"!
Of course, in the example case this value is false. So (according to our working assumption) it won't work!
You would need to write "while ((((KeepGoing == true) == true) == true) == true)"!
(ad infinitum)
So any language where "false" is "non-zero" (by whatever measure) had better make sure that using it in conditional statements works in the normal way anyway.
Admin
So either you've got your thinking cap on sideways, or you're making assumptions you're not telling us about.
Admin
Erm, yes, that was the point of what I posted, there's many verbs that serve the same purpose, it doesn't matter which one you use in English as long as you share the understanding of what that verb means.
If you were explaining it to someone learning English, and they didn't understand ANY of the words you were using, you'd probably resort to a more verbose description.
:)
Admin
There is a much easier way of doing that:
Admin
so what's that supposed to be
Admin
It's Latin for "thirteen hours late on a joke".
Admin
His home-rolled definition was long winded, but meant exactly what he wanted it to mean. The "standard" word he thought would express the same thing turns out to have unexpected constraints (only applies to quadrupeds).
Admittedly something like a string split function should be part of a programmer's every day language, but there's plenty of standard functions in most languages that I've worked on that have unexpected constraints/side-effects/defects that could easily catch out the unwary developer.
Admin
It was 50% Opacity who started the claim that you'd need to write "expression == true" when the compiler happens to use "non zero values" for true and false. I just wanted to show that even if a compiler does that, it would still need to make "if (boolean expression which is false)" work right, even if "false" is represented by some non-zero value.
Admin
It's possible to do that in C with #define false (SOME_NON_ZERO_VALUE) but you deserve to be fired for putting that line of code in your program.
Nah, just don't put assignments in conditionals. Use the compiler warning (in gcc -Wall does the trick) to flag when you accidentally do it.Admin
In general both of these concepts boil down to the same concept: never make assumptions about anything, even "standards." After all, if these things weren't problems, we probably wouldn't even have this site would we? =)
Admin
Admin
Unless you overload the > operator.
Admin
Hey, at least take care who you're quoting. You're thinking about too_many_usernames (ironically).
I have a reputation to protect with this anonymous, unregistered name on this random interweb forum after all...
Admin
Admin
Admin
Oops. Sorry!
Admin
Win.
Admin
I just won £5.
It did take a little while...but my gut instincts on the anality of this board were proved correct (again). ie. the willingness to argue/correct on irrelevent items outweighs the willingness to discuss the actual article.
Well done!
:)
Admin
Wow.
That's totally, totally... what's the word. FILE_NOT_FOUND. That's it.
Admin
Not quite, I bet £5 that some cock would say "oh yeah, well I'm Jewish and I've heard of Moses!"
OK, so it's not exact, but it was close enough.
:)
Admin
Admin
Code should be readable out loud. "if something == true then" is less readable than "if something then".
It requires the use of boolean types and understandable variable names.
Admin
I just won a further £5 for betting that the same cock would reply saying that he'd won a bet too.
I can keep this up for days, weeks probably, you good for it? I suspect you may be...
:)
Admin
Whoa there boy! It's string.Split() for crying out loud.
I'm not a Java developer -- most of what I write these days is in bash -- but if I were to write in Java, I'd certainly look for a "split()" function like the one in Perl before I wrote my own. Heck, I'd look for strtok() too.
Admin
Admin
We call these innovative things "flags". They map to real language pretty effectively. For example, "if ( trainHasArrived ) then boardTrain()".
And by gum, you might want to have that boolean flag returned by a function! Oh my. Now that English phrase becomes "if ( hasArrived(myTrain) ) then board(myTrain)". Screw the grammatical problems: it's understandable.
And back in the fickle world of computery things and that "keyExists" flag, you might want to say "if ( exists(key) ) then process(key)".
And sometimes, you might want to combine a multitude of flags into a bitfield, y'know, for efficiency's sake. Then you might have to say something more like "if ( open(file) & FILE_NOT_FOUND ) then ...". And by golly, doesn't it seem all of a sudden that you have to have an understanding of logical and bitwise operations, along with those ever-so-scary Boolean types?
Maybe computer programmers ought to understand Boolean types and use understandable variable names? And maybe computer science isn't your strong point... jus' sayin'.
Admin
We're in agreement on the use of boolean flags with meaningful names, BTW.
Admin
It's uuencoded.
Admin
Admin
Have any of you considered that maybe the guy looked for a library function... and missed it? It happens. I spent a day writing and testing a base-64 encoder after I couldn't find one on MSDN, and even got it through review, before someone finally told me that Windows had one.
Admin
Sure it's forgivable to miss one library function, but like I said, the guy not only missed string.Split(), but also string.IndexOfAny(), string.Substring(), List.ToArray(), etc. By then it ends being forgivable.
Admin
'cause it don't get 'em laid
Admin
For me, the 32,498 line count of the source file was the give-away. This is too verbose in any language.
There is a programmer I know, who the boss swears by, who produces source files of this length no matter what the language - C++, java, ASP and now C#. They are a nightmare to debug (and yes there are plenty of bugs) in part because of their length. And ignorance of library functions is only one of several reasons for their length.
Admin
Why is this part there?
Admin
I have no sympathy with this position. Sure, the libraries are large, but it's not difficult to just scan the packages to see what sorts of things are there, without memorizing the details of every call. Nor is it difficult to figure out that you are not the first developer who has to split a string or formatting a date or validate an E-mail address.
Admin
You work for the office of the Spanish Inquisition ? Frankly, I never expected that.