//Query last log read int rows = ds.Tables["tblLastLogRead"].Rows.Count; if (rows == 0) { return DateTime.Parse("January 1, 1900"); } else if (rows == 1) { return (DateTime)ds.Tables["tblLastLogRead"].Rows[0]["LastReadDate"]; } //Something bad happened return DateTime.Parse("December 7, 1941");That shit is deeeep.
Found this in some code I wrote 5 years ago
Moderator: Coders of Rage
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Found this in some code I wrote 5 years ago
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Found this in some code I wrote 5 years ago
Code: Select all
if (!japanese)
return error;
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Found this in some code I wrote 5 years ago
Yo, Marius. I want to try to get a Discord channel going to replace the dead IRC and shitty Skype interface. I'm a member of some other Discord communities so I'm pretty much always online when I'm home.
https://discord.gg/0lYtQl5oK46yLcXD
https://discord.gg/0lYtQl5oK46yLcXD
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Found this in some code I wrote 5 years ago
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
-
- Chaos Rift Junior
- Posts: 200
- Joined: Mon Feb 22, 2010 12:32 am
- Current Project: Breakout clone, Unnamed 2D RPG
- Favorite Gaming Platforms: PC, XBOX360
- Programming Language of Choice: C#
- Location: San Antonio,Texas
- Contact:
Re: Found this in some code I wrote 5 years ago
I could also see
being applicable
Code: Select all
//Something bad happened
return DateTime.Parse("September 11, 2001");
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Found this in some code I wrote 5 years ago
Not only is that too close to home, it's too close to now. One of our old applications was written by a guy who thought it would be a good idea to use "9/9/99" as the null date; worst idea ever. Invalid dates should always be far enough in the past that they won't possibly overlap with valid dates, and should *never* be in the future.mattheweston wrote:I could also see
being applicableCode: Select all
//Something bad happened return DateTime.Parse("September 11, 2001");
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Found this in some code I wrote 5 years ago
I mean you also use an exception or a success / error code parameter...
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Found this in some code I wrote 5 years ago
Yeah, that's definitely the best way in most circumstances. On certain occasions you want the software to keep doing what it's doing even if an error occurs though, so you need *some* valid date. A more intelligent date would be 1900-01-01 or something else innocuous in case someone sees it.K-Bal wrote:I mean you also use an exception or a success / error code parameter...
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- short
- ES Beta Backer
- Posts: 548
- Joined: Thu Apr 30, 2009 2:22 am
- Current Project: c++, c
- Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
- Programming Language of Choice: c, c++
- Location: Oregon, US
Re: Found this in some code I wrote 5 years ago
I had no idea at the time what I was doing to myself with this nugget, it's 4 years old at this point:
https://github.com/bjadamson/Smashteroi ... cs#L12-L38
https://github.com/bjadamson/Smashteroi ... cs#L12-L38
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
link: https://github.com/bjadamson
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Found this in some code I wrote 5 years ago
Lol. "FactoryModule" takes in a "ContainerBuilder". Seems perfectly obvious to me.short wrote:I had no idea at the time what I was doing to myself with this nugget, it's 4 years old at this point:
https://github.com/bjadamson/Smashteroi ... cs#L12-L38
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Found this in some code I wrote 5 years ago
* IContainerBuilder
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt