Print Story And the bells were ringing out for Listless Day
Diary
By yicky yacky (Wed Jun 07, 2006 at 08:06:28 AM EST) World Cup, code (all tags)

Inside:

  • World Cup Prediction Challenge: Put your trouser where your mouth is.
  • The most irritating indentation style evar [Don't lie to me; I know some of you use it].
  • Regular Expression Fight: Perl versus C (libpcre).


World Cup Mystic Meg

So: As cannot have been escaped, The World Cup Of All Things Football is finally upon us. The newspapers and magazines are full of players, pundits and pop stars vomiting forth their ill-informed opinions on who will win what and how each team will fare.

Well, we're just as good as their kind of scum, so there's nothing preventing us doing it, too. Post your predictions below, so that, in five weeks time, we can all have a good chuckle about how ludicrously off-the-ball we all were. Predictions can range over anything you like (commentators having coronaries, tourist attacks, most disgraceful fans etc.), but should at least include a guess at who the overall winners will be, plus an estimation of how your home nation will fare (Rogerborg and gpig caveat: if they qualified).

Nobody likes sticking their neck out, so I'll get this ball rolling:

  • Winners: The Argies. Hardly a controversial proposition, but not the Brazilians, at least. Why? They've got just as much skill as the Brazilians, have a more rigorous defensive mentality, have the will to cheat, have developed inner grit, most of them play in Europe, they've a great team mentality - and Carlos Tevez. And Messi. And Riquelme. And Crespo. And Sorin. etc.
  • England's prospects: Much like the rest of the country, I think this is hard to predict as it depends on the form and fitness of the Rune-child. If Rooney doesn't play (and the team is largely the same as that which walloped Jamaica at the weekend) there's a large part of me which genuinely thinks they won't get out of the group. However: If they get out, they'll either die against the Argies in the quarters or, if they avoid the Argies, get to the semis.
  • Crazy arbitrary prediction number one: The Czechs won't do shit. Yes: They're ranked number two (2nd) in the world, but they'll die on their arse this time. Nedved's been underperforming, Baros is heinously over-rated and their defence looks creaky. Even the US (5th) might beat them in the group stage.
  • Batshit arbitrary prediction number two: The Aussies will come second in Group F. Not Japan. Not Croatia. The colonial crims.

 


 

The indentation chestnut

Coders often love to argue about indentation and brace styles - indeed, some people here may have bones to pick over the way I formatted some of the code in the next section, especially the many-parametered function calls.

Code style is one of those things everyone has a preference over but, in reality, most hackers can happily read most styles, so don't really care that much. An indentation style is nothing more than a way of formatting code layout, to reflect scope and structure. It is usually expessed most through the positions of the braces ('{' and '}'), and the indentation.

If given the choice, I tend to use what's known as K&R style (aka OneTrueBrace style). It looks like this:

if (conditional) {
    code
    code
    code etc.
}

A lot of the code I see uses the so-called Allman style (aka BSD style), like so:

if (conditional)
{
    code
    code
    code etc.
}

In truth, there isn't a vast amount of difference between these two styles - just the location of the opening brace - and you can often see people using combinations of the two. For instance, in what I call 'Stroustrup style', people use K&R for conditionals and loops, but Allman style for functions and methods.

Some of the more esoteric ones I'd come across include Whitesmith's style:

if (conditional)
    {
    code
    code
    code etc.
    }

and GNU style, which is kind of a half-way house between Allman and Whitesmith's:

if (conditional)
  {
    code
    code
    code etc.
  }

There are various rationalizations for criteria which cover style, including vertical space conservation, code scope determination, semantic connotations of code placement etc. Until this morning, I had never come across the following style in my day-to-day work, but now I have:

if (conditional) {
    code
    code
    code etc.
    } // end brace goes here! Why, sweet Jesus, would you ever fucking do such a thing?

According to wikipedia, it's called 'Banner Style', maybe because Bruce came up with it when he was cross. It's a travesty. Yeah, it looks innocuous enough there, but imagine how it looks with nested loops and conditionals. Even something not-very-complicated gives completely the wrong impression:

for(i = 0; i < foo; ++i) {
    for(j = 0; j < bar; ++j) {
        if(my_monkey->eats_nuts) {
            while(the_tree->has_nuts) {
                eat(my_monkey, the_tree->nuts);
                }
            }
        }
    }

Completely. Bloody. Useless.

 


 

Perls in the C

Just how do you check for the existence of needle and retrieve it from "Haystackhaystackneedlehaystackhaystack" (where needle may itself be a regular expression and hence not amenable to a straight substring search)?

 

Doing it with Perl

my $subject = "Haystackhaystackneedlehaystackhaystack";
my $tok;
if ($subject =~ /\w*(needle)\w*/)  {
    $tok = $1;
}

 

Doing it with C in one of the most terse but legal ways possible (avoiding dynamic allocation and all things malloc)

#include <stdio.h>
#include <string.h>
#include <pcre.h>

#define OVEC_SIZE 9

static const char haystack[] = "Haystackhaystackneedlehaystackhaystack";
static const char reg_exp[] = "\\w*(needle)\\w*";

char *tok;
int toklen;

int find_needle() {
    
    pcre *re;
    int re_res;
    int ovec[OVEC_SIZE];
    const char *re_error;
    int re_erroffset;
    const int options = PCRE_MULTILINE;
    
    re = pcre_compile (
        reg_exp,
        options,
        &re_error,
        &re_erroffset,
        NULL
    );
    
    /* Essentially a debug - it means regexp compilation failed */
    if(re == NULL) {
        /*
        * Print a "regexp compilation failed" message ...
        * Examine the error returns if need be ...
        */
        return SOME_KIND_OF_FAILURE;
    }
    
    re_res = pcre_exec(
        re,
        NULL,
        haystack,
        strlen(haystack),
        0,
        0,
        ovec,
        OVEC_SIZE
    );
    
    pcre_free(re);
    re = NULL;
    
    /*
    * 2 == number of pattern matches - one for entire match, one for the capture
    * group. If we've got two matches, it means the parenthesis pattern matched.
    */
    if(re_res < 2) {
        /* No match found ...*/
        /* Examine results if need be ...*/
        return SOME_KIND_OF_FAILURE;
    }
    
    tok = (char*) haystack + ovec[2];
    toklen = ovec[3] - ovec[2];
    
    return SOME_KIND_OF_SUCCESS;
}

/*
* Throw in proper error checking and run-time dynamic allocation and this gets
* a lot, lot longer.
*/

Obvious lesson for today: If you can use perl for text processing, do use it.

< A Day in the Life | BBC White season: 'Rivers of Blood' >
And the bells were ringing out for Listless Day | 53 comments (53 topical, 0 hidden) | Trackback
My prerdictions by jump the ladder (4.00 / 2) #1 Wed Jun 07, 2006 at 08:14:07 AM EST
  1. Germany: even if they look total shit, they have a habit of overperforming at most tournaments plus they have home advantage
  2. England: first knock-out stage. Rooney plays but is still unfit, gets fustrated, gets sent off and we get knocked out by Poland.
  3. France won't get past the group stages
  4. Australia will get to quarter finals.




IAWThesePosts by DesiredUsername (4.00 / 2) #2 Wed Jun 07, 2006 at 08:30:53 AM EST
2) ObK&RRules

3) I was just talking about compiled vs scripting languages yesterday because I've been working with scripts for a few years now and now I'm on a small compiled project. Holy Xist, it takes like 10 lines to do the simplest thing in C/C++. It makes zero sense whatsoever to use a language like that for a UI anymore. Backend processing, possibly, but you'd better have a good reason for needing the speed because you are going to pay through the developer's nose to get it.

---
Now accepting suggestions for a new sigline


Amen by TurboThy (4.00 / 2) #4 Wed Jun 07, 2006 at 08:38:23 AM EST
Python all the way.
__
You can't fix anything, you can't change anything, so just tell them that everything is A. The Fuck OK. —Rogerborg
[ Parent ]

3 by yicky yacky (2.00 / 0) #8 Wed Jun 07, 2006 at 08:53:01 AM EST

What propmpted section 3 is that I'm in the middle of rewriting something which was an ad hoc collection of Perl and Python scripts into a coherent C application because the brute speed (repetative known-algorithm float crunching), for once, is needed.

The long-winded part is getting the old configuration data into the app, not the processing itself. It ended up as a two-and -a-half-thousand line function much like the C-section above, to cover something like seventeen configuration parameters. Ridiculous.

Your point stands even more solidly when you consider that vast swathes of mozilla / firefox are actually a combination of XML and ECMAscript running through a couple of central engines. The ECMAscript engine is the same one that runs page code, but with a few more objects accessible.


----
Done.
[ Parent ]

Why do you hate America? by ReallyEvilCanine (4.00 / 2) #3 Wed Jun 07, 2006 at 08:34:14 AM EST
I like Whitesmith and GNU, but Banner is Teh. Bestest. Stile. Evar. for me. When I look at nested code I'm looking at each "container" much like a group of Russian nested dolls. With Banner format I can quickly see the exact boundaries of that "container" without having to count or read through a dozen times. It's very handy if your editor does columnar selects.

My World Cup predictions:





Nebbish Predicts by nebbish (4.00 / 2) #5 Wed Jun 07, 2006 at 08:40:02 AM EST
I really don't know how well England are going to do, but I think we're going to do OK. I'll have a better idea after watching Saturday's match. Owen's a concern for me. If he can't up his game we're fucked. I don't think Rooney should play, he won't be fit even if his toe is.

African nations are going to do shit in this World Cup, which is a shame.

I seriously think the US is going to suprise us all. Semi-finals maybe? Seems like a long-shot but I can feel it in my waters.

There's going to be a lot of bizarre refereeing. It will tarnish the tournament.

Brazil to win.

--------
It's political correctness gone mad!


England will draw on Saturday by Dr H0ffm4n (4.00 / 5) #25 Wed Jun 07, 2006 at 11:18:03 AM EST
Everyone will panic. Then England will win all other group matches.
Everyone will get their hopes up, "England may just do it this time". England will scrape through to the semis with a 'valiant, tenacious effort'.
Everyone will be on the edge of their seats as England goes out in the semis on a penalty shoot out.
Everyone will say "Next time...".


[ Parent ]

Purdictions by TurboThy (4.00 / 2) #6 Wed Jun 07, 2006 at 08:41:12 AM EST

__
You can't fix anything, you can't change anything, so just tell them that everything is A. The Fuck OK. —Rogerborg


WIPO 1: Anyone but Engerland or the Krauts by Rogerborg (4.00 / 2) #7 Wed Jun 07, 2006 at 08:50:13 AM EST
WIPO 2: savagely apathetic, and would agitate strongly against employing anyone who does care.
Implicit WIPO 3: Python > (Perl + C)

-
Metus amatores matrum compescit, non clementia.


Much as I love python by yicky yacky (4.00 / 2) #9 Wed Jun 07, 2006 at 08:57:31 AM EST

and generally prefer it to perl, the regexp handling isn't quiteas clean. But it kicks its arse wholeheartedly everywhere else ...


----
Done.
[ Parent ]

How so? by gpig (4.00 / 1) #16 Wed Jun 07, 2006 at 09:54:05 AM EST
I thought the regex stuff in Python was pretty much identical to Perl.
---
(,   ,') -- eep
"This option is deprecated, as it is conceptually flawed." -- man psql
[ Parent ]

Nyet, comrade, I'm afraid by yicky yacky (4.00 / 1) #31 Wed Jun 07, 2006 at 11:41:39 AM EST

Perl regexps look like this; python ones, like this.

While the syntax of the expressions themselves is nigh-on identical, the way they're handled by the language isn't. Firstly, like java (and C/C++), Python suffers from the backslash plague - perl doesn't. This is because the regular expression operations are built into perl at the lexical level of the language itself [as in the expression $blah =~ s/(m|d)onkey)/gibbon/m; ], whereas, in python, they are implemented using the standard function / object interfaces. Ultimately, they may do the same thing but, at the level of coding it, the perl way is a touch cleaner, IMO. [Don't get me wrong, though - I still prefer python ...]


----
Done.
[ Parent ]

No need for backslash plague by gpig (4.00 / 1) #41 Wed Jun 07, 2006 at 01:30:44 PM EST
If you put an 'r' in front of a string

r"stuff"

then it's all interpreted literally.

e.g. match a date with

r"\d{2}-\d{2}-\d{4}"

http://docs.python.org/ref/strings.html
---
(,   ,') -- eep
"This option is deprecated, as it is conceptually flawed." -- man psql
[ Parent ]

Raw strings by yicky yacky (2.00 / 0) #42 Wed Jun 07, 2006 at 01:50:15 PM EST

don't circumvent the clumsy function syntax, though, and bring problems of their own (e.g. if you want interpolated characters).


----
Done.
[ Parent ]

I agree by gpig (4.00 / 1) #47 Wed Jun 07, 2006 at 08:20:40 PM EST
and I'm still not having that camel in the house

:)

---
(,   ,') -- eep
"This option is deprecated, as it is conceptually flawed." -- man psql
[ Parent ]

As the site's resident... by Metatone (4.00 / 4) #10 Wed Jun 07, 2006 at 09:15:06 AM EST
mindless Engerlandland optimist (nominated last tournament) I have to predict that:

England. Could. Go. All. The. Way.

However, it will take a particular confluence of circumstances:

a) Gerrard will have to play like it's the European Cup final for at least 7 matches.

b) Alice Pulley has to be right about Michael Carrick, which means:

c) I have to be wrong about Michael Carrick, which also requires that:

d) I have to get to Germany before the Sweden game and break the legs of one "Fat Frank Lampard" so that his "big game anonymous, but must be picked because he scores against all the little sides" self can't be picked for the knockout games and Carrick gets in.

e) Owen has to score like he can (but rarely does these days.)

f) The refs don't actually go beserk on the defenders, as that is one area Engerlandland do look to have something.

g) Oblig. miracle in the Bäder of Baden-Baden for Orc Boy's foot.

h) Sven has to engage a hypnotist for all those Premiership players: "Watch the watch, you are feeling very sleepy, you are overcome with feelings of warmth for your teammates, you want to pass the ball to them and receive it back, you want to hold the ball as a team, you don't want to give it mindlessly to Ronaldinho so he can run at you 5 bazillion times in one match, his pirouttes are pretty, but passing to your own team is better..."

i) It would help if Ashley Cole could finally put Roberto Carlos in the shade.

I might come up with some extended thinking about those other teams in the tournament later, when I'm less distracted with that work thing...



We can go all the way by nebbish (4.00 / 2) #15 Wed Jun 07, 2006 at 09:53:29 AM EST
But it doesn't do anyone any good thinking like that.

--------
It's political correctness gone mad!
[ Parent ]

I really don't know by yicky yacky (4.00 / 2) #24 Wed Jun 07, 2006 at 11:14:17 AM EST

quite what to make of England at the moment.

I think the result at the weekend effectively cloaked a lot of problems. I think the Paraguay game is a very dangerous game to have first-up; it would have been better to have the Swedes or T&T. If England don't go into the Swedish game with six points already in the bag, we could fail to qualify with alarming ease. If England spank Paraguay 3 - 0, my hopes will rise considerably, but a lot of people seem to think it's in the bag - and it isn't; they're quite capable of giving us a kicking.


----
Done.
[ Parent ]

Roque Santa Cruz... by Metatone (4.00 / 2) #32 Wed Jun 07, 2006 at 11:46:27 AM EST
is unfortunately declared fit, which means Rio is in for a potentially torrid time. Definitely plenty of grounds to worry.

This actually highlights the reason I haven't made any general predictions yet. I haven't seen most of the teams play decent opposition in a meaningful match. Thus, I'm just going to have to make it up and I haven't found the energy yet.

The last time England played a top ranked team was what? Argentina friendly? Who knows if they are prepared for the heat of combat.

I agree that the Swedes (known quantity, not in form yet) would have been ideal first up, but equally, if Paraguay are going to be dangerous, our best chance is to catch them cold before they get sorted. They looked a bit sticky in their warm up against Denmark and have been slow starters both in World Cups and the last qualifying campaign.

The refereeing is a scary wild card situation. I for one will be watching the bookings in Germany - Costa Rica very carefully.


[ Parent ]

Why Costa Rica? by Breaker (4.00 / 1) #36 Wed Jun 07, 2006 at 11:56:34 AM EST
First game that the refs will try to impose their iron will on the games to come? 

Or are they known for elbows and shirt removals?

Also, if a player pulls his the  bottom of his shirt over his head does that count as a removal?


[ Parent ]

Yep, first game... by Metatone (4.00 / 1) #39 Wed Jun 07, 2006 at 12:10:28 PM EST
is usually where the hammer comes down hardest.

Also, Muscular European team with Defenders Who Are All Elbows against skillful lower ranked South Americans known for good dribbling (and both teams have defenders who are known to "lunge" on occasion) should give me a decent idea if John Terry will be sent off within 15 mins or not.

As for shirt removal, if any of our muppets even think about removing their shirt then I expect England fans to storm the Baden-Baden spa and deliver some rough justice.


[ Parent ]

I see. by Breaker (4.00 / 1) #40 Wed Jun 07, 2006 at 12:45:40 PM EST
Might be worth watching that game tomorrow then, for the very reasons you state.


[ Parent ]

Answers by yicky yacky (4.00 / 1) #43 Wed Jun 07, 2006 at 01:52:43 PM EST

Yeah; the last big match was the Argie game: A game, I'd note, in which England were, for the most part, out-played and stole a victory in the last ten minutes, with a fully-fit strikeforce.

My concerns from the Jamaican match are mostly what they've been for the last year. It seems idiocy to complain about the lack of a cutting edge on the back of a 6-0 whipping, but that is what's bothering me. Against a decent defence, the only goal which would might have happened was Owen's, and possibly Crouch's last - and even they are debatable.

I've yet to see any evidence that Gerrard and Lampard can play together and still feel that they're too similar to be occupying the middle of the park; neither can do what they're best at with any conviction and neither can defend as well as a specialist.

Crouch bothers me. Yes, he can play very well on the deck - sometimes - but let's not pretend for a second that he's there for any reason other than his height: There are better deck players currently sojourning in Antigua. He also can go missing for long periods - and I don't mean "spells" - I mean "tens of games" - what's missing from this picture? Conversely, his height is a genuine asset and it terrifies defenders - it's just a bit of a shame he can't head the ball with any conviction, though.

Finally: Sven. On a "personal" (if it can be called that) level, I like him more than all the managers since Robson. On a professional level (for him, if not me ;) ), I still don't see any reason to believe that he knows what he's doing, and none of the actions of the last four years have persuaded me otherwise; in fact they're what have made me form that opinion. Even so, sucks is a relative term; McClaren has me really worried ...


----
Done.
[ Parent ]

Preach it, brother! by Metatone (4.00 / 2) #44 Wed Jun 07, 2006 at 04:08:10 PM EST
I'm settling in to enjoy us being at this World Cup, because I know with McClaren in charge, we won't be making it to the European Championship.

Cutting edge...

I'm totally open to the idea that Beattie should be there instead of Crouch, which rather gels with your point about Sven. It's that extra 5% in decision making that seems to be missing.

I worry over Owen's sharpness, but I have to say that in this case Sven is right, there isn't anyone in England good enough to take his place.

I think I posted some concerns about the Lampard-Gerrard axis after the Hungary game? It worried me that the solution in the Jamaica game basically came down to "Gerrard hangs back, whilst Lampard gets license to roam" which is a terrible waste, but the only solution because Lampard is much further from a defender than Gerrard.

To me, the solution from a good manager would be to bench one of them and put Carrick in. That Sven doesn't seem to have that level of conviction worries me. (I'll let Breaker and Alice fight over the Parker/Carrick question.)

Personally I would bench Lampard, because he went missing against Argentina (and I wasn't too impressed with his performances against Barcelona either.) In fact, I trace a lot of the problems against Argentina not to the strikers, but to the midfield. Riquelme had a better day than Ledley, but most of all, Lampard failed to come to grips with holding on to the ball in the face of Demichelis which allowed Riquelme so much time with the ball.

As an aside, the flaw in Riquelme is that to produce the genius that a player like Falcao produced, Riquelme requires twice the chances with the ball. (c.f. Villareal - Arsenal for what happens if he doesn't get that much of the ball.)

Anyway, the sad upshot of all this is that without the Orc boy the attack will not generate more than a goal a game against the big teams, and that is unlikely to cut it.

I'm not happy with Walcott in the squad and to be honest I'm less than convinced with Lennon so far. The refereeing noises worries me the most though. In any decent tournament, teams should be fearing having to get past Terry, Ferdinand, Ashley Cole and Paul Robinson, but I fear that advantage may be neutralised.


[ Parent ]

Fortunately, by yicky yacky (4.00 / 1) #45 Wed Jun 07, 2006 at 05:24:56 PM EST

and I never thought I'd say this, the one player who seems to be on fire at the moment is Beckham, so maybe the Lennon worries can take a back seat. It's a bit similar to the Owen situation: Who else is there? I'm not sure Lennon is any worse a prospect than SWP at this point, who's hardly played this year.

"Gerrard hangs back, whilst Lampard gets license to roam". I think the problem is subtler than that, and it's "on-field psychology". From what I was watching, I think the plan is that, whoever bombs forward, the other hangs back, and that it's just that Lamps (intentionally) goes on flimsier pretexts in order to have dibs, leaving Gerrard more often than not to tend shop responsibly, but only ever in a frustrated "Give me a reason to go forward too" kind of way - i.e. not really defending. We've said for a long time that two into one won't go, though. Sheesh; Imagine if Scholes was still around ...

Anyway: Is there any chance that this may all be moot? Do we have the prospect of a fully-armed and operational battle station?


----
Done.
[ Parent ]

I and indeed the whole country... by Metatone (4.00 / 2) #46 Wed Jun 07, 2006 at 05:38:00 PM EST
bleedin well hope we have a fully-armed and operational battle station. And it certainly seems to be the rumour. Of course, we still have to get out of the group stage without that battle station.

I agree about the "on-field psychology" problem, which is why I advocate benching one of them.

Hell, can you imagine if the coach was tough enough to do that and make it stick? He might even get them to buy into it? 45 mins of Lampard giving everything he's got, followed by 45 mins of Gerrard using every ounce of his energy, every minute? I reckon even Demichelis and Makalele would not be looking forward to that...

Speaking of news, is Djbril Cisse the most unlucky football player of recent times or what? Breaking the other leg? Ouch.

[ Parent ]

That's just harsh by yicky yacky (4.00 / 1) #48 Thu Jun 08, 2006 at 05:42:34 AM EST

From all the write-ups I've read (all two) it doesn't sound as if it looked a particularly bad fall either. Poor sod.

Still: It makes you realize the strength-in-depth the French have when it comes to strikers: "Cisse was replaced by David Trezeguet". Plus Giuly, Anelka, Saha etc.


----
Done.
[ Parent ]

Aren't you supposed to be captain of by Breaker (4.00 / 1) #49 Thu Jun 08, 2006 at 06:15:06 AM EST
The Good Ship Mindless Optimism?

with McClaren in charge, we won't be making it to the European Championship.

Although sadly I think you're right there.

Lennon: he's quick and has a really really nice first touch.  I can see him scaring defenders quite a bit.  The problem then is that Beckham's off, and the last 3 games I've seen him, his crossing, tackling and dead ball gambits have been astounding.

We just have to get out of the group stage, and the Orcboy will deliver.


[ Parent ]

It is a measure of the sheer by Metatone (2.00 / 0) #50 Thu Jun 08, 2006 at 06:26:26 AM EST
talent of Mr McLaren that The Good Ship Mindless Optimism falters at the sight of him. OTOH, he got further in the UEFA cup than that Allardici character.

However, for now we are Svedish, ve haf Wine Runey, who is impossible to replace and ve are all set!

Beckham really seems to be back on form. I know Yicky reckons that set piece goals are harder to come by against the better teams, but I do have the inkling that Crouch attracts two defenders and Beckham's got that wicked swerve going. All is set fair for some good English headed goals courtesy of Terry.

[ Parent ]

Still not happy with McLaren by Breaker (2.00 / 0) #51 Thu Jun 08, 2006 at 06:57:16 AM EST
But I am resigned to not qualifying for the European cup, so if he manages better than that I'm happy to eat my words...

Aye, we will be facing better defending against set piece attacks as of Saturday.  But as you rightly say, the Crouchosaur does attract more attention than is really required and Terry does have a penchant for nodding them in. 

Couple that with Lampard and Stevie G running into the box, any clearance by the defence had better be good or there's going to be a 30 yard screamer to be fished out of the onion bag.


[ Parent ]

I forgot to ask... by Metatone (4.00 / 1) #33 Wed Jun 07, 2006 at 11:47:24 AM EST
I'd agree that the powderpuff warm up cloaked a bunch of problems, but what do you identify those problems as?

[ Parent ]

We shouldn't worry unduly by nebbish (4.00 / 1) #34 Wed Jun 07, 2006 at 11:52:51 AM EST
Don't forget this is a piss-easy group compared to most of the others. We couldn't have a better starting chance. I'd rather we played Sweden last - we'll have an idea of what we need to do, which with a bit of luck may turn out to be very little. It also gives Owen a chance to get in practice before the toughest group match.

I'm with Metatone on predictions for England though, it's very hard to say anything at the moment. The Paraguay match will reveal all.

--------
It's political correctness gone mad!
[ Parent ]

various by sasquatchan (4.00 / 1) #11 Wed Jun 07, 2006 at 09:20:48 AM EST




I've used by yicky yacky (4.00 / 1) #13 Wed Jun 07, 2006 at 09:41:37 AM EST

both boost and ICU, but they're both massive dependencies for what's a relatively small app, and boost is C++-only (very good, though). If PCRE is good enough for Apache, Postfix, PHP etc., who am I to argue? The lower-level the code is, the more out-of-place regexps can seem, but there are some things that you just can't do without them.


----
Done.
[ Parent ]

Braces WIPO by Cloaked User (4.00 / 1) #12 Wed Jun 07, 2006 at 09:37:10 AM EST
My personal preference is Allman/BSD, but I don't really care, other than that I'll kill anyone I find using Banner.

Oh ye gads, I just read the Wikipaedia aritcle - people use Banner in HTML files?! Don't they realise how fucking stupid it looks?


--
This is not a psychotic episode. It is a cleansing moment of clarity.


I know ... I know ... by yicky yacky (2.00 / 0) #14 Wed Jun 07, 2006 at 09:42:48 AM EST

Let it go ... ;)


----
Done.
[ Parent ]

A deep breath is a cleansing breath, a deep..(n/t) by Cloaked User (4.00 / 1) #17 Wed Jun 07, 2006 at 10:11:03 AM EST



--
This is not a psychotic episode. It is a cleansing moment of clarity.
[ Parent ]

Braces flames by anonimouse (4.00 / 1) #18 Wed Jun 07, 2006 at 10:20:00 AM EST
Why have an argument about braces, when there is tabs v spaces and Vi v Emacs out there?

Girls come and go but a mortgage is for 25 years -- JtL


As I believe I've mentioned previously by gazbo (4.00 / 1) #22 Wed Jun 07, 2006 at 11:07:28 AM EST
I really don't understand why there is an argument about tabs v spaces.  As far as I can see there is exactly one correct way to do it:
  1. Levels of indentation are always done by tabs.
  2. Formatting is always done by spaces (on top of any indentation tabs).
This results in a file that can be indented to whatever depth a programmer wants (just change the tab stop to whatever you like) without ever destroying formatting.

E.g.
while (true)
{
[TAB]$i++; // Increment i, y'all
[TAB]      // That comment is all you get
}

If anyone can tell me what is wrong with that (brace style excluded - use whatever style you like) then I would be seriously interested to hear it.


"Engarde!" cried the larvae, huskily. - Scrymarch

[ Parent ]

It's a very good system by yicky yacky (2.00 / 0) #26 Wed Jun 07, 2006 at 11:22:20 AM EST

and often gets used in these parts. In fact, I believe I got it from you in the first place. Ta. The only downside is that many text editors have a hard time keeping track of what constitutes an indent level, and you're forever disabusing the editor of various notions it gets into its head.


----
Done.
[ Parent ]

Good call on the editor front by gazbo (4.00 / 1) #29 Wed Jun 07, 2006 at 11:32:30 AM EST
I use UltraEdit, and it seems to cope pretty well.  The only time it gets confused is unindenting after }s.  So in the example I gave above, it would have (rather usefully) decided to tab and space me to the right place to add more lines of comments, but as you've pointed out, if I added a } then it would only take one single tab out.

The only solution I can think of is an editor which has preferences where you can fully control what bracing style to use, so it knows how to match up braces.  I can't work out if I'd love or hate such an editor - certainly it would have to be fully configurable in order to not piss you off with its prescriptive formatting.


"Engarde!" cried the larvae, huskily. - Scrymarch

[ Parent ]

BTW... by Metatone (4.00 / 1) #19 Wed Jun 07, 2006 at 10:55:14 AM EST
All of those indentation styles suck.

Frankly, it just shows how far software has to go that you think any of them are any good. Sure, you've beaten a preferred one into your brain until it becomes your religion, but if this is a mode of communication, it has a long ways to go yet.



predictions by 256 (4.00 / 1) #20 Wed Jun 07, 2006 at 11:03:13 AM EST
korea to place second in group and surprise everyone by making it to the quarterfinals where they unfortunately have to face off against brasil.

i predict brasil to go all the way, but i'm pulling for an unanticipated brasil-mexico final (which would require mexico to finish second in group (behind portugal) but then win all their knockout games once the pressure is on. might just happen).
---
I don't think anyone's ever really died from smoking. --ni


Football: by Alice Pulley (4.00 / 2) #21 Wed Jun 07, 2006 at 11:06:28 AM EST
Winners - Brazil.
England - gallant defeat in semis.
Crazy Prediction #1 - Germany don't qualify from group.
Crazy Prediction #2 - England beat Argentina in qtrs.

--

'But they're adults and perfectly capable of working it out themselves. And if not, well, fuck em.' - Nebbish '06.



Hmmmm by Breaker (4.00 / 3) #23 Wed Jun 07, 2006 at 11:12:38 AM EST
Allman is the way forward as it ports nicely to other languages that use words (begin, end) as block delimeters.

I can deal with GNU style but find the extra screen width that is consumed a problem.

K&R looks archaic and if you have a lot of nesting going on can make it a little tricky to match blocks.

Banner style is just utterly wrong.

I think you missed an important secondary topic for debate here though; indents should be 2,4,8 or how many spaces?

Wild Footie Predictions





begin/end by TPD (4.00 / 1) #37 Wed Jun 07, 2006 at 12:00:47 PM EST
I code begin/end Whitesmith style.... but that is due to a bizarre in house style that my boss forced upon me 10 years or so ago.

Rock Hard Abs are just a sw-sw-swivel away!
[ Parent ]

Ding ding ding! by Breaker (4.00 / 2) #38 Wed Jun 07, 2006 at 12:09:00 PM EST
Wrong!!!  Red card, and you're OFF!


[ Parent ]

2, 4, 8, tabs, spaces by ajf (2.00 / 0) #52 Fri Jun 09, 2006 at 01:24:55 AM EST
Any of those is fine, I don't care. I even worked with a guy who insisted that 3 spaces was ideal, and that was no problem.

What I cannot abide, however, is the mixture of tabs and spaces. Somewhere out there is a sickening kind of freak who thinks it's a good idea to use 4 spaces for one level of indentation, 1 tab for two levels, 1 tab and 4 spaces for three levels, 2 tabs for four levels, and so on. I don't think it's an exaggeration to say that those people just don't deserve to live.


"I am not buying this jam, it's full of conservatives"
[ Parent ]

A good point. by Breaker (2.00 / 0) #53 Fri Jun 09, 2006 at 05:07:18 AM EST
Use tabs only.  Using some bizarre hybrid of tabs and spaces twists my melon.


[ Parent ]

K&R rules, but... by The Fool (4.00 / 1) #27 Wed Jun 07, 2006 at 11:22:57 AM EST
my pet peeves are "else" clauses. While style is preferable to you?

if (foo) {
    ...
}
else {
    ...
}

or

if (foo) {
    ...
} else {
    ....
}

Year of programming Tcl make the second more attractive to me. Also, it makes the task of figuring out which "else" goes with which "if" a bit easier.

Now, don't get me started on people who elide braces just because it's allowed by C...




I don't mind by yicky yacky (2.00 / 0) #28 Wed Jun 07, 2006 at 11:25:32 AM EST

I prefer the first, but am quite happy with the second. In fact, I don't mind any of the styles very much, except 'banner'.


----
Done.
[ Parent ]

Honestly by gazbo (4.00 / 1) #30 Wed Jun 07, 2006 at 11:35:09 AM EST
That is pretty much the only problem I have with K&R style (I'm an Allman guy by preference).  Else clauses just don't seem to go together well.

Then again, the same criticism could be raised against my favoured style now I think about it.


"Engarde!" cried the larvae, huskily. - Scrymarch

[ Parent ]

I prefer Whitesmith by ad hoc (4.00 / 1) #35 Wed Jun 07, 2006 at 11:56:26 AM EST
for the single reason that it's easy to tell at a glance which blocks of code ar enclosed with which braces. It's a great help when trying to find the one unmatched brace.

Footie prediction: I probably won't see any of it.
--
Close friendships and a private room can offer most of the things love does.


And the bells were ringing out for Listless Day | 53 comments (53 topical, 0 hidden) | Trackback