Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have tried to keep an open mind on this topic, or rather developing one, but alas I remain a zealot.

I recently wanted to make a simple enough PR to a large JavaScript codebase to fix a bug. After a few hours I found where the call was happening and what changes I needed to make.

At a simple level the code update was "measure the length of each of these things and store them, for each of the stored things align them relative to the longest length of stored items and add them to the state".

It took about 3 times longer to get to working code because of the lack of types. "Oh, you've used `i` in some context, you must just mean a global of indeterminate type, better keep running. Oh you forgot whether the method name on type of string is SubString or Substring? Sorry can't help you, don't know what a string is. You don't know/remember what you can do with this variable? Neither do I!" Sure you can have linters or whatever to catch these stupid mistakes but I'd rather just have the bloody thing work first time.

I'd rather have my tools assist me than feel like an alpha-chad because I've managed to memorise the entire API of something. I have more useful things to keep in my brain. Sure it might let you go quickly in your 50 line script but woe-betide any developer who comes later.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: