Scripts / Comments in Scripts

Author
Message
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 27th Aug 2014 18:27
It would be great if the TGC team and other scripters put more comments within all Lua scripts (like after each line), explaining step by step what's going on. I for one would find this a very simple but useful learning tool. I know it will take up a little more memory but I don't think it's enough to be an issue.

Julian
PM
tomjscott
User Banned
Posted: 27th Aug 2014 18:31
I agree that code should always be well-documented, but not every single line. And general practice is for comments to precede the code they are commenting and not the other way around. It's a good idea to precede sections of code with details on what that section is for and how it works, say for the next few lines or so, but it is sometimes a good idea to comment even just a single line of code. It all depends. A good programmer learns to strike a good balance here.

It is also very useful for programmers to properly indent their code to make it more readable.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0071
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 28th Aug 2014 07:27
Julian if you check further down this forum you can find a hunger script I put up heavily commented

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home

Login to post a reply

Server time is: 2024-05-06 09:03:11
Your offset time is: 2024-05-06 09:03:11