4 ms·
SQLite: A Lesson In Low-Defect Software (review/summary w/ working source)
- alecco 17y agoPrevious related discussion at: http://news.ycombinator.com/item?id=633151 http://news.ycombinator.com/item?id=633151 "How SQLite is Tested."
- DanielStraight 17y agoThis is awesome stuff, but the fact still remains that for a lot of software, it just doesn't matter if it crashes occasionally. I'm not saying you shouldn't test. I'm saying that not all projects (and probably not even most) require the same degree of reliability and testing that SQLite requires.
- elviejo 17y agoSQLite has said that: "it is a replacement for text file, not Oracle" That seems like a very humble goal, and yet they strive for that level of quality. The reason why it is done with quality is because the developers really wanted to.
- deleted 17y ago[deleted]
- rarrrrrr 17y agoSQLite is used by OS X Mail, Firefox, and plenty of other widely deployed apps. With that many users, even the most obscure branches get exercised. Finding the bugs through internal testing is a better life than reading end user trouble tickets all day.
- gaius 17y agoYep, it is by a considerable margin the most popular open source database in the world, despite what the MySQL might crowd claim.
- SwellJoe 17y agoSQLite is always the first project that springs to mind when people ask those, "What's the most beautiful/robust/clean/well-designed/effective piece of code you've worked with?" kinds of questions. I used it way back in its very earliest incarnation to deal with a BerkeleyDB based project that had gotten too relational for its own good, and it was an absolute joy. One of those shining moments of, "This is what software development is supposed to be like." The level of friction in development (and the lines of code) just fell away at a ridiculous rate, and I finished the long overdue project within a few hours of the switch to SQLite. (This was an extreme case, and borne of my own ignorance of the problem domain and having never used relational databases and not recognizing when my problem was a relational one, but it sticks in my memory, nonetheless, and SQLite gets most of the credit.)
- whopa 17y agoWell, the internals of SQLite are far from beautiful or clean. I do agree that the external interface is very nice to use, and the docs are actually useful.
- SwellJoe 17y agoAre you a C coder? I can't imagine any experienced C coder would say that of SQLite. It's a beautiful codebase. Among the best I've ever seen, if not the best.
- whopa 17y agoYes, I am a C coder. The variable names use awful Hungarian notation, but are often otherwise tersely named beyond that. It could use more whitespace to signify logical blocks instead of running all the logic in a function together. It's well commented except for the confusing parts, like the concurrency logic and the memory management, which seems rather backwards. By contrast, both the Linux kernel and WebKit are far more beautiful codebases than SQLite, and also deal with far more complexity. If SQLite's the best you've seen, you haven't really seen much...
- 17y ago
- stevoski 17y agoGood stuff. After the bullet points, this seems to basically be saying, "unit tests with 100% coverage" and "bounds checking" make for good software. I think these are only two of many techniques for improving code quality. Code reviews, in my experience, are also a huge plus.
- rivo 17y agoI don't get some of the analogies in the presentation. Like, how can I run a music production with an iPod? I'm also not so sure the sides of the brain comparison really captures what they want to say.
- lupin_sansei 17y agoNice interview with the SQLite author here from a year or so back http://www.twit.tv/floss26 http://www.twit.tv/floss26