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.

Oldest comments (45)

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
 
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
 
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
 
satishpatro profile image
satishpatro

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
 
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
 
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
 
satishpatro profile image
satishpatro

Network check
My ip
Calculator
SQL queries
Weather
Etc

Collapse
 
cubiclesocial profile image
cubiclesocial

I always keep SpeedCrunch handy and is usually running already. I use SpeedCrunch for general number crunching and some scientific stuff too. The Windows Calculator in Programmer mode is surprisingly handy when working with binary data.

Conversions though are another story. I'll fire up Google if I want to know what $1 USD is worth today in another currency or how many tablespoons to a quart or other oddball stuff.

Collapse
 
chris_hayes profile image
Chris Hayes

substr vs substring

Collapse
 
cubiclesocial profile image
cubiclesocial

vs slice.

Collapse
 
zizaco profile image
Zizaco

CSS transitions. Every time

Collapse
 
robertsam2000 profile image
ROBERTSAM2000

Whether or not I'm supposed to use "text-align" or "align-text"

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.