> I like to brainstorm in terms of data from the very beginning, which means brainstorming in terms of types.
It's funny, because I feel the same way, except I gravitate towards Clojure, where data is just data (and you stick it in vectors and hashmaps), and I don't feel the need for static types. At a later point, I may think about adding specs, but for quickly iterating at the REPL while I think about a problem, "plain data" works wonders.
I think the difference is that with types, you have a language based reference which you can talk about (fn x takes type y). This allows you to build the lower functions and check the abstractions at compile time, without having to build the higher levels or even run the program.
With a dynamic language, you need a specific instance of data in order to write your functions, so you typically start from the top function and implement downwards. I think this works well when you have a light layer over some other library or system, but does not work well when you are implementing many layers in your own code.
I think this is what he hints at with:
> When I want to know if my code is working, I actually have to run the Python thing and feed it with data
I like REPLs, but Im experimenting with a type system + running a test on save that exercises the functions Im currently working on. This feels REPL-like as the iteration loop is fast.
It's interesting because I would previously implement something top down from the highest functions, but now I can implement mostly bottom up as the types/compiler gives me the language to define the layers.
For what it's worth, my usual flow is to start sketching top-down, and building bottom-up afterwards, refactoring as I go. I also (ab)use Clojure's argument destructuring and will often just pass a map until I settle on the "correct" API for my code.
Not bashing good types (I do like Haskell, too), just showing an alternative based on the same brainstorming idea the GP had mentioned.
It's funny, because I feel the same way, except I gravitate towards Clojure, where data is just data (and you stick it in vectors and hashmaps), and I don't feel the need for static types. At a later point, I may think about adding specs, but for quickly iterating at the REPL while I think about a problem, "plain data" works wonders.