Scott Meyers

aristeia.com · Personal blog · on HN since 2007

Scott Meyers, author of the Effective C++ books, hosts his C++ papers, talk slides, and book information.

What HN saysHN cites his essay on double-checked locking and his books, with commenters recommending Effective Modern C++ for learning to avoid C++ performance problems.
28HN people shared it
21linked it in comments
13stories submitted
107story points
8 months agolast shared
2007people per year2026

Most-shared posts

  1. 1
    C++ and the Perils of Double-Checked Locking (2004) [pdf]
    5 people · 20 points · first shared 2011 · 5 comments on HN
  2. 2
    Advice to Prospective Book Authors (2003)
    3 people · 62 points · first shared 2016 · 8 comments on HN
  3. 3
    The Most Important Design Guideline?
    3 people · 2 points · first shared 2012 · discussion on HN
  4. 4
    Books
    3 people · first shared 2015
  5. 5
    CPU Caches and Why You Care [pdf]
    2 people · 2 points · first shared 2018 · discussion on HN
  6. 6
    Homepage
    2 people · first shared 2015
  7. 7
    The Keyhole Problem (2002) [pdf]
    1 people · 17 points · first shared 2018 · 9 comments on HN
  8. 8
    C++ Program Analyzers
    1 people · 2 points · first shared 2008 · discussion on HN
  9. 9
    Summary of C++0x Feature Availability in gcc and MSVC
    1 people · 2 points · first shared 2010 · discussion on HN
  10. 10
    C vstheVasa2 ups.pdf
    1 people · first shared 2022
  11. 11
    C in embedded
    1 people · first shared 2017
  12. 12
    TR1 info
    1 people · first shared 2009
  13. 13
    Sep95.pdf
    1 people · first shared 2015
  14. 14
    PDXCodeCamp2010.pdf
    1 people · first shared 2021
  15. 15
    Books frames
    1 people · first shared 2007

What HN people wrote when they linked it

mikekchar · 2015-04-23
His webpage: http://www.aristeia.com/ indicates that he has been a programmer since 1972. Even if he has been doing training/consulting for a couple of decades, that leaves a lot of time to get the basics down. I've never met him, though I have browsed one of his books once. My own personal feeling is that books like these can be invaluable for people starting out in the industry. It gives you a reference point to relate to. If he can explain things well and people can understand his writing, then it can be useful even if the person isn't the best living coder on earth. At some point in your development, you need to branch out from what people are saying in books and start to form your own opinions. You have to start questioning what the "experts" are saying and try to experiment with other techniques. It is frustrating when people hang on to certain ideas just because a famous author said it. Sometimes it holds us back. It doesn't make their contribution any less valuable, though, because at least newbies are getting to a certain level due to the well written books.
binarycrusader · 2018-03-06
Scott retired in 2015; I don't know if Scott is still active in terms of lectures/presentations: http://www.aristeia.com/
ComputerGuru · 2011-02-12
Excellent LWN piece, as usual. I just want to point out that there ARE cases where you MUST use volatile in userland. For instance, double-checked locking (see this Scott Meyers essay on DDJ for info: http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf) is only guaranteed to work on the MSCV compiler as of the 2005 release (and others at different versions) with volatile bools (though the same caveats mentioned on LWN will apply): http://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Microsoft…
nickb · 2007-06-03
STL does have a few tarpits and once you know which classes to avid, it's smooth cruising. I recommend Scott Meyer's Effective C++ books if you want to learn how to avoid a lot of C++ performance black holes: http://www.aristeia.com/books_frames.html Yes, the choice of a C++ compiler does make some difference in algo heavy functions/methods but the art of writing high performance C++ programs has a lot more to do with overall design (which is sometimes C++ specific) and your programming style. I left C++ programming but if that's your cup of tea, look into Meyer's books. They're the best. Java guys care because of Java's history: it was always slower than compiled languages and Java dev got a lot of crap for not having fast runtime. That's all history but there's still a ton of people out there who refuse to download Java-based programs because of 'slowness' myth.
j1elo · 2023-08-28
Back in 2015 I read Effective Modern C++ by Scott Meyers [1], which is his latest entry in the saga of "Effective C++" books. It covers all the new stuff that got into the language with C++11 and C++14, and shows how modern C++ can be written. My feeling during the read, and my definite conclusion afterwards, is that I didn't read a collection of new nice additions to the language, but a list of minefields and new fancy ways to crash your program. That there is no chapter which doesn't end up being a list of gotchas. Seemingly every new feature was added as an extension of the language's reputation of being a shotgun that loves your feet. "Oh, now we have lambdas! here are the 32 ways you can fail while using them, and the language will do nothing to help you prevent". Effective Modern C++ is a very well written book and very instructive. Its flaws are none of the book or writer, but of the language itself. [1]: https://www.aristeia.com/books.html
cyber_kinetist · 2022-10-30
There's a looming feeling that C++17 is really going to be the last version of C++ (practically, in production). The Vasa is now half-sunk [0][1], but the alternatives are yet to be truly born. The current issues surrounding the language standards: - The important but half-baked features of C++20 that has never really been polished enough for actual production usage (modules, coroutines) - Unnecessary "hyper-modern" C++ features which are dead on arrival (ranges) - The dramatic increase in build times due to the STL library (which are accelerated by those hyper-modern C++ features) [2] - The fleeing of LLVM/Clang engineers to other projects (as you've said, Apple engineers shifting work to Swift, and Google abandoning Clang and moving to Carbon). - Implosions in the ISO committee (notably the controversy surrounding the rape convict) It's really not looking good, but there aren't that much alternatives so I think people will just stick to C++17 for the moment. Listing the worthwhile competitors: - Rust is a bit too awkward to use in many cases where C++ is used (particularly with unsafe Rust), and inherits some of the hyper-modern complexities/insanities of C++. - Zig is still too unstable, they just finished reworking the compiler - Jai is not even released to the public - D might be a candidate but IMO they should really commit 100% fully for GC-less betterC mode... - Nim still has many warts and unbaked features, and also there was a split in the compiler team…
hartror · 2012-03-05
Scott Meyers (author of Effective C++ et al.) has talked about this subject many times (including in the aformentioned book) and it puts the ball squarely in the Rails team's court. Let's make the reasonable assumption that your clients—the people using your interfaces— are trying to do a good job. They're smart, they're motivated, they're conscientious. They're willing to read some documentation to help them understand the system they're using. They want things to behave correctly. That being the case, if they make a mistake when using your interface, it's your fault. We're assuming they're doing their best—they want to succeed. If they fail, it's because you let them. So, if somebody uses your interface incorrectly, either they're working hard at it (less likely) or your interface allowed them to do something easy that was not correct (more likely). This puts the shoe on the foot not used to wearing it: it means that responsibility for interface usage errors belongs to the interface designer, not the interface user. Source: Scott Meyers: The Most Important Design Guideline? http://www.aristeia.com/Papers/IEEE_Software_JulAug_2004_revised.htm
leoc · 2026-03-10
Another 1990s go at a commercially-released electronic book was Scott Meyer's Effective C++ CD-ROM https://dl.acm.org/doi/10.5555/520985 https://www.aristeia.com/books.html from 1998.
ragnot · 2023-08-23
This paper will help a lot: https://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf tl;dr: Remember that the "new" operator does two operations: allocates memory and fills in the memory with the data. Now, if you have two threads (A & B): - A allocates memory and then gets pre-empted - B will pass the null pointer check and attempt to use the non-filled in memory block
rusanu · 2021-05-03
There are several versions available of Scott Meyers' CPU Caches and Why You care talk: - https://vimeo.com/97337258 - https://www.aristeia.com/TalkNotes/PDXCodeCamp2010.pdf
jfim · 2019-11-23
The loops should be inverted. It should be for y, then for x, which accesses the memory in a linear fashion instead of in stride. This presentation (PDF) explains why: https://www.aristeia.com/TalkNotes/ACCU2011_CPUCaches.pdf
nbaksalyar · 2019-06-01
Thank you, this is very timely: recently I got a cold email from an acquisition editor too and been researching this fascinating topic of writing tech books. :) Some more helpful resources I found: - Advice to Prospective Book Authors from Scott Meyers (of Effective C++ fame): https://www.aristeia.com/authorAdvice.html - "I wrote a book" by Tryggvi Björgvinsson: https://dev.to/trickvi/i-wrote-a-book-lfg - "Writing a technical book" by Ian Miell: https://zwischenzugs.com/2016/05/15/writing-a-technical-book/ - Then there are some good discussion about this topic on HN. You can try searching by keywords like "ask hn + writing a book", e.g.: https://news.ycombinator.com/item?id=14300932
b0sk · 2016-08-10
a bunch of API design guidelines flow from Scott Meyer's famous maxim "Make interfaces easy to use correctly and hard to use incorrectly." http://www.aristeia.com/Papers/IEEE_Software_JulAug_2004_revised.htm
gtani · 2015-09-07
the big 4, 2 very large dense books, and 2 small, very very very dense books: - Lippman et al, C++ Primer, 5th ed - Stroustrup, The c++ Language, 4th ed (which has earlier version "A Tour of" as 1st 150 pages - Meyers "Effective C++", 3rd ed and - "Effective Modern C++" http://www.aristeia.com/books.html (don't dismiss the others cause theyre 14+ years old, either
khuttun · 2015-07-08
Scott Meyers offers his rationale here: http://www.aristeia.com/Papers/C++ReportColumns/sep95.pdf
_delirium · 2011-02-12
From the comments there, this is a pretty good article on why neither volatile, nor anything else in C or C++, necessarily does what people want it to in the multithreaded context: http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf
chipsandkip · 2017-07-20
Yeah, my biggest issue with C/C++ on embedded systems is that it's cumbersome to build useful, safe abstractions of hardware. Almost every manufacturer-provided MCU driver library I've encountered is filled with void* and #define abuse that wouldn't fly in any other type of project. I once worked on a project where some poor soul took the time to provide a zero-cost abstraction, described in a Scott Meyers presentation[1], for every register on an MCU. This resulted in thousands of lines of C++ template classes, which, while hurting compile times, resulted in a really strong, safe and performant API that drivers could be built upon. It was wonderful to use, but all that upfront work isn't realistic for most projects. I'd definitely be interested in a language that supports this type of abstraction "natively" (i.e. doesn't require lots of boilerplate code) while providing C-like performance on bare-metal platforms. I know that some people are trying to make Rust fit this hole but I'm not sure how that's coming along. 1. http://www.aristeia.com/c++-in-embedded.html
haberman · 2014-09-05
Interesting. This appears to solve a more general problem, which is: how to create a barrier against inter-procedural optimization and dead code elimination. I wonder if this trick could also be used to solve the double-checked locking problem. From the quintessential DCLP paper (http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf): Consider again the line that initializes pInstance: pInstance = new Singleton; This statement causes three things to happen: Step 1: Allocate memory to hold a Singleton object. Step 2: Construct a Singleton object in the allocated memory. Step 3: Make pInstance point to the allocated memory. [...] DCLP will work only if steps 1 and 2 are completed before step 3 is performed, but *there is no way to express this constraint in C or C++*. But Colin's pattern here seems to be a way of indeed guaranteeing this. The volatile function pointer is a barrier against inter-procedural optimization: if the function must be called, then step 3 cannot possibly be performed before steps 1 and 2. (There might still be necessary hardware barriers that are missing, and the lack of a memory model for pre-C11/C++11 probably makes it all technically undefined behavior anyway. But the key sequential ordering constraint that was claimed inexpressible in C and C++ appears to indeed be expressible with this trick, if indeed the trick works for guaranteeing a call to memset).
bayareaguy · 2009-01-12
Here are some references I review whenever I need to work with C++. * The GNU C++ Library Documentation - http://gcc.gnu.org/onlinedocs/libstdc++/spine.html * Scott Meyers TR1 Information - http://www.aristeia.com/EC3E/TR1_info.html * Association of C & C++ users - http://accu.org * C++ Library Reference http://www.cplusplus.com/reference/ * Guru of the Week archive - http://www.gotw.ca/gotw/index.htm These are a little older: * Lysator (Linköping, Sweden) - http://www.lysator.liu.se/c/index.html * Brad Appleton's C++ Links - http://www.cmcrossroads.com/bradapp/links/cplusplus-links.html
dmunoz · 2014-04-22
You're asking more specific questions that what I will cover, and they're good ones. It will be interesting to read how others reply. For the other people looking, Stroustrup's A Tour of C++ [0] is the guide for getting quickly up to date with the "new C++", C++11 and onwards. It doesn't specifically cover C++14, but if you understand C++11, the few things coming in C++14 are for the most part minor enhancements to what is in C++11. Scott Meyers should finish up the C++11/14 version of the Effective C++ series this year, and many are waiting for this. For now, his notes Overview of the New C++ (C++11/14) [1] are available for purchase. If you like videos, there is a wealth of information from last years GoingNative conference [2]. More recently, at this years Build conferece, Herb Sutter gave a presentation on Modern C++: What You Need to Know [3]. Finally, come visit up over on reddit in /r/cpp [4]. Some heavyweights in the C++ world participate there, and the larger portion of participants are similarly knowledgeable in C++ as a whole. [0] http://www.amazon.com/Tour-In-Depth-Series-Bjarne-Stroustrup/dp/032195… [1] http://www.aristeia.com/Licensing/personalUse.html [2] http://channel9.msdn.com/Events/GoingNative/2013?direction=asc#tab_sor… [3] http://channel9.msdn.com/Events/Build/2014/2-661 [4] http://www.reddit.com/r/cpp

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