June 19th, 2008

A software engineering diversion…

For my sins software engineering* is my day job. I make a rule no to talk about work here, but today a thread appeared on a cycling forum that about sums up Software Engineering in microcosm…

Names have been obscured to save the dignity of the guilty. And some of these people are smart cookies.

Client gives a spec…

Posted by: xxxx (IP Logged)
Date: June 19, 2008 11:32AM

I have 400 lines of code with

picture1.jpg blah blah blah WRONG.jpg
picture2.jpg blah blah blah WRONG.jpg
picture3.jpg blah blah blah WRONG.jpg
picture4.jpg blah blah blah WRONG.jpg

and I want to find the "pictureX.jpg" at the start of the
line and then stick it in place of "WRONG.jpg" at the end.
so unique find/replace for each line.
Giving me "picture1.jpg blah blah blah picture1.jpg"

geeks wade in with solutions, long, short and off the wall…

Posted by: xxxxxx (IP Logged)
Date: June 19, 2008 11:52AM

I’d use a perl script to do that

Posted by: xxxxxxxxxxx (IP Logged)
Date: June 19, 2008 12:03PM

cut -d" " -f1 foo > foopic
join -o 1.1 1.2 1.3 1.4 2.1 foo foopic > result

Posted by: xxxxxx (IP Logged)
Date: June 19, 2008 12:23PM

open(FILE,"< foo");
@lines=;
while ($line= pop @lines) {
@words=split(/ /,$line);
pop(@words);
push(@words,@words[0]);
$line=join(" ",@words);
print $line,"\n";
}

Posted by: xxx (IP Logged)
Date: June 19, 2008 12:05PM

copy and paste the whole dang thing into excel/word/similar
and do a find/replace there

All we’re short of is someone trying to justify porting perl from C to C++ first to take advantage of it’s object oriented capabilities.

Eventually a solution is offered…

Posted by: xxxx xxxxxxxxx (IP Logged)
Date: June 19, 2008 12:46PM

$ pbpaste | perl -ple ’s/^(\S+\s*)(.*?)\S+\s*$/$1$2$1/’ | pbcopy

Only to find that original customer spec was wrong…

Posted by: xxxxxx (IP Logged)
Date: June 19, 2008 12:54PM

aaah, looking at the file, it’s more complicated than that.
It’s not the first word and it’s not the last word.

Then, too late, a solution is offered with test evidence that meets the new spec…

Posted by: xxxx (IP Logged)
Date: June 19, 2008 02:28PM

$ cat foo
picture1.jpg blah WRONG.jpg
picture2.jpg blah blah WRONG.jpg
picture3.jpg blah blah blah WRONG.jpg
blah picture4.jpg any text in the middle you like WRONG.jpg blah

$ sed ’s/\(picture[0-9]*.jpg\)\(.*\)\(WRONG.jpg$\)/\2\1/g’ < foo
blah picture1.jpg
blah blah picture2.jpg
blah blah blah picture3.jpg
blah any text in the middle you like picture4.jpg blah

But by now there’s been requirements creep…

Posted by: xxxxxx (IP Logged)
Date: June 19, 2008 02:52PM

Also need an href changing to a src

So recriminations start…

Posted by: xxxxx (IP Logged)
Date: June 19, 2008 02:57PM

Fucking geeks.

And finally an IT consultant is brought in to sort out the unholy mess in a manner that management can understand. This solution would also have the advantage of cutting company costs by allowing them to lay off home-grown engineers and award themselves bonuses all round…

Posted by: xxxx (IP Logged)
Date: June 19, 2008 06:44PM
I wouldn’t have used any of the methods above.
I would have emailed it to India and left it up to one of my guys over there.

That’s my bloody life right there.

* Yes, engineering. Full lifecycle, waterfall models etc etc, not hacked together**, 100% tested and certified. It had better be, it might be all that’s keeping your aeroplane flying. Scary huh?***

** If only you knew.

*** But not as scary as when you think that all our customers are like the one above.

Be the first to comment...

Leave a Reply

site feeds

RSS Feed - Entries (entries)

RSS Feed - Comments (comments)

categories

Our random meanderings get stuffed into one - or more! - of the following categories.

things we ride

Actually we‚re lying about the Maverick since some low-life stole it.

photos

My photos on flickr. Get your badge at bighugelabs.com/flickr

meta>>data

A dogs dinner of links to stuff that we have arranged in an apparently random manner, though I assure you it made sense at the time.

Creative Commons License

GeoURL

Powered by PHP

Spam Karma 2

web shit

Get Firefox!

You know it makes sense.

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS]

Level Triple-A conformance icon, 
          W3C-WAI Web Content Accessibility Guidelines 1.0

Page Strength SEO Tool - SEOmoz.org

search 32sixteen

search the web

Google

tape time

The things we listen to are occasionally logged on Last.fm

Now Playing

New! iPod updating courtesy of iScrobbler.

It doesn't update from the wheels of steel though :-)

Remember kids, vinyl can't carry Digital Rights Management.

LastFM

people are people

English Blog Directory.

other places to go

in no particular order...

Vale of Lune Harriers

toilet material

For all that we like the up-to-the minute offerings of the web there‚s nothing like a proper badly photocopied A5 fanzine or a glossily printed proper magazine to keep you occupied on the throne. Here, in no particular order, is our material of choice.

Singletrack
Singletrack

The Outcast
The Outcast

Dirt Rag
Dirt Rag

Bike
Bike

our images

In the UK as we give away our civil liberties in the name of freedom it might be handy to be aware of Photographers Rights.

Don’t let The Man stop you shooting.

www.flickr.com
This is a Flickr badge showing photos in a set called Cycling.
Make your own badge here.

flickr score: 2968

race results

If anyone has a full set of NEMBA results (that‚s North of England for you colonial types) then please forward them.

cycling activism

sometimes you just gotta take action, or at least be able to get our hands on the FACTS


Original Logo

Nothing To See Here, Move Along