Remix.run Logo
deze333 9 hours ago

Don't fight compiler. Just give it an extra definition here and there and it will give you back with blazing compilation speed. Cryptic but "sexy" statements bring suffering in long term, it's a bit like raping your own laptop. No one wins.

antfarm 9 hours ago | parent [-]

I especially ran into it when doing last year's Advent of Code. I restricted myself to not using mutable state or custom data types, i.e. structs or classes, writing in a functional style. That style involved a lot of method chaining (i.e. x.map(...).reduce(...)...) and, of course, of closures.

I had to introduce a lot of helper variables to break up my longer transformation pipelines to make the compiler happy.

I hope Swift is not going the way of Scala any further, which I enjoyed a lot when I adopted it early on, but eventually turned into a monster of a language.

Btw., for recreational coding, I moved on to Elixir in the meanwhile.

deze333 8 hours ago | parent [-]

Yeah, Swift is for creating end-user products, fast iteration, fast delivery. This is where it shines. For recreational coding definitely pick something that reflects your deeper aesthetic affinity, I totally get what you mean.