Recently i’ve been sprinting preparing a very exciting new venture that has force me to write code in languages I had little experience in before. The amazing thing I have learnt is that it’s fairly striaghtforward to transfer skills from other languages fairly seemlessly once you’ve invested time in. The fundamental thing I have realised is good code architecture is universal.
What I like to bring to code is simplification, atomicity and structured design. Consider the following java code…
For me it just feels like it’s doing too much. Worse still the same style was duplicated in every web request.
The first thing I did was define an interface that I wanted this to follow fro an API level.
Very simple interface, I can drop that into any file and not care about JSON, HTTP Requests, Asyncronosity. Just raw input output.
Now all I have to do is write each of the parts in isolation.
I certainly prefer the second style. It’s how I’d write the code in any language, define the right interface and then use it.