Code tip: Don't undo what you haven't done

Поділитися
Вставка
  • Опубліковано 8 січ 2025

КОМЕНТАРІ • 64

  • @aarondfrancis
    @aarondfrancis  4 місяці тому +1

    Prefer to read instead of watching? Check out the article version of this video: aaronfrancis.com/2024/dont-undo-what-you-havent-done-430ac590

  • @jackknash
    @jackknash 5 місяців тому +37

    I was so confused on where you were going until the pure bliss in the moment of clarity

  • @justine_chang39
    @justine_chang39 5 місяців тому +21

    from a content creation perspective, I'm super super super impressed by your ability to speak so effortlessly without needing to take multiple takes. Amazing!

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +10

      If only you could see how many takes I have to do 🙊

    • @justine_chang39
      @justine_chang39 5 місяців тому +3

      @@aarondfrancis owhhh! so each take is just REALLY REALLY long!

    • @aarondfrancis
      @aarondfrancis  5 місяців тому

      @@justine_chang39 haha yup!

  • @sadkebab
    @sadkebab 5 місяців тому +7

    man the level of production of these videos is on a different level, I didn't expect to ever see stuff like this in software-related youtube content

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +2

      Thank you so much! I've got a great partner helping me out. Producer Steve is the man

  • @UsatiyNyan
    @UsatiyNyan 5 місяців тому +12

    So good! I don't even write php, but still am here for bits of wisdom!

  • @kriansa
    @kriansa 3 дні тому

    This is a great tip, I would just add a small gotcha. Although this works perfectly in single threaded contexts, it won't work well in multi-threaded situations and you will need some sort of synchronization to prevent TOCTOU (time of check to time of use) from biting you.

  • @Voltra_
    @Voltra_ 5 місяців тому +3

    And now I feel so stoopid for writing a counter-based system instead of just caching what was there

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +4

      Do not feel stupid! You solved the problem. And now you know another way to solve it

  • @JustPlayerDE
    @JustPlayerDE 5 місяців тому +1

    so doing time paradoxes in my code is still fine then, nice.
    Good video ^^

  • @JagdeepSinghKalsi
    @JagdeepSinghKalsi 5 місяців тому +2

    Watched it, closed the tab.
    Forgot to like the video, came back to like the video.
    You know what this means?
    This means I really like the video!
    (

  • @julienSibille
    @julienSibille 5 місяців тому

    I really needed this stuff in a service, many thanks !

  • @hernanmartinezreumann3279
    @hernanmartinezreumann3279 5 місяців тому

    Bubly lemon is good for me. Awesome video, thanks so much.

  • @thecyrilcril
    @thecyrilcril 5 місяців тому

    Interesting Video, thank you Aaron

  • @vitorlfelix
    @vitorlfelix 5 місяців тому +3

    I don’t know but Agua is the way we in Brazil write water. Btw, great content.

    • @AmxCsifier
      @AmxCsifier 5 місяців тому +1

      we also do it in Nicarwater... ba dum tiss 😂😢 sry

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +1

      Haha yeah I know. I know a little Spanish, living in Texas

    • @n3storm
      @n3storm 5 місяців тому

      @@aarondfrancis Thanks for the tip! Here's is mine: In spanish single "r" inside word is pronounced soft, as you did later. Single r at the begining or double r in the middle is pronounced hard as you tried to in first place :)

  • @Nittiyh
    @Nittiyh 5 місяців тому

    Ahhhh I've never thought of that, I love it

  • @igorcastilhos
    @igorcastilhos 5 місяців тому

    Hello Aaron, do you have a link for the products in your setup? I'm trying to build a more professional setup right now and your audio & image are great!

  • @notnotjake
    @notnotjake 5 місяців тому

    that intro is so fun!

  • @adampatterson
    @adampatterson 5 місяців тому +2

    Just stopped by for an autho thumbs up, and an add to watch later 😀

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +1

      Thank you for your service

    • @adampatterson
      @adampatterson 5 місяців тому

      @@aarondfrancis No, thank you! 🫡

  • @pindab0ter
    @pindab0ter 5 місяців тому

    Very, very nice and clear.

  • @AmxCsifier
    @AmxCsifier 5 місяців тому

    phpstorm looks neat

  • @nghokengdaniel839
    @nghokengdaniel839 5 місяців тому

    Very good video

  • @Metruzanca
    @Metruzanca 5 місяців тому +1

    WOWOWOW, what is that inline docs at 4:39? Is that an editor feature? What editor is that?

    • @BrunoBernard-kn6vt
      @BrunoBernard-kn6vt 5 місяців тому

      PHPStorm

    • @HoussamElbadissi
      @HoussamElbadissi 3 місяці тому

      Any IntelliJ-based IDE! (in this case PHPStorm).
      It's basically rendering documentation comments inline, which makes it look super nice.

  • @vic_casanas
    @vic_casanas 5 місяців тому

    Jarritos! Muy bien 🎉

  • @samldev
    @samldev 5 місяців тому +1

    Noooo Aaron your engineer is showing! You can’t answer “it depends” for your personal sparkling water ranking! 😂 give us something to debate in the comments!

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +2

      Don't worry, I've got a definitive ruling on the next one 🙊

  • @weloveturtlessomuch4240
    @weloveturtlessomuch4240 5 місяців тому

    Great intro

  • @VinceKronlein
    @VinceKronlein 5 місяців тому

    Great as always. Can you get rid of that gray flash? I’m guessing it’s an auto save or something, but man it’s really annoying.

  • @JJJMMM1
    @JJJMMM1 5 місяців тому

    This is all well and good for a single-threaded process, but does this play nicely with Octane? I don't know exactly how it works (yet), but I know it boots each component once and keeps it in memory. Can modifying static properties like this cause a race condition?

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +1

      Each individual octane process is single threaded, so as long as you clean up after yourself like in this video, you're fine

  • @vikingthedude
    @vikingthedude 5 місяців тому

    If we have more than two nested withoutLogging calls, will the stack of previous values be kept in the call stack? I'm assuming this is true, which is why we don't need to store the previous values in our own stack

    • @aarondfrancis
      @aarondfrancis  5 місяців тому

      Not sure I totally understand the question but you always need to store the value as it was at the beginning of your operation and then restore it after

    • @vikingthedude
      @vikingthedude 5 місяців тому

      @@aarondfrancis yeah i was cramming my question a bit. I meant if we have three or more nested calls to withoutLogging, how we make sure the third value doesn't overwrite the second? We only have two variables here: the instance var $this->loggingEnabled and the local var $loggingEnabled. We'd need a stack of vars if we want to store all the previous values. Im guessing this takes care of itself because the local vars live in separate function calls (ie stack frames)

  • @ajzack983
    @ajzack983 5 місяців тому

    Aaron Francis drinks sparkling water and drives a lambo, I wonder where did he get that from?

    • @aarondfrancis
      @aarondfrancis  5 місяців тому

      I have a Lambo??

    • @bthero03
      @bthero03 5 місяців тому

      @@aarondfrancisall php developers have a lambo, its common knowledge 😂

  • @CLizaola
    @CLizaola 5 місяців тому

    Mineragua or Topo Chico?

    • @CLizaola
      @CLizaola 5 місяців тому

      What do you prefer??

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +1

      Man that's gonna be a tough call when it comes time

  • @ricko13
    @ricko13 5 місяців тому

    hey Aaron, it's risky to accept food from someone and assume it's safe to eat/drink... 😐

  • @mineragua3299
    @mineragua3299 4 місяці тому

    Yummy!

  • @marekbee
    @marekbee 5 місяців тому

    You should definitely drink Mocny Gaz from Poland 👌🇵🇱 or Muszynianka

    • @aarondfrancis
      @aarondfrancis  5 місяців тому +1

      Send me one! I'd love to try it

  • @kyngcytro
    @kyngcytro 5 місяців тому

  • @100timezcooler
    @100timezcooler 5 місяців тому

    Jarritos > topo chico > pellegrino > perrier imo

    • @aarondfrancis
      @aarondfrancis  5 місяців тому

      Jarritos? Never tried it! Adding to the list

    • @derrickgrigg
      @derrickgrigg 5 місяців тому

      @@aarondfrancisjarritos 🤤