Christian Couder <chriscool@xxxxxxxxxxxxx> writes: > From: Junio C Hamano <gitster@xxxxxxxxx> >> >> Even though we already added has_suffix() for tail matches, it is >> not too late to rethink, as it is not in 'master' yet. >> >> One thing I noticed is that it is probably misnamed, or at least in >> a way that invites confusion. Can people tell which one of these is >> correct without looking at existing callsites? >> >> has_suffix(filename, "txt"); >> has_suffix(filename, ".txt"); >> >> The semantics of the function we have is the latter and is better >> called endswith(), I suspect. And the corresponding function to >> check for head matches should probably be called beginswith(). > > I don't know if has_suffix() is confusing for a native speaker. > > After a look at some languages, Python has "startwith()" and > "endswith()", and Java has "startWith()" and "endsWith()". > > But while we are at it, why not > "ends_with()" and "begins_with()"? To me using an underscore seems > more consistent with what we are doing in Git. Sure. I do not think Peff and I were discussing at that level yet to debate between camelCase and words_with_underscore. We were mainly talking about what words to be used, which needs to come before the final appearance. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html