Author Topic: Object Oriented Languages for the CPC (or any other 8bit micro)!  (Read 5080 times)

0 Members and 1 Guest are viewing this topic.

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 614
The real question is what do you mean with to make a program  'better' ? fast ? small ? readable ? easy to update ?
Unstructured programming (spaghetti code) may be needed sometimes to improve speed of a program or to reduce binary size but must stay an exception.It is so difficult sometime to understand your own code after months so if it is not correctly written , it is a nightmare (and for other people it is worst)
To be honnest i love programming itself and programming for the CPC so how is good my code (readable, maintainable, extendable,(auto-)documented) is important and how good is my binary for the CPC (speed,size) is important too but when speed and size are not needed, i (try) give priority to good code (to resume , how you do is important like what you do  ;D )

But I think it's fortunate that GOTO isn't limited to Assembly or M/C, because there is argument there that it can be used correctly or help improve an program, I normally just stay away from it wherever possible though.  ;D
Let's say 'GOTO' could be used when the language you are using doesn't own adapted control structures.The best exemple for me is the locomotive Basic that lacks control structures (procedure, functions, ENDIF , SELECT CASE,ect).Since 15 years, i use a derived Basic (that get a lot of things from C) that owns GOTO but i never have to use it because language owns adapted control structures.
About Assembly , this is a particular example as you can make nicely structured program despite that seems to have jumps everywhere, major part of jumps must be seen like 'ELSE', 'ENDIF', 'CASE' , 'LOOP UNTIL' , 'WEND' and so on of other languages.About OO , modern assembler with powerfull preprocessor can help you to have OO approach in assembly.
« Last Edit: 08:37, 11 July 13 by fano »
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 761
  • Country: gb
  • Liked: 207
  • Likes Given: 48
Should it? For me there is only one Thing that Counts at the end: The Features/properties of the final program. I leave it to others to program structured, as Long as my Approach or program is more quick at the end.
However, we will never agree here. You argue based on a mind model and I argue according to Efficiency and pragmatics.
Your Approach is the best for teaching purposes. Mine for the best programs.  8)

Deopends how you measure "best". Commercial software (I don't mean games by the way) has a lifecycle after it is delivered, and is frequently the subject of maintenance and upgrades. This activity is usually costly and you don't really want to have some hacked up piece of spaghetti code adding to that cost. I agree in certain circumstances (usually where space or CPU cycles are at a premium) advanced techniques that are far above the capabilities of the mediocre developer are necessary, but in this day and age there is no shortage of resources in most applications. Therefore the common perception is that code quality is better than [whatever you are arguing in favour of].
 
I think it's wrong to argue that your approach is correct all the time - as in all things, it's horses for courses.

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1983
  • Likes Given: 4650
Oh well, agree and disagree.  :)  CPC is my hobby, so I have the time to try to bring software as close as much to perfection. If I would do commercial software, sure, then things would be different - starting with a tight time schedule usually.
 
However, Spaghetti code is usually very much misunderstood. Spaghetti code is hard to read, but more efficient than all that easy-to-read-modular stuff.
 
It always depends what you want.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1983
  • Likes Given: 4650
But - sorry for the off topic - back to topic...
 
OO programming can be seen in SymbOS (Prodatron explains that somewhere here). Maybe this would provide an easy start into it. I dunno exactly which languages you can use, guess he has some way of using C IIRC.
 
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus