maybe I'm a retard - Developers Anonymous
Thursday, July 27, 2006 12:30 PM Trivium DawnWalker

maybe I'm a retard

plz someone correct me if i'm just being stupid.

 

int x = 20;

 x += 20;

 //x should now = 40 which works BUT

x -= 20;

//x should now = 20 shouldn't it?

 

or have I just dreamed up this function? Today is not a good day..... 

Comments

# re: maybe I'm a retard

Thursday, July 27, 2006 2:56 PM by Craig Nicholson

It does equal 20 dude.

# re: maybe I'm a retard

Thursday, July 27, 2006 3:08 PM by Trivium DawnWalker

well in my asp.net code it resets the value to 0?!?!?!?!?!

# re: maybe I'm a retard

Thursday, July 27, 2006 3:16 PM by Kevin Trethewey

There must be something else happening (ie how many threads are you running?)

# re: maybe I'm a retard

Thursday, July 27, 2006 3:25 PM by Trivium DawnWalker

just a single thread, thats why i said its so weird or maybe i'm a retard. I have to leave the office now. I'm going to check in the morning exactly why and when I find my n00b mistake I'll post it here so we can all have a friday morning laugh ;)

# re: maybe I'm a retard

Thursday, July 27, 2006 4:19 PM by Senkwe

Nothing wrong with the code you wrote. (Final value of x is 20) There must be something else that you're not revealing here.

# re: maybe I'm a retard

Friday, July 28, 2006 7:12 AM by Trivium DawnWalker

Good morning, well, It is now official. I truely am a n00b. it really does help when you wrap your page_load code in a If (!Page.IsPostback) block. I know officially feel like an idiot and my dreams of becoming ASP.Net MVP are shredded. LOL, i'm a n00b. thanks for the comments though.

# re: maybe I'm a retard

Wednesday, August 02, 2006 10:46 PM by Keith Rull

No worries trivium. we all make mistakes and it should be a motivation for you to get better :)

# re: maybe I'm a retard

Wednesday, August 02, 2006 10:47 PM by Keith Rull

..atleast thats how i learned to scrutinize my code more.

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: