So I've been programming a side project (my own 2d fighter game) for a couple months now and throughout I've been trying to program in the way Casey has been teaching on his streams; by utilizing the ideas of 'writing the usage code first' and 'compression oriented programming'. However, I'm having trouble grasping how these concepts are suppose to work together when programming. I believe this comment Casey answered on stream helps to sum up my issue:
"You recently emphasized "Write the usage code first" and then the implementation later. While compression oriented programming is about writing code first and then compressing it, pulling code into functions where necessary, allowing the API to evolve out of that process. They seem like two contradictory methods. Are they? How do you decide when you're using one or the other?"
Basically, Casey said that when you don't know what it is your suppose to do and you don't have code in front of you, that's when you write the usage code first. When you do have code in front of you that's when you do compression oriented programming. But in my mind, when you didn't have any code in front of you and you're not even sure what it is you need to do, that should be when you just write the simplest thing that comes to mind and then your start abstracting out your api through compression oriented programming techniques. Of course, if things are done this way then what is the need of ever writing usage code first? since the api will just come about organically through the compression oriented process?
As you can see Casey's answer on his stream didn't really help clear things up for me so I was wondering if others could help me fully grasp these concepts and how they interconnect to generate an api.