
More Good Programming Quotes (2016) - henrik_w
https://henrikwarne.com/2016/04/17/more-good-programming-quotes/
======
combatentropy
"Should array indices start at 0 or 1? My compromise of 0.5 was rejected
without, I thought, proper consideration." — Stan Kelly-Bootle

Thanks for putting in that one in. Stan Kelly-Bootle was one of my favorite
writers. He recently died, but he was a Brit who wrote computer books and folk
songs.

I think people who dual-specialize, in something left-brained and something
else right-brained, are better at both. I've only read parts of one of his
books, a 90s book about UNIX. It was so clear and fun to read while seeming to
break many rules about writing clearly. I'm not sure how it works.

~~~
dspig
0.5 would be good for anti-aliased drawing where you only get non-blurry lines
at the 0.5's :)

~~~
animal531
I can already imagine the pain for when I'm trying to draw an un-aliased line.

------
zyb09
I thought these two were pretty good:

“Bad programmers worry about the code. Good programmers worry about data
structures and their relationships.” — Linus Torvalds

That's how I always feel when people have lengthy discussions about spaces vs
tabs. Good truth coming from the man himself.

“Sufficiently advanced trolling is indistinguishable from thought leadership.”

Kinda scary true, when you see how some online communities, that started
mostly as trolling, became real idiologys over time.

~~~
jwdunne
And on that, I believe Linus uses 8-wide tabs. You are, apparently, doing it
wrong if that causes problems.

~~~
falcolas
Given the ease with which editors resize tabs, and given the problems caused
by excessively nested code: seems reasonable.

~~~
jwdunne
I agree. I use spaces and 2 to 4 depending on typical language style but even
then heavy nesting is obvious.

I have a project full of essentially 'if (true) return true; else return
false;'. Sometimes heavily nested. It's just not necessary.

Guard-style returns go a long way but a long column of those may mask deeper
problems of structure. I don't mean inheritance-polymorphism no-ifs but rather
your code isn't dumb enough and perhaps your data isn't smart enough.

------
joncampbelldev
Very good, although I thought the dynamic typing one was a bit snarky. I'll
happily give up dynamically typed languages like clojure when structural
typing can give me the same flexibility.

I say this as a person learning idris and Haskell and loving it btw, before
anyone prematurely tries to convert me to static typing.

~~~
tome
As a Haskell proponent I'd be really interested to hear specifically what it
is that you'd like to do in Haskell but can't.

~~~
shakna
Write a program that anyone can read. Haskell inevitably ends up looking more
like a mathematical equation than the simpler constructs people are more used
to finding in languages like Clojure.

~~~
SkyMarshal
Haskell is very readable if you learn to understand the type declarations,
which are nicely set on their own line above every function definition.
Haskell allows very general type declarations, but ideally once you've gotten
your program running, you go back and make the types more specific. Anyone
reading it can then see exactly what the whole codebase does without even
reading the functions.

~~~
tome
I'd be even stronger. Haskell's the most readable language I've ever used, and
I was an early (ish) adopter of Python mostly because of readability.

~~~
43224gg252
Can you link to a small Haskell code base or single file that you believe is
"more readable" than any other language?

~~~
tome
I'll link to some of my own code, since I know it better than any other

[https://github.com/tomjaguarpaw/haskell-
opaleye/blob/master/...](https://github.com/tomjaguarpaw/haskell-
opaleye/blob/master/src/Opaleye/Internal/PrimQuery.hs)

For someone who knows Haskell idioms this is _extremely_ readable compared to
functionally equivalant code in another language.

~~~
joncampbelldev
How easily extendable is that without the original source (e.g. when using as
a library)? From what I can see it looks like if you can't edit the case
statements you can't extend the functionality (e.g. expression problem stuff).

However, I'm not a haskell pro, so I don't know if I'm just missing the
obvious here.

~~~
tome
Very easy! And that's (one reason) why it's written the way it is. Any
PrimQueryFold can be extended to a fold on a type which extends PrimQuery with
additional constructors.

------
neilparikh
Some of my favourite quotes are from Alan Perlis's Epigrams on Programming
[0].

My (current) favourite: "A programming language is low level when its programs
require attention to the irrelevant."

[0] - [http://www.cs.yale.edu/homes/perlis-
alan/quotes.html](http://www.cs.yale.edu/homes/perlis-alan/quotes.html)

~~~
happy-go-lucky
My favorite: "Everyone can be taught to sculpt: Michelangelo would have had to
be taught not to. So it is with great programmers."

~~~
jplayer01
God, what bullshit. Even Michelangelo started with the basics and had to put
in a huge amount of effort to master his craft. He had to learn.

------
Kenji
> _“When your hammer is C++, everything begins to look like a thumb.” — Steve
> Haflich_

As someone who works with C++ every day on my job, this made me laugh out
loud. I think I'm gonna write this one on our whiteboard on Monday.

------
ronilan
I like this quote: "'Even a single quoted word can be a "double-edged sword"'
she said. 'You can't "escape" that'. He didn't."

------
christophilus
Thanks for posting. This gave me a good laugh:

– What do we want?

– Now!

– When do we want it?

– Fewer race conditions!

@wellendonner

~~~
quickthrower
That made me belly laugh

------
leodelang
Focus is a matter of deciding what things you’re not going to do. (John
Carmack)

------
hliyan
Harold Abelson — 'Programs must be written for people to read, and only
incidentally for machines to execute.'

------
seodisparate
"When stuck debugging, question all of your assumptions about the program."

A shower thought. Helpful if the program does something other than what you
thought it did, allowing you to figure that out quicker.

~~~
mjevans
More a reflection of insufficient logging telemetry at higher inspection
(debugging) levels.

If you have the above and still can't figure it out, maybe you're looking at
too much. Sometimes it can help to isolate which stage things appear to go off
the rails and then turn up the detail when you've got an idea where to start
the search.

------
p0nce
Perlis's Epigrams are my favourite. [http://www.cs.yale.edu/homes/perlis-
alan/quotes.html](http://www.cs.yale.edu/homes/perlis-alan/quotes.html)

"When we write programs that 'learn', it turns out that we do and they don't."

I still wonder what he means when he says: "Everything should be built top-
down, except the first time. ". What is different the first time that warrants
not to do it?

~~~
tomsmeding
In my experience with my own projects, building top-down only works if you
already know how the lower-level components will be structured. Else you'll
inevitably end up overengineering the lot.

------
ianamartin
Many of these are good. I agree with joncampbelldev. The dynamically typed
quote is quite snarky.

To that I'd reply: Statically typed languages are when you have to tell a
computer that 2 is an integer and 'two' is a string.

I know this argument goes back and forth and never ends. And I'm not trying to
start a flame war.

But I will say this: type systems occupy a space on a spectrum in my opinion,
and the spectrum is imperative vs. declarative languages.

It's a conceptual spectrum, of course. And the difference is between telling
the language exactly what you want and how you want it vs. telling the
language what you want to get.

On one end you have C# as the avatar of strongly and statically and imperative
languages. In the middle, you have something like Python that is strongly
typed but dynamic, and at the far end, you have SQL, which is as strong or
weak as you define your tables as well as entirely declarative. You can choose
your own adventure with databases.

You have some bad citizens like JavaScript and PhP, but the conversation is
really about the use-case.

IMO, strong typing is far more important than static typing. Because I
personally can't stand silent errors. Weak type systems are the root of all
evils. Anything that can fail silently is dead to me. Fuck you, <language>.
Tell me if something broke. Don't just quietly do something I don't expect.

Which approach to use to me depends on the team and the size of the project.
You can run with Python for small teams. You really can't for large teams. You
really shouldn't use C# for rapid prototyping or small teams.

But you absolutely should a statically typed language for large teams.

Edit to put the sharp in my example of statically and strongly typed language.

~~~
tome
You are making a fair comparison of dynamically typed languages (Python, Lisp,
Clojure, ...) to badly statically typed languanges (C, C++, C#, Java, ...).
What's missing from your analysis is a comparison to well statically typed
languages (Haskell, OCaml, F#, ...).

~~~
ianamartin
I thought I was talking about the principal of static typing, rather than any
language's implementation of it.

Back to my original point, if you have tell your language that 2 is an
integer, well, that is a certain kind of issue with that. And if you don't
have to tell it that, then there's another issue that happens.

I don't know Haskell or OCaml beyond toy programs, and I'm willing to hear
things beyond my knowledge. But as far as I do know, the point doesn't change.

I'm happy to eat my words and learn.

~~~
Sharlin
The GP's point was that "good" statically typed languages have type inference
and indeed do not need to be told that 2 is an integer and "two" is a string.
It is pretty orthogonal to the question of dynamic vs. static typing.

In C++:

    
    
        auto i = 2;
        auto s = "two";
    

Scala:

    
    
        val i = 2;
        val s = "two";
    

C#:

    
    
        var i = 2;
        var s = "two";
    

Rust:

    
    
        let i = 2;
        let s = two;
    

and so on. Note that these are not dynamically typed bindings - you cannot
later assign a string to i, or an integer to s.

However, these are examples of _local_ type inference where the compiler
simply deduces the type of a variable binding based on the type of the bound
expression (although Scala and Rust type inference is actually somewhat more
general than that). Haskell, on the other hand, has _global_ type inference
where the compiler considers the whole program when assigning types to
bindings that are not explicitly annotated. However, some arguably useful
capabilities of a type system such as subtyping and implicit conversions make
global type inference a much more difficult problem to solve.

------
fani_pack
"I've been using Vim for about 2 years now, mostly because I can't figure out
how to exit it." @iamdevloper

------
hyperpallium
1\. The bug is not in the section of code you’re looking at.

2\. Rule #1 is of no practical use.

 _Philip Roe on debugging CFD codes_

------
WalterBright
"The double is cast." \-- Julius C'ster

~~~
WalterBright
"I came, I coded, I crashed." \-- Julius C'ster

------
lou1306
[Warning: spoilers ahead]

> "Debugging is like being the detective in a crime movie where you are also
> the murderer."

So, essentially Memento?

~~~
falcolas
Given how so many programs operate (little global state, minimal information
passed between blocks of execution), there are definitely some parallels.

------
WalterBright
"I think that I can safely say that nobody understands template mechanics."
\-- Richard Deyman

------
WalterBright
"Great, just what I need.. another D in programming." \-- Segfault

------
dwarman
"That which _can_ be configured _must_ be configured. Corr: defaults aren't.

(mine, inspired by WIndows 1.0 and it's only got worse since).

------
fefe23
Why oh why do fans of agile programming and dynamic languages always hide
behind snarky epiphets from other people?

This imbalance is, in my mind, the greatest reason why people still prefer C
and Java over Clojure and other hipster languages. The feeling that those
people must be overcompensating for something, just look at how they feel the
need to talk down on others all the time.

In the left corner, you see snarky hipsters complaining about how all security
problems would go away if only everybody stopped using C, and if people
dropped their methods and adopted agile / XP / scrum / other fad of the week.

In the right corner, you see C programmers writing code in the waterfall
model.

I'm much more attracted to the right corner. Not because C or waterfall are
great. Because of the (to me) juvenile unprofessional behavior of the people
in the left corner. You see, I'm a programmer. I'm attracted to people who are
programming. Not to people who are telling others how not to lead their lives,
while appearing to produce scant noteworthy code themselves.

Compounding this is that OP is leaving a link to his own blog here. And this
blog post is basically "here are some things other people said that I happen
to agree with". I learned nothing.

BTW: The very same behavior makes me think highly of postgresql and less
highly of nosql databases. My instinct tells me to trust people who don't feel
the need to trash-talk others.

EDIT: to stay with the theme of the post: I always liked "Don't learn the
tricks of the trade. Learn the trade."

EDIT: To win me over, don't tell me my stuff is bad. Show me that your stuff
is good.

~~~
icebraining
The only quote in there regarding dynamic vs static is one disparaging
_dynamic_ languages. Also, the complaint about C is about it being too weakly
typed, not about it being statically typed.

~~~
tome
I think fefe23 may have been referring to these responses:

[https://news.ycombinator.com/item?id=14825901](https://news.ycombinator.com/item?id=14825901)

[https://news.ycombinator.com/item?id=14826072](https://news.ycombinator.com/item?id=14826072)

~~~
icebraining
I don't think so, as none of those used "snarky epiphets from other people".

~~~
tome
fefe23 said " _hide behind_ snarky epiphets from other people" (my emphasis)
suggesting that the criticism of dynamic programming was discounted because it
was snarky.

~~~
mcphage
That's not what "hiding behind X" means. It means to use X to distract people
from yourself / your own positions. So here hiding behind scary epithets would
mean using snarky epithets to counter criticism of dynamic languages.

~~~
tome
I know that's not what it means, but in the absence of knowledge regarding
whether fefe23 is a native English speaker I think the interpretation I gave
of his/her comment was a reasonable one.

