Kernighan is also a co-author of The Go Programming Language book, at least of the 1st edition.
Is that why Go forces K&R brackets instead of letting you choose?
Brian Kernighan on “The Practice of Programming” [video]
91–100 of 117 posts
Re: Brian Kernighan on “The Practice of Programming” [video]
#92Earlier quoted context omitted.
Is that why Go forces K&R brackets instead of letting you choose?
Maybe you already know this and your comment was in jest, but the real reason is that the Go lexer automatically inserts semicolons ( https://go.dev/doc/effective_go#semicolons ) using heuristic rules which forces the opening brace to be on the same line.
Re: Brian Kernighan on “The Practice of Programming” [video]
#93Earlier quoted context omitted.
One of the great things about The Practice of Programming is how much it references other non-coding works. You can tell Kernighan draws his knowledge from many sources, not just technical ones.
Well one does wonder, where did the icons like BK pick up their own craft? Surely there were no programming books before computers. Which shoulders did our giants stand on?
Math(s) background is one guess I can make. Based on the fact that many of those pioneers had a basic degree in math and then pivoted (heh) into computer science. In fact some of them started before computer science was even a formal thing.
Re: Brian Kernighan on “The Practice of Programming” [video]
#94Earlier quoted context omitted.
Just ordered the true Gang of Four: * The C Programming Language * The UNIX Programming Environment * The Practice of Programming * The Elements of Programming Style I've read the C book before and also remember the writing to be excellent. I'm sure I'll pick up lots of programming wisdom but I'm also approaching this as a technical writer, figuring out what exactly makes Kernighan's books so good. I have a hunch tha…
In fact if you disregard the contents and preface, the very first words in The Elements of Programming Style are a quote from The Elements of Style, "It is an old observation that the best writers sometimes disregard the rules of rhetoric. When they do so, however, the reader will usually find in the sentence some compensating merit, attained at the cost of the violation. Unless he is certain of doing as well, he wil…
in startups, _ _ _.
fill in the blanks.
suggestions:
disrupting
changing the world
more efficient
productivity
cost savings
people savings
hardware unsavings
...
Re: Brian Kernighan on “The Practice of Programming” [video]
#95Earlier quoted context omitted.
Just ordered the true Gang of Four: * The C Programming Language * The UNIX Programming Environment * The Practice of Programming * The Elements of Programming Style I've read the C book before and also remember the writing to be excellent. I'm sure I'll pick up lots of programming wisdom but I'm also approaching this as a technical writer, figuring out what exactly makes Kernighan's books so good. I have a hunch tha…
To your first three above, add Marc Rochkind's Advanced Unix Programming and Richard Stevens' Advanced Programming in the Unix Environment and you have got yourself a complete course in C/Unix programming which is the bedrock for everything else; C is the "lingua franca" and Unix (via its variants) the "standard" OS. Tip: Many of these old books can be had for cheap as used copies on Amazon/Betterworldbooks etc.
Somewhat over the top comment.
I may be an even stronger proponent of C and Unix than you, partly because I grew up on them, and partly because I like them, although they have their share of issues.
Still, calling them the bedrock and standard is too much. There are other alternatives. Until Android and IOS based systems boomed, Windows outnumbered Unix and Linux systems by a huge factor, which I cannot even estimate.
Re: Brian Kernighan on “The Practice of Programming” [video]
#96Earlier quoted context omitted.
Also his earlier slim Writing Efficient Programs book. What this teaches you is how to think about efficiency from the top down with an emphasis on Algorithm and Language and hence useful to all programmers. Pair it with modern books on efficiency which deal mainly with compiler-level/OS-level/Processor-level performance techniques by Agner Fog, Fedor Pikus etc. and you get a complete picture.
>with an emphasis on Algorithm and Language did you mean algorithms and data structures?
Algorithms and Data Structures always go together (like Yin/Yang) and hence i did not spell that out. At the time the book was written Structured Programming techniques and control structures were somewhat new and people wondered whether it was possible to really write efficient programs using these in a high-level language. In the preface/introduction itself Bentley points this out and says he is looking at efficiency at the "Design Level"(various) and thus you have chapters like "Modifying Data Structures" (Time vs. Space) and "Modifying Code" (mainly Loop rules) which show one how to transform code in the same language to a better form (we know this today as helping the compiler generate better object code). As he points out in the book; people forget the constant factors in big-oh and much efficiency can be had by tweaking this.
This is particularly true nowadays since there are so many interpreted/vm-based/jit-compiled/scripting languages where with some "under the hood" knowledge you can get good performance just by source level transformations.
Re: Brian Kernighan on “The Practice of Programming” [video]
#97Earlier quoted context omitted.
To your first three above, add Marc Rochkind's Advanced Unix Programming and Richard Stevens' Advanced Programming in the Unix Environment and you have got yourself a complete course in C/Unix programming which is the bedrock for everything else; C is the "lingua franca" and Unix (via its variants) the "standard" OS. Tip: Many of these old books can be had for cheap as used copies on Amazon/Betterworldbooks etc.
>you have got yourself a complete course in C/Unix programming which is the bedrock for everything else ; C is the "lingua franca" and Unix (via its variants) the "standard" OS. Somewhat over the top comment. I may be an even stronger proponent of C and Unix than you, partly because I grew up on them, and partly because I like them, although they have their share of issues. Still, calling them the bedrock and standar…
Nope, i meant exactly what i said. The point is not popularity/commodity but understanding a domain from the foundations.
I am one of the oldies who started with (in chronological order) MS-DOS, a brief foray into Mainframe COBOL, 16-bit Windows (Windows 3.1) to 32-bit Windows (Windows NT 3.51 & 4), then to Solaris/Linux and all using C/C++. So i had actually programmed in Windows before Unix. There was only Dave Cutler's book on the Windows NT kernel then with everything else being only on programming the GUI subsystem (Charles Petzold and Jeffrey Richter were the notable ones) whereas in the Unix world you had Maurice Bach/Marshall Mckusick/etc. books explaining the kernel and Marc Rochkind/Richard Stevens/etc. explaining how to program it. I still remember reading the 1st edition of Rochkind's book (there were only around a dozen system calls then and the book was less than 200 pages i think) and understanding everything (Unix was a simple monolith then) while Windows was made up of a kernel+various subsystems and it was rather hard to understand what was what. And through it all C was the common "glue" lingua franca which allowed one to program all of them.
The above situation persists to this day in spite of the explosion of languages/OS/Architectures. A knowledge of C/Unix will allow you to understand and program any system be it bare-metal/kernel-level/app-level/system utilities. You may not need it at your job but a knowledge of C/Unix (you don't have to become an expert) will give you a solid bedrock to hang your higher level understanding on. It will also make your transition to other languages/OSes easier since you will have a good understanding of what is going on underneath.
Re: Brian Kernighan on “The Practice of Programming” [video]
#98This book is foundational; all Programmers (especially beginners) should read it. Like all Kernighan's books, the language is simple, concise and precise focusing on the foundations/essentials with no fluff and all in a little over 200 pages. Understand the principles from the examples shown here and then apply them in your own context. The beauty of K&P's books is that they do not overwhelm you with theory but show…
As someone who has been programming professionally for 10 years - what would I gain from reading this book? Not to sound snarky but genuinely wondering what makes it a 'must read' for people who are comfortably coasting in their careers
I have been programming since the early 90's and can assure you there is more knowledge in these sort of books from certain authors than most of the books being published today.
The book brings together a lot of aspects to Programming some of which may seem obvious but still have nuances to think about. It also teaches you advanced ways to think about your design (eg. the "Notations" chapter i mention in another comment) where you make your code simpler and elegant by inventing simple DSLs/VMs for parts of your problem. It is this "holistic" view of programming that i think is so essential to understand.
Re: Brian Kernighan on “The Practice of Programming” [video]
#99Earlier quoted context omitted.
Well if you're interested, the Elements of Programming Style, to me, was interesting for two reasons. It presents plenty of timeless insights about programming, but it's also very interesting as a historical document; it argues against old-fashioned GOTO-based programming in favour of structured programming, and for-loops executing 0 times, for example. It has a list of rules of thumb at the end, which contains my fa…
Sounds interesting! We're trying to figure out if we should be focusing on more modern books even if they're "unproven" or classics even if they're outdated. Sometimes reading the classics can be a lot of fun because, like you said, they serve as historical documents. As someone who started their career a lot later, it's crazy to me that GOTO used to be in style, but I suppose for it to fall out of style there had to…
Do all four: modern / classic x proven / unproven.
Choose based on your gut feel plus logic plus reader suggestions.
Why live by constraints? ;)
Re: Brian Kernighan on “The Practice of Programming” [video]
#100Earlier quoted context omitted.
Just ordered the true Gang of Four: * The C Programming Language * The UNIX Programming Environment * The Practice of Programming * The Elements of Programming Style I've read the C book before and also remember the writing to be excellent. I'm sure I'll pick up lots of programming wisdom but I'm also approaching this as a technical writer, figuring out what exactly makes Kernighan's books so good. I have a hunch tha…
To your first three above, add Marc Rochkind's Advanced Unix Programming and Richard Stevens' Advanced Programming in the Unix Environment and you have got yourself a complete course in C/Unix programming which is the bedrock for everything else; C is the "lingua franca" and Unix (via its variants) the "standard" OS. Tip: Many of these old books can be had for cheap as used copies on Amazon/Betterworldbooks etc.
The book predates important developments like epoll/kqueue, so is it really a good recommendation today? Are there more modern alternatives?