3 ms·
>place a very high value on what ends up checked-in to a source code repository. The reason for this is very simple: once code gets checked-in, it takes on a li
by jasode 11y ago
>place a very high value on what ends up checked-in to a source code repository. The reason for this is very simple: once code gets checked-in, it takes on a life of its own.
I would modify this slightly and say code that's added to important public branches designated as master, qa, integration, etc should have a very high bar for quality. The other "experimental", "sandbox", etc branches would be understood by the team to have suboptimal code. Yes, it doesn't prevent people from Ctrl+C+Ctrl+V'ing the bad code but at least the developer's work-in-progress code has been backed up to a wider repository than just his laptop. (Yes, the programmer should be backing up files to USB flash, or corporate LAN, yada yada, but disciplined backups outside of repository commits often don't happen.)
That said, cargo culting bad code is definitely a problem. It doesn't matter of the source code has any of these comments:
//This following is experimental. DON'T COPY IT!
//!!!Do not reuse the following loop. It is O(N) instead of O(log N) and I haven't optimized it yet!!!
It doesn't matter how many scary exclamation points and uppercase characters are used in the warning. It will be ignored.
Even if you using language level guards instead of comments such as #pragmas or metaprogramming (if this_function_name == "JohnExperiment3"), people will just ignore the guards and Ctrl+C+Ctrl+V the "bad" source code lines they need. The infamous example of "if windowsos.version begins with "9" is copied all over the place.
- yetihehe 11y ago> Even if you using language level guards instead of comments such as #pragmas or metaprogramming (if this_function_name == "JohnExperiment3"), people will just ignore the guards and Ctrl+C+Ctrl+V the "bad" source code lines they need. The infamous example of "if windowsos.version begins with "9" is copied all over the place. Hmm, could this be the reason for windows 10 after 8?
- kpcyrd 11y agoyes it is. It triggered Windows 95/98 checks in some software.