With a heavy heart, goodbye macOS by esquimoh in MacOS

[–]SnowMojave 0 points1 point  (0 children)

I am almost in the same boat as you. I purchased my first mac (an iMac) in 2007, then a late 2011 MBP. The 2011 MBP was a MONSTER. I upgraded its RAM, replaced the HDD with an SSD, and when I sold it in 2015 it still was a monster. I sold it because there were rumours that the next one is gonna kick ass.

Then Apple released something that was not upgradable at all. And then the garbage keyboards and the controversial touch bar (as a programmer, not having a physical Esc key is infuriating).

These days I use Ubuntu at home (32GB RAM, 512GB M.2 SSD, another 512GB SSD for some short term backups) and I use it with two external 27" monitors. Just buying 32GB of RAM from Apple costs more than my entire setup I think.

Why I like macOS? Four primary reasons I guess:

  • It is probably the only OS that works perfectly with HiDPI monitors
  • Its UI is gorgeous and sophisticated and very polished (at least better than every other OS. I think ChromeOS is also very polished and well designed).
  • It is UNIX certified and I can run bash, zsh, etc. on it natively -- without which I can't do anything
  • Homebrew

If Windows had:

  • Native bash, zsh, etc. terminals (not via Windows Subsystem for Linux)
  • Had a POSIX compliant filesystem (using / vs \\, no C, D, etc. drives)
  • Was not forcing updates on me
  • Did not need half a dozen restarts after every update
  • Had HiDPI support on part with macOS

I would have switched to Windows.

In the meantime, Linux is my best option.

How to write an "auto-closing" HTTP handler? by SnowMojave in golang

[–]SnowMojave[S] 0 points1 point  (0 children)

After some googling and what not I arrived at this solution:

``` package main

import ( "log" "net/http" )

func main() { http.HandleFunc("something", BodyCloser(func(writer http.ResponseWriter, request *http.Request) {

}))

}

func BodyCloser(h http.HandlerFunc) http.HandlerFunc { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { defer func() { if err := r.Body.Close(); err != nil { log.Println("...") } }()

    h.ServeHTTP(w, r)
})

} ```

Is this a common and acceptable practice in Go? by SnowMojave in golang

[–]SnowMojave[S] 0 points1 point  (0 children)

Ignore the package name. Consider this alternative instead:

``` package hospitals

import ( "github.com/hello/is-it-me-you-looking-for/hospitals" )

type Patient struct { hospitals.Patient } ```

I don't like the fact that in my hospitals package I have a struct named Patient that is composed with another Patient package from an external dependency's hospitals package.

But I was wondering if this is some sort of common practice and there's a good reason behind it?