|
Annapurna1
liberal pussy


Registered: 05/21/02
Posts: 5,646
Loc: innsmouth..MA
|
spaghettification of code...
#8984166 - 09/25/08 12:50 PM (15 years, 4 months ago) |
|
|
i have observed this process first-hand several times..but i still dont quite understand it...if theres any experts on this topic in the audience..then pls enlighten us...thx...
--------------------
"anchor blocks counteract the process of pontiprobation..while omalean globes regulize the pressure"...
|
Seuss
Error: divide byzero



Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 2 months, 19 days
|
Re: spaghettification of code... [Re: Annapurna1]
#8984850 - 09/25/08 03:11 PM (15 years, 4 months ago) |
|
|
A bit more information would help. What are you asking? Astrophysics or computer science or something else?
-------------------- Just another spore in the wind.
|
deCypher



Registered: 02/10/08
Posts: 56,232
|
Re: spaghettification of code... [Re: Annapurna1]
#8986603 - 09/25/08 08:39 PM (15 years, 4 months ago) |
|
|
Are you talking obfuscation, or what?
I'll always have a fond place in my heart for GOTO's.
-------------------- We are all in the gutter, but some of us are looking at the stars.
 
|
zouden
Neuroscientist


Registered: 11/12/07
Posts: 7,091
Loc: Australia
Last seen: 14 years, 3 months
|
Re: spaghettification of code... [Re: deCypher]
#8988116 - 09/26/08 03:27 AM (15 years, 4 months ago) |
|
|
My code is pretty horrible because I don't use as much object-oriented stuff as I perhaps should. But if it all works it doesn't matter... right?
-------------------- I know... that just the smallest part of the world belongs to me You know... I'm not a blind man but truth is the hardest thing to see
|
Seuss
Error: divide byzero



Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 2 months, 19 days
|
Re: spaghettification of code... [Re: zouden]
#8988140 - 09/26/08 03:41 AM (15 years, 4 months ago) |
|
|
> But if it all works it doesn't matter... right?
Unless you have to maintain it.
-------------------- Just another spore in the wind.
|
zouden
Neuroscientist


Registered: 11/12/07
Posts: 7,091
Loc: Australia
Last seen: 14 years, 3 months
|
Re: spaghettification of code... [Re: Seuss]
#8988144 - 09/26/08 03:44 AM (15 years, 4 months ago) |
|
|
I love it when I see swearing in my own comments.
-------------------- I know... that just the smallest part of the world belongs to me You know... I'm not a blind man but truth is the hardest thing to see
|
Boom
just a tester

Registered: 06/16/04
Posts: 11,252
Loc: Cypress Creek
|
Re: spaghettification of code... [Re: zouden]
#8988287 - 09/26/08 05:51 AM (15 years, 4 months ago) |
|
|
//please fucking work
|
deCypher



Registered: 02/10/08
Posts: 56,232
|
Re: spaghettification of code... [Re: Seuss]
#8988556 - 09/26/08 08:29 AM (15 years, 4 months ago) |
|
|
Quote:
Seuss said: > But if it all works it doesn't matter... right?
Unless you have to maintain it.
Who needs to maintain perfect, immaculately-conceived code?
-------------------- We are all in the gutter, but some of us are looking at the stars.
 
|
AgingHippy
Flwr Pwr



Registered: 04/19/07
Posts: 15,613
Loc: Necropolis
|
Re: spaghettification of code... [Re: deCypher]
#8989684 - 09/26/08 01:52 PM (15 years, 4 months ago) |
|
|
that would eliminate a lot of programming jobs if code didn't need to be fixed
|
deCypher



Registered: 02/10/08
Posts: 56,232
|
Re: spaghettification of code... [Re: AgingHippy]
#8989718 - 09/26/08 02:04 PM (15 years, 4 months ago) |
|
|
I myself never need to press Backspace.
-------------------- We are all in the gutter, but some of us are looking at the stars.
 
|
Seuss
Error: divide byzero



Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 2 months, 19 days
|
Re: spaghettification of code... [Re: deCypher]
#8989739 - 09/26/08 02:11 PM (15 years, 4 months ago) |
|
|
> I myself never need to press Backspace.
I find h works much better. (viva vi)
-------------------- Just another spore in the wind.
|
deCypher



Registered: 02/10/08
Posts: 56,232
|
Re: spaghettification of code... [Re: Seuss]
#8989743 - 09/26/08 02:12 PM (15 years, 4 months ago) |
|
|
h?
-------------------- We are all in the gutter, but some of us are looking at the stars.
 
|
Seuss
Error: divide byzero



Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 2 months, 19 days
|
Re: spaghettification of code... [Re: deCypher]
#8989893 - 09/26/08 02:55 PM (15 years, 4 months ago) |
|
|
Not a vi user, eh?
-------------------- Just another spore in the wind.
|
deCypher



Registered: 02/10/08
Posts: 56,232
|
Re: spaghettification of code... [Re: Seuss]
#8990124 - 09/26/08 04:04 PM (15 years, 4 months ago) |
|
|
Never really trifled with *nix, unfortunately. Need to get around to that.
-------------------- We are all in the gutter, but some of us are looking at the stars.
 
|
supra
computerEnthusiast
Registered: 10/26/03
Posts: 6,446
Loc: TEXAS
Last seen: 12 years, 9 months
|
Re: spaghettification of code... [Re: Annapurna1]
#8995653 - 09/27/08 08:07 PM (15 years, 4 months ago) |
|
|
Quote:
Annapurna1 said: i have observed this process first-hand several times..but i still dont quite understand it...if theres any experts on this topic in the audience..then pls enlighten us...thx...
wtf is spaghettification? isn't that what happens to your body when you get sucked into a black hole? how would that have anything to do with code? possibly you mean obfuscation or minification?
peace
|
Seuss
Error: divide byzero



Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 2 months, 19 days
|
Re: spaghettification of code... [Re: supra]
#8997116 - 09/28/08 07:04 AM (15 years, 4 months ago) |
|
|
> wtf is spaghettification?
That is why I asked for a better explanation.
> isn't that what happens to your body when you get sucked into a black hole?
Yep, in terms of astrophysics.
In computer science there is obfuscation and spaghetti code. Not sure which was being referred to. Spaghetti code is code that uses a lot of goto (typically) statements resulting in a large non-linear, unreadable mess. It is commonly seen in BASIC programs or languages (such as assembly) that lack structured programming semantics.
-------------------- Just another spore in the wind.
|
ToTheSummit
peregrinus



Registered: 08/22/99
Posts: 9,126
Loc: Las Vegas
Last seen: 7 days, 8 hours
|
Re: spaghettification of code... [Re: Annapurna1]
#8997239 - 09/28/08 08:40 AM (15 years, 4 months ago) |
|
|
spaghettification of code - a term used by a layperson to baffle rather intelligent computer nerds. Probably the only way said person could baffle them.
-------------------- You invented the wheel....You push the motherfucker!!
|
supra
computerEnthusiast
Registered: 10/26/03
Posts: 6,446
Loc: TEXAS
Last seen: 12 years, 9 months
|
Re: spaghettification of code... [Re: Seuss]
#8997474 - 09/28/08 10:19 AM (15 years, 4 months ago) |
|
|
Yeah, ive heard of spaghetti code, but its not a good thing, and I see no reason why anyone would want to make their code worse....Though, usually people call it spaghetti whenever your code is just a general mess from what I have been exposed to. BUt I also have not been in the industry long enough to really mess with any languages that use GOTO statements...
peace
|
flangenips
Batshitinsanse



Registered: 01/20/08
Posts: 1,520
Loc: aotearoa
Last seen: 8 years, 5 months
|
Re: spaghettification of code... [Re: supra]
#9000876 - 09/29/08 12:52 AM (15 years, 3 months ago) |
|
|
I've just finished a module in my course about structured programming concepts and it states the 'spagetti code' is like ridiculous use of goto statements that generally jump all over the place. Thus making a heavy code a bitch to read through and make sense of the logic.
The analogy i can think of is like having a complex wiring setup for a crapload of electronic devices and trying to find which wires go where after they've all been connected all over the show in a disorderly fashion. You can imagine all the entanglement and how one has to follow a wire almost along its entire length in an out of loops and around and through other wires and loops to find which one is having some issues or which output end reaches which input end etc. Lose concentration and you could be end up at the wrong place or have to start again and follow the course.
Yet still all the cables in my room are all disorganised 
With regard to quick-jobs and smaller programs in spaghetti style though, i'm of the opinion that if it doesn't need maintaining and works fine, bleh its still a success in essence of that, i'm sure my tutors wouldn't want to hear that though I personally think the term 'spaggetti' code is quite fitting.
-------------------- All are lunatics, but he who can analyze his delusions is called a philosopher. - Ambrose Bierce
|
delta9
Active Ingredient


Registered: 10/28/04
Posts: 5,390
Loc: California
Last seen: 13 years, 3 months
|
Re: spaghettification of code... [Re: flangenips]
#9011624 - 10/01/08 01:14 AM (15 years, 3 months ago) |
|
|
The main cause of spaghetti code, if it wasn't already written in such a way, is maintainence. Software tends to get crufty over time, which is why we rewrite it. The most common cause is a small non-perfect basically BOLT ON fix complete with the "// TODO: Fix this soon!" comment. Following that, it is the modification or interaction with code one doesn't fully understand, either because one did not write it, wrote it a long time ago, documentation is lacking, source is missing, or whatever similar circumstance that helps make programs ununderstandable.
There's other issues in relation to "structured programming" specifically, which generally means that you will be testing the results of all functions, using SESE functions, etc. The problem is all that conditional logic can make the code bulkier and more difficult to understand. Forcing Single Entry Single Exit can make some functions less clear and clunky as you add conditionals to force this mode.
According to an older study which helped fuel pair programming, most programmers no matter their skill level make a certain number of minor errors an hour which is supposedly due to their being "too close to the code" so that they miss many things that will make maintainence a problem later that are otherwise caught during pair programming. One such example is declaring variables very far from their point of use or worse, in the case of global variables, spreading their usage around and adding many side effects to your program. Side effects can take a lot of brain power from a programmer to keep track of and they are easily forgotten at a later date and never documented.
-------------------- delta9
|
|