How can we make it easier to experiment with the compiler
    Alexandru Ermicioi 
    alexandru.ermicioi at gmail.com
       
    Tue May 25 16:00:32 UTC 2021
    
    
  
On Tuesday, 25 May 2021 at 08:32:46 UTC, sighoya wrote:
> You can't encode the full semantic into one function name with 
> parameter names without to over blow these names.
In this case, it might be good to have a documentation comment, 
otherwise behavior should be known from the function name and 
args.
> However, small comments inside the function would also be 
> beneficial.
Having such comments inside function body, means you've failed to 
make the code easy to read and understand. Instead of such inline 
comments, consider extracting that piece into a function with 
right name. Adding such comments should be the last option in 
your decision on what to do with that piece of code. Note that 
most probably next dev, if he changed that piece of code, will 
most probably just forget updating that comment, meaning that it 
will tell a lie instead of truth.
    
    
More information about the Digitalmars-d
mailing list