TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Balatro Source Code Smell

3 pointsby felhrabout 1 year ago

1 comment

idle_zealotabout 1 year ago
Implementing the logic for this sort of card game is quite tricky. Your natural inclination as a software dev will be to make some sort of effect enum, tag cards with their effects, and then have a generic "do this card" function that will look up handlers for each effect and execute them (or the object-oriented equivalent). This runs into issues with edge cases where actually you need particular effects to be aware of one another and change behavior accordingly, breaking you cleanly separated architecture. You start piling on and shoving in special handling logic with no clear home. The nature of these games invites spaghetti.