Re: naming convention
- Posted by Aku <akusaya at g?x.net> Apr 18, 2008
- 551 views
Jeremy Cowgar wrote: > I'm not quite sure I follow. Can you expand a bit? I too dislike cryptic names > but also dislike string_split_by_char("John Doe", " "). I would strive for a > happy medium, but I am open to suggestions. The current functions are all > lower > case and separated by an underscore where needed. I was going to follow suite > but I do not think that's what your speaking of. Just my 0.02 cents (that's 0.0002$), In my own Eu projects, because Eu do not have a neat namespace feature, I usually named my function with combination of _ and camelCase. So, if I were to make replace all function for strings library, I will use a name like str_replaceAll instead of replaceAll or replace_all or str_replace_all. Then str_indexOf, str_lastIndexOf. The same goes for hash, math, dll, struct, date etc. Like hash_put, date_getSecond, etc. How if we follow Java API for those standard packages? (vector, hash, set, date, pattern (regex), etc) I think Java API is tested by time and by users, and the design is quite great. When I create Eu program now, I almost always use my standard include file. Unfortunately not every people wants to write their own standard include file.