Less Encapsulation With Object-Oriented Programming

A look at the apparent contradiction of following object-oriented principles leading to tight coupling.

type Writer interface {
Write(p []byte) (n int, err error)
Chmod(mode FileMode) error
Chown(uid, gid int) error
Fd() uintptr
Name() string
Stat() (FileInfo, error)
Stat() (FileInfo, error)
Chown(uid, gid int) error
engine := "RD-180"
thrust := 3830
fmt.Fprintf(file, "%s has thrust %0.1f\n", engine, thrust)
RD-180 has thrust 3830.0
file.Fprintf("%s has thrust %0.1f\n", engine, thrust)

The Java Non-Solution

scanner := bufio.NewScanner(file)
for scanner.Scan() {

The Unix Pipeline

Universal Abstractions

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store