3 ms·
Go's naming conventions are much more clean, respected and even enforced than in almost any other language I know (Ruby and Python are specially bad in this, bu
by 198d 15y ago
Go's naming conventions are much more clean, respected and even enforced than in almost any other language I know (Ruby and Python are specially bad in this, but C++ and Java are not much better).
Do you mind explaining this statement a little further, specifically related to Python and Ruby. I work with both of those languages and find the naming conventions to be quite clean and respected. The style of the language is not enforced, but you'll certainly be chastised by any serious developer in either language for doing something outside the norm.
- uriel 15y agoThe Python stdlib is full of examples of CamelCase, under_score and alltogether. In Ruby just looking at the methods for strings is enough to find this like: "instance_variable_defined?", "rindex", "tr_s", "casecmp", "equal?", "eql?" and more. Yes, it is all lower case, but consistent it is certainly not.
- lepht 15y agoI also find myself wishing that Ruby's destructive (!) and boolean (?) suffixes were either enforced somehow or not used at all. The idea itself is cool, communicating extra context about what the method does or its intended usage, but they're used so inconsistently (even withing the Ruby stdlib) that A) They're unreliable and you need to check the source to find out the behavior anyway and B) It's less predictable whether the method exists with the suffix or without, so you need to either run it and modify your method call if there's an error or check the lib/API docs. This is the sort of thing that makes having an IDE handy for completing method names, which is unfortunate because Ruby is generally very usable without any IDE crutches.