5 ms·
Embedding types in the method names is a habit of using dynamically typed languages. If the method is private it can be shorter, if it is public it should be a
by Yokohiii 8y ago
Embedding types in the method names is a habit of using dynamically typed languages. If the method is private it can be shorter, if it is public it should be a bit more descriptive. With statically typed languages I'd agree with your suggestion, but i'd likely would remove the type info from variables as well.
- nailer 8y ago> If the method is private it can be shorter Won't other people still need to read private code?
- Yokohiii 8y agoOf course, but the scope is heavily limited. This doesn't justify nonsense naming, but it can be very compact.
- emodendroket 8y agoTo me, if you feel compelled to start putting type information in the variable names, function names, etc., what you're showing is that you really want a type system.
- marcosdumay 8y agoHaving types on your API names is a good indicator that you didn't abstract your problem in separable enough concerns. It does help one turn a bad API into a bad API that will lead to slightly less bugs.