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

Vitor Paladini @vtrpldn

About: A software engineer that really likes working with user interfaces. Writes mostly JS at getcircuit.com. Loves cooking.

Joined:
May 18, 2019

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

Publish Date: Aug 3 '20
42 88

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

Comments 88 total

  • Marcell Cruz
    Marcell CruzAug 3, 2020

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

    • Vitor Paladini
      Vitor PaladiniAug 3, 2020

      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 😄

      • Marcell Cruz
        Marcell CruzAug 3, 2020

        "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

    • Meir Gabay
      Meir GabayAug 4, 2020

      I use regex101.com/ constantly

  • Madza
    MadzaAug 3, 2020

    regex

    • Vitor Paladini
      Vitor PaladiniAug 3, 2020

      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

      • Madza
        MadzaAug 3, 2020

        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.

    • Nicholas Fazzolari
      Nicholas FazzolariAug 4, 2020

      Yup. Same.

    • Andrew Baisden
      Andrew BaisdenAug 4, 2020

      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.

  • André Matias
    André MatiasAug 3, 2020

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

    • Vitor Paladini
      Vitor PaladiniAug 3, 2020

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

  • harleybl
    harleyblAug 3, 2020

    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.

    • Vitor Paladini
      Vitor PaladiniAug 3, 2020

      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 />

      • David
        DavidAug 3, 2020

        We lose what we don't use

  • Praneeth Nidarshan
    Praneeth NidarshanAug 3, 2020

    Regex 😁

  • Brad
    BradAug 3, 2020

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

    • Vitor Paladini
      Vitor PaladiniAug 3, 2020

      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

      • perpetual . education
        perpetual . educationAug 3, 2020

        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.

    • perpetual . education
      perpetual . educationAug 3, 2020

      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

      • Vitor Paladini
        Vitor PaladiniAug 3, 2020

        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

  • Martín Vukovic
    Martín VukovicAug 3, 2020

    Freaking Adapters in Android.

  • Vitor Paladini
    Vitor PaladiniAug 3, 2020

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

  • Bobby
    BobbyAug 3, 2020

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

  • Klaudio Milankovic
    Klaudio MilankovicAug 3, 2020

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

  • Mumin Gazi
    Mumin GaziAug 3, 2020

    Space in html :/

    • Yogesh S
      Yogesh SAug 4, 2020

      Its the kind of thing, you tend to forget all the time 😂😂

    • Victor Osório
      Victor OsórioAug 4, 2020

      No-Break-SPace => &nbsp;

      • Mumin Gazi
        Mumin GaziAug 4, 2020

        Now that is helpful. Thanks!

  • Dennis Ploeger
    Dennis PloegerAug 3, 2020

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

  • perpetual . education
    perpetual . educationAug 3, 2020

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

  • Doaa Mahely
    Doaa MahelyAug 3, 2020

    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.

    • Vitor Paladini
      Vitor PaladiniAug 3, 2020

      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 😩

      • David
        DavidAug 3, 2020

        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.

  • Adron Hall
    Adron HallAug 3, 2020

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

    • Robert Myers
      Robert MyersAug 4, 2020

      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.

      • Adron Hall
        Adron HallAug 4, 2020

        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'! :)

  • Alex Antra
    Alex AntraAug 3, 2020

    REGEX!

  • Rembrandt Reyes (He/Him)
    Rembrandt Reyes (He/Him)Aug 3, 2020

    for...of vs for...in

  • Justin Mitchell
    Justin MitchellAug 3, 2020

    Basically any PHP function as every like function is back to front, so glad I'm not using that anymore

  • Abdisalan
    AbdisalanAug 3, 2020

    unzipping tar.gzip files 🙃

    • Mario Hernandez
      Mario HernandezAug 4, 2020

      Hahhaha yes! Same here.

    • Meir Gabay
      Meir GabayAug 4, 2020

      I remember it as - tar extract gZip file
      tar -xzf myfile.tgz

  • Harris Geo 👨🏻‍💻
    Harris Geo 👨🏻‍💻Aug 4, 2020

    Date today in YYYY-MM-DD format 😖

  • Shubham Verma
    Shubham VermaAug 4, 2020

    Javascript slice, splice, substr, substring, str

  • Jake Varness
    Jake VarnessAug 4, 2020

    Not really code per se, but the debugging arguments for enabling remote debugging on the JVM. Why can they just have a simpler argument like -DremoteDebug.enable or something??

  • Jonathan Yeong
    Jonathan YeongAug 4, 2020

    CSS Flexbox, every single time. Honestly, I should just bookmark this page: css-tricks.com/snippets/css/a-guid...

  • Chris Neal
    Chris NealAug 4, 2020

    Oh boy, deleting remote branches via git gets me everytime

  • Daniel Brady
    Daniel BradyAug 4, 2020

    Centering a div in CSS.

  • Alejandro Roman
    Alejandro RomanAug 4, 2020

    "C string" and I always forget to do it when no one else is near

  • Niroj Dahal
    Niroj DahalAug 4, 2020

    JavaScript... getting date,month,year part from a Date .

  • Hemant Joshi
    Hemant JoshiAug 4, 2020

    Every CSS code is copied from Google in my case🤒

  • Elliot Derhay
    Elliot DerhayAug 4, 2020

    For PHP in general, DateTime, DateTimezone, and how to create a format string for the DateTime::format() method.

    For WordPress, the parameters for wp_enqueue_script() and wp_enqueue_style().

    • Eber Reta
      Eber RetaAug 4, 2020

      I also always look for Datetime and strtotime function in PHP 🤣

  • Björn Grunde
    Björn GrundeAug 4, 2020

    Every single haystack/needle argument order for any PHP function that uses them.
    I mean did the core team meeting go like:
    Dev1: Hey let's decide the order for arguments in array functions.
    Dev1: I think we should use the order; needle, haystack, optional.
    Dev2: That's not fun. Let the order always be random, also let's make those functions also solve several problems at once so we can have more arguments thrown in.
    Rest of devs: Applauds

  • Raphael Habereder
    Raphael HaberederAug 4, 2020
    new MessageFormat("I just want to format {0} {1}").format("strings","easily");
    

    Every damn time :D I just can't remember it, but need it so often.
    LocalDate is a great candidate was well. I still use my Calendar until I remember there's something newer/fancier with LocalDate

  • Nikhil Gautam
    Nikhil GautamAug 4, 2020

    I used to switch a lot between ruby and JS. Since then I started using capitalize method from ruby in JS. Every single time I have to search why it is not working. facepalm

  • Michiel Hendriks
    Michiel HendriksAug 4, 2020

    That and String.format when it's not a simple %s

  • Alexandre C.
    Alexandre C.Aug 4, 2020

    How to link a CSS file to a HTML one... Gets me every time. 😔

  • Can Nuhlar
    Can NuhlarAug 4, 2020

    jquery on document ready...

  • Jethro May
    Jethro MayAug 4, 2020

    Yeah, I can never remember this!

  • btlm
    btlmAug 4, 2020

    I google for for loop syntax every time I switch technologies I use. I used to develop application in PHP with Twig templating, now I work in Node.js and Angular. The hardest thing to remember is when to type in or of :D

    {% for user in users %} - in Twig we have in <array>

    *ngFor="let item of items" - in Angular we have of <array>

    Annoying.

  • Dominic Myers
    Dominic MyersAug 4, 2020

    Converting an indexOf to a Boolean in JS, every time!

  • Vincent Dedo
    Vincent DedoAug 4, 2020

    Usually git commands I use once every 6 months as well as string and datetime formatting.

  • April Smith
    April SmithAug 4, 2020

    Regex, and object/array sorting

  • c7tt8nt2p
    c7tt8nt2pAug 4, 2020

    isEmpty() and isBlank() of StringUtils in Java.

  • May Meow
    May MeowAug 4, 2020

    regex ...

  • Nguyễn Trọng Vĩnh
    Nguyễn Trọng VĩnhAug 4, 2020

    Yes, splice and slice, so confused.

  • Sachin Saini 🦄
    Sachin Saini 🦄Aug 4, 2020

    regex, centering a div, C++ STL functions, string methods, and I don't know what else.

  • Marco Damaceno
    Marco DamacenoAug 4, 2020

    JavaScript slice and indexOf.
    PHP map, filter and reduce. I always forget the order of the arguments.

  • Ben Sinclair
    Ben SinclairAug 4, 2020

    Anything in PHP that has a haystack and a needle, and the order of arguments for array_map and array_filter. All I remember is that they're different.

  • Django Janny
    Django JannyAug 4, 2020

    Let me check on google, I can't remember it :)

  • Marco S.
    Marco S.Aug 4, 2020

    jQuery "document ready" shortcut x)

  • Mario Hernandez
    Mario HernandezAug 4, 2020

    DateFormats, I forget about them all the time.

    Oh, and the init stuff for git

  • Jesse Phillips
    Jesse PhillipsAug 4, 2020

    I think I'm finally over it, but declaring properties in c#.

  • Paul Johnson
    Paul JohnsonAug 4, 2020

    strftime and strptime in python, every single time. Surely there must be something better than formatting and parsing by arbitrary string formats...

  • Mutale85
    Mutale85Aug 4, 2020

    Bootstrap navigation...

  • Eber Reta
    Eber RetaAug 4, 2020

    Laravel validation rules

  • Victor Osório
    Victor OsórioAug 4, 2020

    How to read a file in Java line by line.

  • Meir Gabay
    Meir GabayAug 4, 2020

    Bash, command line arguments while case esac

  • bronxsystem
    bronxsystemAug 5, 2020

    git revert

  • Mateus Rangel
    Mateus RangelAug 5, 2020

    Count number of files within a directory in Linux

  • Ramya Chinnadurai
    Ramya ChinnaduraiAug 6, 2020

    Regex. Every time I use regex101.com while coming to regex.

  • FeRDNYC
    FeRDNYCAug 8, 2020

    The simplest/stupidest? Bash operator precedence. I have to check Every. Time. But only because it's so weird and stupid! Whoever did this is a sociopath:

    Of these list operators, && and || have equal precedence, followed by ; and &, which have equal precedence.

  • Zacharia Manyoni
    Zacharia ManyoniAug 11, 2020

    CSS pseudo classes and their selectors, almost every time!

Add comment