Charles Miller
fishbowl.pastiche.org · Personal blog · on HN since 2007
Charles Miller, a software engineer, writes about web security, programming practice, and how engineers argue and work.
What HN saysHN users point to his persistent login cookie best-practice post as a reference when implementing logins, and also link his other essays.
61HN people shared it
21linked it in comments
52stories submitted
600story points
6 months agolast shared
2007people per year2026
Most-shared posts
- 1Understanding Engineers6 people · 65 points · first shared 2007 · 9 comments on HN
- 2Persistent Login Cookie Best Practice6 people · 27 points · first shared 2010 · 28 comments on HN
- 3Charles' Rules of Argument (2004)4 people · 6 points · first shared 2011 · 1 comments on HN
- 4Simplicity isn't simple3 people · 8 points · first shared 2015 · discussion on HN
- 5The Java Deserialization Bug2 people · 80 points · first shared 2015 · 29 comments on HN
- 6I don't care. It's not my problem2 people · 5 points · first shared 2016 · discussion on HN
- 7Charles Miller on Google/Verizon2 people · 2 points · first shared 2010 · discussion on HN
- 8The Curse of ' (2003)2 people · 2 points · first shared 2009 · discussion on HN
- 9The Internet, and Understanding Users2 people · 1 points · first shared 2010 · discussion on HN
- 10Hypocrisy is the greatest luxury2 people · first shared 2010
- 11The Two Things about Computer Programming1 people · 138 points · first shared 2010 · 90 comments on HN
- 12What web developers thought of in the noughties as being MVC doesn't scale1 people · 80 points · first shared 2014 · 77 comments on HN
- 13Hi, I'm a Mac… Beep, beep1 people · 45 points · first shared 2008 · 14 comments on HN
- 14The String Memory Gotcha (2005)1 people · 45 points · first shared 2010 · 11 comments on HN
- 15The Death of Blogging1 people · 13 points · first shared 2015 · discussion on HN
What HN people wrote when they linked it
danielstudds · 2013-04-24
Finding the same thing with node.js, I got started OK with passport thanks to the examples for passport-local: https://github.com/jaredhanson/passport-local/tree/master/examples, especially express3-mongoose-multiple-files.
Beyond that though, I've had to hack a fair bit to get "remember me" working (following the practices suggested http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-b… and http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_p… so not exactly straight-forward. (Aside: the remember me example for passport local might not be production ready, see http://stackoverflow.com/questions/16136712/is-an-authtoken-when-using…
Also would love to hear what others are using!
yummyfajitas · 2012-10-11
Neal Stephenson has a great quote on this (from the Diamond Age):
"You know, when I was a young man, hypocrisy was deemed the worst of vices. It was all because of moral relativism. You see, in that sort of a climate, you are not allowed to criticise others--after all, if there is no absolute right and wrong, then what grounds is there for criticism?
"Now, this led to a good deal of general frustration, for people are naturally censorious and love nothing better than to criticise others' shortcomings. And so it was that they seized on hypocrisy and elevated it from a ubiquitous peccadillo into the monarch of all vices..."
http://fishbowl.pastiche.org/2006/03/21/hypocrisy_is_the_greatest_luxu…
whichdan · 2011-08-08
I'd be interested in hearing how other people on HN implement persistent logins. I'm currently working on it, following "Charles Miller's Persistent Login Cookie Best Practice"[1], but hearing some other opinions/techniques would be great.
[1] http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_p…
singer · 2010-11-07
You could store an encrypted username and password, or a session id if you don't want to store the username and password locally. Storing the password locally is not the best idea, but it's easier than tracking a session id.
http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_p…
http://jaspan.com/improved_persistent_login_cookie_best_practice
baxter · 2009-12-01
JavaScript is a beautiful language with much more to it than just the DOM API. You seem to suggest that this is JavaScript's only strength. In fact it could be argued that the DOM API is the single greatest problem with JavaScript in the browser[1].
It's true that different languages have different problem domains for which they are well suited. I would say that projects such as Node.js[2] prove that JavaScript has applications outside of the browser.
[1] http://fishbowl.pastiche.org/2009/02/20/the_dom_stigma/
[2] http://nodejs.org/
e12e · 2016-02-24
The sibling comment alludes to parsing calendar events (possibly .ical files). In general you need it for any kind of (de)serialization -- and as the recent java deserialization bug[1] (along with similar bugs in python, ruby) illustrates -- even in a mature language, "common practice" might not be "best practice" (everyone should've known that the various uses of blind deserialization was a bad idea -- but that doesn't really matter after the fact -- lots of high-profile libraries were completely broken). So "just use a library" might not be possible.
Any time you take native objects/data and persist them, or marshal them, you need a parser -- or a parser library. That might mean reading some CSV, parsing some XML, reading some YAML, JSON or what-not.
Then there's configuration that does more than set some variables, like for Nginx, Apache (web server), etc.
One might want to have a short-hand for defining templates -- either for general meta-programming, or just to generate a layout-language (eg: html, css). If you're doing markdown (or markdown-like) processing, you might want to have some assurances that that's all that code can do -- generate html. Or you might want do meta-programming on some higher level, like generating interfaces for some java-beans based on a CSV structure. For more on meta-programming in Java, I recommend (the now slightly dated: http://www.amazon.com/Program-Generators-Java-Craig-Cleaveland/dp/0130… ). It's a shame he didn't name it as he…
boredguy8 · 2010-04-29
Neal Stephenson, "Diamond Age"
"You know, when I was a young man, hypocrisy was deemed the worst of vices," Finkle-McGraw said. "It was all because of moral relativism. You see, in that sort of a climate, you are not allowed to criticise others--after all, if there is no absolute right and wrong, then what grounds is there for criticism?"
...
"Now, this led to a good deal of general frustration, for people are naturally censorious and love nothing better than to criticise others' shortcomings. And so it was that they seized on hypocrisy and elevated it from a ubiquitous peccadillo into the monarch of all vices. For, you see, even if there is no right and wrong, you can find grounds to criticise another person by contrasting what he has espoused with what he has actually done. In this case, you are not making any judgment whatsoever as to the correctness of his views or the morality of his behaviour--you are merely pointing out that he has said one thing and done another. Virtually all political discourse in the days of my youth was devoted to the ferreting out of hypocrisy.
...
"We take a somewhat different view of hypocrisy," Finkle-McGraw continued. "In the late-twentieth-century Weltanschauung, a hypocrite was someone who espoused high moral views as part of a planned campaign of deception--he never held these beliefs sincerely and routinely violated them in privacy. Of course, most hypocrites are not like that. Most of the time it's a spirit-is-willing,…
thaumaturgy · 2008-07-17
I initally intended to read 100 random Reddit threads, counting posts containing blockquotes with those not, and counting total inflammatory posts in either case.
I've done four now and I'm getting really antsy.
I'd love to come up with an algorithm to automate this, but discerning a troll post from an inflammatory post from an informative post algorithmically is an Engineering-Very-Hard problem [http://fishbowl.pastiche.org/2007/07/17/understanding_engineers_feasib…
Anyway, of the four, so far the results have been surprising: Out of 457 total read comments, there were only 25 blockquotes. Of the 25 blockquotes, there were 5 that I (totally subjectively) considered "inflammatory", either because of a strong personal attack, or because of a deliberate misquote of the author ("FTFY"). I only counted 15 inflammatory posts not containing a blockquote -- clearly, I wasn't counting comments that were just lame, tired repetitions of a meme, lacking content, etc.
Because the sample set's so small, there isn't enough information for statistical significance one way or the other. However, in [http://www.reddit.com/info/6s09o/comments/], I did notice that there was a pattern where posts containing blockquotes in a thread tended to be longer, better written, more precise responses to the previous comment. The thread might devolve into a pedantic debate between two people, but it was still more of a discussion than many of the other threads that didn't contain blockquotes at…
mechanical_fish · 2008-01-04
Permit me to ramble for a bit.
There is no idea so great that a one-sentence description, made by a stranger, will cause me to send an email asking for more. There are too many scammers, cranks, and clueless people in the world. There are too many people who have no idea how hard it is to complete a successful project. There are too many people who are looking for something for nothing.
Of course, you folks are strangers, and yet you got me to give you some design advice -- twice! But you did quite a bit of work for this "free" advice -- you had to build an entire prototype site and post a link to it. That is the kind of presentation -- a working, criticizable prototype -- that might get people interested in joining a random project. It's a lot more than one sentence.
Read this essay:
http://fishbowl.pastiche.org/2005/05/08/finding_discord_in_harmony
and this more recent one, that cites it:
http://www.codinghorror.com/blog/archives/001017.html
Other than providing working code -- or extensive mockups, or a detailed written proposal, or a compelling story -- the easiest way to get me interested in a collaboration is to get me interested in you. I don't care if you plan to cure cancer -- I want to know who you are, first. That takes time, and it takes words.
So, if people are going to meet and start collaborations on your site, you need to give them lots of room to converse, to get to know each other. You need to give them long comment threads and rambling discussions.…
johnnyanmac · 2026-05-20
> The First Law: Every forum is always in a state of constant decline.
> All forums start off good, enjoy a "honeymoon period" in which they continue to be good, and then steadily decline... from the point of view of each individual observer...
https://fishbowl.pastiche.org/2005/11/20/charles_rules_of_online_forum…
I like this first law better.
bin_bash · 2022-02-08
Relevant: https://fishbowl.pastiche.org/2005/08/12/the_head_first_girls_double_l…
I've noticed this stock photo on various flyers over the years too
shiggerino · 2015-03-08
I think it grew out of very much the same idealism that still drives Ted Nelson to this date. I guess to unify all of human knowledge to reach a higher form of understanding just isn't on most people's mind. Not even those whose day job it is to do just that, as is my experience from dabbling in academic publishing.
This reminds me of an old blog post, Charles’ Rules of Argument [1]:
“5. DO NOT argue with Lisp programmers, believers in the Semantic Web, or furries”
1. http://fishbowl.pastiche.org/2004/03/21/charles_rules_of_argument/
aboodman · 2014-12-06
The opposing viewpoint:
http://fishbowl.pastiche.org/2002/02/12/xslt_is_the_spawn_of_satan/
roel_v · 2014-03-20
Depends on what you call 'quite easy'. In the terminology of http://fishbowl.pastiche.org/2007/07/17/understanding_engineers_feasib… , it's still a 'hard' problem. There are tens of thousands if not an order of magnitude more objects and reflections of that size in the ocean.
It certainly is not a 'computer vision 101' project. 'Computer vision 101' is 'do edge detection using opencv', not 'build a complete system that interfaces near-realtime with satellite imagery sources that can do very detailed analysis, but without a real definition of what we're looking for, on huge amounts of data'.
reustle · 2014-03-17
For those who have never seen one, here is a picture http://fishbowl.pastiche.org/archives/pictures/three-apple-mice.jpg
EvilTerran · 2012-04-11
"... when your alarm goes off the next day, just get out of bed ... Just get the hell out of bed ... It's just self discipline."
http://fishbowl.pastiche.org/2003/10/07/just_is_a_fourletter_word/
http://c2.com/cgi/wiki?JustIsaDangerousWord
http://www.oreillynet.com/onlamp/blog/2003/08/cant_you_just_redux.html
Or, for a more specific counterpoint,
http://news.ycombinator.com/item?id=3828794
brehaut · 2010-07-20
I prefer fishbowl's law
Every regexp that you apply to a particular block of text reduces
the applicability of regular expressions by an order of magnitude.
- http://fishbowl.pastiche.org/2003/08/18/beware_regular_expressions/
The minimum any programmer needs to know about regexps is when they are applicable, and more importantly, when they are not.
ubernostrum · 2010-02-12
Charles Miller today commented on this:
http://fishbowl.pastiche.org/2010/02/12/two_steps_forward_two_steps_ba…
And mentioned his own anecdote:
http://fishbowl.pastiche.org/2003/10/09/the_internet_and_understanding…
Choice quote:
URLs. Bookmarks. Changing your homepage. All of these things were voodoo.
As he points out, claims that people are more "savvy" today than they were then probably don't hold up; if anything, users back then probably were more knowledgeable on average, simply by virtue of even having Internet access.
shawn_allison · 2009-12-07
Thanks for your feedback!
In regards to the issue of ' I didn't include it based on compatibility issues and this article's opinion http://fishbowl.pastiche.org/2003/07/01/the_curse_of_apos/
I did totally forget to include " and it will be added in an update later today.
A search box may be something I will implement in the future, but for now I do feel the dataset is small enough that people should be able to find what they need quickly enough. The suggestion is noted though.
Thanks.
DanielStraight · 2009-08-24
I'm a big fan of "non-trivial" myself, especially after reading http://fishbowl.pastiche.org/2007/07/17/understanding_engineers_feasib…
briancooley · 2008-09-15
Industry software "engineers" trained up in trade schools or worse, without any awareness that they are reimplementing solutions (poorly) to problems that were solved decades ago...and we get...horrible industrial monstrosities like Java
Since Guy Steele coauthored both the Lambda Papers (late 1970's) and the first three editions of the Java specification, I don't think that you can successfully argue that awareness of anything solved by Lisp or Scheme was a problem in the development of Java.
I always got the impression that the goal with Java was to make bad programmers better, not to create the ultimate language (e.g., see http://fishbowl.pastiche.org/2004/03/17/halfway_between_the_gutter_and…
To use a golf analogy, consider cavity back irons. The average golfer, who struggles to hit it straight, will likely play a lot better with cavity backs. But a really good golfer won't be able to shape shots easily and will feel hamstrung without his blades.