Hacker News new | ask | show | jobs
by nickik 5576 days ago
You have the typicall overthinking problem. You should just start to write useful functions and then when you really see a need for something like multiple dispatch you have it at hand to solve your problem.

This way your System will grow into what you want you don't have to design everything upfront thats the wrong we to go about it.

(Design is fine but on a much higher level then the object system in your language)

1 comments

Yes can be. My typical approach is to write down what I want to say in an as idiomatic way as I can. Then I go on to implement the notation that I have come up with.

The code I write is usually very high-level code. It can be written like an acceptance test or feature test. I essentially try to model the business domain of the software as cleanly as possible. I might refactor the code until I can express the domain clearly, with DRY etc.

Implementing all the bits of my DSL is often then the actual problem. Often I meet areas of the domain that are tricky because I have never solved such problems before. I think only my the third implementation of some idea can be something usable. So sometimes it takes a long time to get there! :)

This is only a problem in my personal projects because, well, the main goal is to advance my capabilities and thinking and finishing the project is secondary.

It could be that you have trouble think about these concepts but come up with good solutions in the end. Know that you have these features how would it feel to go back to Java. Then you think something like ok I would implement this with a multimethod and then you can start look for a complicated and ugly designpattern do mimic something like a multimethod.