When I grow up, I'll be a Perl Programmer! (78)

1 Name: Alexander!DxY0NCwFJg : 2006-04-06 22:57 ID:oXoZbraC

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!

2 Name: #!/usr/bin/anonymous : 2006-04-06 22:58 ID:Heaven

It's a perfect idea. Go ahead and do it. Get started!

3 Name: dmpk2k!hinhT6kz2E : 2006-04-07 03:45 ID:Heaven

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.

4 Name: Albright!LC/IWhc3yc : 2006-04-07 05:45 ID:Wn+gRsBf

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.

5 Name: #!/usr/bin/anonymous : 2006-04-07 12:54 ID:Heaven

how to become a perl programmer:

  1. learn BASIC
  2. learn x86 assembly
  3. learn java
  4. forget java
  5. learn c++
  6. learn c
  7. learn php
  8. forget php
  9. learn perl
  10. forget BASIC, assembly, and c++

6 Name: #!/usr/bin/anonymous : 2006-04-07 20:31 ID:OMcy04SB

>>3
And what would you suggest as an ideal first language?

7 Name: #!/usr/bin/anonymous : 2006-04-07 20:47 ID:cicY/fQj

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.

8 Name: #!/usr/bin/anonymous : 2006-04-08 00:57 ID:+xU8q+xD

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:

  • It's an actual useful language used in the real-world (unlike BASIC and Pascal), so you can feel like you're doing something worthwhile. I know I don't like to learn things that are only useful for learning -- feels like a waste.
  • It supports many different styles of programming, so you can learn things a piece at a time. Structured, object-oriented, functional, you can do it all in Perl, to some extent.

Possible downsides, but non-fatal:

  • Some Perl features are ad-hoc, arbitrary, and thoroughly wrongheaded (e.g., global variables like $[). However, it shouldn't be too hard to avoid these features. You wouldn't be interested in them as a beginner anyways.
  • A lot of Perl code out there is unreadable and bad. Just take Perl examples you find on the internet with a grain of salt. Don't automatically assume something you see is good Perl code. Then you'll be fine.

9 Name: #!/usr/bin/anonymous : 2006-04-08 18:01 ID:cicY/fQj

>>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

10 Name: #!/usr/bin/anonymous : 2006-04-08 22:06 ID:Heaven

>>9

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.

11 Name: #!/usr/bin/anonymous : 2006-04-09 10:05 ID:cicY/fQj

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)

12 Name: #!/usr/bin/anonymous : 2006-04-09 20:59 ID:Heaven

>>10

> How well it works in practice, though, I have no idea.

You can write stuff like http://www.frozen-bubble.org/ with it.

13 Name: #!/usr/bin/anonymous : 2006-04-18 12:18 ID:Z0QwTcw3

#!/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;

14 Name: #!/usr/bin/anonymous : 2006-04-18 12:28 ID:a9Xnn82k

>>13

Too much fun?

15 Name: #!/usr/bin/anonymous : 2006-04-18 20:12 ID:j1nZRbvx

>>13 that's pretty tame

16 Name: #!/usr/bin/anonymous : 2006-04-18 23:25 ID:cicY/fQj

$_="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 ?

17 Name: #!/usr/bin/anonymous : 2006-04-19 02:50 ID:LhmzHl+F

>>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:

18 Name: #!/usr/bin/anonymous : 2006-04-19 04:56 ID:Heaven

>>17
time paradox

19 Name: #!/usr/bin/anonymous : 2006-04-19 05:27 ID:j1nZRbvx

>>16
i think i came

20 Name: #!/usr/bin/anonymous : 2006-04-19 12:07 ID:a9Xnn82k

>>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?

21 Name: dmpk2k!hinhT6kz2E : 2006-04-20 00:04 ID:Heaven

NO CARRIER

22 Name: #!/usr/bin/anonymous : 2006-04-20 20:14 ID:MdOKSYEn

>>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!

23 Name: #!/usr/bin/anonymous : 2006-04-20 21:03 ID:Heaven

PS: How about a "Coding Challenge #4: Make an obfuscated 4-ch logo", in any language?

24 Name: #!/usr/bin/anonymous : 2006-04-20 21:15 ID:Heaven

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.

25 Name: #!/usr/bin/anonymous : 2006-04-20 22:34 ID:Uqryt+/p

>>22
The first four lines could almost pass for brainfuck or befunge.

26 Name: #!/usr/bin/anonymous : 2006-04-21 17:07 ID:Z0QwTcw3

>>23

I'm up for that

27 Name: #!/usr/bin/anonymous : 2006-04-22 10:45 ID:Heaven

>>24
Poor baby, they've treated you bad haven't they. (This stated only half-jokingly.)

28 Name: #!/usr/bin/anonymous : 2006-04-26 02:45 ID:XXdYtRmU

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.

This thread has been closed. You cannot post in this thread any longer.