- 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
Damn I just had to do this last week with a legacy Informix 4GL / ACE report.
Thank god there's only 12 months in a year.
Admin
PICK BASIC has arrays.
Admin
What the fuck is this?
What language is this?
Admin
Admin
+1
Admin
Actually, it's the thirty-sixth count. There is no COUNT16.
/pedantic
Admin
It looks to me like this guy wanted to count multiple different types of things without mixing up the counts for specific types of things until he explicitly adds them together at the very end. He could be using, for instance COUNT1 to store the number of shoes in stock, and COUNT2 to only store the number of socks in stock, where the total count returns the total number of all items in stock.
Admin
Or not. As some people have pointed out, 16 is missing. So 37 is at most the 36th (given the one indexing) without even looking to see if there are others missing.
Admin
Or could it be that they weren't searching for a word? </pedantic>
Admin
WARNING****: WORD10 is declared, but never used.
Admin
Well, given that much of the code is missing, we don't really know what is being counted. Perhaps the programmer hoped one day to display what all the individual counts were (specifically as the NO.ITEM suggests that each of these counts counts the volume of some (different) item...
This was well thought out...Version two displays: COUNT14 = 9 COUNT37 = 7 etc....
Admin
It doesn't really look like grep to me (the /COUNT at the start I think is the actual search).
Don't know about grep standards, but every version I've ever used would return all of those lines.... grep simply searches for the string you give it, it doesn't care about characters either side, so all of those lines would come up - but hey, as I say, I know nothing about standards, I just use it....
Admin
It does, but the odd thing is he never seems to do anything with them. Come to think of it, he never does anything with COUNT either....
Could this be shenanigans? What is the point of COUNT??? The last thing that happens to it, is it gets assigned a number - then we never hear from him again??? Is he never printed? Is he never used for another calculatio? WTF??
Admin
It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter. daveK gets a win for being... prolifically... lazy. the rest of you link-clicking assholes sucking his dick should find another industry to leech off of.
Admin
That's exactly what I did, and talking about python, this article is a good example of why forced indentation is right, the code suggest a complexity that is not there.
Arg I'm such a fanboy, I read my captchas immitto, as imoutto.
Admin
Admin
WTF?
Admin
This reminds me of a "programmer" who was put in charge of making a test rig. Using an Apple 2 (it was 1985 or so) he was to make 5 measurements, discard the high one and the low one, and average the other three. Using an array, this would have been quite simple (it was written in Basic for the Apple 2). NOPE. The process didn't use arrays, and with all the IF statements it took over TWO PAGES of programming to accomplish the task. A huge WTF if I ever saw one. While I did not re-code the problem, I figured that I could do this in about 10 lines of code (in Basic no less), not the over 150 lines that were actually used.
Live & Learn!
Admin
I wonder if it was an attempt at manual (or even a pre-processor doing) loop unrolling.
Several years ago I had a subroutine which iterated over each bit in an I*04 (32 bit integer), performing some intrinsic function (XOR from memory (that's my memory)). The machine was pretty hot (for the time), the compiler was optimized for the architecture, and compiler optimization was set = all guns blazing. After profiling, it seemed this stupid bit manipulator subroutine was the long pole in the tent. The routine was so basic there was almost nothing to modify. As a last resort I unrolled the loop by hand - it ran twice as fast.
Admin
sigh
Attention span preventing you from making it through the whole thought, then, is it?
Let me make this clear for you:
SUCK LESS.
Admin
Admin
Not that I agree with you, but I did the manual substitution in my head when I came across the first comment without even knowing someone had done the javascript link further down. And I would have to say it took me longer to do than it would have taken to write the javascript snippet.
However, the later poster is perfectly correct, computers are here to make our lives easier. I still use my brain, but for most routine, substitutional or calculation based tasks, even though I can do them myself (got a Bachelor in Mathematics), I prefer the computer does them for me. That's it's job.
In short, because you old people lose track of the point after the story gets long: My job is to think and analyse. The computers job is to process.
Admin
I did the exact same thing. Good thing it's perfectly valid Python code. copy paste read. Easy.
Admin
Admin
Admin
Admin
Hi.
I have ADHD, and I don't care for your flippant comments.
I also object to you presenting yourself as a smarter "old guy" while typing shit like "ur".
Furthermore, I walked the manual code in my head. And I have ADHD. So your petty characterization of people commenting on the javascripting or pythonning of the array fails on at LEAST two fronts. More, because I walked through it faster than I could have typed it, and I type 75wpm (I peak at 110-120wpm, depending on the method of test). So that's a bare minimum of three separate fronts you fail on.
Furthermore, what the hell harm is there in making valid javascript to decode? To copy'n'paste into python's commandline interface? Does every little thing we do have to please you?
No. I don't think so.
So please go crawl back into your mother's basement and think before you speak again.
Admin
Admin
Admin
Admin
Admin
I have worked on some code that looked like that... not to that extreme though...
Admin
This reminds me of an early-90's database technology I had to support. It wasn't paradox but it was billed as 'just like paradox'. The guy who brought in the database tool had no programming training, all the variables were names of baseball teams. His understanding of any sort of code management or debugging was was epic. We suspected that he paid the vendor to write all the code because when we gave him a simple app to write, he struggled with simple loops and variable assignments. Granted 'C' isn't the easiest language to learn but no one ever accused "for(int i; i <= 10; i++);" loops as advanced programming.
Kelly http://codewright.blogspot.com/
Admin
Admin
Admin
Admin
Admin
Admin
very nize, i always makes m like that!
Admin
I call shenanigans. Even Miranda had array-like structures FFS.
Admin
You don't need to fucking kill everyone who writes better code than you, Mr. Balmer.
Admin
1722
Admin
[quote user="m0ffx"] Live & Learn![/quote]Even without arrays, I'm not sure it should take over 150 lines. Maybe we have a coder challenge here? Perform the described task using as few statements as possible, without using arrays.[/quote]
In C, can do it in two functions and twelve semi-colon terminated statements (forward declarations, braces, comments and spaces don't count).
void swap(double *a, double *b);
double measure(double a, double, b, double c, double d, double e) { if (a < b) swap(&a, &b); if (a < c) swap(&a, &c); if (a < d) swap(&a, &d); if (a < e) swap(&a, &e); /* a is maximum */
}
void swap(double *a, double *b) { double t;
}
Admin
Ok, I enjoyed the constructed comment and all but the Werther's Originals reference made me lol way more.
Admin
One, two, another one, another one...
It's like a bad episode of Sesame Street, Count von Count on a caffeine rush.
Admin
That's way cool. You rule.
-- Furry cows moo and decompress.
Admin
It may be spelled "a r r a y s" but it's pronounced throat-warbler mangrove!
Admin
You are probably thinking of procedural programming.
Admin
I might point out that so long as strings exist, arrays are always possible (if not beautiful).
Arrays can be built into any sequential charictar datatype, one example of such is: [addTabLen] < - 4 bytes (integer) [addIndex] < - 4 bytes (integer) - repeate for each element [element] < - ? bytes (byte) - repeate for each element.
Although, nobody in their right minds would build it if they didn't have to... I cannot imagine what would cause someone to write that mess.
CAPTCHA: saluto ( spanish: Health at risk due to alcohol consumption )
Admin
[quote user="Buddy"][quote user="m0ffx"] Live & Learn![/quote]Even without arrays, I'm not sure it should take over 150 lines. Maybe we have a coder challenge here? Perform the described task using as few statements as possible, without using arrays.[/quote]
In C, can do it in two functions and twelve semi-colon terminated statements (forward declarations, braces, comments and spaces don't count).
void swap(double *a, double *b);
double measure(double a, double, b, double c, double d, double e) { if (a < b) swap(&a, &b); if (a < c) swap(&a, &c); if (a < d) swap(&a, &d); if (a < e) swap(&a, &e); /* a is maximum */
}
void swap(double *a, double *b) { double t;
} [/quote]