DEV Community

Discussion on: What do you find yourself searching for again and again?

Collapse
 
ben profile image
Ben Halpern

There is certain functionality, like how to conduct basic operations on data structures, which I definitely know myself if I think hard enough about it, but I default to Googling it anyway. It's just easier to offload some of it to the cloud, especially if it's wordy.

For example getting a random value in a JavaScript array:

var item = items[Math.floor(Math.random()*items.length)];

That's wordy and kind of unintuitive. I don't even try to remember just how to do it.

In Ruby, for me it's probably simpler to remember:

item = items.sample

Of course, there are plenty of operations I similarly Google every time in every language including Ruby.

Any time postgres stops running on my machine, I go find this command:

pg_ctl -D /usr/local/var/postgres start

I probably could remember that, but I've never bothered.