Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

This is good... :oD

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Off Topic
View previous topic :: View next topic  
Author Message
Bazza
LXF regular


Joined: Sat Mar 21, 2009 11:16 am
Posts: 1474
Location: Loughborough

PostPosted: Thu Jul 07, 2011 8:18 pm    Post subject: This is good... :oD Reply with quote

A long read but enjoy... ;oD

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

Bazza, G0LCU...

Team AMIGA...
Back to top
View user's profile Send private message
lok1950
LXF regular


Joined: Tue May 31, 2005 6:31 am
Posts: 1024
Location: Ottawa

PostPosted: Thu Jul 07, 2011 10:14 pm    Post subject: Reply with quote

Reminds me of early 70's IBM manuals Laughing

Enjoy the Choice Smile
Back to top
View user's profile Send private message
johnhudson
LXF regular


Joined: Wed Aug 03, 2005 2:37 pm
Posts: 870

PostPosted: Fri Jul 08, 2011 8:14 am    Post subject: Reply with quote

I know people who do these things without even thinking about them.
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1070
Location: Worcestershire

PostPosted: Fri Jul 08, 2011 12:08 pm    Post subject: Reply with quote

Embarassed

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.
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
M0PHP
LXF regular


Joined: Wed Apr 06, 2005 8:40 am
Posts: 737
Location: Bishop Auckland, County Durham, UK

PostPosted: Fri Jul 08, 2011 7:46 pm    Post subject: Reply with quote

Quote:
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? Wink
_________________
Back to top
View user's profile Send private message Visit poster's website
AndyBaxman
LXF regular


Joined: Tue Oct 04, 2005 9:47 am
Posts: 523

PostPosted: Mon Jul 11, 2011 9:32 am    Post subject: Reply with quote

M0PHP wrote:
Quote:
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? Wink


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"
Back to top
View user's profile Send private message
johnhudson
LXF regular


Joined: Wed Aug 03, 2005 2:37 pm
Posts: 870

PostPosted: Mon Jul 11, 2011 6:30 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1070
Location: Worcestershire

PostPosted: Mon Jul 11, 2011 8:49 pm    Post subject: Reply with quote

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.
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
Bazza
LXF regular


Joined: Sat Mar 21, 2009 11:16 am
Posts: 1474
Location: Loughborough

PostPosted: Mon Jul 11, 2011 10:03 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
AndyBaxman
LXF regular


Joined: Tue Oct 04, 2005 9:47 am
Posts: 523

PostPosted: Tue Jul 12, 2011 8:49 am    Post subject: Reply with quote

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 Very Happy
_________________
Bomb #20: "Let there be light"
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Off Topic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast