[HN Gopher] The case of the vector with an impossibly large size
       ___________________________________________________________________
        
       The case of the vector with an impossibly large size
        
       Author : signa11
       Score  : 66 points
       Date   : 2024-01-12 05:27 UTC (17 hours ago)
        
 (HTM) web link (devblogs.microsoft.com)
 (TXT) w3m dump (devblogs.microsoft.com)
        
       | mgaunard wrote:
       | It's interesting that people have such trivial problems with
       | their C++ code and still manage to get an expert from Microsoft
       | to look at it for them.
       | 
       | Also what I find interesting is that modern tools like sanitizers
       | would quickly say what's going on without needing any human
       | analysis.
        
         | jdthedisciple wrote:
         | It's Raymond Chen.
         | 
         | It's not that the customer deserves Raymond Chen. Not even HN
         | deserves Raymond Chen.
         | 
         | It's just that Raymond Chen is once again gracing us with his
         | vast and deep insights.
         | 
         | Legend.
        
       | trashburger wrote:
       | The fix is kind of weird, no? If the lazy initialization of the
       | widgets fail, won't it stay stuck as failed forever (i.e. until
       | the containing class is destroyed)? Is this intended behavior?
        
         | tallanvor wrote:
         | No, at least not if exceptions are propagated properly. The
         | flag that determines if call_once should actually run or not
         | doesn't get flipped if there's an exception.
        
       | vsnf wrote:
       | A favorite past-time of HN when a post with an interesting title
       | on the microsoft.com domain appears, is to guess whether it's
       | Raymond Chen, and then to fawn over Raymond Chen. All very well
       | deserved, but are there any examples of interesting posts on
       | microsoft.com from someone who isn't Raymond Chen discussed here?
        
         | doesnt_know wrote:
         | It's a pretty easy guess at this point since there isn't much
         | else of value published on that domain.
        
           | mapreduce wrote:
           | The MSDN documents on the website have been invaluable to me.
           | I mean I started by writing chat tools on Windows and their
           | API docs have been excellent in getting me started. I mean
           | stuff like https://learn.microsoft.com/en-
           | us/windows/win32/api/winuser/... I cannot understand why you
           | think such a large website with so much documentation is of
           | no value!
        
             | cylemons wrote:
             | Value in the context of Hacker News means something that is
             | amusing, insightful, or impressive. It is very rare for
             | plain ol' documentation to make it to the front page.
        
         | taspeotis wrote:
         | Eric Lippert used to publish some good stuff, and Michael
         | Kaplan.
         | 
         | Occasionally there is decent technical content from the SQL
         | Server team [1].
         | 
         | [1]
         | https://cloudblogs.microsoft.com/sqlserver/2022/07/21/improv...
        
           | lifthrasiir wrote:
           | Note that Michael Kaplan's original blog ceased to exist
           | after he died and MS "renewed" MSDN blogs, but the archive is
           | still available [1].
           | 
           | [1] https://archives.miloush.net/michkap/archive/
        
           | jcrites wrote:
           | Eric is no longer with Microsoft, by the way. He was
           | previously on the C# compiler team. I believe he was at
           | JetBrains when I last looked him up. Looks like his blog
           | "Fabulous Adventures in Coding" is on his website now:
           | 
           | https://ericlippert.com/
           | 
           | (I worked with him briefly in, I think it was, 2005.)
        
           | selimthegrim wrote:
           | Was Scott Hanselman ever officially on microsoft.com?
        
         | tialaramex wrote:
         | Microsoft ships a moderately interesting modern language C# and
         | so there are posts which attract a small amount of comment
         | about new C# versions and their features, e.g 12 comments about
         | C# 8.0
         | 
         | And likewise they ship new hardware sometimes, a new Surface
         | Pro got hundreds of comments.
         | 
         | A big problem for these posts and for The Old New Thing
         | (Raymond Chen's blog) is that Microsoft doesn't understand URL
         | stability and so old material is too often moved, misfiled, or
         | just destroyed altogether for no good reason. In particular it
         | seems as though the web site (more vital now than ever for the
         | company's appearance to the rest of the world) is routinely
         | offered as a fun toy for a new executive to make their mark on
         | to show how they've got exciting new visions for the company.
         | Maybe this week Microsoft decided they loved blogs, everything
         | is a blog now, want to announce Microsoft Boring Product 8.6.4?
         | Write a blog post, and your customers can respond to the blog
         | post, because we're an exciting modern tech compan... no, we
         | abandoned that idea, all blogs are to be removed and the
         | customer posts go with thme. Yes that means you've written what
         | is now an article "responding" to customer questions which no
         | longer exist but too bad we don't have time to fix that because
         | _now_ Microsoft is a video-first company, they are dynamic and
         | hot, here are six hour long videos about Microsoft Boring
         | Product and we are going to be delivering a new video _every
         | single week_ uh, wait, that 's expensive, OK, no sorry there
         | are no further videos about Boring Product, it's now a Wiki!
         | Yes, experts even from outside Microsoft can contribute
         | valuable material about Boring Product, we're going to
         | transition all our boring stale material into user editable
         | dyna... Nope! New plan, we're locking every wiki article and
         | we're removing the unofficial content, yes, customers were
         | relying on BigBabo4239's sixty paragraph explanation of how to
         | use Power Shell with Boring Product but that no longer aligns
         | with our corporate strategy so we've deleted it...
        
           | logifail wrote:
           | > the web site [..] is routinely offered as a fun toy for a
           | new executive to make their mark on to show how they've got
           | exciting new visions for the company
           | 
           | To be fair to Microsoft, this issue affects a great many
           | other companies, even outside the technology space.
           | 
           | My personal favourite has got to be www.britishairways.com,
           | where you can discover older and older versions of their
           | website layered like the concentric rings of some ancient
           | tree.
           | 
           | https://www.britishairways.com/travel/home/public/en_gb/
           | 
           | https://www.britishairways.com/travel/webforms/public/en_gb?.
           | ..
           | 
           | and even the gloriously broken
           | 
           | https://www.britishairways.com/onbusiness/how.shtml
        
             | OsrsNeedsf2P wrote:
             | While the British Airways link is amusing, it's much less
             | amusing when you've been linked to a now moved
             | documentation page, or worse, a now deleted download page.
        
             | londons_explore wrote:
             | > older and older versions of their website layered like
             | the concentric rings
             | 
             | I like this approach. Keep old content forever, just mark
             | it as "old" at the top of each page and archive it as a
             | static html page at its original URL.
        
               | londons_explore wrote:
               | (archiving as static html needs to be done at some point,
               | otherwise you'll still be running php4...)
        
             | hexane360 wrote:
             | See also Windows setting menus. People see this as a flaw,
             | but I much prefer that to breaking existing functionality
             | for the sake of a redesign. Make a new interface for simple
             | usecases, but keep the old one around just in case.
        
           | jsight wrote:
           | I feel like this is the norm at big companies. Oh, noone is
           | using platform abc any more, it is too basic. We must switch
           | to def! And we can't afford the retain old links feature, who
           | needs that anyway.
           | 
           | I've seen platforms where if no content author was around to
           | vouch for old technical documents, they'd get summarily
           | deleted. Saves storage! _sigh_
        
         | hardware2win wrote:
         | Stephen Toub
         | 
         | https://devblogs.microsoft.com/dotnet/how-async-await-really...
        
         | ReleaseCandidat wrote:
         | Yes, papers or articles from MS research, e.g. from Simon
         | Peyton-Jones or about Koka or Lean.
         | https://news.ycombinator.com/item?id=36471591 ... Guess
         | something about VS or VS code too.
        
         | allenrb wrote:
         | Busted. Saw this and immediately thought it had to be a Raymond
         | Chen post. Whatever he's getting paid, it probably isn't
         | enough.
        
       | physicsguy wrote:
       | I've been out of C++ for a couple of years now, but
       | std::call_once is totally new to me, despite being in C++11.
       | 
       | It really is a language where if you got 5 different people to
       | write a solution to something you'd get 5 wildly different
       | answers.
        
         | tialaramex wrote:
         | Six, at least. Also at least one of the answers the five people
         | swear they use will turn out to be either Undefined Behaviour
         | or a quirk of one particular compiler/ toolchain.
         | 
         | Like sure, volatile integers _are_ basically just atomic
         | variables with easier syntax... _if_ you are on x86-64 and
         | using MSVC. Otherwise no they really aren 't.
        
         | mihaaly wrote:
         | A nice, related meme:
         | 
         | https://mikelui.io/img/c++_init_forest.gif
        
           | tialaramex wrote:
           | And on that subject https://leanpub.com/cppinitbook - a
           | _book_ just about initialization in C++ which is in some
           | sense (more pages) longer than my edition of K &R ("The C
           | Programming Language").
           | 
           | Despite all this complexity, C++ 23 has problems with
           | mistakenly uninitialized variables _and_ still lacks a
           | coherent strategy to do deferred initialization correctly.
        
           | classified wrote:
           | That GIF should mention the relevant C++ standard, because
           | next year there will be at least one more additional way to
           | initialize.
        
         | moralestapia wrote:
         | I consider that a feature tho.
        
           | tiagod wrote:
           | After working on golang projects for a while, I really like
           | having one obvious way to do things.
        
       | davikr wrote:
       | Is it habitual for Microsoft to help their customers like this?
       | Is there some kind of support or consultancy contract for it?
        
         | tallanvor wrote:
         | Microsoft has probably the largest support organization of any
         | software company. A lot of it is outsourced support that mostly
         | runs through support trees, but enterprises can and do pay for
         | support from actual employees who can actually debug issues and
         | involve developers when needed.
        
       | gnarlouse wrote:
       | I missed it. How big was the vector
        
         | abound wrote:
         | > The m_widgets is expected to have only four widgets, but it
         | somehow found itself with ten, and sometimes as many as a
         | hundred widgets.
        
         | mike_hock wrote:
         | Asking that question is UB.
        
       | WesSouza wrote:
       | It's never lupus. It's always race conditions.
        
       ___________________________________________________________________
       (page generated 2024-01-12 23:02 UTC)