|
add a couple of gotos and it'll be perfect
|
|
|
|
|
(In Homers voice)[sobber][drool]Mmmm! Modular![/drool][/slobber]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Holy Cow Im suprised the debugger didnt have a stack overflow when it saw this!
|
|
|
|
|
I'm more surprised that the debugger didn't miraculously become intelligent and decided to commit sumicide
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
That looks strangely familiar, did you delete 4 long case statements and about 10 foreach enumerator loops?
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
OK, what did you replace it with?
|
|
|
|
|
CTRL+A, DELETE. Then start it afresh. That would be a safer start than a buggy restart into the crazy maze.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Right, so what does it look like now?
|
|
|
|
|
Probably nothing. I'm assuming he's doing maintenance code of something he didn't write (he wouldn't be posting here if he had!). Since it's maintenance, most people are reluctant to rewrite code. Especially if the code looks like this. God knows how the rest of the code looks like...
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
I did eventually decide to move the body of each loop into its own function. Still uglier than I'd like it to be, but yes, I was reluctant to rewrite it, especially when the problem I was trying to fix turned out to be somewhere else.
|
|
|
|
|
One quick guess. Was the project manager had a condition of payment on number of lines code?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
If you scroll that up and down real fast it looks kind of trippy.
|
|
|
|
|
That's called VP (Vertical Programming).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Wow! That literally hurt my eyes.
Unfortunately I have seen similar code for text processing. You have to keep scrolling back up a hundred lines or so to find out where the value stored in that variable came from and just what the heck it is supposed to be; of course it was probably modified on the way down – loads of fun.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Well...I wont share you the source code because its an enormous snippet. But i will narrate you the concept like a bedtime story. The technical director of our company - who is in parallel our head programmer (somebody save us)- decided to add a new feature to our super-dooper, high-end, wannabe-ERP product (riiiiiiiiiight!!!!). That was ... the very "advanced" requirement : "Our application will have only one instance.Listen how is going to be implemented..." .And then the problems just begun. "In order to implement it we'll take the ProcessId of our .exe and a timestamp of DateTime. Now to ensure its a today's instance of a process and save it to the database. So every new instance of the program will check the database to ensure if it will execute or not". I asked him very politely "What about using a mutex ?" . I almost got fired because : "You don't pay attention to the requirements and your only concern is to show off to me and to the rest of the development team with theoretical buzz-words. This is real-life programming buddy. Can you do this or not ?".
No comments from me. I leave them to you. I'll keep the dissappointment.
P.S. (1) The same day he forbid me to use again datasets, or LinQ to SQL because they are too complicated, too time consuming to construct, they don't ensure data integrity (???), and they oblige us to stick with a certain schema and "... I don't understand the reason for a disconnected architecture". So from now and on he commanded me to use only text queries through custom dbcommands and keep a database connection alive in a static object. (Hell yeah!!!)
P.S. (2) All the above are real.
modified on Wednesday, May 27, 2009 3:54 AM
|
|
|
|
|
Wow, just wow...
And I thought that I had a bad nightmare tonight... (-
Trust is a weakness.
|
|
|
|
|
God, that must hurt.
On the other hand, why not write a small sample application, demonstrate to your "head programmer" how it can be a single-instance application with the help of a named kernel object!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Do you think he's a guy that can take from words ? or examples ? He is the most dogmatic and half-educated (i dont know if this term exists in english.In my country exists and its worse than uneducated) piece of crap i've ever met.
For example , once i told him that i prefer to use enterprise library from microsoft than to write my own libs because its rather profound that i trust more microsoft's code than mine. The answer was : "I don't find the reason not to write our libs. Even microsoft's code is written by people...so why to trust it more than ours ?"
Incredible ???
Do you get it now ?
|
|
|
|
|
Sounds like this guy loves to reinvent the wheel instead of using the F1 racing wheels that have been developed over years and matured into stable, proven code.
Have you tried quantifying the development time in terms of labour cost to the company? and compare that to using the off the shelf tools? maybe its time to drop marketing lingo on him with "time to market" etc etc.
PS: Does your forehead have a calis on it from banging your head against hte wall?
|
|
|
|
|
killabyte wrote: Sounds like this guy loves to reinvent the wheel instead of using the F1 racing wheels that have been developed over years and matured into stable, proven code.
I admit the guy sounds like a tool, but comparing Microsoft libraries to F1 racing wheels and calling it mature and stable is a bit over the top. Submersible school bus with non functional wings, chrome plates, and 25 hood ornaments (one with a frickin lazer beam) would be a better comparison.
|
|
|
|
|
Robert Surtees wrote: one with a frickin lazer beam
That does sound cool though!!
|
|
|
|
|
That's what I thought too
|
|
|
|
|
|
great idea in principal but in case you hadn't noticed not many jobs around right now so wait 6 months, then quit!
|
|
|
|
|
I have to go through this s***hole. I just opened my own company and i desperately need this paycheck to cover my expenses and my company's expenses.
|
|
|
|