Originally posted by: Alternex
whoa.. never seen that embedded code thing in this forum before!
I find more verbose languages (such as java and c#) a lot nicer. A little extra typing goes a long ways towards readability.
If you choose a compact language such as perl, then projects become unreadable. Sure everyone says their code is clean but tell that to the maintanence guys (or yourself when you're working on someone else's code)
Originally posted by: notfred
So are you saying the code I posted is unreadable?
Originally posted by: MrChad
Originally posted by: notfred
So are you saying the code I posted is unreadable?
It's not unreadable, but for someone who's not familiar with Perl syntax, it doesn't make a lot of sense. I have no idea what these four lines mean:
# Set up all the initial vars.
my $csvdata = shift @_;
my @alldata = ();
my @thisline = ();
my $thisfield = '';
Originally posted by: MrChad
Originally posted by: notfred
So are you saying the code I posted is unreadable?
It's not unreadable, but for someone who's not familiar with Perl syntax, it doesn't make a lot of sense. I have no idea what these four lines mean:
# Set up all the initial vars.
my $csvdata = shift @_;
my @alldata = ();
my @thisline = ();
my $thisfield = '';
Originally posted by: amdfanboy
Originally posted by: MrChad
Originally posted by: notfred
So are you saying the code I posted is unreadable?
It's not unreadable, but for someone who's not familiar with Perl syntax, it doesn't make a lot of sense. I have no idea what these four lines mean:
# Set up all the initial vars.
my $csvdata = shift @_;
my @alldata = ();
my @thisline = ();
my $thisfield = '';
But you wouldn't be working on perl then![]()
Originally posted by: MrChad
Originally posted by: notfred
So are you saying the code I posted is unreadable?
It's not unreadable, but for someone who's not familiar with Perl syntax, it doesn't make a lot of sense. I have no idea what these four lines mean:
# Set up all the initial vars.
my $csvdata = shift @_;
my @alldata = ();
my @thisline = ();
my $thisfield = '';
Originally posted by: notfred
Originally posted by: Alternex
whoa.. never seen that embedded code thing in this forum before!
I find more verbose languages (such as java and c#) a lot nicer. A little extra typing goes a long ways towards readability.
If you choose a compact language such as perl, then projects become unreadable. Sure everyone says their code is clean but tell that to the maintanence guys (or yourself when you're working on someone else's code)
So are you saying the code I posted is unreadable?
Originally posted by: notfred
Originally posted by: MrChad
Originally posted by: notfred
So are you saying the code I posted is unreadable?
It's not unreadable, but for someone who's not familiar with Perl syntax, it doesn't make a lot of sense. I have no idea what these four lines mean:
# Set up all the initial vars.
my $csvdata = shift @_;
my @alldata = ();
my @thisline = ();
my $thisfield = '';
Of course you don't if you don't know perl. They're extremely fundamental to the langauge though.
In java, that would look something like:
String csvdata = somearray[0];
Object [] alldata = new Object[];
String [] thisline = new String [];
String thisfield = new String();
If you show someone who's never looked at C before a file full of * and & they're not going to know what the hell they do either.
Originally posted by: Alternex
Originally posted by: notfred
Originally posted by: Alternex
whoa.. never seen that embedded code thing in this forum before!
I find more verbose languages (such as java and c#) a lot nicer. A little extra typing goes a long ways towards readability.
If you choose a compact language such as perl, then projects become unreadable. Sure everyone says their code is clean but tell that to the maintanence guys (or yourself when you're working on someone else's code)
So are you saying the code I posted is unreadable?
No.. but you did get to pick the code snippet to show yourself. Generally speaking most code is badly documented. If you didn't have those comments there I'd have no clue whatsover the code did.. if it was in java/c# it should be somewhat easier (given that the developer is the same)
Originally posted by: skace
perl regex is messy but also EXTREMELY functional. People looking at it for the first time won't understand it. But once they realize that perl is practically parsing stuff 24/7 with regex, it all adds up. Java may look pretty, but... I still don't like it.
Originally posted by: Alternex
What I'm saying is that if you take a programmer equally skilled in Perl and Java and have them read their own code a year after they write it, they would probably have an easier time reading their own Java code than their Perl code because Perl is more condensed.
Originally posted by: notfred
Originally posted by: skace
perl regex is messy but also EXTREMELY functional. People looking at it for the first time won't understand it. But once they realize that perl is practically parsing stuff 24/7 with regex, it all adds up. Java may look pretty, but... I still don't like it.
regular expressions look messy in any language.