News for hackers. Stuff that matters.
Re:Ask HN: A Book or Course to Learn Code Quality/Structure? by hayst4ck on Friday December 16, 2022 @12:17AM (#34010685)
> I feel like if I worked at a big company and stared at good code all day long I would have learned a lot by now.

I promise you good code is extremely developer dependent and there are many senior engineers in big valley that write horrible code.

This guy's blog is all about writing extremely boring code (my take):

http://misko.hevery.com/code-reviewers-guide/

I've read pretty much everything that wasn't framework specific and it is definitely the most enlightening source of information on how to code I've ever read.

Everything roughly boils down to one guiding principle: don't use global state.

Re:Ask HN: A Book or Course to Learn Code Quality/Structure? by Exuma on Friday December 16, 2022 @11:43AM (#34016689)
Awesome thanks! I will read that PDF
Re:Ask HN: A Book or Course to Learn Code Quality/Structure? by hayst4ck on Friday December 16, 2022 @12:24PM (#34017342)
FWIW, that page itself is a tactical summary of what the guy thinks.

Until you understand:

  Draw object graph then execute the program
  Object lifetimes, and their relationship with each other
  Dependency injection
  What is global state
  testability = good architecture
  hard to test = bad architecture (and why)
Then you probably haven't read enough of his stuff yet.

It's the blog posts themselves that are the gold:

http://misko.hevery.com/2008/08/01/circular-dependency-in-co... http://misko.hevery.com/2008/08/29/my-main-method-is-better-...

http://misko.hevery.com/category/advice/ http://misko.hevery.com/category/uncategorized/