Search Amazon.com:
Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
  • Post
  • Reply
duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Mr. Heavy posted:

Never has a single empty method call made me want to hit something so badly.

code:
$self->maybeTakeUserFromForm();

Fuzzy logic!

Adbot
ADBOT LOVES YOU

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


I just found this little ripper in some code that, uh, I might of written many years ago. From memory I might not of been entirely sound of mind at the time....

code:
if ((((!(in_array($_REQUEST['context'],array(-10,-11,-12,-13)))) and ((($_SESSION['authenticated'] == 0) or ($_SESSION['authuserrole'] > 0)) or ($_REQUEST['context'] >2)))) and (!(in_array($_REQUEST['context'],array(80))))) { 
We dubbed it "ifzilla" , shortly before refactoring the poo poo out of it, once we worked out how it worked. It helped that I had written it, but I might of been a bit drunk at the time

A true hate crime against boolean logic.

edit: (in_array($_REQUEST['context'],array(80)) lol

duck monster fucked around with this message at Apr 2, 2008 around 23:33

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Surge Strip posted:

Our intern programmer makes me laugh some days. For example, he future proofed all his code, just in case the definition for a newline ever changes on Windows:

code:
CRLF := #13 + #10;
He codes mostly in Delphi, which has quite a few functions for you to use. I guess he just didn't like the Uppercase function they wrote:

code:
function Upercase(str : string) : string;
   var
   len : integer;
   count : integer;
   newstring : string;
   begin
   len := length(str);
   count := 0;
   while (count < len) do
      begin
      newstring[count] := str[count] - 32;
      count := count + 1;
      end;
   result := newstring;
   end;
So many things wrong. He even got an error that Uppercase was already defined, and so he misspelled it.

When you consider that pascals unparallelled strongpoint is set mathematics, that example is even looper than you'd imagine. You can write a flawless uppercase function in a 4 lines of code, including the "function" "begin" and the "end" lines.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Jesus loving christ. If GCH emerges, I'm going to lobotomise myself so I can never understand any thread under the SH/SC forum tree again.

No. BAD NERDS. NO.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


mantaworks posted:




alright im out

Holy poo poo. ESR you sly Ron Paul votin' Hot chick banging machine of a man.

I can never work out if I hate this guy or adore him.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Janin posted:

cout isn't a singleton, LogSingleton isn't a (proper) singleton, almost any use of "singletons" is dumb, and the particular implementation of static methods proxying to private method is absurd.

I think they are great, because it lets you have resources that really really should be singular , like data base connections, but you just loving know dipshit junior developers will be re-instantiating over and over against. (They should be re-instantiating the cursor, but the cursors just hang off the connection.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Trabisnikof posted:

Political Science major programmer checking in

hi5 buddy. our code is ideologically correct.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Dijkstracula posted:

holy crap, this guy is evidentially a legend http://thestupidestmanonearth.com/

http://telusplanet.net/public/stonedan/source.txt

This code is spectacular. I haven't seen a GOSUB in decades, outside of old engineering scripts to drive RS232 poo poo around in qbasic (open "com1:" as #1,9600,blah,blah")

edit: Ahaha this is schizophrenic as hell. I don't know if anyone here ever stumbled on the "Kyoon" threads in LF. Kyoon was a paranoid schizophrenic dude , aka "The end times prophet", who managed to stumble into LF and was quickly adopted as the forum crazy-person mascot. This guys like the computer-programmer version of kyoon.

duck monster fucked around with this message at Jan 2, 2010 around 04:32

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Vanadium posted:

If you really want something that approaches a REPL for C++, why not go the whole distance and turn it into an IRC bot.



if one of you assbutts attaches #include </dev/tty> to an irc bot, I'm so going to own your box.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Ignore the retarded image macros in the thread on this patch:

https://github.com/MrMEEE/bumblebee...be0acce6#diff-0

code:
@@ -348,7 +348,7 @@ case "$DISTRO" in

   ln -s /usr/lib/mesa/ld.so.conf /etc/alternatives/gl_conf
   rm -rf /etc/alternatives/xorg_extra_modules
   rm -rf /etc/alternatives/xorg_extra_modules-bumblebee
-  rm -rf /usr /lib/nvidia-current/xorg/xorg
+  rm -rf /usr/lib/nvidia-current/xorg/xorg
   ln -s /usr/lib/nvidia-current/xorg /etc/alternatives/xorg_extra_modules-bumblebee
   ldconfig 

  ;;


I wonder how many people got their machines bricked by this clanger.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


qntm posted:

I don't know much about bash but doesn't this change fix the line of code which deletes /usr? Surely the change where that error was introduced would be more of a facepalm.

EDIT: Here we go.

Yeah thus the - + in the diff. But thats not really what I was pointing out. The fact that it was there in the first part.

From memory Eve Online had a similar bug once that wiped out the BOOT.INI (or whatever its called) on everyones windows boxes.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


GrumpyDoctor posted:

I'm pretty sure this is all scientific programming. I work with some physicists who have an elaborate simulation application, written in Fortran, that doesn't use any Fortran numerical libraries.

Scientists are generally horrible coders. When that whole climategate frameup was going on, people where gasping on horror at some of the numerical processing code that was leaked.

The funny thing was, I doubt there was an experienced fortran coder on the planet that would have even blinked at it. Its just what happens when you get a non programmer and put "ultramaths basic" in front of him. Its going to be awful.

Interestingly enough some of the tightest code I've seen came from some biologist dudes I worked with at my old uni that where doing DNA sequencing stuff. Those guy could code up a loving storm.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Aleksei Vasiliev posted:

Labeled breaks aren't the same thing as gotos.

And yes but my case was justified and not bizarre like that thing. I haven't actually worked on it for awhile since I got bored with parsing binary->XML, but I'm pretty sure gotos would have helped me write cleaner code in that method.

Completely abuse the gently caress out of exceptions?

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Scaevolus posted:

Looks like a FORTRAN programmer has been forced to write C, and is resisting.

I've seen C written like that by an engineer who had only ever done verilog. Every single loving constant was defined as such Including things like const_two = 2 , etc.

Oh and the macros. God drat it macros are cool, but when every loving operation is first defined as a macro THEN applied to code, it very rapidly becomes brain damage inducing trying to read.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Biowarfare posted:

Ghettocode horror: find nd replace 'id=' with 'class=' then iterate through that

Man I've been dealing with django templates from a graphic designer where there are no classes just ids repeated over and over again
code:
<h1 id="heading">blah</h1>

<p id="paragraph">rara</p>
<p id="paragraph">rarara</p>
etc
etc
Seriously how loving hard is it to understand the difference between an id and a class, and how the gently caress am I supposed to xpath that poo poo sanely.

Worst part is if I change half of them to classes (and the corresponding css) it somehow introduces mysterious subtle layout changes and since I'm completely terrible at CSS (Yet not terrible enough to confuse ids and classes) fixing them has been a real manual-at-side stinkyhole.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


tef posted:

In one project ~2500 lines I found 0 semicolons. In the 12000 line one, I found import traceback; traceback.print_exc(); three times. I blame debugging.

Your move

I didn't actually know semicolons where allowed.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Today I stumbled across a simple set of words that describe a real thing that ought cause any coder with a sense of his industry to imediately break out into a rash.

"LegacyJ : Enterprise JavaBeans and XML with COBOL"

Just saying it is like committing a hate-crime against IT workers. I'm pretty sure if my boss pulled up and said "Hey we got a job writing J2EE stuff with heaps of XML configuration using COBOL on a Java stack!" I'd probably start lighting fires.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Gazpacho posted:

If you consider COBOL dead maybe your "sense of the industry" isn't quite as good as you think.

I spent the first part of my career as a COBOL programmer. Its not the language thats dead, but me who is dead, inside. Terrible terrible language.

But yeah, theres still billions of lines of that godawful poo poo out there.

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Zamujasa posted:

php:
<?
// END CODE FROM testcreateinfo.php
}}}}}}
}// goodtogo = 1, infoid passed is available to the passed username/password
 }// end of check to see if info id is passed
// end of valid user/pass test and info return
// end of is api command 'doeverything'
mysql_close($con);
} // End of is api functions?>


(The lack of formatting here isn't some error, there are about 4 copies of this file and this is how they are: left justified. boss doesn't believe in indentation because he does coding on a 1024x768 TV and indents are just wasted space. )


Edit: Oh, the snip from the last post is from this file, too, but run through a code reformatter. (Rest assured, it was left-justified too.)

quote:

} // end of is api command 'doeverything'
hahaha

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Aleksei Vasiliev posted:

PHP added gotos in 2009, actually.

For the love of god, bring back pascal as a mandatory educational language PLEASE aarrgghhhhhhh. There is no valid reason to use GOTO ever that does not have as its root cause "Doesn't 'get' structured programming discipline".

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


Ensign Expendable posted:

There is an educational variant of Pascal called Turing that my high school offered in grade 9 and 10 programming courses, with Java in 11 and 12.

I just wish whatever the gently caress borlands latest hate-spawn is now called would loving wake up and offer a hacker friendly delphi or turbo pascal again at a price (or better still freeness) that makes senes. A fully updated object pascal is still a great language that emphasizes type correctness and is dead set all about doing structured and object oriented correctly. And seriously, follow the pascal rules and your code will make sense and be good and chivalrous.

The sleep of java has produced monsters.

Get off my lawn kids.

Adbot
ADBOT LOVES YOU

duck monster
Dec 15, 2004

Never stop arguing about casual racism.


ultramiraculous posted:

Mother. Of. God.


Edit: After a quick test, I'm extremely disappointed that the Scala compiler isn't accepting Emoji for operator identifiers. The bikini XOR has as much right to exist as any other!


Ahahaha I love academics and what hapens when you stick them on committees to debate stupid poo poo. Long bewildering debates spanning years over the meanings of words.

I was on the academic council (reasearch funding coordination committee) at Murdoch university in the mid 2000s , and there was an ongoing debate about what the meaning of "Multidisciplinary" was in the universitys constitution. The debate had been going for 15 years and was still unresolved, and would come up as a topic about every 3 months to the same shouting match between the postmodern leaning eng-lit ("its context dependent!") department, the ultra-analytical ("Words have meanings damnit!") philosophy department , and everyone else who would watch on in bemused bewilderment, and occasionally offering "Well , I think I know what multidisciplinary means. Yesterday I borrowed a stapler from the vetrinary science guys!".

15 loving years to define a word. Still unresolved to this day. But if you walked down into the courtyard and asked an undergrad, you'd get a 5-10 second silence followed by a consise and entirely useable answer good enough for about 90% of the time. This is for a concept that was supposed to be the defining trait of the university, yet none of the boffins could agree on what the defining trait was supposed to mean!

And it was in this sort of committee environment unicode was born.

duck monster fucked around with this message at Nov 20, 2012 around 04:40

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply