Live data from Hacker News

Brian Kernighan on “The Practice of Programming” [video]

youtube.com

71–80 of 117 posts

Re: Brian Kernighan on “The Practice of Programming” [video]

#71
post #40

Earlier quoted context omitted.

Curious what examples you felt were outdated.

They mention at one point that Java doesn't have a way to pass a function as a parameter to another function. That was added in Java 8 with lambdas. That's just one off the top of my head.

Nit: it's still right. Lambdas are just functor sugar.

Re: Brian Kernighan on “The Practice of Programming” [video]

#72

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?

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]

#73

I wish interviewing now was more about knowing the concepts in that book versus leetcode Brian Kernighan prob couldn’t pass a leetcode hard interview in this ridiculous new world

My last interview cycle I interviewed with some big names (Stripe, Square, Shopify, etc.) and was pleased that none of them asked any LeetCode style questions. All pretty practical programming stuff. Stripe had an interview where they had forked the Jackson Java library, introduced a bug, and then asked me to find and fix it. Pretty unique style, but much more applicable to the actual job of programming.

[deleted]

Re: Brian Kernighan on “The Practice of Programming” [video]

#74

Earlier 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…

No idea what your background is, but since you just bought four books, make sure you're spending more time reading and writing code than reading books. Some people fall into the theory trap and don't spend enough time making use of that theory.

Agreed. Reading books is great if it's replacing Twitter and Reddit time. It's not great if it's replacing coding time.

Re: Brian Kernighan on “The Practice of Programming” [video]

#75

This 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…

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.

Re: Brian Kernighan on “The Practice of Programming” [video]

#76

Earlier quoted context omitted.

They mention at one point that Java doesn't have a way to pass a function as a parameter to another function. That was added in Java 8 with lambdas. That's just one off the top of my head.

Nit: it's still right. Lambdas are just functor sugar.

The only mainstream languages where you can actually pass function references around, without them being sugar for some complex object that the compiler creates are C, C++ and Rust. And it's not trivial to do in Rust.

Re: Brian Kernighan on “The Practice of Programming” [video]

#77

Earlier quoted context omitted.

No idea what your background is, but since you just bought four books, make sure you're spending more time reading and writing code than reading books. Some people fall into the theory trap and don't spend enough time making use of that theory.

Agreed. Reading books is great if it's replacing Twitter and Reddit time. It's not great if it's replacing coding time.

> I'm also approaching this as a technical writer, figuring out what exactly makes Kernighan's books so good.

I am docs lead for https://pigweed.dev

I will probably also eventually post my findings to https://technicalwriting.dev

Re: Brian Kernighan on “The Practice of Programming” [video]

#78
post #25

Earlier quoted context omitted.

We might have to add Elements of Programming Style to our backlog.

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…

Because I was curious: https://en.wikipedia.org/wiki/Arithmetic_IF

It's a three way if statement that scrutinizes a number rather than a boolean, with branches for negative, zero and positive values.

Re: Brian Kernighan on “The Practice of Programming” [video]

#79

I suggest you add Software Tools in Pascal to your list of books to podcast about. Also by Kernighan. I own a copy of that book and think it is good.

Finding 'Software Tools in Pascal' in my local mall bookstore, before I even had access to a computer running Pascal, turned out to be a kind of cheat code for my career. I marveled at the ideas and the writing and it set me up to acquire much of the the rest of the Kernighan canon.

Re: Brian Kernighan on “The Practice of Programming” [video]

#80

I suggest you add Software Tools in Pascal to your list of books to podcast about. Also by Kernighan. I own a copy of that book and think it is good.

You might get more than you bargained for on that topic. Kernighan and Plaugher had written "Software Tools" in RATFOR. Then they wrote "Software Tools in Pascal". And then, in direct response to the experience of writing that, Kernighan wrote a paper titled "Why Pascal Is Not My Favorite Programming Language". (Because writing in Pascal should have been way easier than writing in RATFOR, and it wasn't, and Kernighan…

Just to add to the above; RATFOR (https://en.wikipedia.org/wiki/Ratfor) was implemented as a preprocessor to Fortran with its control structures almost identical to those of C. So going from the freedom of C syntax to the straitjacket of Pascal might have been too much and hence the Pascal paper.

Here is the pdf of Brian Kernighan's paper on RATFOR - http://www.econ.uiuc.edu/~roger/research/repro/ratfor.pdf

Post reply on HN