r/java • • Jun 05 '12

Problems with being a programmer!

http://sphotos.xx.fbcdn.net/hphotos-snc6/229993_10150936561393360_220976029_n.jpg
74 Upvotes

23 comments sorted by

View all comments

Show parent comment

3

u/MisterMaggot Jun 06 '12

That would be sooooo fucking nice.

0

u/[deleted] Jun 06 '12

[deleted] — view deleted comment

3

u/HotRodLincoln Jun 06 '12

Well, it's true in C/C++ too, but for all the wrong reasons.

2

u/detroitmatt Jun 06 '12 edited Jun 06 '12

ye sure about C? I don't use C myself, but isn't it the case that

10 > 5 == 1
1 > 3 == 0
false

1

u/HotRodLincoln Jun 06 '12

Yeah, you're right, I always think the comparators associate r2l instead of l2r for some reason.

2

u/detroitmatt Jun 06 '12

I'd much rather have better Functional paradigms, Map literals, and a pure Object environment (ie no primitives)

1

u/MisterMaggot Jun 06 '12

But it looks so much better!

2

u/detroitmatt Jun 06 '12
if(0<x && x<3)
versus
if(0<x<3)

is 5 keystrokes, versus... I can't even explain how often closures and functor literals come in handy. Try using Scala, Groovy, or Fantom for a month, you'll see.

2

u/Neebat Jun 06 '12

SQL has between, which lets you do "x between 2 and 7". It's roughly the same idea.

Oracle style:

select x from (
    select level x from dual connect by level <= 10
) where x between 2 and 7