|
Just found a bug in our code that sends e-mails(MSSQL):code:
|
# ? Sep 23, 2009 16:10 |
|
|
# ? Apr 27, 2024 17:48 |
|
Mustach posted:0. Why would someone attempt that?
|
# ? Sep 23, 2009 16:48 |
|
MagneticWombats posted:Why would someone attempt that?
|
# ? Sep 23, 2009 16:52 |
|
MagneticWombats posted:Why would someone attempt that? It resembles nothing so much as a failed attempt at a CS assignment, if it's from Industry(tm) I would assume it's from someone that thinks STL lists are Too Slow or sth else real dumb, as it's using C style genericity (although I thought void* wasn't a universal implicit cast in C++?) without knowing how free()/delete works
|
# ? Sep 23, 2009 16:55 |
|
Otto Skorzeny posted:STL lists are Too Slow Ugggh these people are everywhere and it's never an argument against the design, it's always "I used dinkumware STL 0.1 on Visual C++ 6.0 in a trivial benchmark with a new/delete allocator and it was slower than java! So what the gently caress"
|
# ? Sep 23, 2009 19:35 |
|
Painless posted:Ugggh these people are everywhere and it's never an argument against the design, it's always "I used dinkumware STL 0.1 on Visual C++ 6.0 in a trivial benchmark with a new/delete allocator and it was slower than java! So what the gently caress" The design is awful too, though.
|
# ? Sep 23, 2009 20:07 |
|
Avenging Dentist posted:The design is awful too, though.
|
# ? Sep 23, 2009 20:19 |
|
I've realized that my posting has gotten crankier lately and it has to do with finding things like this:code:
code:
|
# ? Sep 28, 2009 23:47 |
|
Mustach posted:I've realized that my posting has gotten crankier lately and it has to do with finding things like this: What the gently caress is this poo poo? Why not just do char * buff = malloc( num_bytes);?
|
# ? Sep 29, 2009 00:03 |
|
Because ten years ago someone decided that we needed a "Buffer" "class" that offers no advantages over even plain C-style strings and now it's used everywhere by pretty much everyone.
|
# ? Sep 29, 2009 00:23 |
|
Mustach posted:I've realized that my posting has gotten crankier lately and it has to do with finding things like this: That is the worst C++ thing I have ever seen.
|
# ? Sep 29, 2009 13:49 |
|
C++:code:
|
# ? Sep 29, 2009 14:09 |
|
Lexical Unit posted:C++: I'm brought comfort by the knowledge that the optimizer is probably sorting that out.
|
# ? Sep 29, 2009 14:19 |
|
code:
|
# ? Sep 29, 2009 15:14 |
|
Lexical Unit posted:
BigRedDot fucked around with this message at 15:49 on Sep 29, 2009 |
# ? Sep 29, 2009 15:46 |
|
Zombywuf posted:
Trailing whitespace, mixed spaces and tabs, and 8 space indents are never right
|
# ? Sep 29, 2009 15:52 |
|
Not specifically a coding horror but heard from a CS student in the hallway:quote:Why do we need hardware floating point? Computers are fast enough to do arbitrary precision anyway!
|
# ? Sep 29, 2009 23:46 |
|
UraniumAnchor posted:Not specifically a coding horror but heard from a CS student in the hallway: Were they under-grad or grad? Also what year as under-grad?
|
# ? Sep 30, 2009 00:40 |
|
RussianManiac posted:Were they under-grad or grad? Also what year as under-grad? Sophomore.
|
# ? Sep 30, 2009 00:44 |
|
Half the time you hear dumber poo poo from grad students tbqh
|
# ? Sep 30, 2009 00:46 |
|
UraniumAnchor posted:Not specifically a coding horror but heard from a CS student in the hallway: To try and rationalize that mentality, the difference is probably imperceivable for the little crappy things that they do. They haven't tried to do operations with huge datasets to know the difference.
|
# ? Sep 30, 2009 01:07 |
|
^^^ Basically the kid's never thought about how an arbitrary-precision math library works, he ought to know about asymptotic time bounds and such by sophomore year
|
# ? Sep 30, 2009 01:21 |
|
Arbitrary-precision math? More like symbolic math, helllll yeah.
|
# ? Sep 30, 2009 01:57 |
|
UraniumAnchor posted:Not specifically a coding horror but heard from a CS student in the hallway: Well to be honest, the more I've programmed, the more I like languages which tend to have the most powerful representation as the default (Lisp, Scheme, Haskell) with the ability to constrain to smaller faster machine dependent types when needed.
|
# ? Sep 30, 2009 03:59 |
|
What does what you said have anything to with what you quoted?
|
# ? Sep 30, 2009 04:46 |
|
HFX posted:Well to be honest, the more I've programmed, the more I like languages which tend to have the most powerful representation as the default (Lisp, Scheme, Haskell) with the ability to constrain to smaller faster machine dependent types when needed. But said languages are useful because you can drop down to machine-level operations when necessary.
|
# ? Sep 30, 2009 10:59 |
|
I have an SQL statement that is AT LEAST twice as long as the 5000 character limit per post, and there's an error in it somewhere: .... CITIZENSHIP.COUNTRY_ID = COUNTRY.ID and COUNTRY.REGION_ID = REGION.ID) ON (CITID = APPLICANT.CITIZENSHIP_ID) LEFT JOIN (select APPLICANT_STATUS.APPLICANT_ID as SAPP_ID, STATUS.NAME as SNAME from STATUS, APPLICANT_STATUS where APPLICANT_STATUS.STATUS_ID = STATUS.ID and APPLICANT_STATUS.GARGROUP_ID = 44) ON SAPP_ID = APPLICANT.ID LEFT JOIN (select APPLICANT_SUPPORT.APPLICANT_ID as SUPAPP_ID, SUPPORT.NAME as SUPNAME from SUPPORT, APPLICANT_SUPPORT where APPLICANT_SUPPORT.SUPPORT_ID = SUPPORT.ID and APPLICANT_SUPPORT.GARGROUP_ID = 44) ON SUPAPP_ID = APPLICANT.ID WHERE "MAJOR1" = '5' AND "ENROLL" = 'NonDeg' AND "RNAME" = 'China'SELECT DISTINCT APPLICANT.ID as APPID FROM "APPLICANT" JOIN (select PROGRAM.TERM_ID as PTID, PROGRAM.YEAR_ID as PYID, PROGRAM.APPLICANT_ID as P_APP_ID, YEAR.NAME as YNAME, TERM.NAME as TNAME from PROGRAM join YEAR on (PROGRAM.YEAR_ID = YEAR.ID) join TERM on (PROGRAM.TERM_ID = TERM.ID) where YEAR.NAME = '2010' and TERM.NAME = 'Spring') ON P_APP_ID = APPLICANT.ID LEFT JOIN (select PROGRAM.APPLICANT_ID as PROGRAM_APP_ID, PROGRAM.MAJOR_ID as MAJOR1, ENROLLOBJ.ABBRV as ENROLL from PROGRAM, ENROLLOBJ where PROGRAM.ENROLLOBJ_ID = ENROLLOBJ.ID) ON PROGRAM_APP_ID = APPLICANT.ID JOIN (select APPLICANT_GARGROUP.APPLICANT_ID as APP_GARGROUP, APPLICANT_GARGROUP.GARGROUP_ID as GAR_GROUP_ID from APPLICANT_GARGROUP where APPLICANT_GARGROUP.GARGROUP_ID = 44) ON APP_GARGROUP = APPLICANT.ID LEFT JOIN (select GENDER.NAME as GENDERNAME, GENDER.ID as GENDERID from GENDER) ON (GENDERID = APPLICANT.GENDER_ID) LEFT JOIN (select ETHNICITY.NAME as ETHNICITYNAME, ETHNICITY.ID as ETHNICITYID from ETHNICITY) ON (ETHNICITYID = APPLICANT.ETHNICITY_ID) LEFT JOIN (select COUNTRY.NAME as COUNTRYNAME, CITIZENSHIP.ID as CITID, REGION.NAME as RNAME from COUNTRY, REGION, CITIZENSHIP where CITIZENSHIP.COUNTRY_ID = COUNTRY.ID and COUNTRY.REGION_ID = REGION.ID) ON (CITID = APPLICANT.CITIZENSHIP_ID) LEFT JOIN (select APPLICANT_STATUS.APPLICANT_ID as SAPP_ID, STATUS.NAME as SNAME from STATUS, APPLICANT_STATUS where APPLICANT_STATUS.STATUS_ID = STATUS.ID and APPLICANT_STATUS.GARGROUP_ID = 44) ON SAPP_ID = APPLICANT.ID LEFT JOIN (select APPLICANT_SUPPORT.APPLICANT_ID as SUPAPP_ID, SUPPORT.NAME as SUPNAME from SUPPORT, APPLICANT_SUPPORT where APPLICANT_SUPPORT.SUPPORT_ID = SUPPORT.ID and APPLICANT_SUPPORT.GARGROUP_ID = 44) ON SUPAPP_ID = APPLICANT.ID WHERE "MAJOR1" = '5' AND "ENROLL" = 'NonDeg' AND "RNAME" = 'India'SELECT DISTINCT APPLICANT.ID as APPID FROM "APPLICANT" JOIN (select PROGRAM.TERM_ID as PTID, PROGRAM.YEAR_ID as PYID, PROGRAM.APPLICANT_ID as P_APP_ID, YEAR.NAME as YNAME, TERM.NAME as TNAME from PROGRAM join YEAR on (PROGRAM.YEAR_ID = YEAR.ID) join TERM on (PROGRAM.TERM_ID = TERM.ID) where YEAR.NAME = '2010' and TERM.NAME = 'Spring') ON P_APP_ID = APPLICANT.ID LEFT JOIN (select PROGRAM.APPLICANT_ID as PROGRAM_APP_ID, PROGRAM.MAJOR_ID as MAJOR1, ENROLLOBJ.ABBRV as ENROLL from PROGRAM, ENROLLOBJ where PROGRAM.ENROLLOBJ_ID = ENROLLOBJ.ID) ON PROGRAM_APP_ID = APPLICANT.ID JOIN (select APPLICANT_GARGROUP.APPLICANT_ID as APP_GARGROUP, APPLICANT_GARGROUP.GARGROUP_ID as GAR_GROUP_ID from APPLICANT_GARGROUP where APPLICANT_GARGROUP.GARGROUP_ID = 44) ON APP_GARGROUP = APPLICANT.ID LEFT JOIN (select GENDER.NAME as GENDERNAME, GENDER.ID as GENDERID from GENDER) ON (GENDERID = APPLICANT.GENDER_ID) LEFT JOIN (select ETHNICITY.NAME as ETHNICITYNAME, ETHNICITY.ID as ETHNICITYID from ETHNICITY) ON (ETHNICITYID = APPLICANT.ETHNICITY_ID) LEFT JOIN (select COUNTRY.NAME as COUNTRYNAME, CITIZENSHIP.ID as CITID, REGION.NAME as RNAME from COUNTRY, REGION, CITIZENSHIP where CITIZENSHIP.COUNTRY_ID = COUNTRY.ID and COUNTRY.REGION_ID = REGION.ID) ON (CITID = APPLICANT.CITIZENSHIP_ID) LEFT JOIN (select APPLICANT_STATUS.APPLICANT_ID as SAPP_ID, STATUS.NAME as SNAME from STATUS, APPLICANT_STATUS where APPLICANT_STATUS.STATUS_ID = STATUS.ID and APPLICANT_STATUS.GARGROUP_ID = 44) ON SAPP_ID = APPLICANT.ID LEFT JOIN (select APPLICANT_SUPPORT.APPLICANT_ID as SUPAPP_ID, SUPPORT.NAME as SUPNAME from SUPPORT, APPLICANT_SUPPORT ... and it just keeps going...but i've narrowed the problem down to something in that general area....
|
# ? Oct 1, 2009 16:15 |
UserNotFound posted:I have an SQL statement that is AT LEAST twice as long as the 5000 character limit per post, and there's an error in it somewhere: This doesn't look good: code:
|
|
# ? Oct 1, 2009 16:34 |
|
UserNotFound posted:I have an SQL statement that is AT LEAST twice as long as the 5000 character limit per post, and there's an error in it somewhere: What's this thing supposed to do? Is the database itself as horrible as this query?
|
# ? Oct 1, 2009 18:20 |
|
Heard from an undergrad discussing the decompiling of a professors class files: "I don't wanna steal his code and turn it in. I just want to look at the comments to get a better idea how to code it."
|
# ? Oct 1, 2009 20:02 |
|
clockwork automaton posted:Heard from an undergrad discussing the decompiling of a professors class files: "I don't wanna steal his code and turn it in. I just want to look at the comments to get a better idea how to code it." Hey, I'm submitting byte code comments as something to put into the next java standard. EDIT: He'd also have to understand/learn JVM byte code 0_0
|
# ? Oct 1, 2009 20:40 |
|
clockwork automaton posted:Heard from an undergrad discussing the decompiling of a professors class files: "I don't wanna steal his code and turn it in. I just want to look at the comments to get a better idea how to code it." Honestly if I were a professor and I found out my student went through the effort of decompiling my reference program and then rewriting it sensibly in the original language, I'd let it go because he probably did learn whatever he was supposed to, and then some.
|
# ? Oct 1, 2009 23:35 |
|
floWenoL posted:Honestly if I were a professor and I found out my student went through the effort of decompiling my reference program and then rewriting it sensibly in the original language, I'd let it go because he probably did learn whatever he was supposed to, and then some. Eh, it depends. If a student manually inspected bytecode or assembly language code and rewrote it in the original language, then yes, I'd be impressed by that and would congratulate the student instead of punishing them. But if he's just running Jad or Reflector.NET, those generate reasonable enough code automatically that it's not worthy of any kind of praise.
|
# ? Oct 2, 2009 00:54 |
|
Flobbster posted:Eh, it depends. If a student manually inspected bytecode or assembly language code and rewrote it in the original language, then yes, I'd be impressed by that and would congratulate the student instead of punishing them. But if he's just running Jad or Reflector.NET, those generate reasonable enough code automatically that it's not worthy of any kind of praise. Good point. I'm actually not familiar with the state of decompilers for languages like Java/C#. How readable does "reasonable" look? Are variable names preserved?
|
# ? Oct 2, 2009 01:25 |
|
floWenoL posted:Good point. I'm actually not familiar with the state of decompilers for languages like Java/C#. How readable does "reasonable" look? Are variable names preserved? I only have experience with Jad, but yes variables names are preserved if debugging is turned on.
|
# ? Oct 2, 2009 01:57 |
|
SwimNurd posted:I only have experience with Jad, but yes variables names are preserved if debugging is turned on. This has been my experience as well, in just about every class file I've had to decompile -- the main project I've been working on for the past couple years is a Frankenstein-like beast built on Apple WebObjects and we've had to resort to using Jad from time to time to hack into WO classes that we need to fix bugs in or change the functionality of where just subclassing isn't an option. The code that Jad dumps out is usually quite usable, and in many cases, without needing any manual repair. The only times I've seen it fail were in some heavy try/catch situations, or occasionally with complex nested conditionals where it can't figure out the structure and just dumps out labels. I haven't used Reflector.NET in several years since I don't do .NET anymore, but I seem to remember it generating pretty good C# code too (never bothered with other languages). Since MSIL can be generated by a handful of source languages, there's probably some cases where it gets tricker (like I don't know how good VB (compile) --> MSIL (decompile) --> C# would look), but if you stick to the same source and destination language it's probably on the same level as Jad.
|
# ? Oct 2, 2009 03:57 |
|
code:
|
# ? Oct 2, 2009 10:37 |
|
floWenoL posted:Good point. I'm actually not familiar with the state of decompilers for languages like Java/C#. How readable does "reasonable" look? Are variable names preserved? As far as C# goes, if you don't run it through Dotfuscator the thing basically looks like you just removed comments. If you do, then the variable names change to a, b, c, d, etc (so, no change ) or nonprintable characters if you have the full version, but it's still trivial to see your app logic.
|
# ? Oct 2, 2009 10:59 |
|
Wheany posted:
I'd punch someone in the face if I had to maintain that. It's the code equivalent of, "Everything's ok...... NOT!!".
|
# ? Oct 2, 2009 14:00 |
|
|
# ? Apr 27, 2024 17:48 |
|
From the wild west days before static imports:code:
code:
|
# ? Oct 2, 2009 14:38 |