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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Does Your Code Pass the Turkey Test? (2008)

132 点作者 hosteur5 个月前

18 条评论

QuercusMax5 个月前
There's one more test: the Thailand test. I've been bitten by issues in Java where Calendar.getInstance() will return a Thai Buddhist calendar, which is exactly the same as the Gregorian calendar except 543 years in the future.
评论 #42345946 未加载
评论 #42345279 未加载
评论 #42345793 未加载
eckesicle5 个月前
There’s another fun thing we can call the Britain test.<p>The short form for September is Sept in en-GB, the only month abbreviated with four letters. It’s Sep in en-US and other en- locales. All other parsing is identical.<p>For example, if you’re parsing abbreviated date formats on AWS, this parsing fails only on eu-west-1 and -2 servers, and only in September.
评论 #42349155 未加载
dowager_dan995 个月前
A lot of these seem to be the &quot;not America&quot; test.
评论 #42346005 未加载
评论 #42347472 未加载
评论 #42349220 未加载
SideburnsOfDoom5 个月前
As for dates and times interchange, use ISO 8601 (largest to smallest order).<p>The EU and many other countries ordering of day, month, year (smallest to largest order) also makes sense, but is sadly ambiguous due to<p>The US format of month, day, year (middle-endian order) <a href="https:&#x2F;&#x2F;9gag.com&#x2F;gag&#x2F;a2KEqOe" rel="nofollow">https:&#x2F;&#x2F;9gag.com&#x2F;gag&#x2F;a2KEqOe</a><p>US not TUrkey is the outlier
评论 #42344910 未加载
saaaaaam5 个月前
Of course, the Turkey test itself now fails the Turkey test as Turkey has been updated to Türkiye.
评论 #42344845 未加载
评论 #42346110 未加载
评论 #42347173 未加载
frizlab5 个月前
Most of these problems have incorrect solution. For instance, the actual solution to parsing portrait or landscape is to not use a string for this. It should never have been a string! Other better solutions apply for the rest too.
评论 #42344854 未加载
评论 #42344877 未加载
9dev5 个月前
Am I missing something? The realisation comes down to „yes, there are regional differences in formatting“, and doesn’t strike me as a particularly profound insight.
评论 #42350039 未加载
评论 #42349386 未加载
评论 #42350435 未加载
评论 #42350042 未加载
inglor_cz5 个月前
Some extra tests...<p>Central Europe has a lot of accentuated Latin characters. ěščřžýáíéů etc.<p>Cyrillic letters are also worth trying, especially if you are trying to set up an international e-shop and need to print out labels with addresses.<p>Spanish-speaking people tend to have very long full names, in case that a complete name is needed. Picasso was, in fact, Pablo Diego José Francisco de Paula Juan Nepomuceno María de los Remedios Cipriano de la Santísima Trinidad Ruiz y Picasso.<p>Hungarians write surnames first, e.g. Orbán Viktor. Doing it otherwise looks unprofessional and may lead to confusion, because some first names can also be surnames.<p>Most of Europe writes streetname first and house number second, e.g. Friedrichstrasse 52, so the other way round than Americans and Brits are used to.
评论 #42349063 未加载
fsckboy5 个月前
Turkiye would like people to call it Turkiye.<p>even Old New York was once New Amsterdam. Why? Maybe people just liked it better that way, and that&#x27;s nobody&#x27;s business but the Turks.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Uqnb_nU7RBE" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Uqnb_nU7RBE</a><p>(Istanbul is the traditional Turkic name for the city, basically a borrowed&#x2F;altered pronunciation of Constantinople)
评论 #42347393 未加载
评论 #42347434 未加载
评论 #42352182 未加载
评论 #42347233 未加载
评论 #42349011 未加载
lxgr5 个月前
&gt; Or use the RegexOptions.ECMAScript option. In JavaECMAScript, “\d” means [0-9] which gives us: [...]<p>Wow, the default in the Windows API does <i>not</i> do that? I would have 100% bitten by that at some point doing any development there, coming from a Unix background where I believe the &quot;ECMAScript&quot; behavior is pretty commonplace (and in fact it seems to be a subset of PCREs).
评论 #42347576 未加载
kobalsky5 个月前
This is from 2008
xigoi5 个月前
I think the main problem here is that the behavior of the programming language is locale-sensitive by default. What languages other than C# behave like this?
评论 #42349020 未加载
ern5 个月前
OT: I like how he refers to a Hanselman post about great interview questions, and how around 40% of the questions in that post are obsolete. It shows how quickly our field evolves, for better or worse.
anticensor5 个月前
Example ticket: <a href="https:&#x2F;&#x2F;github.com&#x2F;ROCm&#x2F;ROCm&#x2F;issues&#x2F;2888">https:&#x2F;&#x2F;github.com&#x2F;ROCm&#x2F;ROCm&#x2F;issues&#x2F;2888</a>
legobmw995 个月前
One of my first ever public projects actually had a bug report that ended up being the Turkish i problem. Didn’t know there were more!
soygem5 个月前
The normal units test
baxuz5 个月前
It&#x27;s infuriating that most calculator apps, including the quick ones in spotlight, force me to use a comma instead of a period for a decimal delimiter.
shreddit5 个月前
Ah yes, ye old m&#x2F;d&#x2F;y - d&#x2F;m&#x2F;y debate. One is clearly wrong but the Americans won’t listen…
评论 #42345227 未加载
评论 #42345262 未加载
评论 #42345238 未加载
评论 #42345332 未加载