This is good... :oD

Non-computer-related chit-chat

Moderators: ChrisThornett, LXF moderators

This is good... :oD

Postby Bazza » Thu Jul 07, 2011 7:18 pm

A long read but enjoy... ;oD

http://thc.org/root/phun/unmaintain.html
73...

Bazza, G0LCU...

Team AMIGA...
User avatar
Bazza
LXF regular
 
Posts: 1483
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

Postby lok1950 » Thu Jul 07, 2011 9:14 pm

Reminds me of early 70's IBM manuals :lol:

Enjoy the Choice :)
User avatar
lok1950
LXF regular
 
Posts: 1044
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Postby johnhudson » Fri Jul 08, 2011 7:14 am

I know people who do these things without even thinking about them.
johnhudson
LXF regular
 
Posts: 884
Joined: Wed Aug 03, 2005 1:37 pm

Postby guy » Fri Jul 08, 2011 11:08 am

:oops:

Not bad for a beginner, but not really grasped the spaghetti code methodology:

- Use tabs and space characters constructively to mess up indentation in any other text editor.

- open in another text editor and partially correct indentations in arbitrary places.

- divide code base into multiple files, then multiple routines/procedures/ whatever within each file. For any given routine, do not call it from code within that file - always call it from within a different file. Break this rule occasionally. Particularly applicable to scripted web apps in php, python, jsp, etc.

Also applicable to scripted web apps - if you need a thing many times, don't just do it once, do it each time in a different language, taking care to call each language version from a different language.

Careful use of these techniques allows you to jump from deep within a nested structure without closing off cleanly behind you, while giving the appearance that you are doing so. Do not over-use this technique, or memory consumption and instability will become too obvious.
"Klinger, do you know how many zoots were killed to make that one suit?" — BJ Hunnicutt
User avatar
guy
LXF regular
 
Posts: 1105
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby M0PHP » Fri Jul 08, 2011 6:46 pm

In the interests of creating employment opportunities in the Java programming field, I am passing on these tips from the masters on how to write code that is so difficult to maintain, that the people who come after you will take years to make even the simplest changes.


Who needs a huge list of those tips to write unmaintainable code in Java - I thought it did that by default? ;)
Image Image Image
User avatar
M0PHP
LXF regular
 
Posts: 737
Joined: Wed Apr 06, 2005 7:40 am
Location: Bishop Auckland, County Durham, UK

Postby AndyBaxman » Mon Jul 11, 2011 8:32 am

M0PHP wrote:
In the interests of creating employment opportunities in the Java programming field, I am passing on these tips from the masters on how to write code that is so difficult to maintain, that the people who come after you will take years to make even the simplest changes.


Who needs a huge list of those tips to write unmaintainable code in Java - I thought it did that by default? ;)


What a strange thing to say.

Java is probably one of the easiest languages to write maintainable code with, and, while you can write "spaghetti" code in any language, there are plenty that beat Java with regard to the ease with which you can do so.

Javascript's obscure paradigms make writing clean code a real chore, and the Perl community almost worships the ability to write code that nobody else can understand. VB is rightly famous for providing numerous features that aid the creation of incomprehensible code. C++ with its function pointers, make writing indecipherable code a breeze.

Then there are the "functional" languages like Lisp and Prolog. Ouch!

Of course, if you really want to write code that nobody (even you, after a week or two) can understand, then any form of assembly language would be the weapon of choice. Code that redefines itself on the fly? No problem!
Bomb #20: "Let there be light"
User avatar
AndyBaxman
LXF regular
 
Posts: 523
Joined: Tue Oct 04, 2005 8:47 am

Postby johnhudson » Mon Jul 11, 2011 5:30 pm

It does partly depend on how well you comment it. I dusted down some Z80 assembler code I wrote over 20 years ago to show someone and it was very easy to understand because I had done what my teachers drummed into me - added plenty of comments. Even I was surprised at how easy it was to understand after so many years.
johnhudson
LXF regular
 
Posts: 884
Joined: Wed Aug 03, 2005 1:37 pm

Postby guy » Mon Jul 11, 2011 7:49 pm

AndyBaxman wrote:Of course, if you really want to write code that nobody (even you, after a week or two) can understand, then any form of assembly language would be the weapon of choice.

It's also dead easy to customise an assembly language so only you know the equivalent machine code. Not quite so easy if you want the system to compile it though.
"Klinger, do you know how many zoots were killed to make that one suit?" — BJ Hunnicutt
User avatar
guy
LXF regular
 
Posts: 1105
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby Bazza » Mon Jul 11, 2011 9:03 pm

Crikey jh...

I ain't seen the AF, HL, BC, DE, IX and IY registers for donkeys years...

I wrote a FULL screen testcard program for the Sinclair Spectrum by
writing graphics into the border using HiSoft assembly. The main window
was drawn in Spectrum BASIC but the border in assembly...

RANDOMIZE USR <Basic Line Zero + Offset>

I remember it well... ;oD
73...

Bazza, G0LCU...

Team AMIGA...
User avatar
Bazza
LXF regular
 
Posts: 1483
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

Postby AndyBaxman » Tue Jul 12, 2011 7:49 am

Bazza wrote:Crikey jh...

I ain't seen the AF, HL, BC, DE, IX and IY registers for donkeys years...

I wrote a FULL screen testcard program for the Sinclair Spectrum by
writing graphics into the border using HiSoft assembly. The main window
was drawn in Spectrum BASIC but the border in assembly...

RANDOMIZE USR <Basic Line Zero + Offset>

I remember it well... ;oD


Wrote a MIDI sequencer for the spectrum and later ported it to and Amstrad CPC. The listing, as I remember it, was humongous, with about 30% of that humongousness being comments. Someone made a comments elsewhere about Spectrum's sounding crap compared to C64s. Mine sounded like an orchestra :-D
Bomb #20: "Let there be light"
User avatar
AndyBaxman
LXF regular
 
Posts: 523
Joined: Tue Oct 04, 2005 8:47 am


Return to Off Topic

Who is online

Users browsing this forum: No registered users and 0 guests