3 ms·
I honestly think this complaint is poorly argumented. It depends on the nature of the project. When you say "findeventsfromthelast6hours" that's perfectly reaso
by vladimirralev 12y ago
I honestly think this complaint is poorly argumented. It depends on the nature of the project. When you say "findeventsfromthelast6hours" that's perfectly reasonable name for disposable code or private implementation. You should only be concerned about such name if it made it to the API somewhere. Hardcoding things is also not a bad thing by itself. If I had to guess, your team is under the impression the code they write is prototype and will be rewritten anyway, not API to be consumed by other parties or doesn't have a direction that allows them to make the proper abstractions. Sure you can demand nothing to be hardcoded, but you must remember eventually those params will have to come from somewhere. I see so many people move hardcoded values Java -> IOC/DB config or Erlang -> DB not realizing it's more difficult to reinitialize the component than to do a hot reload and speed up your development process at the very least. Whatever you do it must be for a well-defined reason. It's also possible your team developed their own process where it's easier or faster to fix these issues on the go rather than planning in advance.
- cellularmitosis 12y agoIndeed, I think Robert Martin's "Clean Code" would agree that if you don't need to vary the "6 hours" part at run-time, then "findeventsfromthelast6hours" is actually better than passing in an "hours" argument ("Clean Code" advocates minimizing function arguments). Refactoring the name in the face of a one-time change in behavior (e.g. "4hours") should be trivial with any modern IDE.