Primes can be confusing even when doing pure maths (I studied physics), it's just so easy to miss them, so good riddance.
When it comes to model names, I always try to 1) pipe my functions so that I need the least intermediate variable names and 2) use descriptive names no matter what; for example, after I applied the tick function, i get a `tickedModel`. If I need more than one or two intermediates, I rework things so I can pipe. (Also, if I use `newModel` I never use `model` but rather `oldModel` to kill *any* possibility for ambiguity) On Thursday, October 20, 2016 at 7:56:11 AM UTC+11, mbr wrote: > > Naming sometimes can be hard. > > While I agree that model03 or model''' is a code smell. > But often you are just transforming some data and the intermediate > variables names are meaningless (besides reminding us that they are related) > I've seen things like newModel being used everywhere and then later a > newestModel > shows up. > > > I do also agree that triple primes is a sign that your function should be > split. > On the other hand, 3 lines functions everywhere adds too much indirection > and, IMO, are code smell as well. > > Another things about primes, is that its used in calculus all the time as > well and I feel nostalgic about it. Silly right? > > What I really wish, is that things like type_ is used instead of type' > but the ability for us to use primes on out variables name not be removed > from the language. > > > > > > > On Wednesday, October 19, 2016 at 3:06:58 AM UTC-4, Peter Damoc wrote: >> >> Elm optimizes for learning and in doing so, encourages people to write >> clear code. >> >> I too had a brief love affair with primes after watching Leslie Lamport >> videos about TLA+ and discovering that they are allowed in Elm. >> >> I was encouraged to move away from them and favor a more explicit name >> like newModel. I did it and never looked back. >> >> I found that if I needed more than one prime, it was a very good sign >> that I might need to use functions. >> Instead of naming my intermediary values something silly and useless like >> model03, I named the process something meaningful and then chained the >> processes with |> >> >> >> >> On Wed, Oct 19, 2016 at 4:28 AM, mbr <[email protected]> wrote: >> >>> just learned that primes and backticks won't be on elm 0.18. >>> >>> What are the reason for their removal? >>> >>> I will miss the primes quite a bit. Am I the only one here that feels >>> this way ? >>> >>> For instance, I would have to write headerModel___ and headerModel__ >>> instead of headerModel''' and headerModel'' >>> In the prime case I count the 'while on the underscore case I will >>> compare its length. >>> >>> at the end of the day, I will just skip the underscore and use number >>> like headerModel03 and headerModel02. >>> >>> And my case for backticks, I understand it will make the andThen API >>> easier, but why completely remove it from the language ? >>> >>> I guess my main question is, What is the motivation for their removal ? >>> >>> -- >>> 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 [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> There is NO FATE, we are the creators. >> blog: http://damoc.ro/ >> > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
