Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411558 Posts in 69384 Topics- by 58443 Members - Latest Member: junkmail

May 03, 2024, 10:55:06 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Post if you just laughed at your code.
Pages: 1 ... 19 20 [21] 22 23 ... 27
Print
Author Topic: Post if you just laughed at your code.  (Read 86677 times)
JobLeonard
Level 10
*****



View Profile
« Reply #400 on: May 08, 2013, 02:39:23 AM »

Try

Logged
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #401 on: May 08, 2013, 08:18:54 AM »

 Kiss
Logged

ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #402 on: May 08, 2013, 10:20:03 AM »

Try



What I experience watching this must be what it's like for my parents if I ever talk about programming around them.
Logged

uselessffs
Guest
« Reply #403 on: May 11, 2013, 12:57:08 AM »

What I experience watching this must be what it's like for my parents if I ever talk about programming around them.

You should have a look at the functional programming paradigm then, its possibilities are mind-blowing!
I despise Java precisely because it's almost impossible to even simulate function objects in it, contrary to C/C++ and C#, and you end up writing dirty blocks of code for what should take a line or two...
Logged
methozoid
Level 0
**



View Profile
« Reply #404 on: May 14, 2013, 08:21:20 AM »

Code:
if(fading == 0)
{ ... }
else if(fading == 0)
{ other methods }

Lesson to myself: NEVER EVER write code if you haven't slept for 20+ hours..
Logged

Evan Balster
Level 10
*****


I live in this head.


View Profile WWW
« Reply #405 on: May 14, 2013, 09:31:32 AM »

Haha, that's why I don't let myself do late-night coding sessions any more.
Logged

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
JobLeonard
Level 10
*****



View Profile
« Reply #406 on: May 14, 2013, 10:46:39 AM »

Depends, if it's the "easy, dumb typing that requires time but little mental effort", that's easier late in the evening for me. Basically, when I know what I'm going to do before I start coding.
Logged
Dr. Cooldude
Guest
« Reply #407 on: June 10, 2013, 11:43:58 PM »

So I'm currently working on a school project (It's a game rental application), and this abbreviation made me chuckle a bit

Code:
GamesForm gf = new GamesForm();
gf.Show();

EDIT: Just updated from source control and now it looks like this

Code:
if (gf == null || gf.IsDisposed) gf = new GamesForm();
gf.Show();

gf.IsDisposed... Huh?
« Last Edit: June 11, 2013, 03:32:15 AM by Dr. Cooldude » Logged
impulse9
Guest
« Reply #408 on: June 11, 2013, 01:39:21 PM »

After performing some find/replace through the code I saw this and laughed.

Code:
end->SetDescription("Potion of end");
Logged
Kekskiller
Guest
« Reply #409 on: June 12, 2013, 01:23:51 AM »

Minimalizing error messages to the very essence:

Code:
debugStep("legacy fail", "important");
Logged
d
Level 0
***


View Profile
« Reply #410 on: June 17, 2013, 02:59:04 PM »

Ahem:

Code:
// fopen is kinda janky
#pragma warning(disable: 4996)
Logged
sublinimal
Level 8
***



View Profile
« Reply #411 on: June 18, 2013, 08:42:57 AM »

Code:
// no
Logged
Dacke
Level 10
*****



View Profile
« Reply #412 on: June 18, 2013, 09:18:43 AM »

Gotta love the Java 7 multicatch

Code:
try {
   mainController.getDaxploreFile().writeUploadFile(uploadFile);
} catch (TransformerFactoryConfigurationError | TransformerException | SQLException | DaxploreException | SAXException | IOException | ParserConfigurationException e1) {
   // TODO HAHAHAHAHAHA
   e1.printStackTrace();
}
« Last Edit: June 18, 2013, 09:25:15 AM by Dacke » Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Quarry
Level 10
*****


View Profile
« Reply #413 on: June 18, 2013, 02:55:12 PM »

WHAT, ECLIPSE WHY DIDN'T YOU TELL ME ABOUT THAT D:<
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #414 on: June 18, 2013, 03:06:13 PM »

Gotta love the Java 7 multicatch
While that's nicer than a million catch statements for all the subclasses of exceptions, the whole "Exceptions fucking everyhere" part of java is one of the reasons I never feel like I'm having fun writing it. Like, I write fun things in it but writing the code is a constant source of furrowed brows and feeling mad. :/

To stay on topic, had a giggle at how banal and undocumented some of the behaviour of KAG's engine is.
Code:
this.setTeamNum(-1);
print(this.getTeamNum()); //255
the team is stored in a u8, so this is expected if you know the internals, but some people have already started modding with it and are having some amusing wtf moments.
For the record, the get/set functions take an int, so the literal -1 doesn't even generate a warning. Troll interface is troll. Will it ever be fixed? Only time will tell.
Logged

Quarry
Level 10
*****


View Profile
« Reply #415 on: June 18, 2013, 06:38:13 PM »

nope it won't be
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #416 on: June 18, 2013, 06:44:41 PM »

It's been in "the shame hole" for a few months now, maybe it'll bubble over into "low priority" eventually/
Logged

George Michaels
Level 0
***


I like big butts and I can not lie


View Profile
« Reply #417 on: June 19, 2013, 12:45:57 AM »

Code:
vec distance_norman /* #SoFunny */ = f_vec::normalize(f_vec::subtract(next, collision));
Found in an old version of my Ai code..
Logged

Yeah, that.
heisenbergman
Level 2
**


LoGaP


View Profile
« Reply #418 on: June 19, 2013, 12:56:11 AM »

Gotta love the Java 7 multicatch

holy crap this is news to me.
Logged
Dacke
Level 10
*****



View Profile
« Reply #419 on: June 19, 2013, 04:24:02 AM »

While that's nicer than a million catch statements for all the subclasses of exceptions, the whole "Exceptions fucking everyhere" part of java is one of the reasons I never feel like I'm having fun writing it. Like, I write fun things in it but writing the code is a constant source of furrowed brows and feeling mad. :/

I think exceptions are one of the better solution to a necessary evil. Programs will get runtime errors and you have to deal with it somehow. I know a few approaches, in falling order of explicitness:

1. Throw exceptions
2. Have multiple return values and return explicit error-values (possibly the best approach, as seen in Go)
3. Have special function that check for errors (database.isCorrupt())
4. Return error values in-band (often null or -1)
5. Let it crash as soon as something goes remotely wrong
6. Keep going with a corrupt data state, which may make the program crash at some point

Option 5 or 6 is often the most fun to write, that's how I usually write small programs that just have to work for me (like personal scripts). But for production-ready code you want to explicitly handle every bloody error, which is a huge chore but generally necessary.

Java wants you to write production-code so it forces you to be explicit about what you want to do with every error. But since Java has to be written in an IDE anyway, you can easily let the IDE convert option 1 to 5 for you. As soon as the IDE warns about an uncaught exception, just click the warning and choose to throw it. Keep throwing it upwards at every level. At the top-level you get something horrendous like this:
Code:
} catch (TransformerFactoryConfigurationError | TransformerException | SQLException | DaxploreException | SAXException | IOException | ParserConfigurationException e1) {

It takes almost no time to write, you just keep telling the IDE to ignore the exceptions. Once you are ready to turn the code into production-ready code, you just go back in and explicitly handle all the exceptions in a reasonable way.
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
Pages: 1 ... 19 20 [21] 22 23 ... 27
Print
Jump to:  

Theme orange-lt created by panic