I warn you though, this is a philosophical and painstakingly detailed intro in to this way of thinking that takes an entire series of videos to build up a single algorithm, in C++, bit by bit, episode by episode. It also happens to be one of my favorite lecture series.
I like Stepanov, he shows integrity. And I'm ever grateful for his influence on C++.
I'm also fairly experienced, having spent the last 30 years or so writing code. Every kind of code you can think of in any language. Which means I'm fairly used to juggling abstractions.
But I just couldn't crack this one, I lack the motivation needed to work this elevation for extended periods of time. I need some kind of real-world connection now and then to make sure what I'm learning is at all useful.
I got the book when it just came out, and haven't tried since, but I'm pretty sure the problem persists. I have even less patience with academic abstractionitis these days.
I would be very interested to learn how and why people find the information contained in the book useful.
After reading this book, I built a high throughput, multi-threaded processing system in C++ that didn't use any mutex because I was able to define my operations as both commutative and associative. Because I was able to start thinking at that level thanks to this book it led me to a better design of my system.
It's worth reading, you will get something out of it! But it is a lot of work!
Do you mind maybe explain how you were able to communicative and associative props to avoid using semaphores/mutex?
There seems to be a lot of complaints here about the formality of it all. My preference is usually for more formal literature, just because it tends to lend for a more powerful tool for me. With that said, did you find it to be too formal?
those properties allow you to divide up work on data in a way that guarantees that no two processes will work on the same data at the same time. You can then take data, divide it up, use 'const correctness' in the language to guarantee original data doesn't change and then you don't need a mutex because you know only one thread is working on that piece of data.
A typical approach is if you can divide your algo into map/reduce, you can do this. Going back to the properties of you computation allows you to reason how to apply something like map/reduce.
Agreed here- was very excited about this book, bought it as soon as I heard of it. Then I opened it, and it was intense. I joined a study group set up by I can't remember exactly who but was fairly "famous" in C++ circles, and while I got through the first few chapters, it was really difficult, and also, really hard to find a use for.
Its one of the few books that are sitting on my shelf waiting for the day I give it another go, but I really doubt that day is coming.
I was interested to see if my memory was correct- the group was set up by David Abrahams. Which then sent me down a rabbit-hole of why has he seemed to have faded from the scene the last few years? It seems he has been working on Swift for Apple since 2013.
Its amazing how well gmail works, instantly finding emails from ten years ago.
This was a tough one for me as well, but I appreciated it as a kind of mind-bending exercise. I plan on checking it out again this year to take another crack at it.
As someone who’s largely self taught, I was fascinated by the concepts around modeling the complete input and output space of a program, and being able to fully reason about its correctness. I also liked the elegance of some of the approaches.
I guess overall I’d say that it’s a nice way to stretch out of the comfort zone, and think about programming in a different way than a lot of us learned.
This book is non-trivial. Programmers without a background in Mathematics should take care not to be intimidated by the formalism and lose heart while studying this book (i myself have not finished it). Some knowledge of Discrete Mathematics, Logic and in particular; Abstract Algebra are prerequisites. I can recommend https://www.amazon.com/gp/product/0201179571/ref=dbs_a_def_r... for the reqd. background. It is one thing to know mathematical concepts and quite another to know how to apply it to programming. That is where this book comes in.
OMG, that's great. i have the follow-up book, from mathematics to generic programming -- hardcore read for someone who is no expert at maths or cplusplus but still a phenomenal read.
i have had elements of programming on my wishlist for a while and saw the price skyrocketed on amazon. the book is being sold used for $200+ on amazon right now. i am just going to get the lulu paperback because that's a steal right now. big fan of Alexander Stepanov.
I had bought the Kindle edition a few years ago because of recommendations, but still haven't read it as I am supposed to read it all (and prove theorems) in order to understanding the motivation. Could someone briefly say why the book contains what it contains?
Thanks
While you won’t have any trouble finding “From Mathematics to Generic Programming,” you may be interested in the book’s website, http://www.fm2gp.com/ , which includes a sample chapter and links to interviews about the book, including one with Lakos:
“John: ... How — and please be brutally honest — would you contrast your experiences of co-authoring a book with Dan versus Paul?
“Alex: The goals of the books were quite different. Both books have their place.
“Paul convinced me that it is essential to write a very formal treatise in order to unambiguously define the foundations of generic programming. He thought that the conversational style of my lectures undermines the seriousness of the subject. I agree with him. We wrote a very terse, but — in my opinion — elegant book. Some people appreciate it; but it is clearly not for everyone. I am very grateful to Paul. He is and will always remain my close friend. I would gladly collaborate with him on another book.
“Dan had a different idea. He thought that what was needed was a more accessible book, and I agree with him as well. And he led the work in such a direction. I would love to collaborate with him on another book as well.”
This book is really good, really dense but the ideas have inspired a generation.
In this video, Sean Parent, at the time working at Adobe on Photoshop, estimated that if PS codebase followed ideas from this book, the codebase could be reduced from 3,000,000 LOC to 30,000 LOC.
Stepanov's work on the STL was revolutionary. I personally came to mathematical programming via the Dijkstra/Scholten route, but this is an excellent work at an unbeatable price.
If you mean something that's influenced my way of thinking: not a book, but some transcribed lectures: On the meanings of the logical constants and the justifications of the logical laws by Martin-Lof [0]
If you mean something that takes a very mathematical approach to deriving programs: Algebra of Programming by Bird and de Moor [1]
It seems clear that theories of software should continue to develop this level of formalism if we ever hope to trust it with our lives (eg software-piloted automobiles, safety mechanisms, nuclear technology, etc).
Imagine if car manufacturers had formal proofs of their claims regarding self-driving car software and it’s predictability / reliability. This is not a situation for trial-by-error.
Thank you very much for posting the link! This book is phenomenal. The prices for previous editions were pricing me out; now ordered a paperback for myself.
"Efficient Programming with Components" - https://www.youtube.com/playlist?list=PLHxtyCq_WDLXryyw91lah...
"Programming Conversations" - https://www.youtube.com/playlist?list=PLGvfHSgImk4Y1thqJLpcS...
I warn you though, this is a philosophical and painstakingly detailed intro in to this way of thinking that takes an entire series of videos to build up a single algorithm, in C++, bit by bit, episode by episode. It also happens to be one of my favorite lecture series.