3 ms·
I guess static first is a chore because at that point you have no idea what invariant or structure is required for the task. After prototyping you know where to
by agumonkey 6y ago
I guess static first is a chore because at that point you have no idea what invariant or structure is required for the task. After prototyping you know where to tighten the bolts.
- gameswithgo 6y agoThere are some languages that give you a bit of both worlds, like F#.
- meheleventyone 6y agoSort of but at the same time being forced to think about those things also helps get a handle on exactly those parts of the program. Remember you still need to think about them in a dynamically typed language but it's obfuscated because they're implicit.
- cercatrova 6y ago> you have no idea what invariant or structure is required for the task I often write the program in TypeScript types/interfaces first because it forces me to think about the data flow both in and out. In my opinion, data, not code, is the most important thing about a program.
- agumonkey 6y agothat way of working was my only pleasurable experience in eclipse/java start with interfaces and let the live type checker tell you where your incoherences are. Very very smooth way to work.
- munchbunny 6y ago> you have no idea what invariant or structure is required for the task In my experience, in general, if you don't already have an idea, you should probably be spending the up-front time thinking about it. If we're talking React/Redux, then carefully thinking through both data representation and what goes into components' properties/states helps a lot for designing a clean and understandable structure.
- tshaddox 6y agoDesigning my types first is precisely how I want to begin prototyping.
- zaccusl 6y agoThere is why TypeScript IS so great. In the early days of a new app or feature, you have no idea what the correct data/type shapes are. In TypeScript you can define the types and then easily do major refactors even if you have 1000's of lines already written. It becomes so tedious to do the same refactoring in JavaScript. TypeScript makes it trivial to change an object or function signature when developing new code (or old code). Refactors that take 3 minutes in TypeScript take 3 days in JavaScript and you better hope you catch all the uses. The refactor ability that TypeScript gives you makes it so much easier to change data types and function signatures dozens of times until you get things right.