Is it ok to have lots of messages and a large update? (seems to be...)

Hi. I’m building an app where users will poke, prod, listen to, photograph (etc etc) a malfunctioning device to try and work out what’s going on. They will do things like OpenTopCover, OpenBottomCover, TurnRedKnobUp, HitWithHammer…

you get it…

The most simple thing to do seems to be have all of those actions be messages and deal with them in the update, but there will be many messages (maybe > 50). Looking at Richard F. and Evan’s YouTube videos, this seems like not something to be frightened of. All the action is in one place (Update), in a big case statement. Obviously, I would make each message call a function and not clutter the particular item with too much code.

I’m seeking reassurance that this is not nuts!!!

I dont think its nuts. I think you are okay.

Maybe you will want to modularize stuff in the future, but then I guess thats not really a reduction in the number of Msg, just a reallocation from one big top-level case to a few top-level Msg that delegate to many nested Msg.

1 Like

Thanks - so far so good!

Did you see this video yet, it talks about this also:
“Elm Europe 2017 - Richard Feldman - Scaling Elm Apps”

Thanks @malaire.
Yes, that was one of the talks that gave me the confidence to not break things up into a million parts. It’s going quite well at the moment with just a “one big file”, and I’ll have a go at using the strategies @rtfeldman discusses when my brain is full!
thanks again for the help


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.