Comment On Feeling Aggregated

"All right, Jory, we're gonna start you off simple here, kid!" Jory B.'s boss was a large man with forearms like hairy hams, and he spoke in a gruff, deep, and loud voice. "Yer gonna learn about The Aggregator by adding a simple feature. I want it to be sendin' emails whenever someone signs up at one of our locations!" He continued on his throaty, saliva-y explanation of what should appear in the emails, which mail server to use, and so on. "Welcome aboard, kid," he said warmly, extending a hand with fingers that looked like sausages. [expand full text]
« PrevPage 1 | Page 2Next »

Re: Feeling Aggregated

2009-01-20 11:04 • by KattMan
I'll see your fist and raise it...err never mind.

If I had a dollar for every project I got placed on that was developed like this I'd be retired by now.
This is the type of stuff that makes me want to go flip burgers for a living.

Re: Feeling Aggregated

2009-01-20 11:10 • by SoonerMatt (unregistered)
I have seen the same problem with incrementing primary keys using "MAX(intuserid) + 1".

Can't really disclose the problem that it caused, but it was very bad.

Re: Feeling Aggregated

2009-01-20 11:21 • by Uber
I was wondering why my gym was spamming me with male enhancement emails.

Re: Feeling Aggregated

2009-01-20 11:29 • by Ant (unregistered)
The Architect showed up later that day. He was tall, very slender, with a thin mustache. If he had a cap with a "W" on it he'd look like Waluigi.


No he wouldn't - Waluigi has an inverted "L" on his cap.

</pedantry>

Re: Feeling Aggregated

2009-01-20 11:30 • by Neil (unregistered)
240027 in reply to 240023
Uber:
I was wondering why my gym was spamming me with male enhancement emails.

Perhaps its just that guess they have genital size recognition software on the cameras in the locker room.

Re: Feeling Aggregated

2009-01-20 12:09 • by Anonymous (unregistered)
And then they wanted to sell their services to other "Gyms" so it was requested that the other "Gyms" be allowed to send "membership" information to it.

Jory's boss said, "Well since we can send information to it, what's so hard about allowing other gyms to send information to it?"

At which point and time Jory began a 3 month journey down the road of educating his superiors and letting them know why direct database access is a bad thing.

Next they decided that since they have these email addresses for members, they should send mass emails out to these users as well. To do this we weren't allowed to use a mass emailing service. Also, you can't use the same servers or ip addresses that the original servers are hosted under in case we get blacklisted. Solution: let's use the ip addresses from a different company that we own. Nevermind that the two systems are nowhere near each other physically. Nevermind that it would require a process to be setup that pulls down all 700,000+ email addresses, and separate email templates for each location (that were setup in the aggregator) to this new server. Nevermind that there are people that spend their lives figuring out how to get spam through email filters and now Jory was required to figure that out as well. Oh, and lastly nevermind that they didn't actually want to pay for a server, or software, so a glorified workstation was used and mercury mail server sent the emails.

Re: Feeling Aggregated

2009-01-20 12:20 • by the real wtf fool
240034 in reply to 240026
Ant:

No he wouldn't - Waluigi has an inverted "L" on his cap.
</pedantry>


Just wasted half an hour of my life looking at the super mario wiki - thanks to you...

Re: Feeling Aggregated

2009-01-20 12:34 • by D. Travis North (unregistered)
240037 in reply to 240034
the real wtf fool:
Ant:

No he wouldn't - Waluigi has an inverted "L" on his cap.
</pedantry>


Just wasted half an hour of my life looking at the super mario wiki - thanks to you...


And I'll be spending the next half hour there, thanks to you...

Re: Feeling Aggregated

2009-01-20 12:36 • by Charles Manson (unregistered)
240038 in reply to 240034
the real wtf fool:
Ant:

No he wouldn't - Waluigi has an inverted "L" on his cap.
</pedantry>


Just wasted half an hour of my life looking at the super mario wiki - thanks to you...
Get back to work slacker.

Re: Feeling Aggregated

2009-01-20 12:36 • by Steve H (unregistered)
240040 in reply to 240020
SoonerMatt:
Can't really disclose the problem that it caused


Well, that post was worthwhile then.

Re: Feeling Aggregated

2009-01-20 12:45 • by Daniel (unregistered)
Frankly, the solution is correct for what passes for the architecture.

Re: Feeling Aggregated

2009-01-20 12:56 • by I'm not tellin' you (unregistered)
I'm missing something here....what then happens (more specifically than a bunch of emails go out).

Re: Feeling Aggregated

2009-01-20 13:10 • by Fred Burns (unregistered)
Completely irrelevant to the article, I really enjoy the new Irish Girl ad. Improves the site aesthetics immeasurably.

Re: Feeling Aggregated

2009-01-20 13:17 • by Crash Magnet (unregistered)
I was expecting a variation on:

1. Each gym would print out a copy of the application and mail it to the mother ship.

2. The applications would arrive by mail, be opened, then put on a wooden table and photographed.

3. The photograph would be scaned into the computer then OCR'ed.

4. The resulting document(s) would then be compiled and a list created for pig boss.

Re: Feeling Aggregated

2009-01-20 13:42 • by durnurd
I'm just curious, how can max(x) + 1 make a duplicate key?

Re: Feeling Aggregated

2009-01-20 13:46 • by Charles400
240049 in reply to 240045
Oh damn. If it is one thing that will make me turn on NoScript for this site, it is seeing Irish Girl.

Re: Feeling Aggregated

2009-01-20 13:47 • by AMerrickanGirl
240050 in reply to 240047
durnurd:
I'm just curious, how can max(x) + 1 make a duplicate key?


Two requests go in at about the same time. Both read the current value of the key and get the same value.

With no constraints this is entirely possible.

Re: Feeling Aggregated

2009-01-20 13:49 • by suzilou
240051 in reply to 240047
I'm just curious, how can max(x) + 1 make a duplicate key?


if you do a "max(x)+1", and then do it again, and then do your inserts, you get dups. it's a classic race condition that needs some sort of semaphore or other synchronization mechanism around it.

Re: Feeling Aggregated

2009-01-20 13:50 • by IT Girl (unregistered)
240052 in reply to 240037
D. Travis North:
the real wtf fool:
Ant:

No he wouldn't - Waluigi has an inverted "L" on his cap.
</pedantry>


Just wasted half an hour of my life looking at the super mario wiki - thanks to you...


And I'll be spending the next half hour there, thanks to you...


You don't have google? First hit is a picture. Very clear.

Re: Feeling Aggregated

2009-01-20 13:54 • by Anon (unregistered)
240054 in reply to 240047
durnurd:
I'm just curious, how can max(x) + 1 make a duplicate key?


Oh dear....

Re: Feeling Aggregated

2009-01-20 14:00 • by Franz Kafka (unregistered)
240055 in reply to 240051
suzilou:
I'm just curious, how can max(x) + 1 make a duplicate key?


if you do a "max(x)+1", and then do it again, and then do your inserts, you get dups. it's a classic race condition that needs some sort of semaphore or other synchronization mechanism around it.


which is why sequences are so handy.

Re: Feeling Aggregated

2009-01-20 14:12 • by WC (unregistered)
Um, the real WTF is that the kid didn't automatically see that the code would be handled like that. In a coding environment that badly done, you don't try to fix everything first day or say to the boss 'I can't see how it could be done' simply because it can't be done the ideal way. You work on the problem, fixing what you can when you can. At the end, you end up with better code. For now, you end up with a job and a boss that doesn't think you are incompetent.

Re: Feeling Aggregated

2009-01-20 14:12 • by Anonymous (unregistered)
240058 in reply to 240047
They weren't autonomous calls to the database. So instead of making it part of one big transaction the code went out grabbed the next id number and then returned that back to the code and then it inserted the new record into the DB.

Re: Feeling Aggregated

2009-01-20 14:12 • by kmactane
240059 in reply to 240032
Anonymous:
At which point and time Jory began a 3 month journey...

Did you perhaps mean "point in time"? Because that would actually make sense and have some semantic meaning, instead of being a weird malapropism.

Re: Feeling Aggregated

2009-01-20 14:18 • by Anonymous (unregistered)
240060 in reply to 240059
Congratulations you found an error in a poster's grammar!

Re: Feeling Aggregated

2009-01-20 14:31 • by jimlangrunner
240063 in reply to 240045
Fred Burns:
Completely irrelevant to the article, I really enjoy the new Irish Girl ad. Improves the site aesthetics immeasurably.


Yeah. I noticed her to.

Hip-hip-hoooray!
Hip-hip-hoooray!
Hip-hip-hoooray!

Irish I were really Irish!

Re: Feeling Aggregated

2009-01-20 14:39 • by wee
240064 in reply to 240038
Charles Manson:
the real wtf fool:
Ant:

No he wouldn't - Waluigi has an inverted "L" on his cap.
</pedantry>


Just wasted half an hour of my life looking at the super mario wiki - thanks to you...
Get back to work slacker.


Compiling!

Re: Feeling Aggregated

2009-01-20 14:48 • by the real wtf fool
240065 in reply to 240052
IT Girl:
D. Travis North:
the real wtf fool:
Ant:

No he wouldn't - Waluigi has an inverted "L" on his cap.
</pedantry>


Just wasted half an hour of my life looking at the super mario wiki - thanks to you...


And I'll be spending the next half hour there, thanks to you...


You don't have google? First hit is a picture. Very clear.


You've never wandered off on a linky voyage of discovery after finding the information you wanted? WTF??

Re: Feeling Aggregated

2009-01-20 14:51 • by the real wtf fool
240066 in reply to 240064
wee:
Charles Manson:
the real wtf fool:
Ant:

No he wouldn't - Waluigi has an inverted "L" on his cap.
</pedantry>


Just wasted half an hour of my life looking at the super mario wiki - thanks to you...
Get back to work slacker.


Compiling!


nicely put. Unfortunately play fighting in the corridor is somewhat frowned upon where I am so daily wtf has to suffice.

Re: Feeling Aggregated

2009-01-20 14:51 • by I'm not tellin' you (unregistered)
240067 in reply to 240052
I think that it's because they came for the pic and stayed for the nostalgia.

Re: Feeling Aggregated

2009-01-20 14:54 • by Vic Tim (unregistered)
Waluigi is retarded, and so am I since I don't know anything about OOP but it seems:

Mario = subclass of player
Luigi = subclass of Mario
Wario = subclass of mario? or should be also subclass of player?
Waluigi = wtf???

Re: Feeling Aggregated

2009-01-20 15:35 • by Nathan (unregistered)
240071 in reply to 240057
Um, the real WTF is that the kid didn't automatically see that the code would be handled like that. In a coding environment that badly done, you don't try to fix everything first day or say to the boss 'I can't see how it could be done' simply because it can't be done the ideal way. You work on the problem, fixing what you can when you can. At the end, you end up with better code. For now, you end up with a job and a boss that doesn't think you are incompetent.

I agree entirely -- does he plan on staying employed?

Occasionally software sucks that you have to work on. The trick is to suffer through the painful code until you have learned how it works, and shown your superiors that you are capable, intelligent, and get stuff done right. THEN you worry about overhauling it.

I wouldn't want to hire someone that was afraid to touch badly written code -- EVERY company has its share of crusty, nasty code, and somebody has to maintain it. An "I can't figure it out" just means you are incompetent.

Re: Feeling Aggregated

2009-01-20 16:25 • by KattMan
240080 in reply to 240055
Franz Kafka:
suzilou:
I'm just curious, how can max(x) + 1 make a duplicate key?


if you do a "max(x)+1", and then do it again, and then do your inserts, you get dups. it's a classic race condition that needs some sort of semaphore or other synchronization mechanism around it.


which is why sequences are so handy.

and use of Scope_Identity() or the equivilent in your database of choice. If there is no equivilent, choose a real database next time.

Re: Feeling Aggregated

2009-01-20 16:43 • by Kermos
240081 in reply to 240071
Nathan:
Um, the real WTF is that the kid didn't automatically see that the code would be handled like that. In a coding environment that badly done, you don't try to fix everything first day or say to the boss 'I can't see how it could be done' simply because it can't be done the ideal way. You work on the problem, fixing what you can when you can. At the end, you end up with better code. For now, you end up with a job and a boss that doesn't think you are incompetent.

I agree entirely -- does he plan on staying employed?

Occasionally software sucks that you have to work on. The trick is to suffer through the painful code until you have learned how it works, and shown your superiors that you are capable, intelligent, and get stuff done right. THEN you worry about overhauling it.

I wouldn't want to hire someone that was afraid to touch badly written code -- EVERY company has its share of crusty, nasty code, and somebody has to maintain it. An "I can't figure it out" just means you are incompetent.


Depends a bit on the situation though. I've had cases so bad that no amount of maintaining would really have made any long term sense and we were just better off creating something new from scratch.

Re: Feeling Aggregated

2009-01-20 16:57 • by Anonymous (unregistered)
240082 in reply to 240047
"I'm just curious, how can max(x) + 1 make a duplicate key?"

If you remove some entries.

Say you have 50 entries max(x) + 1 will be 51.

Say you remove entries 12 and 13, max(x) + 1 is now 49, but 49 still exists unless you renumber the whole table.

Re: Feeling Aggregated

2009-01-20 17:01 • by Charles Manson (unregistered)
240083 in reply to 240082
Anonymous:
"I'm just curious, how can max(x) + 1 make a duplicate key?"

If you remove some entries.

Say you have 50 entries max(x) + 1 will be 51.

Say you remove entries 12 and 13, max(x) + 1 is now 49, but 49 still exists unless you renumber the whole table.

Not correct.

Re: Feeling Aggregated

2009-01-20 17:01 • by Spoon (unregistered)
240084 in reply to 240082
max not count.

Re: Feeling Aggregated

2009-01-20 17:02 • by Tama (unregistered)
240085 in reply to 240058
Anonymous:
They weren't autonomous calls to the database. So instead of making it part of one big transaction the code went out grabbed the next id number and then returned that back to the code and then it inserted the new record into the DB.


That still wouldn't solve your problem. Even with a transaction at the serializable level, there is a possible ordering of reads and writes between two concurrent transactions that would result in duplicate keys.

Re: Feeling Aggregated

2009-01-20 17:02 • by Bill (unregistered)
240086 in reply to 240082
Anonymous:
"I'm just curious, how can max(x) + 1 make a duplicate key?"

If you remove some entries.

Say you have 50 entries max(x) + 1 will be 51.

Say you remove entries 12 and 13, max(x) + 1 is now 49, but 49 still exists unless you renumber the whole table.



No...
If max(x) = 50, then removing anything other then x=50 will not change max(x) = 50 (it's max, not count).

The problem is more (as many have said before me) that if multiple processes access this concurrently, they both take max(x) = 50 (because nothing higher has been committed), and both set x = 51...DUPLICATE

Re: Feeling Aggregated

2009-01-20 17:03 • by Bill (unregistered)
240087 in reply to 240086
Bill:
Anonymous:
"I'm just curious, how can max(x) + 1 make a duplicate key?"

If you remove some entries.

Say you have 50 entries max(x) + 1 will be 51.

Say you remove entries 12 and 13, max(x) + 1 is now 49, but 49 still exists unless you renumber the whole table.



No...
If max(x) = 50, then removing anything other then x=50 will not change max(x) = 50 (it's max, not count).

The problem is more (as many have said before me) that if multiple processes access this concurrently, they both take max(x) = 50 (because nothing higher has been committed), and both set x = 51...DUPLICATE



In fact I notice that many others have said while I was writing....OOPS - Apologies....

Re: Feeling Aggregated

2009-01-20 17:16 • by Anonyblort (unregistered)
240089 in reply to 240082
Anonymous:
"I'm just curious, how can max(x) + 1 make a duplicate key?"

If you remove some entries.

Say you have 50 entries max(x) + 1 will be 51.

Say you remove entries 12 and 13, max(x) + 1 is now 49, but 49 still exists unless you renumber the whole table.



You're thinking count(*) + 1

Re: Feeling Aggregated

2009-01-20 17:45 • by SwedishChef (unregistered)
Or you could just, you know, auto increment and move on

/party pooping

// yes, I said poo

/// and poop

Re: Feeling Aggregated

2009-01-20 17:57 • by Sum egghead (unregistered)
240094 in reply to 240047
durnurd:
I'm just curious, how can max(x) + 1 make a duplicate key?


racist condition.

Re: Feeling Aggregated

2009-01-20 18:15 • by DeepThought (unregistered)
240095 in reply to 240057
> Um, the real WTF is that the kid didn't automatically see that the
> code would be handled like that. In a coding environment that badly
> done, you don't try to fix everything first day or say to the boss 'I
> can't see how it could be done' simply because it can't be done the
> ideal way. You work on the problem, fixing what you can when you can.
> At the end, you end up with better code. For now, you end up with a
> job and a boss that doesn't think you are incompetent.

I agree. An experienced developer would have leveled with the boss and told him that while it can be done, the quickest solution is not the ideal one. He should have also spelled out the deficiencies he found and given the boss some idea of the amount of effort required to set things right or at least requested permission to do a thorough review and analysis of the code in order to come up with a more accurate estimate.

TRWTF was simply telling the boss that he couldn't do it.

Re: Feeling Aggregated

2009-01-20 18:28 • by randomo (unregistered)
240098 in reply to 240071
Nathan:
Occasionally software sucks that you have to work on.


Occasionally? Occasionally I get to work on a codebase that does not suck. Lesson for the kid to learn: Nearly all the code you get to work on in your life will be fubar. Including your own. Get used to it.

Re: Feeling Aggregated

2009-01-20 18:49 • by chrismcb
240099 in reply to 240068
Vic Tim:
Waluigi is retarded, and so am I since I don't know anything about OOP but it seems:

Mario = subclass of player
Luigi = subclass of Mario
Wario = subclass of mario? or should be also subclass of player?
Waluigi = wtf???


It is obvious that you don't know anything about OOP.
But Mario and Luigi are brothers, so Luigi isn't a subclass of Mario.
Wario is an evil Mario, and Waluigi is an evil Luigi (and possibly Wario's brother?)
You can make Wario a subclass of Mario with the evil bit set.

Re: Feeling Aggregated

2009-01-20 18:49 • by Prosthetic Lips (unregistered)
240100 in reply to 240045
Fred Burns:
Completely irrelevant to the article, I really enjoy the new Irish Girl ad. Improves the site aesthetics immeasurably.


The real problem is those **@#$&@#^ random ads. I think I refreshed 20 times before the ad came up.

<me needs_a_life="true" />

Re: Feeling Aggregated

2009-01-20 18:55 • by Commatator (unregistered)
240101 in reply to 240060
Anonymous:
Congratulations you found an error in a poster's grammar!


I found one too.

Re: Feeling Aggregated

2009-01-20 18:57 • by Yoshi (unregistered)
240102 in reply to 240099
chrismcb:
Vic Tim:
Waluigi is retarded, and so am I since I don't know anything about OOP but it seems:

Mario = subclass of player
Luigi = subclass of Mario
Wario = subclass of mario? or should be also subclass of player?
Waluigi = wtf???


It is obvious that you don't know anything about OOP.
But Mario and Luigi are brothers, so Luigi isn't a subclass of Mario.
Wario is an evil Mario, and Waluigi is an evil Luigi (and possibly Wario's brother?)
You can make Wario a subclass of Mario with the evil bit set.


But if Wario is a subclass of Mario, and Waluigi is a subclass of Luigi then Wario and Waluigi would almost certainly NOT be brothers....

Furthermore, if Mario is a subclass of player, then Wario cannot be a subclass of Mario (excepting in the games where you can play as Wario)....

Re: Feeling Aggregated

2009-01-20 19:04 • by Jimbo (unregistered)
240103 in reply to 240101
Commatator:
Anonymous:
Congratulations you found an error in a poster's grammar!


I found one too.


I see lots of Posters every day.
Many of them have Grammatical errors.

(It all reminds me of "Bill Posters will be prosecuted"....)
« PrevPage 1 | Page 2Next »

Add Comment