[quote user="Isuwen"] America is switching over, just very slowly.
[/quote]
Just ask NASA!
[quote user="Isuwen"] America is switching over, just very slowly.
[/quote]
Just ask NASA!
My vote for representative line is this bit
line_13640:
'back to the logic after 12120 line
GoTo line_12120
1) It's got gotos.
2) Redundant comment (I suppose we should be thankful there were comments at all).
3) A label which leads to a goto. Why not just replace GoTo line_13640 with GoTo line_12120.
OK, I admit I only read the first dozen lines & the last dozen so there may be better bits in the middle but there's only so much I can take. Is it time for a comment about inefficacy of eyewear yet?
Just found this in some old code at work
szMaskedReferenceField[ strlen( szMaskedReferenceField ) + 1 ] = 0;
One way to ensure that it's null-terminated at the null terminator, I suppose.
@ShadowWolf said:
@RayS said:@GeneWitch said:No, if you follow that logic, you'd be saying 2007, September 11th.You sort of just proved a point up there at the top, dude.. no, we don't say 25:3PM. Why? Cause hours are bigger than minutes. (longer)
So, by that logic, saying "september 11th, 2007" makes more sense than "11th of september, 2007"
@GeneWitch said:
someone saying "12th of august" to me... i'd sneer at them for being a snob.So because someone is from a different culture to you, they're a snob? riiiiight...
Shadowwolf - no functional difference at all. Either way. Both work just as well if you're used to them, as would "2007 13th June", or "May 2005 3rd" or any other plan you can think of. Purely from an academic/logical structural POV, it's nonstandard. Three units - small, medium large. No other commonly used system does anything other than SML or LMS.
I don't see why so many people see it as a personal attack when you point out the obvious..
Then that demonstrates that no, there is no good reason. Just cultural differences.
Academically/Logically speaking nothing - you're clearly attempting to assert your way is superior, which it is not as you stated yourself. Your "obvious" statement is just the prototypical euro-centric elitism. Yes other people are being subjective and centric too, but I'm just making a point here that the entire argument is subjective. You can't say one way is better than another.
I live in the USA, I prefer HH:MM:PM & dd/mm/yy - so what? It's just preference :) Refering to a specific way of recording Time or Date as "Proper" is annoying.
The problem with these cultural differences is that 01/06/2007 is ambiguous. You don't know if I'm English or American, so you don't know if you've missed my birthday this year or if you still have a chance of some birthday cake in a few months. There's no problem if the context is clear but it would be good to agree on international standards.
Surely a job for a drop-down list with the option to select multiple responses, to allow the users to roll their own Maybe & Don't Know from combinations of responses.
@joe.edwards@imaginuity.com said:
If you want a goldmine of language based WTFs try some esoteric languages like INTERCAL, brainfuck, or Malbolge. Actually, I'd be impressed with someone who could write anything useful in these languages.
" N E W S hit"
I misread this first time around. I thought it said NEWS hit, then I realised the truth.
Like the BRAKING, too. Let's slow things down here.
@Angstrom said:
Variable-length encodings are your friend. For the specific case assufield described (which is extremely contrived, but we'll work with it) it's possible to compress every file containing a string of 0x00 bytes [b]to no larger than itself[/b].
Ooh! I can do this one. I think the function is called cp.
My vote for representative line is this bit
line_13640:
'back to the logic after 12120 line
GoTo line_12120
1) It's got gotos.
2) Redundant comment (I suppose we should be thankful there were comments at all).
3) A label which leads to a goto. Why not just replace GoTo line_13640 with GoTo line_12120.
OK, I admit I only read the first dozen lines & the last dozen so there may be better bits in the middle but there's only so much I can take. Is it time for a comment about inefficacy of eyewear yet?
@tster said:
If the array size is hard coded then why would you use sizeof(array)?!?!?! not only is it worthless, but it's wrong. you would have to use sizeof(array)/sizeof(type) first of all. Second of all, just tell him to declare a constant
#define ARRAY_LEN 256
not only that but you suggested clearing only the items that were set. This sounds like a lot of extra bookkeeping keeping track of which items have been set. Why not use memset? Before you start putting quotation marks around the word developer as an insult to your co-workers, perhaps you should examine your own answers to their problems.
sizeof(array) will cause even more problems if the cleanup is done in a separate function from the original declaration of the array. Then array is just pointer-to-int and you get the size of the pointer instead.
I'll add my vote for being able to sort by first post date.
[quote user="president_ch0ice"]
I've been asked to debug a stored procedure used in a POS application. The POS programmer complained that the procedure would work for new transactions, but not for existing transactions.
Here is the code...
---8<---
CREATE PROCEDURE dbo.proc_transaction_result @iTransactionNumber int, @bAccepted, @bRefused AS
SET @iTransactionNumber = dbo.generateNewTransactionNumber(GETDATE())
IF (SELECT COUNT(*) FROM tb_transaction WHERE iTransactionNumber = @iTransactionNumber) = 0
INSERT tb_transaction (iTransactionNumber, bAccepted, bRefused) VALUES (@iTransactionNumber,@bAccepted, @bRefused)
ELSE
UPDATE tb_transaction SET iTransactionNumber = @iTransactionNumber, bAccepted = @bAccepted, bRefused = @bRefused
RETURN 100
--->8---
The bAccepted and bRefused fields (both booleans) puzzled me, especially since the table included some records with both fields having the same value. In regard to this situation, the programmer told me that those fields were linked to checkboxes and that sometimes "the stupid users" would either select both Accepted and Refused, or select none. (Duh!)
The new transaction number generation was obviously misplaced. A funny thing is that this mistake was protecting the system from a bigger bug (the UPDATE statement).
[/quote]
The best WTFs have all been taken, but no-one has yet pointed out that the procedure returns 100, which is the common SQL return value for record not found.