Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,752 members, 7,817,082 topics. Date: Saturday, 04 May 2024 at 03:51 AM

Is This Programming - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Is This Programming (966 Views)

Pls Help With This Programming Assignment / What Is This Programming And Software Development All About (2) (3) (4)

(1) (Reply) (Go Down)

Is This Programming by javarules(m): 8:41pm On Jun 02, 2008
I have posted this somewhere before but I will like to see/hear the views of the guys on nairaland

Really quick, can you tell me what this is?

-pl s!.!y$IVCXL426(-:$XLMCDIVX$dfor$$_.=5x$&*8%29628;$$$_=$_!egfor-4e3, y/iul-}/-$+ /%s''$';*_=eval

I’ll give you a hint- It’s not a cat walking across my keyboard. If that was your first guess, though, we’re at least on the same page. This was the winning entry in a game of Perl Golf: The problem was to write a Roman Numeral Calculator in the fewest characters possible. Submissions can be found here http://www.fonality.com/golf/post_mortem.cgi?id=1 . Now, this is an amazing piece of code. The person who wrote it is clearly very skilled. The fact that Perl makes code like that possible is pretty impressive. The problem here is that people write code like this outside of PERL golf, and think to themselves, “it’s only one line, so it must have fewer bugs than a 50 line solution”. Really? Because if I had to debug one, I’d have definitely gone with the 50 line solution.

Writing unmaintanable code does not reduce the bug count for a project. A friend of mine coined a term for code like that- “Write-Only Code”- a takeoff on the permissions you can set with chmod. Think about it: Readable, writeable, and executable. Shouldn’t code be all three?

Another quick example:

(0/:l)(_+_)

The first time I saw this snippet, I thought someone was, via emoticons, trying to re-enact the facial expression one wore when seeing Ghosts for the first time. It’s not actually a story told by emoticon. It’s a piece of scala code that sums the elements in a list. And I just don’t see it as having been easier to write than a for loop. It’s definitely not as maintainable. This piece of code, actually, prompted a conversation with a friend about holding a “code or emoticon” contest, but we really couldn’t come up with any serious contenders to this one. Maybe some Perl Golfers could throw their hat in the ring?

So wot do you think, should code be readable, writable and executable or we should go with these "Write-Only-Code"?
Re: Is This Programming by davidt(m): 4:42pm On Jun 03, 2008
I believe code must be readable, writable and executable.

Someone once described Perl as "Line noise".

Such code as above should only be seen in contests (Perl Golfing, etc.) and never in the real world.
Re: Is This Programming by javarules(m): 6:51pm On Jun 04, 2008
Line Noise indeed grin
Re: Is This Programming by davidt(m): 9:55pm On Jun 04, 2008
Yep! Llllliiiiiiiiiiiiiiiinnnnnnnnnnneeeeeeeee noooooiiiiiissssseeee! It's a powerful language though!
Re: Is This Programming by Nobody: 1:54am On Jun 05, 2008
the area of programming where you'll usually see similar combination of characters is regex
Re: Is This Programming by javarules(m): 11:47am On Jun 05, 2008
Sincerely I tried to learn regex, but I think I prefer to copy and paste it rather than write it myself undecided
Re: Is This Programming by uspry1(f): 5:39pm On Jun 05, 2008
javarules:

Sincerely I tried to learn regex, but I think I prefer to copy and paste it rather than write it myself undecided

I always copy and paste the regex for my both Flash and HTML form handler validation parsing with PHP email results.

Nothing wrong with copy/paste regex instead of write it---to avoid too many syntax errors. grin
Re: Is This Programming by javaprince(m): 10:35am On Jun 06, 2008
@usurpy @javarules
Sincerely I tried to learn regex, but I think I prefer to copy and paste it rather than write it myself
I always copy and paste the regex for my both Flash and HTML form handler validation parsing with PHP email results.
Nothing wrong with copy/paste regex instead of write it---to avoid too many syntax errors


I think you both should takes some time to learn regex and pattern matching to better understand and write customisable regular expressions. Gosh!, even the Java documentation as a tutorial section on REGEX.

No hating. wink



Proud to be a JAND(Java Nigerian Developers) . Want to join, ??
Re: Is This Programming by javarules(m): 8:56pm On Jun 09, 2008
Thanks javaprince, how I wish I have the time to do that, with projects flying around here and here and deadlines to meet.I wish I had learnt it back in sku.

tx anyway.




JAND (Proudly Java Proudly Nigerian)
Re: Is This Programming by LordLangug(m): 8:45am On Jun 10, 2008
It has always been nice to know more about AUTOMATA and graduate to REGULAR EXPRESSION and Pattern machining simulation then you will know that jargon cry

(1) (Reply)

Programming A Web Form To Email / I Wanna Help About Accp / Reputable ICT Schools For Arts Graduate

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.