When Booleans Are Not Enough... State Machines?

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

ความคิดเห็น • 39

  • @madhavsingh7345
    @madhavsingh7345 2 ปีที่แล้ว +10

    That is very useful and exactly what I needed. A project I'm working on right now is polluted with flags, and this is going to help so much.

  • @EloiTeaching
    @EloiTeaching 4 ปีที่แล้ว +14

    Surprise of how small are the commentary count on this video.
    This video is amazing !

  • @AntonioDoesMetal
    @AntonioDoesMetal 6 หลายเดือนก่อน

    I've watched tons and tons of tech talks in the past few years and this one was one of the best I've seen. Thanks for sharing

  • @csharp609
    @csharp609 3 ปีที่แล้ว +11

    The clearest explanation about the state machine, Thanks.

  • @derduskenga
    @derduskenga 4 ปีที่แล้ว +5

    Genius! Stumbled on this when I was almost giving up

  • @onlymecz
    @onlymecz 2 ปีที่แล้ว +2

    Exactly what I needed!! Thank you so much!

  • @spaceyfounder5040
    @spaceyfounder5040 5 ปีที่แล้ว +19

    Freaking useful!

  • @Only1retro
    @Only1retro 2 หลายเดือนก่อน

    Finally a real application of my formal language and automata course

  • @devtest8078
    @devtest8078 3 ปีที่แล้ว +4

    Excellent talk. State Machines very well explained. Well done Harrington Joseph.

  • @ashwinmathews9859
    @ashwinmathews9859 ปีที่แล้ว +1

    Excellent video

  • @madsxcva
    @madsxcva ปีที่แล้ว +1

    great talk

  • @user-uh2cr9so8l
    @user-uh2cr9so8l 3 ปีที่แล้ว +6

    Highlighted the use case of state machine really well, I needed that. Shame the implementation used a library though

  • @fringefringe7282
    @fringefringe7282 3 ปีที่แล้ว +1

    Marvelous.

  • @aleksandrkubar6255
    @aleksandrkubar6255 3 ปีที่แล้ว +1

    Great presentation, thanks!

  • @nikhilgoyal8340
    @nikhilgoyal8340 3 ปีที่แล้ว +1

    Nice explanation and use case.

  • @tienbui1106
    @tienbui1106 3 ปีที่แล้ว +2

    It's pretty helpful, thanks

  • @lycantropos
    @lycantropos ปีที่แล้ว +2

    in the next iteration people using this pattern will understand that using separate classes to switch between states is a much better approach that can be checked by static type checkers like `mypy` in Python or a compiler in any of OO compiled languages

    • @lepidoptera9337
      @lepidoptera9337 ปีที่แล้ว +1

      You must be joking... did I miss the sarcasm? Why in the world would you ever smear a state machine over several classes???? That makes it almost impossible to follow your program logic. The very beauty of a state machine with e.g. a switch statement is that it's all in one place... so you (and the people who have to maintain your legacy code!) can see immediately where things are going wrong. This also makes extending the state machine is nearly trivial. You are a good example of what's wrong with the OOP crowd.

  • @vladimirgorea8714
    @vladimirgorea8714 4 ปีที่แล้ว +2

    Ok, this is useful. Thanks

  • @louaykhammar7268
    @louaykhammar7268 3 ปีที่แล้ว +1

    Thanks

  • @eswarreddy6280
    @eswarreddy6280 3 ปีที่แล้ว +1

    great one

  • @willculpepper9637
    @willculpepper9637 2 ปีที่แล้ว +3

    1) Say what you're going to say. 2) Say it. 3) Say what you said. This is the way.

  • @openroomxyz
    @openroomxyz 3 ปีที่แล้ว +1

    Love it thanks a lot!

  • @paulchamberlain7942
    @paulchamberlain7942 3 หลายเดือนก่อน

    no rewinding if tape stopped? So unlike any tape machine ever made..

  • @brookestephen
    @brookestephen ปีที่แล้ว +2

    Perhaps it's easier to make unavailable functions unavailable in the user interface, rather than generate an error when the user selects an unavailable function.

    • @lepidoptera9337
      @lepidoptera9337 ปีที่แล้ว

      The better way is to give an explanation why the function is not available and what pre-requisites the user has to provide to make it available. Yes, there is the crowd that thinks that the user is a toddler who needs to be put into a tiny cage... that crowd tends to write highly unintuitive and frustrating software that leaves no room for growth, neither for the user nor the software designer. If you want to treat your user like an adult, tell him what the program needs to be able to do more for him. If you can't do that, then you don't understand either your user nor your own software.

  • @geodome83
    @geodome83 3 ปีที่แล้ว

    NFA is probably the easiest way to express a state machine, but there are other kind of automata which may be used to model the state machine.

    • @lepidoptera9337
      @lepidoptera9337 ปีที่แล้ว

      A state machine can be written easily with if-then-else or switch statements. No need to complicate things.

  • @chikkai2432
    @chikkai2432 2 ปีที่แล้ว +1

    👏

  • @alexanderkyei8947
    @alexanderkyei8947 3 ปีที่แล้ว +1

    Very great presentation👍🏿

  • @enzotriches7657
    @enzotriches7657 4 ปีที่แล้ว +1

    amazing

  • @ahmednabil5119
    @ahmednabil5119 4 ปีที่แล้ว +1

    But how does state machine library works? It checks the state (true or false) for every condition.
    He only abstract the code using an external library.

    • @rednafi
      @rednafi 3 ปีที่แล้ว +11

      Go read the source code of the pytransitions library. It's a 20 minutes talk. What do expect? I think the speaker did a fantastic job in explaining the problem and pointing the audience in the right direction.

    • @lapidations
      @lapidations 2 ปีที่แล้ว +3

      @@rednafi I agree. Even if I'm currently struggling to implement a state machine, I watched this to understand the use cases and design, not the implementation.

    • @yash1152
      @yash1152 2 ปีที่แล้ว

      umh, yeah, but abstraction is good. It's reusable, it's maintainable, it's flexible. it's less error prone.
      so, even if it's abstracted, it still fits the aim of the talk.
      by the way, thanks for the comment (:

    • @lepidoptera9337
      @lepidoptera9337 ปีที่แล้ว +1

      @@yash1152 Abstraction for abstraction sake is a bad idea. Everybody who can touch your code understands if-then-else and switch... and almost nobody wants to read the documentation for your choice of state machine library. Moreover, you may be running into some serious performance problems with libraries that are too general for your particular use case.

  • @johnodenkiurk
    @johnodenkiurk หลายเดือนก่อน

    neat im going to make garbage

  • @totrantien
    @totrantien 3 ปีที่แล้ว +1

    amazing