4 ms·
Something I started doing a while ago that was surprisingly helpful was naming arguments to methods or functions like so ... params_durations or params_user etc
by trustfundbaby 15y ago
Something I started doing a while ago that was surprisingly helpful was naming arguments to methods or functions like so ... params_durations or params_user etc.
This helps when I'm scanning code, to quickly to know whether a variable was passed in vs being local, global or part of a class.
In Rails/Ruby programming I will also usually just write self.this_method where most people would just write this_method, because I instantly know where to look for that particular method (since a method definition could be in so many different places in rails).
Works really well for me but YMMV.