- 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
But a 5% discount becomes a 50% discount! Probably the bug in question.
Admin
Admin
Hehe, just messing with you.
I've read the arguments on both sides, and I'm an ardent supporter of making my own life easier.
Admin
[quote user="uns"][quote user="Spudley"][quote user="very punny"][quote] but one thing was for certain - this was going to be a long<!--Get it? Long...Decimal... When was the last time you saw a data type pun?--> week. [\quote]
He was going to need to use a float-ing holiday after this. [/quote]
This int what I was expecting. I object that they string me along just for a punchline like that! I'll have to double my efforts to come up with a suitable array of ripostes. [/quote]
for real?[/quote]
Yeah, I would object.
Admin
Especially since the majority of code, whether you want it like that or not, is English:
http://msdn.microsoft.com/tr-tr/library/0x9tb07z(v=vs.80).aspx
Admin
Admin
Think about it: Code written in Turkish works OK in a Turkish locale (obviously). But code written in English will fail there if case-insensitive.
Admin
That's just semantics. And it's up to the developer to realize that. The combination of the English programming vernacular and VB both being case-insensitive make it superior. Especially when combined with how well Visual Studio manages it real-time, so you don't have to. I honestly believe that case-sensitive languages, whether it be a programming language like C#, or a language like Turkish, are extremely flawed.
Admin
Admin
I'll take your WORD on it.
Admin
Admin
Admin
Problem is that replacing a / b / c with a / (b * c) for floating-point numbers will most likely change the result due to rounding errors, which makes it illegal to do in many languages (like C, C++, Java, Objective-C).
Admin
The problem is that there are a bunch of so-called programmers who learned how to do string concatenation on day 1, and then go on to apply it everywhere for the rest of their career.
Where I work, we have one guy who does string concatenation in SQL to return a HTML select, and another who does string concatenation in javascript to do date arithmetic.
Admin
Admin
Worse: there are programmers out there who don't realise they are working with case-sensitive language (when it is optional).
A common error in SQL Server development projects is to install SQL Server as case-insensitive, then write case-insensitive code, thereby risking that said code will not compile on systems where SQL Server is installed case-sensitive.
A major WTF: case-insensitive is the "default" SQL Server installation state, binary (case-sensitive) is the "recommended" configuration state. Most projects I have seen (including major open source projects) have programmers that have not read that part of the manual.
Admin
can anyone explain it, is there something wrong with the code? I dont get it.
Admin
Admin
Maybe I'm an ignorant savage, but I have a JavaScript program that needs to truncate a (float) number to integer. There is no such JavaScript function. All JavaScript integers are floats. The only way I've figured out how to do it is to convert X to a string and parse the string up to the decimal point. var I = parseInt( X.toFixed(3)); Argh!
Admin
My usual response to that sort of guidance is "in that case, I'll arrange to code it so that if the thing you say will never happen does happen, it's okay to call you at your personal unlisted number any time of the day or night". They seldom agree to this. They never agree to it a second time.
Admin
Math.floor(X); // takes off everything beyond the decimal point.
Admin
Admin
Ant that is TRWTF. >;->
Admin
And that is TRWTF.
(Sorry for the earlier typo! WTF?!? ;-)
Admin
And given that it's been wrong like that for... HOW LONG?!? What makes it such a big crisis RIGHT NOW?!?
Admin
[quote user="very punny"][quote] but one thing was for certain - this was going to be a long<!--Get it? Long...Decimal... When was the last time you saw a data type pun?--> week. [\quote]
He was going to need to use a float-ing holiday after this. [/quote]
If he was union-ized, he could do all the type punning he wanted.
Admin
There, fixed that for you
Admin
[quote user="very punny"][quote] but one thing was for certain - this was going to be a long<!--Get it? Long...Decimal... When was the last time you saw a data type pun?--> week. [\quote]
He was going to need to use a float-ing holiday after this. [/quote]
Hmmm, enough to drive me to drink... better make it a double!
Admin
Smart people know VB is generally not a very good choice of language, so they stay away from it as much as possible. Stupid people don't, so they will program in whatever they can.
I think I can safely assume that stupid people create more WTFs than smart people, therefore combining these two will result in the proposition that VB code will generally contain more WTFs than code written in a language such as Java or C#.
Call me arrogant or narrow minded, but the reality really is not much more complicated than that.
Admin
Admin
[quote user="Nutster"][quote user="RRDY"]But dividing by 100 is HARD![/quote] Yes, dividing is generally takes more time than multiplying, so instead of dividing by 100, multiply by 0.01 instead. Problem solved.[/quote
If that would solve the problem, the compiler would do it for you.
When you write 0.01, you don't get 0.01 but a floating point number very close to but not exactly equal to 0.01. If you multiply let's say 3700 by that number, the result before rounding isn't 37 but some number close to but not exactly equal to 37. Rounding may round to 37, but isn't guaranteed to. All kinds of funny things may happen as a result.
Admin
no--you're wrong
Admin
But hey! At least he should get double time overtime pay!
Admin
On the double!
Admin
The WTF in that last statement is that you didn't realize that they purposefully f*cked it up in order to get people to talk about it and watch to try and locate more screw ups.
Pretty good marketing actually. MS would pay them for mentioning VB; meanwhile it's self serving.
Admin
A lot of people still don't realise this, but most operations, including division take just one tick. The real performance issues are caused by cache misses and page faults. As for the case thing, case-sensitivity is bloody annoying. It says something that IDEs for case-sensitive languages almost always have a way to mitigate it and fix the case.
Admin
Being innumerate should be as socially unacceptable as being illiterate.
Admin
It might be something other than services or products too. There have been a few cases where loans had interest rates around -0.005%. Ordinarily one would expect that the lender would be better off just keeping the cash, but someone explained that keepers of cash have to pay to store and guard the cash so the loan was better.
Admin
"Hey look, I had a fantastic game of golf." "You added up the numbers wrong. Here's your real score." "Well what do you want, a good mathematician or a good golfer?" "You're neither." "GTFO asshole."
Admin
Because horrendously stupid WTFs in C are uninteligable except to experts, unnoticble except to LINT, and mostly never discovered even when they cause regular crashes.
Admin
If it was your father's FORTRAN, it wouldn't need a modern compiler's optimizer to reduce your code to something more efficient.
Modern copiler optimizers are designed to reduce your C code to something almost as efficient as your Fathers FORTRAN. And even that is possible only if you are using the C99 'restrict' keyword.
Admin
The Fortran standard restricted some kinds of expressions in ways that appeared unnecessary. The reason for the restrictions was that compiler writers knew ways to optimize some kinds of expressions, so the executable code could be nearly as fast as assembly. If arbitrary expressions were allowed, the executable code would be 10 times slower than assembly and no one would have switched to Fortran.
Admin
Personally, I'd take the percentage as a string in base-10, pad on the left with zeroes if needed and insert a '.' two characters before the end.
Admin
dDiscount←ot×2⊃⎕VFI'0.',¯2↑'0',⍕O.DiscountPercentage
Fixed it for you
Admin
You, sir, made my day. I wish more people were as int-elligent as you.
Admin
[quote] [quote] but one thing was for certain - this was going to be a long<!--Get it? Long...Decimal... When was the last time you saw a data type pun?--> week. [\quote]
He was going to need to use a float-ing holiday after this. [/quote]
That was an epic... double whammy, if I may say so.
Admin
...Fifth grade? If that?