Live data from Hacker News

Yagni Exceptions (2021)

lukeplant.me.uk

201–210 of 214 posts

Re: Yagni Exceptions (2021)

#201
> Versioning APIs

I hear this recommended quite frequently, but I don't see it practiced much, nor do I really understand what is being recommended. No matter how you wrote your first API you can always introduce a /v2/ later, and no matter how good you get at versioning it's still much worse than maintaining a well-designed backwards-compatible API. If anyone has recommended reading on this I'd love to check it out.

Re: Yagni Exceptions (2021)

#202
post #132

Earlier quoted context omitted.

> I have used the Angular one and the Laravel one, and both are a chore to use, because they interrupt your flow. If I'm writing the view of my component, I don't want to have to switch to another file, think of a key that identifies that text well enough and then translate the text, thinking of potential plurals and others. I just want to write my damn text. In django (python), the key is just the English text (with…

Does this work well? What happens when you need to make a change in the english version? Do you just search/replace through all the translations? Does django do anything to make this easier, or does it work with any i18n library?

There's also "translate to English", so you can instead treat it directly as a key and use that, or treat the English text as a key and change/add to the file if it's just something like a typo.

Don't recall about the second, we only had translations on one site and it's been a few years.

Re: Yagni Exceptions (2021)

#203
post #76

Earlier quoted context omitted.

Never write a function called destroyBaghdad(). Instead name it destroyCity and pass the target as a parameter.

Ugh. Try writing destroyKiev instead and see what happens.

Last time I tried, I got a 404 Competent Military Not Found error. :/

Re: Yagni Exceptions (2021)

#204
post #164

Earlier quoted context omitted.

> Conflating thumb rules with principles is a sign of sloppy thinking Multiple dictionaries and thesauruses would disagree with you there. Rule of thumb is often defined in terms of "rules, procedures, principles, or... ...derived from..." Some sources say that "rule of thumb is a principle or procedure..."" So, you know, going straight to "sloppy thinking" reminds me of OldManYellsAtCloud.jpg. Anyway, I'm really not…

That they include "rules" and "procedures" indicates those definitions are based around the "what" rather than the "why". A rule of thumb is something passed down, while a principle is something you come to from experience. A rule of thumb likely started as a principle from someone else. Rules and procedures are a further watering down of the original idea, where even the rule-of-thumb's justification isn't paid atte…

Your definitions are very interesting there mate. In some contexts, yep, what's often called a rule of thumb (for example, sparkies use a multitude of -hand rules[0][1] and call them rule of thumb, because you know, there's a thumb involved) are passed down.

But people are entirely able to derive their own rules of thumbs, if we hark to the common definition that a rule of thumb is a principle/procedure/process derived from practical experience.

For example, I rapidly developed a rule of thumb when dating post-divorce that any person who said "I hate drama" in their dating profile is in actual fact the source of any drama, but it took me a couple of disastrous dating attempts to develop that rule of thumb.

[0]: https://en.wikipedia.org/wiki/Right-hand_rule#Electromagneti...

[1]: https://en.wikipedia.org/wiki/Fleming%27s_left-hand_rule_for...

Re: Yagni Exceptions (2021)

#205
post #196

Earlier quoted context omitted.

Our current system uses soft deletes, and I wish we had done a "deleted" table. The biggest downside to soft deletes for us is that it ruins the default indexes cause every query has a !IsDeleted where clause added to it.

Wouldn’t partition indexes solve this?

Yes, we use filtered indexes to mitigate it. It's a lot of additional boilerplate though.

Re: Yagni Exceptions (2021)

#206
post #76

Earlier quoted context omitted.

Ugh. Try writing destroyKiev instead and see what happens.

Last time I tried, I got a 404 Competent Military Not Found error. :/

My point was that neither routune should ever be written and the Middle East would've been much better off if the world had started an all-out economic war against the US in 2003.

In case you are wondering, I'm Russian, have friends in the Ukraine and destroyed Kiev is the last thing I want.

Jokes about destroying Baghdad are just callous. Especially coming from Americans.

Re: Yagni Exceptions (2021)

#207
post #206

Earlier quoted context omitted.

Last time I tried, I got a 404 Competent Military Not Found error. :/

My point was that neither routune should ever be written and the Middle East would've been much better off if the world had started an all-out economic war against the US in 2003. In case you are wondering, I'm Russian, have friends in the Ukraine and destroyed Kiev is the last thing I want. Jokes about destroying Baghdad are just callous. Especially coming from Americans.

Good thing I'm not American then.

(And the joke I'm referencing is making fun of software ethics, so you're in violent agreement.)

Re: Yagni Exceptions (2021)

#208

Earlier quoted context omitted.

> Pragmatism vs Dogmatism. For example DRY vs YAGNI. DRY often has exceptions to the "rule"/"principle" too though. And people often blog on these exceptions. And pragmatism and dogmatism aren't a xor, they're just convenient labels for the -X and the +X ends of the axis. (Admittedly, the fact that I've seen more "It's okay to have exceptions to DRY" blog posts than "It's okay to have exceptions to YAGNI" indicates y…

That is because DRY sets a puzzle for us, how to cleanly reuse some code. YAGNI on the other hand, denies us a puzzle. We like puzzles.

I like your thinking on this

Re: Yagni Exceptions (2021)

#210

Earlier quoted context omitted.

> In MySQL, though, as you said, you have to come up with two tables (one for `user`, one for `skills`, make sure FK are in place, and then use joins for filtering... doesn't seem to me that this model fits better) Their other option was an array-typed column. As per the article, Postgres' JSONB column type will give you that, as one example. But the skills table - and many to many linking table - shines as soon as y…

The data model fits better. The data is relational and fits neatly into a simple relational table of user_id, skill_id. I think perhaps you just don't perhaps like SQL syntax which is why a join feels weird to you, but what you've described is a 4 or 5 line sql query which anyone can understand. Additionally, you can now easily answer questions like. "How many skills does the average user have?" "Who has the most ski…

I know (except I didn't know I didn't like SQL syntax). That's why I'm saying tables are a good idea.
Post reply on HN