Live data from Hacker News

Be careful of the examples you use. They stick

blog.thinkst.com

41–50 of 129 posts

Re: Be careful of the examples you use. They stick

#41
post #14

Earlier quoted context omitted.

How do we combine evolution and development with backwards compatiblity? I think it's quite natural that we end up with this conundrum. Like say for example Vim having outdated defaults, because changing them could disrupt existing users. A reboot/fork of it can reset and start fresh but will eventually in its own development hit the same problem. Are there examples of projects who solve this well? Ripgrep's author i…

A reasonable compromise would be to allow changing defaults whenever there's a major version bump. ripgrep seems to have a major version bump every 18 months or so, which seems a bit excessive. OTOH vim went through 9 versions in 30-something years which seems more reasonable. Although I think there was more churn early on. ISTR vim 6 being around for a long time.

Does vim follow semver? (vim predates semver...) So how do you know you're comparing apples-to-apples?

Look at the breaking changes in each ripgrep major release. I don't use major releases as a means of breaking popular workflows. I use major releases even when there are very small breaking changes with minimal impact.

Re: Be careful of the examples you use. They stick

#42

Earlier quoted context omitted.

That option has nothing to do with limited disk space. Eliminating the duplicates makes it much easier to search the history for a command that was used long ago instead of having to skip over hundreds of duplicates of some non-interesting command, such as "ls". It also makes it much more likely that complex commands used a long time are still preserved. No matter how large you make your history file, it is much more…

$ cat ~/.inputrc "\e[A": history-search-backward "\e[B": history-search-forward This means that I can type the first couple of letters of a command, and then use the up and down arrow keys to cycle through history to search the rest of it. It makes life simpler for me, and confuses me only on the occasions when I've used `git stash`, so `git status` doesn't appear when I expect it to.

fish shell does this by default, and also autocompletes commands from your history. I highly recommend it.

Re: Be careful of the examples you use. They stick

#43
post #28

Can we please use `example.com` for an example domain name instead of like `somedomain.com`? It can create accounts with emails that someone can actually intercept.

There is also an entire TLD, .example so that you can put multiple names in a TLD and distinguish big-corp.example from my-local-store.example and it's clear that those aren't related, they just share a registry the same way as letsencrypt.org and wikipedia.org do

example.com is officially reserved in the spec for this use case. Is the .example TLD reserved as well?

Re: Be careful of the examples you use. They stick

#45
Very true. Good examples consume a lot of time. I was bitten a couple of times when the customer nailed me down with "But this example can never occur" and my futile attempt to justify "But it's an example!"

Good examples make documentation worthwhile to read.

Good defaults make an application worthwhile to use.

Re: Be careful of the examples you use. They stick

#46
post #9

I'm thinking if invalid characters in the examples given would be an acceptable solution. For DNS records this could be XML-like tags like . . On one hand, it prevents blind copy-pasting but on the other hand, your example is invalid.

An invalid example could confuse the customer and create unnecessary support calls.

Re: Be careful of the examples you use. They stick

#48
post #38

I gave what my company calls a “lunch and learn” presentation once of some interesting tools. People liked it and shared my deck around which was cool. But then my quick/dirty examples started showing up in best practice (I loathe that term) decks shared to very large teams with my name at the bottom. A security guy, who I greatly respect, raised some questions and I had to go through the whole story with him and the…

I did a similar thing as part of a "lunch and learn". NodeJS + Express was super fresh and I did a small example app. When returning the user profile, I just queried the database and returned the entry displaying some properties on the frontend.

The team lead was like "show us the request in the console", and I opened it up and there was the non-encrypted password, createdAt date and basically all the not-needed properties.

I still cringe thinking about it.

Re: Be careful of the examples you use. They stick

#49
post #43

Earlier quoted context omitted.

There is also an entire TLD, .example so that you can put multiple names in a TLD and distinguish big-corp.example from my-local-store.example and it's clear that those aren't related, they just share a registry the same way as letsencrypt.org and wikipedia.org do

example.com is officially reserved in the spec for this use case. Is the .example TLD reserved as well?

Yes https://www.rfc-editor.org/rfc/rfc2606.html

Re: Be careful of the examples you use. They stick

#50
post #43

Earlier quoted context omitted.

There is also an entire TLD, .example so that you can put multiple names in a TLD and distinguish big-corp.example from my-local-store.example and it's clear that those aren't related, they just share a registry the same way as letsencrypt.org and wikipedia.org do

example.com is officially reserved in the spec for this use case. Is the .example TLD reserved as well?

It is (in RFC 2606), along with .test, .invalid, and .localhost, for similar reasons [0].

https://datatracker.ietf.org/doc/html/rfc2606

Post reply on HN