TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How many man years are wasted with western naming convensions?

14 点作者 drudru将近 3 年前

30 条评论

MauranKilom将近 3 年前
Maybe I&#x27;m being dense, but I fail to see the point. The code has the exact same sequence of tokens in all cases, just with different names for the constant. The fact that a Ctrl+F doesn&#x27;t find all related uses seems to be the only argument and it doesn&#x27;t convince me.<p>The article does not provide an alternative solution, or a discussion of the upsides of different naming conventions (e.g. knowing that ALL_CAPS is almost surely a compile-time constant). &quot;How many man years are wasted...&quot; - compared to <i>what</i>?
评论 #31605813 未加载
geoalchimista将近 3 年前
The title seems to imply that this problem does not exist in languages not using Latin scripts. That&#x27;s not true. Take Japanese for an example, when you have hiragana, katakana, and kanji to express the same idea (and not to mention a kanji typically have more than one way of pronouncing it), the problem is gonna be orders of magnitude more complex.
评论 #31605927 未加载
avian将近 3 年前
&gt; Someone had to translate GL_MAX_TEXTURE_SIZE into mMaxTextureSize.<p>I fail to see how the fact that the Latin alphabet has upper and lower case is to blame for this. This is more about the coding standards the author has to abide to than anything else.<p>If your coding standard would require you to name the property MMAXTEXTURESIZE instead of mMaxTextureSize, would there be any less busy work?
评论 #31605794 未加载
评论 #31606123 未加载
grose将近 3 年前
Japanese has two syllabaries, hiragana and katakana. They represent the same sets of sounds. I think this is very similar to uppercase and lowercase. Of course, the conventions around their usage are different.<p>If I write a sentence in ALL CAPS, I’M YELLING AT YOU. if i write a sentence in lowercase i am maybe laid back or aloof.<p>A sentence written in all hiragana might represent a toddler speaking. A sentence written in all katakana might represent a foreigner speaking broken Japanese (ouch!).<p>Usually, hiragana is used for grammatical purposes, such as particles and conjugations. But for some reason, laws and contracts use katakana instead. In a hypothetical Japanese programming language, which one should they pick? In university I had to learn this strange language called Doolittle[1] which uses Japanese but dodges the grammar particle issue by using spaces and symbols, which I found to be terribly confusing. I would love to see an attempt at a Japanese programming language that is closer to how the spoken language works.<p>This only scratches the surface. There are even more ways to represent arbitrary syllables, such as with arbitrary kanji (ateji) or even more complex systems like Kanbun. And of course there are many levels of simplification and variation within Chinese characters.<p>My point is that I don’t think this is inherently a Western thing, even if it ended up that way. It’s interesting to ponder how a non-Western language’s programming conventions could look like. Sometimes it’s even a real issue: see languages like Go where uppercase is semantically meaningful and therefore it is impossible to export Eastern symbols.<p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dolittle_(programming_language)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dolittle_(programming_language...</a>
kryptiskt将近 3 年前
The different casing conventions is a signal indicating what kind of value the identifier represents (macro, local variable, type etc), it&#x27;s actually doing work and isn&#x27;t useless embellishment. If case didn&#x27;t exist to signal those distinctions, other means would have been used (like the m_-prefix for members in some C++ styles). So the existence of upper case and lower case certainly isn&#x27;t to blame, programmers would be free to use just one if it sufficed for them (and there was a time when a lot of programs consisted of upper case only).
shakow将近 3 年前
If we programmed in Chinese, one would need to know thousands of characters to write any decent-sized program; if we programmed in Japanese, one would need to master <i>several alphabets</i>, if we were to program in Hindi, the very shape of our characters would depend of the context...<p>All in all, the upper&#x2F;lower case problem does not seem to be that much of a waste of man-years.
评论 #31606142 未加载
评论 #31606062 未加载
评论 #31606098 未加载
lordnacho将近 3 年前
What exactly is the reason people started to have upper and lower case letters? I found a few articles about this appearing in the middle ages, but there doesn&#x27;t seem to be a reason that makes sense. Seems to add nothing to the language, wtf is the point of the first letter being a capital anyway, and rules about various words that have to have caps?
评论 #31606248 未加载
评论 #31605940 未加载
评论 #31605870 未加载
评论 #31605910 未加载
Hamuko将近 3 年前
I&#x27;d dread to think of what naming conventions would look like if they were modeled after Japanese. You can write the same exact word as ひとごみ, 人ごみ, 人込み, 人混み, 人込, or even ヒトゴミ if you&#x27;re feeling bold.
评论 #31606229 未加载
评论 #31605704 未加载
评论 #31606352 未加载
dtech将近 3 年前
This article is a load of bollocks. If another language would be the main programming one, there would be other competing conventions resulting in similar problems.
danbruc将近 3 年前
If this is really a major pain point in some project, there are probably solutions - macros, reflection, code generation, custom build steps and probably more. Or just change your naming convention.
评论 #31610988 未加载
jlnthws将近 3 年前
That&#x27;s why we have conventions: to avoid wasting time arguing about which style to use here and there. I wasted more time reading this article than I will ever waste with lower&#x2F;upper case naming issues.<p>By the way, Arabic has 4 letter forms, Japanese has 3 sets of characters, Chinese has 2 character forms, Vietnamese and some other romanized Asian languages have many diacritics (for the tones) which change the meaning of words,... Latin alphabet as it is used in English is by far the simplest of all (to use, teach or learn).
评论 #31606395 未加载
BlargMcLarg将近 3 年前
It&#x27;s not a problem of the Western language, it&#x27;s a problem of conventions made to preserve context and assuming the worst, along with some cult stuff.<p>You could avoid stuff like get&#x2F;set, but that&#x27;s pretty low-hanging fruit compared to the explosion of things when you have 3 components referencing from top to bottom, each with a 8+ character variable. Preserving context is expensive in writing and reading. Assuming the reader has a shared context is required to shorten many things, however. This can backfire and make things worse than writing things fully.<p>Example, you could shorten mMaxTextureSize to maxSize or maxTexture or something. It entirely depends on what the reader knows coming in and what other variables exist or may exist in the future. In the other example, &quot;getCurrentContext()-&gt;getLimits()&quot; could be shortened to &quot;Context()-&gt;Limits()&quot; assuming there is only context property available is the current one. In both examples, I have to make assumptions on what the reader knows and both the existing and future code which, as mentioned before, can backfire completely.
kkfx将近 3 年前
Programming is for humans, that&#x27;s why we have programming languages instead of writing machine code... Humans have different concept of writing. I think that&#x27;s perfectly natural to have conventions on style of writing.<p>Koreans use sillabic bigrams, in the west we use mostly letters in a handful of variation per country and two main alphabet (how many remember that in Europe we have various letters not only in Cyrillic and it&#x27;s national variations? Like þ, Ð, ȝ, ...), Japanese have even three alphabets (hiragana, katakana and kanji) often <i>mixed</i> for kanji reading aids, ... we have invented the concept of International Auxiliary Languages, with their alphabets, the most well-known is Esperanto but they never took off because pushing their own language give advantage to the successful push-er and so a war at a time we see winners and looser...<p>Computer time does not count much in that game.
beardyw将近 3 年前
I agree to some extent. I often trip myself up with filename and fileName (which is right?)<p>And then there is the hyphen in CSS for example background-color which in js is backgroundColor. (Colour spelt wrong to me in both cases!)
eimrine将近 3 年前
This is so tabs vs spaces holywar. If you can type rather fast you can type any variable without autocomplete no matter how long. If I understood correctly, man years are wasted for more typing only.
gjvc将近 3 年前
much less than by poor spelling
评论 #31605564 未加载
est31将近 3 年前
The way Rust solves this inconsistency issue is by having a bunch of builtin style lints, that 95% of Rust code follows. The key word here is builtin, as in, they existed since 1.0 and are enabled in the compiler by default. You still have to deal with different naming conventions, but they only exist when you interface with some existing component&#x2F;API.
doctor_eval将近 3 年前
I was really hoping this was going to turn into a rant about visibility in Go.<p>As much as I like Go, I really dislike the use of upper case to make things public. About the only thing I miss about Java is the convention of using capitalised words for types and lowercase for fields, methods and variables.<p>I must hit a name conflict in Go every second week.
jansan将近 3 年前
There is also kebap case, which is used in CSS for example.<p><pre><code> number-input-wrapper { background-color: goldenrod; } </code></pre> But to be honest, for me those conventions are one of the smallest problems when programming.<p>Oh, and whoever uses lower case snake case in any circumstance needs a slap on the wrist IMO.
mcv将近 3 年前
Isn&#x27;t the real problem here that people unfamiliar with the Latin alphabet will have to learn the Latin alphabet?<p>I suppose they could design programming languages using the Chinese alphabet (maybe they already have? I wouldn&#x27;t know) that use different conventions[0].<p>[0] Convention is with a &#x27;t&#x27;, by the way.
评论 #31618155 未加载
rob74将近 3 年前
My answer: not as many by far as are&#x2F;were wasted with various character encoding standards and the problems involved in converting between them. Fortunately Unicode is slowly making that a thing of the past, but brings with it new issues (combining characters anyone?)
guerrilla将近 3 年前
As others said, Japanese isn&#x27;t remotely that simple but also many non-Western languages use Latin script. Anyway, hard to take someone complaining about notation seriously when they&#x27;re simultaneously fine with a syntax as complicated and nonsensical as C++.
faangiq将近 3 年前
Western languages invented all that fancy computer stuff. Maybe we should keep them.
V-2将近 3 年前
What is missing is some evidence (by which I mean ANY shred of evidence, not necessarily a full-scale research; could be circumstantial) that coders whose native languages lack the concept of upper&#x2F;lower case ACTUALLY struggle more with this aspect of programming.<p>For what it&#x27;s worth, we&#x27;ve had quite a few languages that only used upper case. Off the top of my head, FORTRAN or COBOL, but I believe it was pretty much the standard up until a point. Was it beneficial? Was there a detectable drop in productivity among programmers of Japanese&#x2F;Korean&#x2F;... origin once this trend reverted, and case-sensitive languages took over?<p>The article offers some food for thought, but objectively it does a better job riding the wave of current intellectual climate (inadvertently, perhaps) than producing a convincing argument in favor of the hypothesis.
usrn将近 3 年前
Maybe I&#x27;m misinterpreting this but the way I read it this guy is complaining about type checking and then calling it racist? It sounds to me like what the zoomers would call a &quot;game dev moment.&quot;
baisq将近 3 年前
What&#x27;s with game developers being unable to spell correctly?
teknopaul将近 3 年前
How many man years wasted?<p>None if you use sanename.org conventions.
drewcoo将近 3 年前
Too many convensions? I am un=convensed.
hulitu将近 3 年前
Hungarian notarion to the rescue &#x2F;s
tripdubroot将近 3 年前
One could ask the same about this post…