4 ms·
I never liked how go makes you fix all your types before letting you run a program. Suppose I wanted to hack something up and run it, just as a new idea? Mayb
by gorgoiler 5y ago
I never liked how go makes you fix all your types before letting you run a program.
Suppose I wanted to hack something up and run it, just as a new idea? Maybe change a library function that is called in 20 places, but I only want to test it in one call site. Nope! Go forces you to polish up your turd of an idea in all 20 call sites before you can see that your algorithm / model / refactoring is nonsense. If you back out of the idea then all that turd polishing was a waste of time.
The mypy-python workflow, on the other hand, lets me write my nonsense, see that it was a bad idea, then throw it away without eating up more time than I needed to with satisfying all the type checking ceremonial stuff. Much nicer. It’s a linter that follows the “make it work, then make it right, then make it fast” iterative workflow that I’m used to.
Alas, I suppose if I wasn’t an imposter in the programming world, I would be able to dream up my changes and think them through in my head properly before committing them to my text editor. Maybe I wouldn’t even need to do that because my ideas are just great all the time instead of 50/50 between ok and terrible. I’m not smart like that, and it felt like go went out of its way to rub it in.
Maybe I used go wrong. I haven’t touched it in a decade. Is there a “hey ho your types are all out of sync but let’s try and compile anyway” option?
- valcron1000 5y agoThe only compiled language that I know that supports this kind of development is Haskell by enabling '-fdefer-type-errors'
- lolinder 5y agoThere's a big difference between Python's types and and Go's: in Python they're only there to check correctness while in Go they're there to tell the compiler how to lay out the machine code. If the compiler ignored types in Go it wouldn't just throw an error message at runtime, the behavior would be completely undefined.
- gorgoiler 5y agoThat’s interesting. The hacky-developer option I’m after is the ability to cull pieces of code if they do not type check, I guess.
- bmn__ 5y ago> Is there a “hey ho your types are all out of sync but let’s try and compile anyway” option? "typed holes" in some programming languages
- lolinder 5y agoTyped holes are slightly different: they allow you to write the types but not the code.