3 ms·
I tend to use guard statements in ruby methods to prevent invalid input. It helps people understand how the method is supposed to be used while also failing ear
by kayodelycaon 5y ago
I tend to use guard statements in ruby methods to prevent invalid input. It helps people understand how the method is supposed to be used while also failing early with an obvious error, rather than late with a cryptic one.
If there was a way to do a type signatures inline without making things ugly, I would use them. Optionally enforcing @param and @return comments would be good enough for me. A separate file is useless for me because I don’t use an IDE.
- eropple 5y agoYou might not use "an IDE", but you can get language server support for a ton of languages in almost any text editor worth using these days. There are Vim LSP plugins for TypeScript, even.
- kayodelycaon 5y agoI suppose. I use a number of linters with Sublime.(1) It’s just not as rich or integrated as a real IDE would be. 1: I have my reasons for using Sublime over the alternatives.