Schoolwork is keeping me from doing anything with this particular project, but some years ago I decided that I'm going to learn how to program.
I've decided to learn Perl first. Please tell me why this is a horrible idea! The more interesting reasoning, the better!
It's a perfect idea. Go ahead and do it. Get started!
I don't think Perl is an ideal first language, but you certainly could make worse choices.
You could make better choices too. Of the major scripting languages, Perl is one of the nastier ones.
http://en.wikipedia.org/wiki/Perl#Con
Also, if you want to go on to learn any form of C, Perl is so different from it that you'll have to re-learn many things.
how to become a perl programmer:
>>3
And what would you suggest as an ideal first language?
pascal is quite cool to learn the basics, but its syntax is so different from C and his derivates (like perl) that it's quite useless.
Let's see, java is quite simple to learn, and then you'll learn to manipulate objects (which is not at all perl-like but it's useful)
personally I began with pascal. Then I learnt perl. At school threre was some Scheme (which is a good thing to learn in the contrary to general opinion) and now it's java (which sux, but it's simple)
Oh yes, and BEFORE learning perl you should learn Regular Expressions. Without that, perl loses a half of it's potential.
Perl may not be an ideal first language, but I don't think such a thing -- "ideal first language" -- exists. Perl is as good a place to start as any. The way I see it, the advantages of starting with Perl would be:
Possible downsides, but non-fatal:
>>8 is right (just that objects in perl... well...)
as for unreadable perl code, it might be leet but I'd say that if perl code is well written it might be most readable code ever (for someone who know perl of course, otherwise you can read binary file as well). At least more readable than scheme (or lisp)
but then there is something like utility... perl is really the best for internet applications and text transformations, as well as for scripts (irssi, gimp..., bash scripts as it can send commands directly to system) but for applications like games or graphics it's not a good choice at all
I think there are SDL and OpenGL modules for Perl, but I can't say I've ever tried them. Of course you won't be doing per-pixel graphics operations in Perl anytime soon, but it should at least allow you to play with stuff. How well it works in practice, though, I have no idea.
oh yes, there are also GtK and QT modules... but doing this with perl is just wrong. (in exeption of giving a GUI to a simple script, like text transformer or batch whatever file)
> How well it works in practice, though, I have no idea.
You can write stuff like http://www.frozen-bubble.org/ with it.
#!/usr/bin/perl
$d="unu lbh ner";$f="guvf vf ";$d.="yrrg";$k=0;$f.="jul lbh qba'g";
$m="zl anzr";$f.=" yrnea gb cebtenz va Crey";$m.=" vf fdhrrxf";
$f=~tr/a-zA-Z/n-za-mN-ZA-M/;$f.='.';print $f;
$_="P;=N?;MA:LB:M\@;N><HA?3RC4RBFB\@EE>C?5CB>9A?>K;CJ7HI4?69J3<:9J39<9K39<9K3::;J49;?E59<AA59A>?76G8\@";$o='.';
s/(.)/for($i=0;$i<ord($1)-50;$i++){print$o;$l++;}if($o eq'.'){$o='x'}else{$o='.'}if($l>=50){print"\n"; $l=0;$o='.'}/ge;
O RLY ?
>>35
Yeah I know, I just did it rather quickly. It now seems this thread is turning into a round of Perl Golf... what did I just do D:
>>17
time paradox
>>16
i think i came
>>16 is kiddy stuff. It looks like it was written by a BASIC programmer. At least try and make the effort!
$_='@+I/F1D2E0G.B10B5BF2C5?/%32.)1/.D3?8;/&);,*);),)<),)<**+<)+/8),14)1.4&7(0';
s/./((pos)&1?"x":".")x(ord($&)-34)/ge;s/.{50}/$&\n/g;print
That is still way too readable. Anybody want to try and improve it?
NO CARRIER
>>20 was really just a bit of syntactic obfuscation of a trivial algorithm, and therefore not much fun. Here is something more interesting:
@r=d('<,=@;,>B;,?<<;,<<<;,<<;,C=@:,C=A:,<<<<;<,<<<<:::::,<<<<<::=:,<B'.
'<<::::,<@<<:::<:,<,<,<');@c=d(';,<,=,>,<;,<;,I,I,I,;,,;,<;<,=;=,=;=,'.
';;,;;,;;,<<,<<,;;,,E,E,@,;,;,@,@,?,,:,,>,:,:,=,,<,:::,:::,;:,,:,@,:');
@f=map "." x@c,@r;for(a,b){for(0..$#r){foreach$c(0..$#c){$n=x ((join"",
map{substr$f [$_],$c,1}(0..$#r)),@{$c [$c]});(substr$f[$_],$c,1)=substr
$n,$_,1for(0..$#r);}$f [$_]=x($f[$_],@{$r[$_]});}}printf"$_\n"for@f;sub
x{$f=shift;my$l=length$f;return" "x$l if!@_;return c (grep m/^$f/,map{(
" "x$_).(X x$_[0]).(" "x($l-$_[0]-$_))}(0..$l-$_[0]))if@_==1;my$r+=($_+
1)for@_;$n=shift;return c(grep length$_==$l,map$$_[0].x($$_[2],@_),grep
$$_[0]=~/^$$_[1]/,map[(" " x$_).(X x$n)." ",$f=~/(.{$_}.{$n}.)(.*)/],(0
..$l-$r-1))}sub c{$r=shift;$r=~s/(.)/(substr$_, pos$r, 1)eq$1?$1:'.'/ge
for@_;$r}sub d{map[map ord($_)-57,/./g],split',',$_[0]}
Try to figure out what exactly it is that the code does!
PS: How about a "Coding Challenge #4: Make an obfuscated 4-ch logo", in any language?
My worthless two years of vo-tech education taught me to program in Turbo Pascal, Cobol and RPG IV. I promptly forgot all of them upon graduation. My first (and only) programming job involved Clipper, a DBase IV-based language that I learned by reading the source code and comparing it to what was on the screen.
I wish I'd learned C instead. At least it's useful.
>>22
The first four lines could almost pass for brainfuck or befunge.
>>24
Poor baby, they've treated you bad haven't they. (This stated only half-jokingly.)
THERE'S MORE THAN ONE WAY TO DO IT. That's the motto of Perl and Larry Wall. It has led to a very bloated language over the years. You may find it hard to understand a Perl program you wrote when you come back to it after 6 months, and impossible to follow someone else's Perl program.
Python was designed by professors to make it difficult for their students to introduce bugs into their code. Derived from ABC language as I recall.
Professional programmers say they just enjoy Python.
Euphoria is more obscure, but supposedly simple to learn and powerful.
C/Java/Pascal etc. are lower level than Perl/Python/TCL etc.
You can simply do more in a line of Python than in a line of C or Java. Several studies have proven that. Companies switch to the higher level scripting languages to get projects developed faster. TCL is still dominant there I suppose, but losing ground to Python.