| View previous topic :: View next topic |
| Author |
Message |
Bazza LXF regular

Joined: Sat Mar 21, 2009 11:16 am Posts: 1393 Location: Loughborough
|
|
| Back to top |
|
 |
lok1950 LXF regular

Joined: Tue May 31, 2005 6:31 am Posts: 959 Location: Ottawa
|
Posted: Thu Jul 07, 2011 10:14 pm Post subject: |
|
|
Reminds me of early 70's IBM manuals
Enjoy the Choice  |
|
| Back to top |
|
 |
johnhudson LXF regular
Joined: Wed Aug 03, 2005 2:37 pm Posts: 778
|
Posted: Fri Jul 08, 2011 8:14 am Post subject: |
|
|
| I know people who do these things without even thinking about them. |
|
| Back to top |
|
 |
guy LXF regular

Joined: Thu Apr 07, 2005 1:07 pm Posts: 861 Location: Worcestershire
|
Posted: Fri Jul 08, 2011 12:08 pm Post subject: |
|
|
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 |
|
 |
M0PHP LXF regular

Joined: Wed Apr 06, 2005 8:40 am Posts: 737 Location: Bishop Auckland, County Durham, UK
|
Posted: Fri Jul 08, 2011 7:46 pm Post subject: |
|
|
| 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?  _________________
 |
|
| Back to top |
|
 |
AndyBaxman LXF regular

Joined: Tue Oct 04, 2005 9:47 am Posts: 520
|
Posted: Mon Jul 11, 2011 9:32 am Post subject: |
|
|
| 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?  |
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 |
|
 |
johnhudson LXF regular
Joined: Wed Aug 03, 2005 2:37 pm Posts: 778
|
Posted: Mon Jul 11, 2011 6:30 pm Post subject: |
|
|
| 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 |
|
 |
guy LXF regular

Joined: Thu Apr 07, 2005 1:07 pm Posts: 861 Location: Worcestershire
|
Posted: Mon Jul 11, 2011 8:49 pm Post subject: |
|
|
| 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 |
|
 |
Bazza LXF regular

Joined: Sat Mar 21, 2009 11:16 am Posts: 1393 Location: Loughborough
|
Posted: Mon Jul 11, 2011 10:03 pm Post subject: |
|
|
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 |
|
 |
AndyBaxman LXF regular

Joined: Tue Oct 04, 2005 9:47 am Posts: 520
|
Posted: Tue Jul 12, 2011 8:49 am Post subject: |
|
|
| 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  _________________ Bomb #20: "Let there be light" |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|