Reputation
442
Top tag
Next privilege 500 Rep.
Access review queues
Badges
4 15
Newest
 Yearling
Impact
~10k people reached

15h
comment Removing hard-coded values and defensive design vs YAGNI
rates changes, which is usually handled by just copying the rate to the relevant record. No admin screen is needed at this point, the system can then handle when the rates change, and it will be simple script to change them. None of this should be more than a few hours, but will prevent the basement from flooding next year when the putty fails.
15h
comment Removing hard-coded values and defensive design vs YAGNI
@BerinLoritsch But this particular design decision is akin using substandard parts saying "I can use plumbers putty to plug this leaky pipe, that's your cheapest option!" The rates WILL change. Its a given, and its irresponsible for a professional to build a system that doesn't allow it. And the savings are probably negligible in the grand scheme of the cost of the project. Put the data in a table; the code that gets the lookup data is slightly different, the logic figuring out which rate to use is the same either way. The only other decision is how to handle historical data after the...
1d
comment Removing hard-coded values and defensive design vs YAGNI
Let me install this substandard value so when it most certainly breaks in a year I get repeat business. That sounds shady, because it is.
1d
comment Removing hard-coded values and defensive design vs YAGNI
Assigning blame for when things go wrong in the future doesn't seem professional to me.
1d
comment Removing hard-coded values and defensive design vs YAGNI
Best and most complete answer, +1
1d
comment Removing hard-coded values and defensive design vs YAGNI
Don't forget, if the rates change and all you have are hard coded values, you could mess up historical record calculations when the rates change (and they will, regardless of what your client is telling you).
1d
comment Removing hard-coded values and defensive design vs YAGNI
The problem is that when the rates change (and they will), the customer will almost certainly be in a state of "oh shit, the rates changed today, what do we do with our program?!" and it will immediately be a fire. And if they finally track you down they'll be less than thrilled to pay you to do an emergency fix that also borks their historical data.
1d
comment Does it make sense to use “ys” instead of “ies” in identifiers to ease find-and-replace functionality?
Whatever, I find that paper full of shit. Code is between natural language and bytecode. If not for easing human understanding of code, there wouldn't be any reason not just to enter bytecode directly.
1d
comment Does it make sense to use “ys” instead of “ies” in identifiers to ease find-and-replace functionality?
or you're only going to hurt those that double take at Companys when it should be Companies. After all, the entire point of the code we usually write is in fact to make it closer to natural language.
1d
comment Does it make sense to use “ys” instead of “ies” in identifiers to ease find-and-replace functionality?
Well to start with, if is an English word with a well understood meaning, as are for, while try catch throw They are English words and the meaning is similar to what an English speaker would expect. And the reason we use if is because its easer to remember than 0x00FD as an instruction to compare, hence code PRIMARLY is meant to be understood by humans. Otherwise we'd all just write the bytecode ourselves. So if you're going to write English, you'd better get used to writing it properly, ...
2d
comment Does it make sense to use “ys” instead of “ies” in identifiers to ease find-and-replace functionality?
While English may not be your native language, it might be the next person that reads your code. It will probably also confuse others of your native tongue that have learned English.
2d
comment How to reuse domain model logic in services?
And even then, it might be better not to have ban on user, just have the UI use the ban command to do the ban, then reload the user from the repo. It just depends on how you want to do it and your specific requirements.
2d
comment How to reuse domain model logic in services?
@DenisPshenov what logic are you duplicating? Setting a property from false to true is hardly something to be concerned about. All the work of updating the database and any other actions would be handled by the command; for example, if you disable notifications that a user can setup and email them to say they've been banned, if all those are the things that must happen on ban, only the command does those. The flag on user would only matter if you have a use case to go to your edit user screen and ban from there
2d
comment How to reuse domain model logic in services?
@DenisPshenov If your user has a Banned flag, the Ban method on user could just change it to match the new state after it calls the command.
2d
comment Is an interface considered 'empty' if it inherits from other interfaces?
Good for Java; you can't do that in .Net interfaces. Just because a language allows something doesn't mean its necessarily a great thing to do. Like the new keyword in C#. And yes, it is a very nitpicky thing, and most times you don't need to care about it, but it can bite you in insidious ways in the times it is important, which is why they are NOT the same thing in the languages. I mean if there really wasn't any difference, we wouldn't even have interfaces right? Sadly I'm not explaining well why it matters, and I can't find the link that did a good job of it.
2d
comment How to reuse domain model logic in services?
I've deleted my comments and added an answer.
2d
answered How to reuse domain model logic in services?
Jul
26
comment How to reuse domain model logic in services?
It seems like you shouldn't need to create an instance of user to remove it'
Jul
26
comment Why is filesystem preferred for logs instead of RDBMS?
@MarjanVenema What's acceptable for a program to do depends on the requirements, but what I see here is endless pushing of dogma (not just in this question, but all over PSE). And no need for straw man arguments, nobody said error recovery is unimportant. FYI, I don't care what you think is mature, and in my world running out of disk space is something that needs to be addressed by either freeing or adding more storage, not by ignoring it and pretending everything is fine.
Jul
26
comment Why is filesystem preferred for logs instead of RDBMS?
@noonex and you may not get m*n complexity. You're arguing on theory and worse case, which often is nit realistic. And in your standard operating view, where its normal to have no free disk space, file logging fails too. I'm not saying logging to a DB is always what should be done but there are times when it makes more sense. It depends. A database is no less reliable than a file system, that's kinda the point of a database is not to lose data. In any event, if any of those systems fail its usually a hardware issue. If the disk is bad DB vs fs is irrelevant.