494
you are viewing a single comment's thread
view the rest of the comments
[-] dreugeworst@lemmy.ml 3 points 1 day ago

as someone who would also reach for a state machine when doing simple parsing... what's the better alternative in python?

[-] lectricleopard@lemmy.world 2 points 19 hours ago

A loop and a data structure to hold the result of parsing. The data structure will have a state you can interrogate. No need to build a state machine to explicitly name each way the parsing can develop.

[-] dreugeworst@lemmy.ml 1 points 14 hours ago

that's what I'd do for a state machine implementation too

[-] lectricleopard@lemmy.world 1 points 11 hours ago

I think of a state machine as a hardware concept, not software. If all these conditions, transition to state 21. Then do a thing, if these conditions, transition to 38.

this post was submitted on 22 May 2026
494 points (98.8% liked)

Technology

84878 readers
6298 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS