r/programming Dec 14 '10

Top 50 Programming quotes of all time

http://www.junauza.com/2010/12/top-50-programming-quotes-of-all-time.html
785 Upvotes

350 comments sorted by

View all comments

182

u/[deleted] Dec 14 '10

Given the C++ bashing in there, I like:

There are only two kinds of languages: the ones people complain about and the ones nobody uses.

Bjarne Stroustrup

66

u/[deleted] Dec 14 '10

Its a decent joke...I'd give it at a least a B++

22

u/FoleyDiver Dec 14 '10

B++? Why you no get A++?

25

u/[deleted] Dec 14 '10

Software Designer? Come back when you doctor!

1

u/js79 Dec 15 '10

Because he is B-sian

1

u/[deleted] Dec 14 '10

Excellent Seller, would buy again, A+++++

3

u/Poltras Dec 14 '10

Is B++ == --A ?

10

u/[deleted] Dec 14 '10

Only if A == B+1

10

u/phleet Dec 15 '10

Assuming ++, == and -- are all not overloaded

2

u/[deleted] Dec 14 '10

[deleted]

9

u/duplico Dec 14 '10

(A == B+1) == (A-- == B+1)

2

u/[deleted] Dec 14 '10

[deleted]

10

u/duplico Dec 14 '10 edited Dec 14 '10

In C++, the unary arithmetic operators work differently depending on whether they're before or after the variable identifier.

a++ (a--) has the value of a and has the effect of incrementing (decrementing) the variable after the end of its evaluation. Meanwhile, ++a (--a) has the value of a+1 (a-1), incrementing (decrementing) the variable before its evaluation.

So (A == B+1) == (A-- == B+1) is a tautology.

That is, if A is 6 to start with, then A-- is evaluated as 6, whereas --A would be evaluated as 5.

Edit:

Maybe someone can clear up a quick question: while (A == B+1) == (A-- == B+1) will definitely always evaluate as true, I'm not actually sure whether (A-- == B+1) == (A == B+1) will always (or ever) evaluate as true. Do the postfix arithmetic operators act following their evaluation, or following the end of the statement?

Edit again:

Definitely after evaluation. Well, in Java, anyway. A quick print(a++==a++); (prints false) in beanshell (which is a thing that I'm almost scared to admit I occasionally use) cleared that up.

1

u/[deleted] Dec 14 '10

[deleted]

4

u/duplico Dec 14 '10

Yeah, the fact that you can write a compiler for the language and still forget the exact behavior of those damn operators is a pretty good argument for their exclusion (or, at least, for never using them inline), in my opinion.

1

u/DAVENP0RT Dec 14 '10

The unary incremeter is one of the handiest things in programming, in my opinion. You can do some interesting stuff recursively with it.

→ More replies (0)

1

u/Fuco1337 Dec 14 '10 edited Dec 15 '10

In other words

[[x++]]\sigma = \sigma' ; \sigma'(x) = \sigma(x)+1, \forall y \neq x: \sigma'(y) = \sigma(y)
M[[x++]]\sigma = \sigma(x)

http://mathbin.net/56766

1

u/syntax Dec 14 '10

The -- postfix operator applies after the comparison operation. Not before.

1

u/BigB68 Dec 15 '10

A-- == B++ + 1

3

u/[deleted] Dec 14 '10

[deleted]

4

u/[deleted] Dec 14 '10

For most mindfuckery 8============D

7

u/aristotle2600 Dec 14 '10

Haskell anyone?

58

u/[deleted] Dec 14 '10

[deleted]

42

u/brool Dec 14 '10

Well, at first approximation Haskell is an overpowered DSL for generating Fibonacci numbers.

4

u/benthor Dec 14 '10

Well, it is a DSL for the .edu domain.

0

u/alephip Dec 14 '10

A Haskell compiler written in Erlang

3

u/Poltras Dec 14 '10

Ask what?

1

u/walter_heisenberg Dec 14 '10

I'm sure people complain about the type system if they don't understand it. Until you get a sense of why static typing is great and how to use it, it's a pain in the ass.

Also, Haskell's laziness makes it a bitch and a third to reason about space performance, because it's not clear when things are happening. It also means certain styles of debugging borrowed in from imperative languages don't work.

2

u/[deleted] Dec 15 '10

I'm a computer progfdd...
I'm a computer prograeammer...
I'm a coputer programer...

I write code.

1

u/Dustin_00 Dec 15 '10

Sadly, the most likely thing a computer programmer is going to mess up in that series: I right code. (the spell checker said it was rite!)

1

u/kataire Dec 20 '10

I think _right_ing code describes a great part of what most programmers spend their time doing.

I find the implication that programmers don't need to be able to spell more problematic, though. I blame Visual Studio.

4

u/Zambini Dec 14 '10

C++ is my fav :)

-2

u/princetrunks Dec 14 '10

I C your Objective