Page 5 of 7

spagheti code

Posted: Wed Sep 14, 2005 2:11 pm
by PB&J Lover
No one died of ugly code... especially not when noone else can see it
No so:

A patriot missle missed its target in Desert Storm because the guidance software had been running too long and it had developed a mathmatical precision error (something produced by the conversion from binary to decimal and back) allowing the Scud missle to hit a crowed barracks (killing several US troops).

An Airbus crashed on a demo flight because its computer "thought" it was landing when it was really taking off.

A Peruvian flight crashed in the mountains because the Pilots thought they had dailed in a decent angle when they had really dialed in a decent rate. The difference on the display was a decimal point.

Patients were over-radiated by a medical device because it calculated the intensity incorrectly.

Lots of lives and property have been lost from poor coding. :shock:

Posted: Wed Sep 14, 2005 2:45 pm
by PB
> Sometimes coders (or most times) do actually dont see how they are
> stuck in the past trying to optimize their small apps to not use more
> than half a Mb of memory when it WAS necessary years ago but not
> now.

Well, I say it STILL is necessary now. :)

The attitude of "leaving the bloat there" just because the user has 1 GB
of RAM is a lazy and sloppy approach to coding. If something can be done
smaller and faster, it should be. There's no justification for not doing it,
apart from simple laziness.

If you needed a virtual desktop app, and you needed it solely for the
purpose of just switching desktops and nothing else, which of these two
would you choose?

BossKey -- 7 KB -- http://keir.net/bosskey.html
Virtual Desktop -- 3.7 MB -- http://enablevirtualdesktop.com/virtualdesktop/

The answer is simple: you'd pick the tiny 7 KB app! Why? Because nobody
likes bloat for no reason. They can pretend it doesn't matter, but when it
comes down to the crunch, they'll always pick the smaller app. ;)

Posted: Wed Sep 14, 2005 2:49 pm
by blueb
Lots of lives and property have been lost from poor coding.
Hell.... now you're just trying to scare us. :shock:


I won't be able to sleep for a week. :lol:


blueb

Re: spagheti code

Posted: Wed Sep 14, 2005 2:52 pm
by rsts
PB&J Lover wrote:
No one died of ugly code... especially not when noone else can see it
No so:

-snip-
Lots of lives and property have been lost from poor coding. :shock:
ugly code <> poor code. There is a difference.

Ugly is subjective. Poor (buggy) is not.

Re: spagheti code

Posted: Wed Sep 14, 2005 2:56 pm
by PB
> ugly code <> poor code. There is a difference.

Agreed. Some of the code in my apps is as ugly as sin, yet the code and what
they do is tight as a drum. I'm also not a believer in one-line-per-command,
as I hate scrolling when coding and try to minimize it as much as possible.
This is partly what leads to ugliness in my apps. :)

Re: spagheti code

Posted: Wed Sep 14, 2005 3:01 pm
by TerryHough
PB wrote:>Some of the code in my apps is as ugly as sin...
I have noticed that code gets uglier just before the deadline.

Sort of the converse of "the girls all get prettier at closing time"

:lol:

Terry

Re: spagheti code

Posted: Wed Sep 14, 2005 3:06 pm
by rsts
TerryHough wrote:
PB wrote:>Some of the code in my apps is as ugly as sin...
I have noticed that code gets uglier just before the deadline.

Sort of the converse of "the girls all get prettier at closing time"

:lol:

Terry
Nice analogy :)

Unfortunately, "rushed" code and forced deadlines can lead to "poor" code too.

"Ugly" I can live with, as long as it's "good".

"Poor", as PB&J Lover pointed out, is another story.

Posted: Wed Sep 14, 2005 5:28 pm
by Kale
AJirenius wrote::shock:
Sometimes coders (or most times) do actually dont see how they are stuck in the past trying to optimize their small apps to not use more than half a Mb of memory when it WAS necessary years ago but not now.
Also optimizing code to perfection so it renders all calculations in 4 mSec instead of 50 is also a typical "coder" thing that actually could be compromised tonadays.
I dont say optimizing is bad but somehow you need to see WHERE you need it and where you actually can look at the goal instead and take the fastest road there.
I kind of agree with this. Sometimes you can get a bit too over concerned with how much RAM your program uses etc. but i also understand the need for optimisation. When i write a program, the very first priority of mine is to write extremely neat, re-readable code before anything else is considered. This way i can re-read this stuff months down the line and everything still makes perfect sense to me and pulling things out for re-use on other projects is a breeze. BUT! if i see my app is getting bloated in any way i try cut this down to what i feel comfortable with. I also like to make use of UPX as long as its completely transparent. :)

For me Clear, Readable, Easily Maintainable Code is more important than anything else. ...but then thats just me! :wink:

Re: spagheti code

Posted: Thu Sep 15, 2005 1:54 am
by Dare2
TerryHough wrote:
PB wrote:>Some of the code in my apps is as ugly as sin...
I have noticed that code gets uglier just before the deadline.

Sort of the converse of "the girls all get prettier at closing time"

:lol:

Terry
:D

Posted: Thu Sep 15, 2005 2:04 am
by Brice Manuel
Because nobody likes bloat for no reason.
Thats what I keep trying to tell all these coders who use .NET

Posted: Thu Sep 15, 2005 2:46 am
by Sub-Routine
BASIC is Spaghetti spelled backwards. I love it!

Rand

Posted: Thu Sep 15, 2005 3:03 am
by Shannara
Brice Manuel wrote:
Because nobody likes bloat for no reason.
Thats what I keep trying to tell all these coders who use .NET
Heh, my job requires .NET (C#) scripting for all of their apps. all web based for the most part. Then I come home and am happy for speed and size.

Posted: Fri Sep 16, 2005 1:26 am
by okasvi
PB wrote:If you needed a virtual desktop app, and you needed it solely for the
purpose of just switching desktops and nothing else, which of these two
would you choose?

BossKey -- 7 KB -- http://keir.net/bosskey.html
Virtual Desktop -- 3.7 MB -- http://enablevirtualdesktop.com/virtualdesktop/
if im right Virtual Desktop opens new explorer.exe to every "virtual" desktop :shock:


and long live small, fast & simple code :)

Posted: Fri Sep 16, 2005 9:44 am
by thefool
PB wrote: Virtual Desktop -- 3.7 MB -- http://enablevirtualdesktop.com/virtualdesktop/
Okvasi that is another product by same name.
However, i would recommend Dexpot. It uses very little memory but is full of great functionalities! And FREE.
Do a search on google.

edit: http://www.dexpot.de/en/index2.html

Posted: Fri Sep 16, 2005 3:53 pm
by blueznl
how to prove prebasuc doesn't suck?

well, what if it does?

;-P

how to prove it doesn't? by showing them cool apps
and to create those nice apps we'd all like to see some additional features (yes, there's the bridge :-))

pb doesn't suck, but it could use some extensions that would eanble us to make it easier to prove our point...