DEV Community

Cover image for What's that piece of code that you have to Google *every time*?
Vitor Paladini
Vitor Paladini

Posted on

What's that piece of code that you have to Google *every time*?

"Is it .splice(), .slice() or .explode()?"

Oldest comments (87)

Collapse
 
____marcell profile image
Marcell Cruz

Regular expressions in general, i've used to do the same for reduce but then I saw one definition that I always remember

Collapse
 
vtrpldn profile image
Vitor Paladini

Reduce argument order was a common search for me as well, but repeating "prev, curr, ind, arr" a million times eventually made me learn it πŸ˜„

Collapse
 
____marcell profile image
Marcell Cruz

"acc, item".. was the one that done it for me, I don't know why I always found it "prev" wierd, like, it's not the previous value is the accumulation of the previous values, I know that you can argue that "prev" means the previous returned value, but I always got confused because of this πŸ˜„ it's funny how much naming is important in programming and how different people have a different understanding of the names

Collapse
 
unfor19 profile image
Meir Gabay

I use regex101.com/ constantly

Collapse
 
madza profile image
Madza

regex

Collapse
 
vtrpldn profile image
Vitor Paladini

regex is a classic, I've been through the whole HackerRank's regex course last year but still find myself searching for specific regex patterns

Collapse
 
madza profile image
Madza • Edited

Exactly, I was considering to learn everything there is on it (like taking some advanced course or smth), tho I decided not to. While you know what you can do with it and it's use cases, you can quickly search it up thanks to sites like RegExr and Regex101.

Collapse
 
nickfazzpdx profile image
Nicholas Fazzolari

Yup. Same.

Collapse
 
andrewbaisden profile image
Andrew Baisden

Even now I don't know it that well I have to constantly keep googling it to remember different patterns. If we used it day to day then I think we would learn it better. I watched a video where a developer was using regex for daily productivity.

Collapse
 
andrematias profile image
AndrΓ© Matias

Always is the datetime UNIX formats. I just don't get this hehe.

Collapse
 
vtrpldn profile image
Vitor Paladini

I've come to a conclusion that, no mater how experienced you are, dealing with Date always require some hours of googling.

Collapse
 
harleybl profile image
harleybl

This isn't just a #beginners thing. I've been developing for a long time but have mental blocks with certain syntax. I was just writing up a post about the things I have to look up all the time.
For Typescript/Javascript I never remember when to do 'for of' or 'for in' when iterating an array or iterable. No matter what language I am writing in I wind up having to look up the syntax for initializing a Map or Dictionary with a bunch of values.

Collapse
 
vtrpldn profile image
Vitor Paladini • Edited

Indeed not a #beginners only thing! My reasoning behind the tag is so that junior devs can see that it is perfectly normal to search for code πŸ˜„

I decided to post this question when I realised that despite having 10 years experience making websites I still need to Google how to add a .css file with <link />

Collapse
 
wulymammoth profile image
David

We lose what we don't use

Collapse
 
pranid profile image
Praneeth Nidarshan

Regex 😁

Collapse
 
bradtaniguchi profile image
Brad

Not sure if you can call it "code", but I need to lookup css all the time.

Collapse
 
vtrpldn profile image
Vitor Paladini

CSS might not be a programming language but it is a kind of code nonetheless πŸ™‚

One CSS thing that I always search for is gradients syntax and display: grid stuff

Collapse
 
perpetual_education profile image
perpetual . education

It's totally a programming language... / but - it's ok if you don't agree.

background-image: url($url); - is a function that goes and sends an HTTP request for an image based on an argument.

Collapse
 
perpetual_education profile image
perpetual . education

CSS in general probably doesn't count - because it's like - an entire language / but "Is it text-decoration or font-style...?" - is surely what this discussion is about! haha

Collapse
 
vtrpldn profile image
Vitor Paladini

It does count, yes! πŸ˜„

For me if it is a matter of property name DevTools suggestions works great. But if it is a whole concept like Grid, Gradients or Flexbox, then I have to search it

Collapse
 
mdev88 profile image
MartΓ­n Vukovic

Freaking Adapters in Android.

Collapse
 
vtrpldn profile image
Vitor Paladini

It makes me happy to know that some things never change, haha.

Collapse
 
bobbyiliev profile image
Bobby Iliev • Edited

A quick way to kill all sleeping MySQL connections, I've finally put a one-liner together and saved it here.

Collapse
 
klaudiomilankovic profile image
Klaudio Milankovic

How to make a triangle in CSS. You know those that you apply on :after.

Collapse
 
isamrish profile image
Amrish Kushwaha

always googled :)

Collapse
 
mumingazi profile image
Mumin Gazi

Space in html :/

Collapse
 
firzenyogesh profile image
Yogesh S

Its the kind of thing, you tend to forget all the time πŸ˜‚πŸ˜‚

Collapse
 
vepo profile image
Victor OsΓ³rio • Edited

No-Break-SPace => &nbsp;

Collapse
 
mumingazi profile image
Mumin Gazi

Now that is helpful. Thanks!

Collapse
 
dploeger profile image
Dennis Ploeger

Even basic jq filters. That tool is so powerful and awesome, but also a major brainfuck. 😊

Collapse
 
perpetual_education profile image
perpetual . education

"metaviewport" tag - but we use textExpander now... so - yeah. Also "box-sizing paul irish"

Collapse
 
dmahely profile image
Doaa Mahely

Literally all string and array functions since I switch between 3 languages a day. My latest one was the syntax for uppercasing a string in JavaScript.

Collapse
 
vtrpldn profile image
Vitor Paladini • Edited

I still have some muscle memory from PHP times so I always try Array.explode() and wonder why it is not working before remembering that it's Array.split() in JS 😩

Collapse
 
wulymammoth profile image
David

LOL! I hadn't worked in PHP in so long and I've completely forgotten about this.

But now it's a bit of a solved problem unless you're using an old editor like Notepad++, Sublime, or Atom. The editors that are timeless (sans Notepad++, and emacs), all seem to have decent LSP (language server protocol) support now to provide "intellisense" for auto-completion and linting at minimum.

Collapse
 
adron profile image
Adron Hall

Not code, but the switches for keygen to get the ssh key setup for ya know, everything.

Collapse
 
sqlrob profile image
Robert Myers

Ditto. I think part of the reason is I rarely do it. I set up a machine then use it for a long time. Fresh machine and it's Google time to get the key generated and the agent working with git properly.

Collapse
 
adron profile image
Adron Hall

Exactly, same thing for me. I know the command, I know the switches I want, I just don't always remember the specifics of em'! :)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.