homebrew update on Mac: /usr/local not writable

Sometimes the most obvious solution isn’t so obvious

On my work MacBookPro laptop I issued the following Terminal Command:

brew update

it promptly came back:

 Error: /usr/local must be writable!

 

Doing a little web Googling and Face-2-Face conversing here in shop I learned the solution:

  • change ownership the to your current user :> whoami
sudo chown -R $(whoami) /usr/local
  • When this is successful re-execute brew update
brew update
  • When complete revert ownership of /usr/local back to root
sudo chown -R root /user/local

 

BAM – Homebrew update is happy, obviously 🙂

Some material for this post leveraged from github forum:  https://github.com/Homebrew/brew/issues/476

NULL Is bad : Using Optional in Java 8

Oh man has the argument against using NULL come out strong in event years.

It started with the inventor of null, Tony Hoare, calling it the Billion Dollar Mistake in 2009.

And everyone has piled on since. No one likes the NullPointerException.

See this tweet, showing everyone is jumping on this bandwagon. https://twitter.com/yegor256/status/835854965721694212

This blog author decided to take on this argument from a different angle, somewhat amusing, still thought-provoking:  Optional Method Parameters via @DZone

 

 

Java 8 Optional

My shop is considering development paths and frameworks.

One Framework path I am evaluating is a homegrown library, small and specific in nature, built on top of Google Guava.

Here is a quick GitHub writeup explaining the issue around null, and how the Guava framework developers avoid it:

https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained

Reading my DZone blogs today the top article was this very topic, demonstrating the use (in code) of ‘Optional’, which has made it’s way into the Java 8 VM.

https://dzone.com/articles/java8-optionals-overview-with-examples?edition=272883&utm_source=Daily%20Digest&utm_medium=email&utm_campaign=dd%202017-02-23

And beware of those NULLs!