Obviously people are going to disagree, but this weblog gives me a way to gripe about things that annoy me, and damnit, I'm going to use it.
Why oh why do people like to put their curly braces on their own lines? You waste a whole line for one character. For whatever reason I've seen this style used all over the place lately. Its use in this article just pushed me over the edge to where I'm now posting about it, but it was this article on continuations in web apps as well as someone else's code I've been working on that have made me so frustrated. Here's an example from that continuations article:
1: if (zone=="A")
2: {
3: if (qty >= 100)
4: {
5: discount=0.1;
6: }
7: }
8: else if (zone=="B")
9: {
10: if (qty >= 200)
11: {
12: discount=0.2;
13: }
14: }
What a waste:
1: if (zone=="A"){
2: if (qty >= 100) discount=0.1;
3: }else if (zone=="B"){
4: if (qty >= 200) discount=0.2;
5: }
But even if it was a more conventional:
1: if (zone=="A"){
2: if (qty >= 100){
3: discount=0.1;
4: }
5: }else if (zone=="B"){
6: if (qty >= 200){
7: discount=0.2;
8: }
9: }
That's still much better. The less physical space code takes up the easier it is to take in at one glance, and therefore the easier it is to comprehend. It's a shame to waste a precious line for a mere curly brace.
new⇒Perl 6 1.0 in March?
Doh, my mistake. I'm aware of therelation between Parrot and Rakudobut I'...
Keith: Dec 2, 1:03am