DEV Community

Adam McKerlie
Adam McKerlie

Posted on

What's the one thing you always need to google?

For me, it's reading/writing CSV's in Python. I've done it a thousand times but I can never remember the syntax.

Top comments (45)

Collapse
 
emma profile image
Emma Goto šŸ™

The shorthand form of css padding - e.g. when you do padding: 8px 0 I can never remember which sides it applies to.

Collapse
 
satishpatro44 profile image
satishpatro44

Always clockwise. If one to all. If two, two opposite starting from top. If three top right side common buttom. If four clockwise from top. This is how I remember

Collapse
 
lkhrs profile image
Luke Harris

Thank you, I've just been switching the values around until it works for the past 8 years. Kept forgetting to just look it up and keep it as a stickynote on my desk

Collapse
 
wobsoriano profile image
Robert • Edited

For real! Me too

Collapse
 
cubiclesocial profile image
cubiclesocial

You can always use the long-form: padding-top, padding-right, padding-bottom, padding-left. There can be advantages to using the long-form as well if you don't want to override some parent style by accident.

I generally prefer using em (e.g. 7px is ~0.3em) rather than px for most padding and margins. That way, if someone enlarges the page, the padding/margins scale up too and keeps the presentation looking nice and spaced out properly without expending any extra effort. I use px in select (aka rare) locations where something needs to remain 'x' pixels from a specific edge regardless of text size.

Collapse
 
thatfrankdev profile image
Francis Cote

SQL Server: UPDATE a table from a SELECT statement that joins on other tables. I always end up on the same Stack Overflow thread. Yet, to this day, I still havent bookmarked it, saved it somewhere or anything... That's 3 keywords on Google and SO has stellar SEO šŸ¤·ā€ā™€ļø

Collapse
 
monfernape profile image
Usman Khalil

Regex.

Collapse
 
cubiclesocial profile image
cubiclesocial

regex101.com/

Is my go-to. Punch in a regex and it'll tell how it breaks down. Punch in some sample data to see if it matches or not. It also gives performance feedback too (steps + total execution time). Never mess around with regexes in the dark again.

Collapse
 
jef profile image
Jef LeCompte • Edited

I also like regexr.com. A little more minimal if you get the gist!

Thread Thread
 
cubiclesocial profile image
cubiclesocial

It is definitely a faster loading web app and it might even run locally? I'm pretty sure regex101 was the first tool like it out there and I've seen a few others over the years...but my fingers type in what they remember!

Thread Thread
 
jef profile image
Jef LeCompte

Haha -- hey, no harm in that. As long as it gets the job done!

Collapse
 
kovidr profile image
Kovid Rathee

Most of the times, it's just for syntax and I think that's cool because we shouldn't waste our brain's finite memory to remember syntax from 15 different programming and query languages. Google search and StackOverflow have made remembering such things redundant. Obviously, it's good to remember stuff but you can't remember everything. There's just too much noise.

Now that everyone's mentioning, I don't really remember the syntax for creating triggers. It's really simple but I use them rarely so I can't get myself to remember it.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

CSS shadow.

Collapse
 
cubiclesocial profile image
cubiclesocial

Yes. It's definitely one of the most confusing aspects of CSS. I usually use a tool to aid me like:

cssmatic.com/box-shadow

They've still got a Flash component on the page and the default drop shadow settings are UGLY, but it gets the job done quick.

Collapse
 
george profile image
George Nance

Switch statement syntax

Collapse
 
cubiclesocial profile image
cubiclesocial

This probably happens because most people aren't aware of where switch-case came from in the first place. The syntax came about to aid in creating "short jmp" tables in languages like C with intentional fallthrough, which became useful for things like loop unrolling where the performance gains were notable at one point. Loop unrolling was one of the many tricks used to make the first 3D game engines. Nowadays, loop unrolling can have negative side-effects on CPU branch prediction and cause a stall.

Other languages later adopted the style of switch-case but treat it more as a pseudo-if/then/else than something that generates a 'short jmp' table.

Switch-case today still has one very powerful use: State engines (aka Finite State Machines or FSMs/FSAs). Moving from one logical state to another enables powerful functionality that can't be accomplished any other way as efficiently.

Collapse
 
chris_hayes profile image
Chris Hayes

substr vs substring

Collapse
 
cubiclesocial profile image
cubiclesocial

vs slice.

Collapse
 
wldomiciano profile image
Wellington Domiciano

MySQL update with join syntax

Collapse
 
cubiclesocial profile image
cubiclesocial • Edited

I always look up pretty much anything Javascript. Mostly to find the MDN and CanIUse entries to determine browser support and maybe read a StackOverflow post or two on the topic. With browsers constantly changing usually for the better (but not always), it's kind of pointless to try to remember what browser version supports what function or event or feature.

For PHP, I just go to php.net but I inevitably need to search for the date() function 80% of the time I visit php.net. Do I need "F j, Y" or "M j, Y"?

Any time I have to use Perl, I end up having to relearn the entire language from the ground-up. Most languages I can remember enough of to fumble my way around and eventually find my way again - kind of like learning to ride a bicycle. With Perl, it's beginners-ville every single time.

Collapse
 
andreasjakof profile image
Andreas Jakof

Maybe with Perl it is, because there is always one more way to do it?

Collapse
 
hinasoftwareengineer profile image
Hina-softwareEngineer

I always use to search for syntax. Because I always forget syntax and think that I am fool who can't remember syntax whether it's python or javascript. Moreover, sometimes I search for functions name, such as push in javascript and append in python. I always mix them.

Collapse
 
jfet97 profile image
Andrea Simone Costa • Edited

random numbers generation, between two desired ones

Collapse
 
andreasjakof profile image
Andreas Jakof

How much water to add to 500g of flour for the pizza dough. I am always unsure, whether it is 300ml or 350ml. (300ml ... I just looked it up šŸ™ƒ)

Collapse
 
andreasjakof profile image
Andreas Jakof

operator syntax in C#

public static operator implicit TargetType(SourceType obj)
{
    // transformation from source to target 
}
Collapse
 
adammckerlie profile image
Adam McKerlie

This one hits close to home. I can rember other recipes but I always have to look up my pizza dough recipe

Collapse
 
thisdotmedia_staff profile image
This Dot Media • Edited

Definitely relatable šŸ˜‚

Collapse
 
nasoma profile image
nasoma

CSS media queries, my brain just can't get it.

Collapse
 
cubiclesocial profile image
cubiclesocial

Trying to use 'min-width' is just asking for all kinds of trouble.

Stick to sporadic 'max-width' media queries - it's a lot easier on the brain. Design for "desktop-first" but plan ahead with your design so that it can be made responsive (e.g. no tables). At various points during development, shrink the browser width to a point where things scrunch up too much, look at the computed layout tab in Dev Tools to get the pixel width of the body element, add a new 'max-width' media query to your CSS at that width, and add some CSS rules to clean up the way it looks at that point. Once satisfied, keep shrinking the browser window until it gets scrunched up again and repeat the process. My experience is that it requires only a half-dozen rules across 2-3 'max-width' media query sets to get a site to be fully responsive. Then throw the website on a phone to see how it looks there just in case the phone tries styling some things differently.

Collapse
 
elmuerte profile image
Michiel Hendriks

A better title for this article would be "What's the one thing you always need to lookup?"

Even though I still use Google as my search engine. We should not elevate Google. Also, in a lot of cases I perform targeted lookups because I know where to find my answer. For example I have my browser configured with the keyword "mdn" to search the Mozilla Developer Network.

As for what I lookup, basically anything API related which isn't obvious through auto-completion. Never try to remember things which you can easily look up.

Collapse
 
kovidr profile image
Kovid Rathee

I feel what you're saying but it's part of the language now. I'll just google it is a valid phrase. Google might be too big a company and there might be things wrong with that but no one ever has done search better than them. I tried to get away from Google for a while and move to DuckDuckGo. Although I love their philosophy and their ideas, they're so slow and not at all as good as Google when it comes to search. Does DuckDuckGo need our support? Yes, it does. And we should continue doing that by still using it wherever it can be used.

Collapse
 
elmuerte profile image
Michiel Hendriks

I know it's a common language now, it wasn't 20 years ago, and we can fix it to become proper again. Google is powerful enough, and they have not proven to be a good shepherd, and thus should not be empowered when not needed.
Additionally for trademark reasons Google does not want people to say they "googled" something, as they would loose the trademark.

Thread Thread
 
kovidr profile image
Kovid Rathee

Yes, it can be fixed in the long run if we're persistent enough. I wouldn't say that they have not proven to be a good shepherd entirely. There are very good things about them and there are a couple of shady things about them. To counter those shady things, some of the IDW people started OpenAI - to secure a better future by distributing power rather than concentrating it. I think that approach will succeed in the long run. About Google losing the trademark - I don't think that's going to happen. But I like surprises.

Collapse
 
thefluxapex profile image
Ian Pride

Nothing. I do web searches with DuckDuckGo šŸ˜‹ or even Bing if I must; just as long as it's not from the Google engine.

I'm getting old and forgetful so I have to look up anything I haven't done in the last 6 months lol, but just usually as quick reference and it all comes back to me instantly.