Spaghetti code
-
If you think the code we see here is bad, you should check out the IOCCC[^] :)
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)Ian Shlasko wrote:
we see here is bad
You should see the code I am stuck with.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
Yes, we ought to send them to a special place, were they could get.. ehh... decoded :-D
-
If you think the code we see here is bad, you should check out the IOCCC[^] :)
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
Yes, we ought to send them to a special place, were they could get.. ehh... decoded :-D
After spending 3 days unravelling their crap code to do something really simple, I need to be.... de-programmed... :-)
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
-
After spending 3 days unravelling their crap code to do something really simple, I need to be.... de-programmed... :-)
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
Commonly know problem, and is in the chategory of stupidity de-mystified :laugh:
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
Indeed. Many of the coworkers I've had over the years seem to think that building complex code is impressive. I don't think so. I think building simple code to support complex scenarios is impressive.
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
for(int i=0;i<4;i++){ switch(i){ case 1: callThisMethod(); break case 2: callThisMethodAgain(); break case 3: andThenThisOne(); break } }
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
for(int i=0;i<4;i++){ switch(i){ case 1: callThisMethod(); break case 2: callThisMethodAgain(); break case 3: andThenThisOne(); break } }
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Too clean for my taste. Could use some method calls in your start value, conditional, and adjusting. And why use a switch? Maybe we need to change the conditions for the cases dynamically ;P
for(int i=GetDefaultStart();Validate(i);Adjust(ref i)){
if(ConditionMet(i))
callThisMethod();
else if(OtherConditionMet(i))
callThisMethodAgain();
else if(YetAnotherConditionMet(i))
andThenThisOne();
}Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
Its a problem with every software every where. At start every thing turns out to be beautiful, but over years and due to preassure and stuffs people tends to get the feature out rather than thinking about code beautification/maintaenance/quality etc. Yes on the contrary to this, one developer should be good at his/her skills. I always consider doing the things good though i my output will be a bit delayed, i always concentrate over quality of my output than the quantity, which many of my colleagues think i am weird.
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
-
I just went for the first item on their list of entries, then when it opened I realized I recognized the ASCII art the program forms :laugh: [Edit: looks like there are some anonymous Yuru Yuri fans here too ;P ]
Yuru yuri fans? where? :D
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
Wes Aday wrote:
... go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Code is not meant to be maintained, it is meant to be rewritten :cool: -- RP
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
Sometimes it's a misconceived attempt at self-glorification. Has anyone here ever run into the Code of the Real Programmer?
One of the enduring fallacies of the younger (but not the youngest) folks in this trade is the belief that coding tricks are a demonstration of expertise. Oftentimes, they'll go out of their way to embed a tricky bit of code in a program, and then draw others' attention to it. "Look at me, I'm standing on my hands!"
A beginning programmer doesn't know enough to do such things. His programs are relatively easy to read and debug.
A well-seasoned programmer appreciates the virtues of simplicity. His stuff looks a lot like the beginner's code, and is about as easy to comprehend and debug.
It's the intermediate guy, who's knocked off a couple of problems and has begun to "feel his oats," who causes most of the trouble.
The hell of it is, nearly all of us go through that stage on our way to becoming "productive members of society."
(This message is programming you in ways you cannot detect. Be afraid.)
-
If you think the code we see here is bad, you should check out the IOCCC[^] :)
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
The best way to get the best spaghetti coders this side of Naples Italy to stop is to have the code reviews performed by Catholic Nuns! Sister Mary Concurrent reviews the code, and if it resembles spaghetti at all she will whack you on the knuckles with a yard stick (or metre stick), or the dreaded wooden pointer that resembles a cane used in Singapore!
-
Yuru yuri fans? where? :D
-
Sometimes it's a misconceived attempt at self-glorification. Has anyone here ever run into the Code of the Real Programmer?
One of the enduring fallacies of the younger (but not the youngest) folks in this trade is the belief that coding tricks are a demonstration of expertise. Oftentimes, they'll go out of their way to embed a tricky bit of code in a program, and then draw others' attention to it. "Look at me, I'm standing on my hands!"
A beginning programmer doesn't know enough to do such things. His programs are relatively easy to read and debug.
A well-seasoned programmer appreciates the virtues of simplicity. His stuff looks a lot like the beginner's code, and is about as easy to comprehend and debug.
It's the intermediate guy, who's knocked off a couple of problems and has begun to "feel his oats," who causes most of the trouble.
The hell of it is, nearly all of us go through that stage on our way to becoming "productive members of society."
(This message is programming you in ways you cannot detect. Be afraid.)
Wow, that pretty much exactly describes where I'm at in my coding journey :^) Thanks, I needed that.
This space intentionally left blank.
-
There really ought to be a special punishment reserved for people (using the term people here loosely, as what I really think is not KSS) that go out of their way to write the most convoluted code that they can in an effort to make maintenance as painful as possible.
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
Don't worry, they will eventually die and burn in coder's hell.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia