Questions on style - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: Chatting and Socializing (https://staging.qb64phoenix.com/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://staging.qb64phoenix.com/forumdisplay.php?fid=2) +--- Thread: Questions on style (/showthread.php?tid=1785) |
RE: Questions on style - bplus - 06-27-2023 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. RE: Questions on style - Gets - 06-27-2023 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. RE: Questions on style - justsomeguy - 06-27-2023 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_of_10:_Rules_for_Developing_Safety-Critical_Code Its a bit extreme and certainly not necessary for small projects, but in a large base, you kinda have to have a standard. RE: Questions on style - CharlieJV - 06-28-2023 (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/showthread.php?tid=1496&pid=17330#pid17330 |