Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coding Styles
#1
One of the things I love most about BASIC is the flexibility to code in various styles including declaring or not declaring variable types. This saved me a bunch of time back in the early days when memory was at a premium. I would use single letter variables, and DEFINT at the top of each program to assign A-G as variable length strings, H-P as integers, and other letters for long, double, etc. as needed. Also making most if not all of your variables integer types was an important for speed back in the day. There is also the choice to pass variables to sub routines as global variables. I did that almost exclusively. It sure takes the work out of passing a long laundry list of variables to several sub routines. The best compromise between these two methods, I think, is using UDT's, except, of course if you are heavy into arrays. I wish those could be supported some day, but, anyway, I found it much easier to pass UDT's in sub calls, as the whole grouping gets passed instead of typing out each passed variable.

So, anyone want to chime in on what they have found to be helpful coding styles for their projects? Maybe how and why you evolved to the way you code today, etc? It might make for a fun discussion thread, and a nice reference to help share knowledge.

Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
Coding Styles - by Pete - 08-09-2024, 03:09 PM
RE: Coding Styles - by SpriggsySpriggs - 08-09-2024, 03:21 PM
RE: Coding Styles - by TerryRitchie - 08-09-2024, 05:29 PM
RE: Coding Styles - by Pete - 08-09-2024, 03:54 PM
RE: Coding Styles - by bplus - 08-09-2024, 04:03 PM
RE: Coding Styles - by SMcNeill - 08-09-2024, 09:03 PM
RE: Coding Styles - by Pete - 08-09-2024, 04:16 PM
RE: Coding Styles - by SpriggsySpriggs - 08-09-2024, 06:40 PM
RE: Coding Styles - by TerryRitchie - 08-09-2024, 07:52 PM
RE: Coding Styles - by Jack - 08-09-2024, 07:10 PM
RE: Coding Styles - by Jack - 08-09-2024, 07:19 PM
RE: Coding Styles - by Kernelpanic - 08-09-2024, 10:29 PM
RE: Coding Styles - by CharlieJV - 08-09-2024, 10:56 PM
RE: Coding Styles - by Kernelpanic - 08-09-2024, 11:21 PM
RE: Coding Styles - by CharlieJV - 08-09-2024, 11:27 PM
RE: Coding Styles - by Pete - 08-10-2024, 03:46 AM
RE: Coding Styles - by SMcNeill - 08-10-2024, 04:55 AM
RE: Coding Styles - by JRace - 08-10-2024, 09:41 AM
RE: Coding Styles - by SMcNeill - 08-10-2024, 10:43 AM
RE: Coding Styles - by OldMoses - 08-10-2024, 12:08 PM
RE: Coding Styles - by CharlieJV - 08-10-2024, 02:11 PM
RE: Coding Styles - by Pete - 08-10-2024, 02:55 PM
RE: Coding Styles - by bplus - 08-10-2024, 03:19 PM
RE: Coding Styles - by SMcNeill - 08-10-2024, 03:41 PM
RE: Coding Styles - by Pete - 08-10-2024, 04:28 PM
RE: Coding Styles - by SMcNeill - 08-10-2024, 11:08 PM
RE: Coding Styles - by Kernelpanic - 08-10-2024, 06:00 PM
RE: Coding Styles - by Pete - 08-10-2024, 07:30 PM
RE: Coding Styles - by TerryRitchie - 08-10-2024, 07:53 PM
RE: Coding Styles - by TempodiBasic - 08-11-2024, 12:46 PM
RE: Coding Styles - by Pete - 08-11-2024, 06:45 PM
RE: Coding Styles - by Kernelpanic - 08-19-2024, 06:35 PM
RE: Coding Styles - by quickbasic - 09-04-2024, 06:09 PM
RE: Coding Styles - by dano - 09-09-2024, 12:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Program Flow vs Coding Order Pete 3 241 02-03-2026, 05:30 PM
Last Post: Pete
  personal coding challenge results James D Jarvis 4 623 06-20-2025, 03:20 PM
Last Post: James D Jarvis
  Funny Coding eoredson 10 1,780 01-01-2025, 05:09 AM
Last Post: eoredson
  Coding Efficiency SMcNeill 33 5,827 09-13-2024, 06:56 PM
Last Post: Pete
  What are your best and worst coding traits? Pete 11 2,186 11-10-2022, 04:01 AM
Last Post: JRace

Forum Jump:


Users browsing this thread: 1 Guest(s)