|
UberJumper posted:
You could put it in a pastebin, but I think it's worth it to see this poo poo in all its glory. To be perfectly frank, I feel a lot better about some of the poo poo I've written in a rush or early in my career... nothing was ever this bad. Also, I personally love this part: code:
|
# ? Feb 24, 2009 01:12 |
|
|
# ? May 28, 2024 15:22 |
|
TRex EaterofCars posted:You could put it in a pastebin, but I think it's worth it to see this poo poo in all its glory. Nope, not a scientist. It was written by a third year Software Engineering coop student from Waterloo University.(:??? (I don't want to go into alot of detail, since i am too a coop student, and dont want to break rules(I dont know if there are even any)) The application is an internal Government Application its basically a massive spanning application that is used, to fetch some random sets of information/other stuff. Thankfully this poo poo, is only confined within a little application that only deals with a very specific type of data. It's used maybe twice a month. But unfortunately since the system is basically it interacts with other parts of the system using temporary files, and some other ridiculous things. But realistically needs to die a slow/painful death. Its terrible and probably in total is a million lines of code. This is one small part made up of around 40 odd java classes(the gently caress does it use them for) and is to try and figure it out. Maybe the kid never really programmed before, but gently caress come on. I think i should start pushing to have an actual source repistory, with code inspections etc. Because this is ridiculous.
|
# ? Feb 24, 2009 01:39 |
|
code:
|
# ? Feb 24, 2009 02:28 |
|
So i actually looked at the wrapper objects, i can see what they are for. But its just useless. I browsed and found all the wrapper java classes, WTFGFD. WrapperFIXED_A.java WrapperFIXED_A.class WrapperFIXED_B.java WrapperFIXED_B.class WrapperFIXED_C.java WrapperFIXED_C.class WrapperFIXED_D.java WrapperFIXED_D.class WrapperFIXED_E.java WrapperFIXED_E.class WrapperFIXED_G.java WrapperFIXED_G.class WrapperFIXED_H.java WrapperFIXED_H.class WrapperFIXED_I.java WrapperFIXED_I.class WrapperFIXED_J.java WrapperFIXED_J.class What happend to WrapperFIXED_F? All the classes are identical just with a slightly difference class name. I found this comment in A Tho. Its GOLD: code:
Please someone tell me what the gently caress he is rambling about?
|
# ? Feb 24, 2009 03:58 |
|
I was going to post crap about a database that at first blush seemed pretty nicely normalized and set up with proper relations and such with only small hiccups in naming here and there, which upon second blush unleashes the coding horror of having datetime columns of varying lengths (some are "yyyyMMddHHMM", some are "yyyyMMdd") stored in varchar(100) fields, dollar/quantity amounts in varchar(100) fields, things that will never be more than 5 or 6 characters in varchar(100) fields, etc. ...but UberJumper pretty much topped all that
|
# ? Feb 24, 2009 04:45 |
|
UberJumper posted:
|
# ? Feb 24, 2009 05:05 |
|
One more before i go to bed. This is what WrapperFIXED_A.java is made of: (NOTE: I cut out alot of the boring stuff, because its redundant, boring and useless code, some of the other functions were given to him, he just gave them retarded all caps names) All my comments start with >> and are bolded. code:
For the retarded little minirant of his, my theory is: for this: for(int i = 0; i <= 100; i++){ (WrapperClass_ + i) (mywrapper_ + i) = new (wrapperclass_ + i); } I think that more explains it, im not sure. Looks like he wants to dynamically create 100 variables, of a 100 different classes. I.e. WrapperClass_1 mywrapper_1 = new WrapperClass_1(); WrapperClass_2 mywrapper_2 = new WrapperClass_2(); ... etc. Why. *EDIT* Boo bold doesnt work in code tags. UberJumper fucked around with this message at 05:25 on Feb 24, 2009 |
# ? Feb 24, 2009 05:20 |
|
That or he doesn't know how to create an array of objects
|
# ? Feb 24, 2009 06:35 |
|
What does he use WrapperFIXED_A through WrapperFIXED_J for, anyway? Why would he want 50 identical but differently named classes? Also, unlike what he suggests... You can't do that with a loop in C++. Although there's probably some preprocessor macro fuckery that could do it
|
# ? Feb 24, 2009 06:54 |
|
Mill Town posted:What does he use WrapperFIXED_A through WrapperFIXED_J for, anyway? Why would he want 50 identical but differently named classes? Hilariously, you can do it in Java, using the reflection API stuff: Class cls = Class.forName("WrapperFIXED_" + i); Object whateverVariable = cls.newInstance();
|
# ? Feb 24, 2009 07:18 |
|
ColdPie posted:Hilariously, you can do it in Java, using the reflection API stuff: Right, but the class still needs to be defined somewhere. Can you do that with reflection, too? I'd like to know! (I like reflection)
|
# ? Feb 24, 2009 07:55 |
|
UberJumper posted:One more before i go to bed. Holy poo poo that code owns. The horrors I run into are mostly nested #ifdefs. Boring poo poo compared to that. e: Although at one of my earlier coding jobs I had a colleague who loved to use single- and double letter variable names. So stuff like int a = 1; int b = 1; int aa = a + b; Wheany fucked around with this message at 10:43 on Feb 24, 2009 |
# ? Feb 24, 2009 10:34 |
|
Wheany posted:Holy poo poo that code owns. We're working on a project right now that specifies in the coding standards that all variables must be descriptive, especially loop variables. They also have to be spelled out completely. code:
code:
|
# ? Feb 24, 2009 13:19 |
|
Mill Town posted:Right, but the class still needs to be defined somewhere. Can you do that with reflection, too? I'd like to know! (I like reflection) You could do it with CGLIB or ASM. With either you can basically class load arbitrary streams of bytecode on the fly and give them arbitrary class names so long as the class can be verified and the name is valid according to the JLS.
|
# ? Feb 24, 2009 14:15 |
|
UberJumper posted:
This reminds of what I (think I) had to do in a Cobol project for school once. I had made some wrapper code around the standard database access code you would normally use which made it a lot easier to work with. Unfortunately I couldn't find a way to make my code work for different tables, so I had to copy the same code like 10 or 20 times with just a few lines changed for each different table. Same thing for about 20 listboxes: 20 times, basically the same code with a few lines changed. Thinking back, there must have been a better way to do this, maybe delegate functions or something, but I didn't know how. Then again, it was Cobol, so who knows ? Anyway, I'm fairly sure that at least my variables and functions had good names, so it wasn't all bad. I think this guy's situation was similar to mine: not enough knowledge to make his classes the way he wanted, so "forced" to make copies of one that are only a little different.
|
# ? Feb 24, 2009 17:47 |
|
Richard Noggin posted:I can certainly understand using descriptive variable names, but you have to be a complete loving moron to require them in loops. Now if you'd have put: code:
|
# ? Feb 24, 2009 17:57 |
|
Right. My point was that in the simple "for i = 1 to 100" cases, i is descriptive enough. If it isn't, then you shouldn't be loving with this code. We can't even use a variable named "numOfItems", it must be "numberOfItems". Blah blah blah modern IDEs, auto-completion and all that.
|
# ? Feb 24, 2009 18:17 |
|
Every time I see all those Java WTFs brought from some government programmer, all I have to imagine is how horrible the C/C++ version of that would become and my brain crashes and reboots.TRex EaterofCars posted:You could do it with CGLIB or ASM.
|
# ? Feb 24, 2009 18:49 |
|
UberJumper posted:
It looks like he's confusing classes and objects. He wants 50 objects of the same class, but he thinks classes and objects are the same thing so he makes 50 identical classes instead. Unless he's gotten the class/object distinction right in the rest of the code, in which case I have no clue what he's going on about. Also, JAVA is hirrable.
|
# ? Feb 24, 2009 19:22 |
|
And I was angry at choosing western over waterloo. I guess the difference in education does not play that much of a role hahah.
|
# ? Feb 24, 2009 20:03 |
|
Richard Noggin posted:
Short loop variables can be descriptive, though. For example using y and x instead of, say, the traditional i and j: code:
Confession: I just made a program last week where I used variables int Δx and int Δy. Because I could. I copy-pasted the delta-character every time.
|
# ? Feb 24, 2009 21:47 |
|
Wheany posted:Short loop variables can be descriptive, though. For example using y and x instead of, say, the traditional i and j... Meh, any programmer should have taken at least one statics course and thus grok i, j and k
|
# ? Feb 24, 2009 23:41 |
|
Otto Skorzeny posted:Meh, any programmer should have taken at least one statics course and thus grok i, j and k Yeah but i, j, and k (with hats at least) are unit vectors, not displacements along an axis, as x, y, and z often are.
|
# ? Feb 24, 2009 23:53 |
|
Avenging Dentist posted:hats Yesssssssssssssssssssssssss this whas the best part of intro to engineering analysis
|
# ? Feb 25, 2009 00:06 |
|
Richard Noggin posted:Right. My point was that in the simple "for i = 1 to 100" cases, i is descriptive enough. If it isn't, then you shouldn't be loving with this code. We can't even use a variable named "numOfItems", it must be "numberOfItems". Blah blah blah modern IDEs, auto-completion and all that. The real horror is camelCase.
|
# ? Feb 27, 2009 00:06 |
|
Zombywuf posted:The real horror is camelCase. Don't start this.
|
# ? Feb 27, 2009 00:10 |
|
TheSleeper posted:Don't start this. Have I mentioned Emacs recently? p.s. Today I discovered that C-M-h C-w will kill the function the point is in :-)
|
# ? Feb 27, 2009 00:22 |
|
Zombywuf posted:The real horror is camelCase. Last night in Warcraft I was joking around with some friends in raid chat and spat out "Klaatu.shutUp();". Little did I know that the C programmers would start a jihad on "Javaboy".
|
# ? Feb 27, 2009 00:42 |
|
Wait, what's wrong with camel case? Have I been doing it wrong again?
|
# ? Feb 27, 2009 00:43 |
|
Ledneh posted:Wait, what's wrong with camel case? Have I been doing it wrong again? The only thing that's wrong is neckbeards with no social skills criticizing everyone who doesn't do things their way.
|
# ? Feb 27, 2009 00:50 |
|
Ledneh posted:Wait, what's wrong with camel case? Have I been doing it wrong again? The scheme you use to handle variable names with multiple words is by far the most important factor for determining how good code is, and you're using the wrong one.
|
# ? Feb 27, 2009 01:01 |
|
royallthefourth posted:The only thing that's wrong is neckbeards with no social skills criticizing everyone who doesn't do things their way. I'm sorry, I seem to have wandered into the "Get butthurt about people not liking the way I code" thread. Can you please direct me to the thread about taking the piss out of code?
|
# ? Feb 27, 2009 01:04 |
|
Zombywuf posted:I'm sorry, I seem to have wandered into the "Get butthurt about people not liking the way I code" thread. Can you please direct me to the thread about taking the piss out of code? You kind of started it by getting butthurt about camel case...
|
# ? Feb 27, 2009 01:39 |
|
Zombywuf posted:I'm sorry, I seem to have wandered into the "Get butthurt about people not liking the way I code" thread. Can you please direct me to the thread about taking the piss out of code? Uh, naming conventions that are not patently insane are not coding horrors. For example, if he had named it it_nm_dx then perhaps you could say that was the real horror.
|
# ? Feb 27, 2009 01:44 |
|
Behead those who say K&R is a violent religion
|
# ? Feb 27, 2009 02:02 |
|
Otto Skorzeny posted:Behead those who say K&R is a violent religion Durka durka One True Brace Style jihad!
|
# ? Feb 27, 2009 02:32 |
|
UberJumper posted:
But this sort of thing makes me go code:
|
# ? Feb 27, 2009 02:34 |
|
This script has been in daily use since 07/13/05:code:
code:
"Hey guys, why do I have to specify the parameters in a specific order or it ignores them all?" In the future I'm taking the blue pill...
|
# ? Feb 27, 2009 03:03 |
|
Veritron posted:[-D AE_Title] I worked for a medical imaging company that had its own horrific (Ruby) script to generate and send DICOM files.
|
# ? Feb 27, 2009 03:38 |
|
|
# ? May 28, 2024 15:22 |
|
Lysidas posted:Application Entity title? I smell DICOM!
|
# ? Feb 27, 2009 13:16 |