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 money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Mikey-San
Nov 3, 2005

I'm Edith Head!
meh

Adbot
ADBOT LOVES YOU

Mikey-San
Nov 3, 2005

I'm Edith Head!

GT_Onizuka posted:

:shroom::shroom::shroom:


Thanks

No no, it wasn't in response to anyone. I posted something, realized I spoke too quickly and the post was bad, and removed it. That's all. I would've just deleted the post if I could've.

Mikey-San
Nov 3, 2005

I'm Edith Head!

yaoi prophet posted:

Sometimes I think that if CoC had it's own YCS/helldump/BYOB style subforum, many people would have a hell of a time telling the difference.

The Something Awful Forums > Discussion > Serious Hardware/Software Crap > Goto Considered Helpful > so is it just me or is coldfusion kinda faggy or what

Mikey-San
Nov 3, 2005

I'm Edith Head!

Drx Capio posted:

GCH is leaking! :supaburn:

quotin dis for truth

Mikey-San
Nov 3, 2005

I'm Edith Head!


this guy is totally GCH

Mikey-San
Nov 3, 2005

I'm Edith Head!

more falafel please posted:

We had a girl programmer in our group once for a while but she wrote this code
code:
char* p = malloc(somesize);

p = malloc(somesize);

she wanted to make sure the memory REALLY WAS allocated, what's wrong with that

Mikey-San
Nov 3, 2005

I'm Edith Head!

Lexical Unit posted:

I can one-up that. A struct with longitude, latitude, and longititude. No longititude is not different that longitude, it is just there because somehow longititude got into a spec sheet and it was easier to add to the spec than change it. Old code expects longititude to be populated, new code expects longitude to be populated. Good night, and good luck.

I see this and raise you:

http://en.wikipedia.org/wiki/Referer

Mikey-San
Nov 3, 2005

I'm Edith Head!
code:
if (!isset($bravo)) {
   $blah = here($something);
} elseif (isset($charlie)) {
   $blah = here($charlie);
} else {
   $blah = nothere();
}
This kills me. The same-line braces are just so noisy. I don't mind collapsing if/else statements like this, but untangling/ignoring the superfluous braces drives me nuts.

Planning ahead with your code formatting is akin to premature optimization, in my book. If later you need to add extra lines (and therefore, braces), okay, you can do it later. Making it as readable as possible at the moment someone is looking at it is more important than worrying about how you might need to format it later.

edit: clarity

Mikey-San fucked around with this message at 22:11 on May 9, 2008

Mikey-San
Nov 3, 2005

I'm Edith Head!

wolf_man posted:

longer statements I do the same as Mikey-San
code:
if (!isset($bravo)) { 
	$blah = here($something); 
} elseif (isset($charlie)) { 
	$blah = here($charlie); 
} else { 
	$blah = nothere(); 
}

I don't do that. I said I can't stand the superfluous braces.

quote:

my thinking is, if your not able to read my code, or at least figure it out, then you shouldnt be looking at it in the first place

My thinking is, in this order:

1. Adhere to the coding standards of the project you're working on.

2. If I don't strive for readability for others who might read my code later, I shouldn't be writing it in the first place.

Mikey-San
Nov 3, 2005

I'm Edith Head!

JoeNotCharles posted:

"whitespace" means any space, not just newlines. No whitespace would be:


((!isset($bravo))?($blah=here($something)):((isset($charlie))?($blah=here($charlie)):($blah=nothere()));


Which is why this whole argument was so weird - as far as I could tell, the original poster was complaining about "if(!isset($bravo))", which is hard to read because the "if" is all jammed up against the bracket, and then everyone argued about where the newlines should go.

EDIT: I think I'll leave those smilies there: they're pretty appropriate.

I'm arguing about bracket placement HELLO GET IT RIGHT :argh:

To contribute:

I once worked on a project that had a feature for integrating with Flickr. We inherited the source base from an outsourced 1.0 (almost worthy of its own wtf thread), where instead of "Flickr", or even "Flicker", it was called "Ficker". Now whenever I think about Flickr, all I can hear in my head is "Ficker". :(

One day, I got so annoyed by seeing it that I burned an hour and got rid of it all. That was not a fun commit.

Mikey-San
Nov 3, 2005

I'm Edith Head!
I think Torvalds means "stupid" in the sense that "it only knows a set of predefined rules". It cannot determine the intent of the programmer, so while it's good at what it does, it can't think. It's "dumb".

Yeah?

Mikey-San
Nov 3, 2005

I'm Edith Head!

TSDK posted:

Whilst that is a reasonable statement about compilers, I'm still worried that someone's default attitude to warnings would be "I'm a programmer, I know best". Compiler warnings and sanity checking tools are there to help - as soon as false positives start creeping in unchecked, then they become useless. There's nothing worse than finding a bug the compiler was warning you about, but you didn't see it because it was hidden amongst a mass of 'harmless' warnings.

Yeah, it's a thorny bush. When can a programmer determine that a compiler warning is truly safe to ignore? At what point does the compiler know better, despite not "knowing" anything about the intent of the code? And how does the programmer know when which scenario is true?

Mikey-San
Nov 3, 2005

I'm Edith Head!

Jungle Bus posted:

But that's not "stupid," it's "not-smart."

"Semantics"

Mikey-San
Nov 3, 2005

I'm Edith Head!
Holy poo poo, ydnar. There is a name I have not seen in years.

http://www.ydnar.com/
http://www.shaderlab.com/

Marathon fans (all seven of you) in the room may recognize the name.

Mikey-San fucked around with this message at 06:39 on Jun 4, 2008

Mikey-San
Nov 3, 2005

I'm Edith Head!

Zakalwe posted:


Here's another coding horror. A student of mine refused to use a for loop. He wrote everything as a while loop


for(int i=0; i<5; ++i){
do_stuff(i);
}

was

int i=0;
while(i<5){
do_stuff(i);
++i;
}


Now they'll compile down to the same code 99.99% of the time, but it takes up more space, reads strangely to anyone else and the iterator now has scope outside of the loop. I never got a satisfactory answer from him as to why he did this.

It probably made more sense to him but he couldn't express why or how. That's sad, because I believe a majority of problems people have with code stem from an inability to delineate the nature of their thinking and the problems their thinking attempts to solve.

Mikey-San
Nov 3, 2005

I'm Edith Head!

Zakalwe posted:

I know I've been guilty of the same thing. When learning C years ago (self taught) I had a habit of using (*foo).bar rather than foo->bar which some people would call horrific.

Hey, at least you knew how to use pointers. :v:

Mikey-San
Nov 3, 2005

I'm Edith Head!

more falafel please posted:

I've seen return(((some_bool) ? (true) : (false)));

Sometimes you need to make absolutely sure you really mean true.

Mikey-San
Nov 3, 2005

I'm Edith Head!
Just spotted this in the source for a web performance analysis tool:

code:
  
if (pObj==NULL)
    return JS_TRUE;;

return JS_TRUE;

Mikey-San
Nov 3, 2005

I'm Edith Head!

Flobbster posted:

Then there should be a comment indicating exactly what you just said :colbert:

And when you do that, the code isn't necessary at all. Don't rely on code to convey intent, that's what comments are for. If you're worried about a future traveler not knowing to look for a potential situation and handle it differently, make a note in a comment.

Mikey-San
Nov 3, 2005

I'm Edith Head!
.

Mikey-San
Nov 3, 2005

I'm Edith Head!

subreality posted:

The same guy also wrote a login.php that went a little something like this:
php:
<?
  $logged_in = false;

  $users = mysql_query("SELECT * FROM users");

  while ($row = mysql_fetch_assoc($users)) {
    if ($row['username'] == $_POST['username'] && $row['password'] == $_POST['password']) {
      $user_id = $row['id'];
      $logged_in = true;
    }
  }
?>

Who gives a gently caress about this disaster when you're storing passwords in plain text in the database?

Mikey-San
Nov 3, 2005

I'm Edith Head!

Rottbott posted:

There are several functions over 3000 lines in the C codebase I work with.

why

Mikey-San
Nov 3, 2005

I'm Edith Head!
Don't get me wrong, I've seen really long functions in C programs before, but 3,000+ lines for one function? What's the weird case here that makes such a beast necessary?

Mikey-San
Nov 3, 2005

I'm Edith Head!

quote:

Okay, 3000 lines *is* a bit much. But splitting up functions just for the sake of bringing per-function line count to some arbitrary maximum isn't a good idea.

Agreed. 3,000 just struck me as whoa, slow down partner in most situations.

quote:

Language interpreters regularly end up like this, although "large functions" tends to be the least of the craziness. But if you're worried at all about interpreter performance, you really can't afford to make a function call per instruction or AST node.

Sounds reasonable.

quote:

Well regarding 3000 line functions, they're only sensible when the level of complexity is very low, like when 2975 lines are used to fill a static array.

I certainly hope you don't need to do this very often. :)

Mikey-San
Nov 3, 2005

I'm Edith Head!

That Turkey Story posted:

He's also really freakin gay.

forgot to quote dis here

Mikey-San
Nov 3, 2005

I'm Edith Head!

awesmoe posted:

Why is your dev server running different versions of stuff than your live server?

Mikey-San
Nov 3, 2005

I'm Edith Head!
hexadecimal.txt all up in this page

e: i kid, i kid

Mikey-San
Nov 3, 2005

I'm Edith Head!

hexadecimal posted:

My WTF is really because I have trouble reading my own code, which is not good. Probably should never use 3 ternary operators on same line.

Probably?

quote:

drat I suck.

Mikey-San
Nov 3, 2005

I'm Edith Head!

Mustach posted:

High as gently caress

The Something Awful Forums > Discussion > Serious Hardware / Software Crap > The Cavern of COBOL: if (!(hexadecimal ^ high)) { ++posts; }

Mikey-San
Nov 3, 2005

I'm Edith Head!

Sergeant Rock posted:

Guys, this isn't strictly a coding horror, but I thought this was the right thread:

How much flour should I use when making dumplings for a goulash? I always have problems with putting too much or too little. TIA.

little babby can't follow a recipe

Mikey-San
Nov 3, 2005

I'm Edith Head!

Avenging Dentist posted:

I want my password to be Bender! o-(8 E|

5318008 is the best password

Mikey-San
Nov 3, 2005

I'm Edith Head!

royallthefourth posted:

No matter how many words you put inside the braces you must ask yourself:
am I really doing anything?

It's a pretty clever way to find out if the compiler accidentally generates new code for you.

Mikey-San
Nov 3, 2005

I'm Edith Head!

Avenging Dentist posted:

A question so bad, even StackOverflow shits on it. :pwn:

Idea: Post code to Stack Overflow that was pulled from highly rated answers previously found on Stack Overflow, pretending it's yours. Ask for feedback.

"Is it possible for a turd to eat itself?"

Mikey-San
Nov 3, 2005

I'm Edith Head!
Everybody needs to vote that up.

Mikey-San
Nov 3, 2005

I'm Edith Head!

sex offendin Link posted:

Are we really having an argument about code quality in the game industry? That's like discussing the environmental impact of Formula 1 cars.

code:
// drunk, fix later

Mikey-San
Nov 3, 2005

I'm Edith Head!

That thread is terrible.

Bhaal posted:

Being familiar with .NET could look extra appetizing on your resume if your PR/marketing duties are largely web-oriented.

Yes, someone who doesn't know any language and is asking about learning challenges should start with .NET because it'll look awesome to marketing dudes.

It looks like the OP is asking for the challenges people have dealt with, not recommendations for a first languages to learn. Why are people posting poo poo like this?

mrbass21 posted:

If you choose linux for your compiler

Mikey-San
Nov 3, 2005

I'm Edith Head!

BigRedDot posted:

I work on sonar systems for submarines, I can say confidently that regular expressions are not at all an integral part of the programming we do.

I find it hard to believe that you could extract those little blips accurately from the ocean without some kind of regular expression. :colbert:

Mikey-San
Nov 3, 2005

I'm Edith Head!

quote:

There is a really simple reason we owned PerlMonks: we couldn't resist more
than 50,000 unencrypted programmer passwords.

quote:

the administrators notified the owners of the exposed accounts and forced a reset of all their passwords.

problem solved guys go home nothing to see here

Mikey-San
Nov 3, 2005

I'm Edith Head!

Ryouga Inverse posted:

Don't check in commented out code because you're half done with it. Check in only code that builds.

Fun way to stop people from checking in code that breaks the build: set up your VCS to notify a build machine every time someone checks in changes. Have your thankless robot build the project on every commit. When the build fails, your robot fires off an email to everyone:

THE loving PROJECT DOESN'T BUILD NOW
YOU CAN THANK: <PERSON>
BECAUSE OF HIS OR HER CHECK-IN: <REVISION NUMBER>
GO YELL AT THIS PERSON

edit: doesn't stop simple human mistakes, but eventually people get the message and stop doing reckless poo poo

Mikey-San fucked around with this message at 02:25 on Sep 12, 2009

Adbot
ADBOT LOVES YOU

Mikey-San
Nov 3, 2005

I'm Edith Head!

UraniumAnchor posted:

In my last job the 'big boss' checked in a piece of code that was k<=30 instead of k<30 and caused some 3rd-level damage. That one was fun to track down.

Does the 'big boss' not like to have other engineers review his changes before committing?

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