Top all-time · #1423
Musing Mortoray
Personal blog · mortoray.com · on HN as mortorayprogrammingwriting
Musing Mortoray is a personal blog at mortoray.com about programming and writing. Since 2012, 48 different Hacker News readers have linked it 149 times, most often “The string type is broken”. It is still writing: the last post was on 2026-10-30, and you can follow it by feed.
Too few sampled comments (12) to say how often HN recommends it.?
Why HN links it
HN readers link Mortoray's posts on string types, exception costs, CORS, rounded-rectangle rendering and browser sandboxing. Commenters cite them as sources for points on programming design and web security.
Summarised by Claude from a sample of 12 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- The string type is broken3 people · 3 mentions · first linked 2013-11-27
- The Internet Lottery for Content Creators2 people · 3 mentions · first linked 2019-03-13
- What is the length of a string? A tricky question2 people · 3 mentions · first linked 2016-05-16
- Fast build turnaround time is essential2 people · 2 mentions · first linked 2015-08-11
- The very real mess of virtual functions2 people · 2 mentions · first linked 2016-08-10
- Can a language be safe?2 people · 2 mentions · first linked 2012-07-02
- The hard part of error handling is not the error itself2 people · 2 mentions · first linked 2015-12-03
- Why I don’t use a Parser Generator (2012)2 people · 2 mentions · first linked 2017-08-12
- I don’t know how to create a website2 people · 2 mentions · first linked 2018-07-09
- Why I’m not a fan of pair programming2 people · 2 mentions · first linked 2017-08-11
What Hacker News says?
Some historic articles on software rendering (the original Bill Atkinson stuff) https://www.folklore.org/Round_Rects_Are_Everywhere.html http://wg20.criticalcodestudies.com/index.php?p=/discussion/... A modern 3D accelerated article (using SDF as another commenter suspected) https://mortoray.com/quickly-drawing-a-rounded-rectangle-wit...
Comment linking /quickly-drawing-a-rounded-rectangle-with-a-gl-shader/
on “So you think you know box shadows?”Submitted Why aren't AI companies being charged for hacking? as a story · 336 points
HN discussionWhat are you talking about? How is unused imports related to library versioning? And how is focusing on improving build times orthogonal to " building "? The concern with build times is to make building while developing faster [0], how is that related to " releasing "? Your points are tangential at best, and nonsensical otherwise. [0]: http://mortoray.com/2015/05/06/fast-build-turnaround-time-is...
Comment linking /2015/05/06/fast-build-turnaround-time-is-essential/
on “Go 1.6 is Released”Submitted The string type is broken as a story · 302 points
HN discussionThis pre-AI article makes a very similar argument: https://mortoray.com/programming-wont-be-automated-or-it-alr... Once we realize that what we actually want is turning specifications into software, I think that English will become the base for a new, high level specification language.
Comment linking /programming-wont-be-automated-or-it-already-has-been/
on “AI coding”Submitted Programming won’t be automated, or it already has been as a story · 191 points
HN discussioninteresting article, although unfortunately it mentions but doesn't currently cover one of the more mis-understood parts of CORS, which is the Access-Control-Allow-Credentials part. The fact that Access-Control-Allow-Origin: * doesn't work with Access-Control-Allow-Credentials, for example, is something I've seen sites get wrong quite a lot. there's a good post which covers it https://mortoray.com/2014/04/09/allowin…
Comment linking /2014/04/09/allowing-unlimited-access-with-cors/
on “Demystifying CORS”Submitted Sadly, I must say goodbye to Leaf, my programming language as a story · 183 points
HN discussionIn a compiler's intermediate representation, exceptions are typically modeled as multiple returns. E.g. in LLVM the `invoke` op specifies a label to go to if an exception is returned http://llvm.org/docs/LangRef.html#invoke-instruction By the time this reaches the backend, the exception handling is usually converted into "zero cost" exceptions where raising an exception calls a handler which uses a lookup table to w…
Comment linking /2013/09/12/the-true-cost-of-zero-cost-exceptions/
on “Size cost of C++ exception handling on embedded platforms”Submitted Invented here syndrome as a story · 155 points
HN discussionWriting exception-safe code is non-trivial. There has been a lot of debate recently about whether exceptions are a mis-feature. The main worry is that if you allow exceptions sensible-looking code can lead to many non-obvious bugs. This link gives some insight: http://stackoverflow.com/questions/1853243/c-do-you-really-w... Some more reasons why exceptions are problematic: http://mortoray.com/2012/04/02/everything-w…
Comment linking /2012/04/02/everything-wrong-with-exceptions/
on “On Go”Submitted What’s to love about C? as a story · 139 points
HN discussionWriting tac in C++ is trivial: std::deque<std::string> lines; for (std::string line; std::getline(std::cin, line); ) lines.push_front(line); for (const auto &line : lines) std::cout << line << std::endl; // Note that I typed this quickly off the top of my head: I'm willing to believe there is a trivial typo the compiler would catch, but the overall implementation should be fine ;P. As for ohce, you have defined a ve…
Comment linking /2013/11/27/the-string-type-is-broken/
on “Announcing the C++ FAQ”Submitted A Failed Experiment with Python Type Annotations as a story · 127 points
HN discussionstruct and few functions and you get there. Look at zig's std lib. "String" type is also IMO anti-pattern https://mortoray.com/the-string-type-is-broken/ People often complain about null terminated "strings" in C, but I don't really see them as a problem. It rarely is performance bottleneck, and when it is you can opt for your own "string type". There is also bstring that's compatible with these strings but prepend…
Comment linking /the-string-type-is-broken/
on “C++ creator rebuts White House warning”Submitted Fix your crappy ads and I’ll stop blocking them as a story · 95 points
HN discussionI wish COWL went as far as this proposal for domain sandboxing: http://mortoray.com/2014/09/30/a-secure-and-private-browser-... I know Google would never agree to do something like that - unless Mozilla, Apple (the new "privacy" company) and Microsoft (another one pretending to defend user privacy) would put pressure on Google by adopting such a system, together.
Comment linking /2014/09/30/a-secure-and-private-browser-sandbox/
on “COWL: A Confinement System for the Web”Submitted Invented here syndrome (2015) as a story · 89 points
HN discussionLooks like that what Tcl means by 'string', the author names 'text' ? What does Tcl mean by 'character' ? See for instance, the author's HTML example : > Combining characters can create an accented version of that symbol, <̧. In text this is clearly a different symbol: it’s a distinct grapheme cluster. The HTML parser doesn’t care about that. It sees code #60 followed by #807 (combining cedilla). It thus sees the op…
Comment linking /2016/04/28/what-is-the-length-of-a-string-a-tricky-question/
on “We don't need a string type (2013)”Submitted Wait-free queueing and ultra-low latency logging as a story · 81 points
HN discussionThe author has these followup blogposts : 2013 : https://mortoray.com/2013/11/27/the-string-type-is-broken/ 2014 : https://mortoray.com/2014/03/17/strings-and-text-are-not-the... (See also : https://thehardcorecoder.com/2014/04/15/data-text-and-string... ) 2016 : https://mortoray.com/2016/04/28/what-is-the-length-of-a-stri...
Comment linking /2016/04/28/what-is-the-length-of-a-string-a-tricky-question/
on “We don't need a string type (2013)”Submitted Why I don't use a parser generator as a story · 72 points
HN discussionI agree my initial examples were not clear enough to illustrate the problem precisely. I've added a section now about idempotance and how this slight varation in floating point is causing my original problem. Your point about floating point not having exact values is precisely the issue, and that is what my added example tries to demonstrate. My previous article, linked from the intro, about floating point tries to…
Comment linking /2015/07/06/essential-facts-about-floating-point-calculations/
on “The trouble with 'floor' and 'ceil'”Submitted High-Throughput Game Message Server with Python WebSockets as a story · 68 points
HN discussionThis is a followup to my article "The string type is broken" http://mortoray.com/2013/11/27/the-string-type-is-broken/
Comment linking /2013/11/27/the-string-type-is-broken/
on “Strings and Text are not the same”Submitted Ride the carousel of folly with a Python migration as a story · 65 points
HN discussionMainly, there are 3-4 reasons for considering alternatives to using booleans: 1. Booleans are primitive types without rich domain-specific information or context. When using true/false, it can be more beneficial to employ more descriptive options such as AnsweredYes/AnsweredNo, PositiveResult/NegativeResult, LightsOn/LightsOff, or UserOnline/UserOffline. Mixing and matching booleans of different domain types can lea…
Comment linking /get-rid-of-those-boolean-function-parameters/
on “What If? Driven Development”Submitted Get rid of those boolean function parameters (2015) as a story · 60 points
HN discussionSubmitted Get rid of boolean function parameters as a story · 54 points
HN discussionSubmitted I don’t know how to create a website as a story · 47 points
HN discussion