Questions on style
#21
Quote:I forgot to mention that although I prefer one monolithic file in QB64, I do try to keep my code organized by function (general-use, graphics definitions, tile routines, etc.) Having collapsible sections would be nice for this approach. 

I have giant file too for storing reusable subs and functions, my toolbox. But I don't include that file with code I share at forum, I use it to pick out tools I need for a particular app and copy/paste them in. I also keep a testing area for those Subs and Functions.
b = b + ...
Reply
#22
I have massive single files. Most of the actual work is done in a few key subs so the rest might as well be a library, but whenever I tried to clean up my code along those lines and make some improvements for efficiency, I ended up ignoring it once I was done and fell back into my ordinary habits.

For assets, I create a single file memory dump and use precompiler commands to switch between loading that or the original files which are usually in a subdirectory that has the same name as the program.
Reply
#23
As I've gotten older I've adopted many standards of coding, some K&R and camel case, but I've been slowly trying to adopt some of "The Power of 10" which is what NASA uses. https://en.wikipedia.org/wiki/The_Power_...tical_Code

Its a bit extreme and certainly not necessary for small projects, but in a large base, you kinda have to have a standard.
Reply
#24
(06-26-2023, 12:29 PM)Ultraman Wrote: But I really wish we had code folding in our IDE. Then again, you could also just do it with the Visual Studio Code extension that Grymmjack wrote a tutorial for. It has lots of cool features. I haven't ever been able to take much advantage of these features but there are tons of them.

I'm a huge fan of code folding, but I am spoiled: Gupta Team Developer (aka SQLWindows) programmer over here since 1993, and to this day nothing does code folding like that product.

That said, I rather like TreeSheets for analyzing long and complex code.  If the code is indented, it automagically gets organised perfectly in TreeSheets when pasted into a cell.

To not clog up this thread of discussion, see here: https://staging.qb64phoenix.com/showthre...0#pid17330
Reply




Users browsing this thread: 2 Guest(s)