Hello!

Here are a few things I'd think about.

First, (and this is kinda unrelated to organization) but I'd recommend 
using elm-format and having type signatures.


Some quick thoughts:

You could break your styles into their own file, either using elm-css, or 
raw elm styles.

You could break Model out into it's own file and take related model 
processing functions there.

Side note, you can combine all your animation subscriptions into one 
message.




   




On Friday, December 2, 2016 at 11:32:56 AM UTC-5, Rex van der Spuy wrote:
>
> Hi Everyone,
>
> Over the past few months I've been follow the Best Practice 
> recommendations in Elm World to not use nested Model/Update/View modules.
> The general consensus seems to be just to keep one giant M/U/V engine 
> running, and farm out specialized work to helper functions.
> Cool, that make sense!
> Updating child modules is a big chore anyway that I'm happy not to have to 
> do.
>
> But, the "small" application that I'm working at the moment has now grown 
> to over 1000 lines of code.
> I'm starting to have to hunt for things, do a lot of scrolling, and I'm 
> forgetting how it's organized.
> And I realized I have absolutely no idea at all how to modularize it into 
> a sensible/understandable collection of smaller files.
>
> Can anyone help?
>
> Here's a code dump of what my main application code looks like so far:
>
> https://gist.github.com/kittykatattack/e30d860bbdfba57e0af2341c0c59552c
>
> (It's a kind of Eliza-like chat-bot - the code above won't run without 
> some dependencies that I haven't included, but hopefully it illustrates my 
> problem?)
> *Disclaimer: this is a work-in-progress and there is some redundant and, 
> frankly, plain bad code I need to clean up -- so please ignore my messy 
> work!!*
>
> But, can anyone recommend to me how I can organize this into a manageable 
> series of smaller files?
>
> The general way it's structured is:
>
> - imports
> - initial model
> - update (including update helper functions)
> - view (including css and elm-mdl components)
> - subscriptions
> - main app wiring
>
>
> Thanks, Everyone!
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to