3 ms·
There's this book that I've been mentioning around here called Elements of Programming https://www.amazon.com/Elements-Programming-Alexander-Stepanov/dp/032163
by adamnemecek 10y ago
There's this book that I've been mentioning around here called Elements of Programming
https://www.amazon.com/Elements-Programming-Alexander-Stepanov/dp/032163537X/ref=as_li_ss_tl?ie=UTF8&sa-no-redirect=1&linkCode=ll1&tag=akgg-20&linkId=66e61085fdce329bbcf6f12f2d180b57 https://www.amazon.com/Elements-Programming-Alexander-Stepan... that makes exactly this claim, that we are writing too much code.
It proposes how to write C++-ish (it's an extremely minimal subset of C++ proper) code in a mathematical way that makes all your code terse. In this talk, Sean Parent, at that time working on Adobe Photoshop, estimated that the PS codebase could be reduced from 3,000,000 LOC to 30,000 LOC (=100x!!) if they followed ideas from the book https://www.youtube.com/watch?v=4moyKUHApq4&t=39m30s https://www.youtube.com/watch?v=4moyKUHApq4&t=39m30s
Another point of his is that the explosion of written code we are seeing isn't sustainable and that so much of this code is algorithms or data structures with overlapping functionalities. As the codebases grow, and these functionalities diverge even further, pulling the reigns in on the chaos becomes gradually impossible.
Bjarne Stroustrup (aka the C++ OG) gave this book five stars on Amazon (in what is his one and only Amazon product review lol).
https://smile.amazon.com/review/R1MG7U1LR7FK6/ https://smile.amazon.com/review/R1MG7U1LR7FK6/
This style might become dominant because it's only really possible in modern successors of C++ such as Swift or Rust that have both "direct" access to memory and type classes/traits/protocols, not so much in C++ itself (unless debugging C++ template errors is your thing).
- GregBuchholz 10y agoHave you looked in the STEPS program by Alan Kay? Trying to recreate modern computing setup from the OS up in 20k lines of code... http://www.vpri.org/pdf/tr2012001_steps.pdf http://www.vpri.org/pdf/tr2012001_steps.pdf "If computing is important -- for daily life, learning, business, national defense, jobs, and more -- then qualitatively advancing computing is extremely important. Fro example, many software systems today are made from millions to hundreds of millions of lines of program code that is too large, complex and fragile to be improved, fixed, or integrated. (One hundred million lines of code at 50 lines per page is 5000 books of 400 pages each! This is beyond humane scale.) What if this could be made literally 1000 times smaller -- or more? And made more powerful, clear, simple, and robust? This would bring one of the most important technologies of our time from a state that is almost out of human reach -- and dangerously close to being out of control -- back into human scale." ...and of course if you haven't seen it, you'll want to check out the Forth guys who want to do everything with 1000 times less code: http://www.ultratechnology.com/forth.htm http://www.ultratechnology.com/forth.htm
- adamnemecek 10y agoI'm aware of this but Alan Kay's work and this seem to be orthogonal. Alan Kay talks about reducing real systems that have compilers, inputs etc whereas Elements talks about like the day to day ways of writing code. Alan Kay might come up with a new keyword whose semantics magically lets you cut out 30% but Elements shows you that if you make your types behave certain way, generics will let you cut out a lot of code.
- buzzybee 10y agoI would counter that this appears to be a repeatedly emerging consensus, including Stepanov, Kay, Simonyi, and a number of other "greats", that an approach that involves some degree of metaprogramming, guided by domain problem, is the way forward. They differ on terms - cooperating systems, model-driven, intentional, generic - and focus - whether to create new syntax, or to guide the creation of specific algorithms or data structures - but they aren't debating the power of the approach.
- tnecniv 10y agoI recently picked up this book. Seems quite good, but I'm also mathematically inclined (there's a lot of abstract algebra in there).
- deleted 10y ago[deleted]