Jon Skeet

codeblog.jonskeet.uk · Personal blog · on HN since 2014

Jon Skeet, a longtime Stack Overflow contributor, writes about C#, .NET, Java dates and times, and how to ask good questions.

What HN saysHN commenters cite his question-writing guide as useful and point to his UTC post as the best treatment of storing times.
80HN people shared it
41linked it in comments
76stories submitted
1.5Kstory points
3 months agolast shared
2014people per year2026

Most-shared posts

  1. 1
    Storing UTC is not a silver bullet
    24 people · 600 points · first shared 2019 · 184 comments on HN
  2. 2
    Writing the perfect question (2010)
    6 people · 28 points · first shared 2016 · 1 comments on HN
  3. 3
    Stack Overflow Question Checklist by John Skeet (2012)
    4 people · 3 points · first shared 2018 · discussion on HN
  4. 4
    All about java.util.Date
    3 people · 195 points · first shared 2017 · 90 comments on HN
  5. 5
    The Open-Closed Principle is poorly described
    3 people · 2 points · first shared 2020 · 1 comments on HN
  6. 6
    Stack Overflow Culture - Jon Skeet
    2 people · 31 points · first shared 2018 · 10 comments on HN
  7. 7
    A Tour of the .NET Functions Framework
    2 people · 12 points · first shared 2020 · discussion on HN
  8. 8
    The bug is in your code (and mine)
    2 people · 7 points · first shared 2024 · discussion on HN
  9. 9
    Versioning Limitations in .Net
    2 people · 6 points · first shared 2019 · discussion on HN
  10. 10
    Backward compatibility and overloading
    2 people · 4 points · first shared 2018 · discussion on HN
  11. 11
    Diversity and speaking engagements
    2 people · 4 points · first shared 2016 · discussion on HN
  12. 12
    Stack Overflow Culture
    1 people · 264 points · first shared 2018 · 273 comments on HN
  13. 13
    Diagnosing a Linux-only unit test failure
    1 people · 70 points · first shared 2017 · 23 comments on HN
  14. 14
    Unexpected inconsistency in records
    1 people · 61 points · first shared 2025 · 32 comments on HN
  15. 15
    OMG Ponies (Aka Humanity: Epic Fail) (2009)
    1 people · 32 points · first shared 2016 · discussion on HN

What HN people wrote when they linked it

andrewaylett · 2026-01-04
In part a follow-on from the Stack Overflow thread, when I was younger I found various "how to ask questions" articles to be really useful (I particularly recommend Jon Skeet's https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)… But he's focused on asking questions of "the Internet", where there should be no expectation that a random netizen will put effort into answering. That's not necessarily the case at work with colleagues, so I wrote this article to fill a perceived gap.
jmkni · 2025-10-16
Different prompts/approaches? I "grew up", as it were, on StackOverflow, when I was in my early dev days and didn't have a clue what I was doing I asked question after question on SO and learned very quickly the difference between asking a good question vs asking a bad one There is a great Jon Skeet blog post from back in the day called "Writing the perfect question" - https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/ I think this is as valid as ever in the age of AI, you will get much better output from any of these chatbots if you learn and understand how to ask a good question.
c17r · 2025-05-28
currywurst · 2022-10-17
A linked article (https://codeblog.jonskeet.uk/2021/01/27/osc-mixer-control-in-c/) highlights a great transition that we went through in our church as well: huge, bulky analogue mixers replaced with a digital mixer. The training we had to do with our sound team dropped significantly, as we could load useful presets, do some preparatory work at home before the service etc. It was a great example for what a real "digital transformation" looks like ;)
jmcqk6 · 2019-06-18
In addition to the other replies, I defer to the great Jon Skeet: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
ZeroClickOk · 2017-01-30
[John Skeet] (https://codeblog.jonskeet.uk/) C#'s transcedence lord
daxfohl · 2025-07-12
Going a little further, what I'd really like to see is the core concepts implemented in a way that allows a standard implementation to follow straightforwardly from the type system, but also allow for doing nonstandard things. Like, "here's a logic language built in" is kind of boring. What's more enticing is "Here are the components. Here's a nominal implementation based on these components. Here's a weird thing you can do that we hadn't actually designed for, but could fit certain use cases." I remember Jon Skeet did a whole series of blog posts on reimplementing C# async, which was possible because C#'s async syntax isn't bolted to the implementation, and added features like coroutines that weren't part of C# at all. https://codeblog.jonskeet.uk/2011/06/22/eduasync-part-13-first-look-at… Similarly Daniel Earwicker had a series where he implemented async/await using iterator syntax instead https://smellegantcode.wordpress.com/2010/12/14/unification-of-async-a… And sure, now I know it's all kind of fancy but fairly trivial stuff you can do with monads (and I guess free monads in the Linq-to-SQL case), but it was fascinating to me at the time. So yeah, for "selling" purposes, I think rather than selling datalog built into the language as a front-page feature, a series of "how to build a datalog" posts would go further in showing off the power of the components of the language that it's built from. (And FWIW I do like the way…
the_af · 2022-09-15
> The original Java date classes (also from the 1.1 era) were functional and correct, but badly designed. A modern time API was introduced in Java 8 in 2014. I'm pretty sure they were neither correct nor functional. I've read pretty detailed examples of everything they got fundamentally wrong, which was a lot. Wrong, not as "this is cumbersome to use" but as in "this fundamentally misunderstands what dates are at a conceptual level, and produces wrong results". Unfortunately, I would have to google it now. All I can find right now is Jon Skeet's summary [1], which leans more to the "avoid using java.util.Date because it's one giant pitfall" side of the argument. Though it does mention some fundamental problems with it. However, this is not the article I found back in the day, which was both more comprehensive and more critical. > A modern time API was introduced in Java 8 in 2014. I seem to remember even at that time people were still not recommending Java standard date classes and functions, but I may be misremembering. Or were all the replacements like joda time from a previous era? --- [1] https://codeblog.jonskeet.uk/2017/04/23/all-about-java-util-date/
mekoka · 2021-03-21
The problem with SOLID is not SOLID, it's the fetishism that sometimes surrounds it. I get it, rules are attractive as they make everything easier. You put on blinders and follow the track. But the fact that there's so much disagreement about how to best build software, with valid arguments in all sides of the multiple spectra, should hint at its truer nature as a craft (some would say a philosophy, but I haven't yet reached that level of enlightenment) rather than an exact discipline. Isn't it time to perhaps get comfortable with the idea that there are no perfect solutions, only trade-offs and that the right answer is most likely "it depends"? I understand that some people feel protective of their investment at internalizing the various "principles", but learning them doesn't give anyone a license not to think and to mindlessly apply them. And yes, SOLID is mostly useful in its essence, but over time parts of it have caused confusion and have not always aged well (https://codeblog.jonskeet.uk/2013/03/15/the-open-closed-principle-in-r… At a more personal level, the DIP section of this article hit close for me, as I've (again) lived the described scenarios a mere week ago. Sometimes `main()` is all you need and all you'll ever need. The extra tooling is also debt. If you choose to incur it, it must palliate to an actual problem that you actually have, else YAGNI.
ben509 · 2020-06-10
Python gets love for a number of choices it made right early on, and that its core langauge is obviously well thought out. Even very old Python is generally readable and clear; except for some colons, it looks like pseudo-code. This is the same reason I think Java gets a lot of respect: they had a few core language design ideas and built the language around them. People will say COBOL's syntax is horribly verbose, but you can see what they were trying to do. So you might dislike those choices, but your critique becomes about the consequences of the choice, which implicitly is something the person making it can't know at the time. With PHP, people are complaining that users have to live with a whole host of accidents or poorly thought out ideas that are now baked in. Other languages get criticized for that, too. Python was hammered over their poorly thought out support for unicode in Py3K[4], which blocked many distros from supporting it until around 3.4. (And, generally, most people agreed Python3 was a mess until ~3.6 and the whole transition is widely seen as a case study in what not to do.) Java gets dislike for similar bad choices. Java's Date class is pretty notorious[2] as a how-not-to. Java arrays are covariant, and it was staring them in the face as they coded the ArrayStoreException[5] to deal with otherwise perfectly valid assignments. But the .NET one-upped them by knowingly making their arrays covariant, despite knowing it was a problem in Java. (Probably to…
teh_klev · 2018-06-21
I do feel your pain with these crappy tutorials, and many of them are glorified blogspam or recycling/reheats of the same thing you could have already found out by reading the docs. There's no depth, no referencing of documentation, very little reasoning about why the thing you're explaining works. That said...ideally if the author abides by (1) do proper research and (2) "Your tutorial can be reviewed by other brilliant engineers who can point out your mistakes" then there's no reason why you couldn't produce a reasonable quality tutorial in this way. I think this article is written for developers/engineers who's overall skill level and expertise is a cut above inexperienced folks who're just starting out. i.e. you know how to research, you have a working familiarity with the tech stack you're working with (and broader awareness of other tech stacks), you know how to ask a "good question" on Stack Overflow (or have read and understood Jon Skeet's "Writing the perfect question" article[0]). It's kinda like taking rubber ducking to the next level and sharing your learning experience. [0]: https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/
viraptor · 2016-09-15
Don't take it personally. People spending lots of time on SE sites see people repeating the same questions or asking things that cannot really be answered all the time. At some point you either have a boilerplate comment, or a favourite "this is a duplicate" link, or a just downvote them. I don't know anything about the quant site, but if people with 1k+ reputation say "I don't know what you're asking.", and "So basically you stated (at least) 2 falsehoods right there in your question.", then you should just try to rewrite the question. For programming questions it's easier. You just point people at some known post, like https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/ For other site it may be harder, but the process is probably similar. Separate your question from your assumptions. Ask a clear question that has a specific answer. If you're writing "so the Black Scholes model would be correct, no?", then your question should probably be titled "Is the Black Scholes model correct for american put options?" or something similar. (not "what's the deal with...")
jsmeaton · 2016-08-17
Cool library, I'll definitely be looking into this more closely in the future. The automatic handling of ambiguous time during timezone transitions is curious. As an example, Django punts on automatic handling and requires a user to choose between pre and post transition (I wrote the is_dst handling): https://github.com/django/django/blob/19e20a2a3f763388bba9263d56db3401… What if you were to begin with a time at 3:30 and then subtract an hour. Would your library properly return 1:30? What if a user had a naive time at 3:30, subtracted an hour, and then converted to an aware time using your library? For what it's worth, I think moving to 3:30 is the correct behaviour in the vast amount of cases. Requiring a user to provide a direction to move and throwing an exception if they don't is dangerous. How often are users going to see this exception, if at all? Just wondering how much you've considered cases, if they exist, that would be better off moving to 1:30. I'll add one more thing. As soon as I started browsing the page I thought "why would I use this over arrow?". Great to see you addressed that by default. I didn't know about some of arrows shortcomings/bugs, so they were really useful. Handling dates, times, and timezones in particular is a tricky problem, as evident by the large number of libraries in each language trying to get it right. If you haven't already, I'd really recommend reading the blog posts of Jon Skeet regarding Noda…
SideburnsOfDoom · 2025-12-22
> be aware it's going to have a funky non C# compliant field name That's longstanding behaviour. Ever since features such as anonymous types or lambdas arrived, they mean that classes and methods need to be generated from them. And of course these need names, assigned by the compiler. But these names are deliberately not allowed from the code. The compiler allows itself a wider set of names, including the "<>" chars. I have heard them referred to as "unspeakable names" because it's not that they're unknown, you literally can't say them in the code. e.g. by Jon Skeet, here https://codeblog.jonskeet.uk/category/async/ from 2013. > they’re all "unspeakable" names including angle-brackets, just like all compiler-generated names.
mzl · 2025-06-25
As many others have said, time and calendars is messy, and there is often no correct solution but just a bunch of trade-offs. Jon Skeets Storing UTC is not a Silver Bullet (https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu… was very influential for me in realizing some of the subtleties in what a point in time means for a user, and how that should incluece the design of a system.
davejohnclark · 2025-05-28
There's a good post about why this isn't as foolproof an approach as it might first seem here https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
isleyaardvark · 2025-05-28
The problem with that is you lose the localtime information, which you may want. Say you have recorded the localtime with the known UTC offset of 0, and that localtime is midnight UTC. Now you want to map it back to a localtime in the past. Ok, which localtime? Was it 8pm in NYC? Or was it 5pm in LA? Is the assumption that the localtime is wherever the user is right now, and is that a valid assumption? If the user has traveled to a different timezone, the time is now being converted to a localtime in the past that is different than it actually was when it happened. edit: another commenter shared this link with an example: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu… I like their "Principle of preserving supplied data".
1propionyl · 2024-12-11
Another good article that discusses the same topic in detail: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
MH15 · 2024-11-17
Something (unrelated) that surprised me here is that the author has two decades of posts on this blog, leading back to their first post about a new version of C# (https://codeblog.jonskeet.uk/2005/09/) Personally as a younger software guy I had no idea that C# had type inference back in 2005- an interesting perspective shift!
fowl2 · 2024-11-01
There is a distinction in the dotnet world too. The docs[1] seem to refer to ABI as "Binary compatibility" and API "Source compatibility". Jon Skeet has some good examples [2] [1] https://learn.microsoft.com/en-us/dotnet/core/compatibility/categories [2] https://codeblog.jonskeet.uk/2018/04/13/backward-compatibility-and-ove…
namtab00 · 2024-08-25
It's long, and has examples in C#, but this article by Jon Skeet should instill some healthy doubt in your convictions: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
fendy3002 · 2024-07-23
> OP says to always store a timezone with each date Jon Skeet talked about this once. https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu… What I take is convert everything to UTC is fine if it's historical data, even unix timestamp is fine. However for the future datetime, it's more complicated than that.
lijok · 2024-02-18
Unfortunately timezones have the nasty ability to change. See: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
ainar-g · 2023-08-31
There are a few ways to represent that in the database, see[1]. Unless I misunderstood what you mean by “no way to specify”. [1]: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
smarx007 · 2023-05-12
I think keeping time in UTC as primary data for as long as possible is a really bad idea, as explained by Jon Skeet quite a while ago: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
svieira · 2023-01-30
I can't take credit for this idea - it's from Jon Skeet: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
muspimerol · 2022-03-16
It's not sufficient in many cases, especially when scheduling things that you expect to happen at a specific local time. https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu…
k_sze · 2021-02-10
This also reminds me of the post Jon Skeet wrote about using UTC: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu… Also discussed on HN back in the days: https://news.ycombinator.com/item?id=19500640
tigershark · 2020-07-10
No, they are not trivial at all as I explained in my previous comment. For more sauce: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bu… About your question it’s impossible to answer without further context. There may be DST tonight, or a leap second, or the enforcement of some strange treaty that will change the time zone..
addictedcs · 2019-09-26
First example I've checked is wrong [1]. Shuffle a list, with a static Random object initialization. Using a static random object is not thread-safe in .NET. "One common solution is to use a static field to store a single instance of Random and reuse it. That’s okay in Java (where Random is thread-safe) but it’s not so good in .NET – if you use the same instance repeatedly from .NET, you can corrupt the internal data structures." [2] Very often the very same resources which claim to be the source of truth provide bad code examples. [1] https://www.programming-idioms.org/cheatsheet/Csharp [2] https://codeblog.jonskeet.uk/2009/11/04/revisiting-randomness

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close