Is PERL good for a linguist new to programming?

A

A. Sinan Unur

(e-mail address removed) wrote in
....

....

Im aware of something like "sort" but i just a wanted to make it a
challenge to myself and use only the resources that i know at this
stage :)

Exactly. That is why Uri recommended you try to implement the Bubble
Sort algorithm. It is easy to implement (it was a demo that came with my
ZX Spectrum 48K back in 1982 ... written in Basic and read from cassette
tape -- In fact, after almost 20 years of continuous beeping first from
cassettes then from modems whenever I tried to do something useful, I
find the quiet that comes with today's internet access quite
disturbing). OK, that was not relevant but neither is drumming ;-)
Do you guys write out algorithms very often before sitting down to
programming?

No. I steal other people's algorithms.

Now, if you were asking about thinking about what to write, how to
organize it, how things fit together etc, yes, always. All the time.
Every time.

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
C

ccc31807

I also want to be a better
specialist in my domain (im a translator), but hence my above
question.

Programming is also translation -- translating a language that a human
can understand (like Perl) to a language that a machine can understand
(like 1s and 0s).
Im just worried if my brain will be up to par with all the
challenges posed by programming.

I think that the sense from all the responses to this thread is that
the language is the easy part, doing the job is the hard part. I
started off by saying that a programming language is simply a tool.
Think about this: what if you had all the proper tools for a job and
knew how to use the tools, but had no idea how to do the job?

A famous computer scientist (I've forgotten who) said that we have two
shining jewels that enabled the modern age: calculus and algorithms.
(Quote is approximate.) The idea of the algorithm is ABSOLUTELY
fundamental to the modern age, and I'm sure that you use algorithms
all the time without realizing it. This has nothing to do with this
thread, but it might be helpful for you to spend a little time
thinking about what algorithms are and why the idea of the algorithm
is so important.
Right now for example im racking my brains how to sort several words
alphabetically using only if, for, else, and several variables. So i
really got into it but im afraid that ill get discouraged if i see im
not cut out for it.

There was an article on slashdot.com several weeks ago about the
practice of programming a generation ago. One thing that struck me was
that several decades ago, programmers implemented their own sorting
routines, and the journeymen programmer could write several different
sorting algorithms relative to the job at hand. There are a number of
web sites that have animated different sorting routines. It might be
helpful at some point to implement several of these algorithms using
Perl.

http://en.wikipedia.org/wiki/Sorting_algorithm


CC
 
M

Mart van de Wege

ccc31807 said:
Programming is also translation -- translating a language that a human
can understand (like Perl) to a language that a machine can understand
(like 1s and 0s).

My personal experience is that that is the wrong place to start
learning.

Yes, programming is translating an algorithm into concrete
steps. However, before you can start with the translation, you *must*
know what your data set is and how you want to transform it. Once you
know that, you can start selecting algorithms, and then you can start
implementing.

I once saw a colleague use multiple sequential 'if' statements to
generate snippets from a config file, with the 'if' selecting the only
thing that changed, and spitting out the entire snippet with the one
change. Had he had a little more experience, he would put the changing
items in a list and iterated over that, using a here document with
variable substitution to generate the config snippets.

Mart
 
H

Henry Law

Well, I'll try anyway :) Thank you for so many suggestions and
comments.

I'm a drummer myself, I write music.

Then you'll understand the difference between knowing a programming
language, which parallels understanding scales and notation and pitch
and consonance and dissonance and "rules", and programming, which
parallels composing music.

Q: What is the difference between a drum machine and a drummer?
A: You only have to punch the rhythm into a drum machine once.
 
U

Uri Guttman

pp> Im aware of something like "sort" but i just a wanted to make it a
pp> challenge to myself and use only the resources that i know at this
pp> stage :)

but sort uses a particular algorithm, one of many that exist to do
sorting. some are specialized for certain data sets, some are general
purpose but have different degenerative cases (i.e. they can get very
slow with certain data sets). as i said sorting is a very core part of
algorithms.

pp> Do you guys write out algorithms very often before sitting down to
pp> programming?

you don't write out algorithm. they are a specific way to solve a
specific problem in a theoritical way. you still have to implement the
algorithm in a programming language and that can be easy or hard
depending on many factors including the complexity of the algorithm and
the skill of the coder. and you can code it up well or very crappy
too. a good coding of a bad algorithm can be better than a bad coding of
a good algorithm.

a good coder knows many fundamental algorithms or how to use modules
that implement them. i don't write out sort coding directly
anymore. instead i use perl's sort function but even that can be used in
better or worse ways. so understanding the concepts of sorting is important
to using it effectively and efficiently even if you don't directly code
the sorting yourself. this is why knowing basic algorithm theory is
important to any coder who wants to be a professional. and it is why so
many kiddies out there think they code well but don't since they have no
fundamentals.

uri
 
A

A. Sinan Unur

Programming is also translation -- translating a language that a human
can understand (like Perl) to a language that a machine can understand
(like 1s and 0s).

No no no ... That is not programming. That is compilation.
Think about this: what if you had all the proper tools for a job and
knew how to use the tools, but had no idea how to do the job?

Quite right.
A famous computer scientist (I've forgotten who) said that we have two
shining jewels that enabled the modern age: calculus and algorithms.
(Quote is approximate.)

Formal algorithms (see http://en.wikipedia.org/wiki/Muhammad_ibn_M%C5%
ABs%C4%81_al-Khw%C4%81rizm%C4%AB) and Calculus existed a long time
without much effect on the daily lives of people. We owe modernity to
political and economic freedom but that is getting waaaaaayyyy to far
off-topic.
The idea of the algorithm is ABSOLUTELY
fundamental to the modern age, and I'm sure that you use algorithms
all the time without realizing it. This has nothing to do with this
thread, but it might be helpful for you to spend a little time
thinking about what algorithms are and why the idea of the algorithm
is so important.

An algorithm is a carefully constructed complete recipe for doing
something. So, yeah, they are everywhere. And, guess what, they were
available even before they were formally named algorithms.
There was an article on slashdot.com several weeks ago about the
practice of programming a generation ago.

This should give you an idea:

http://prog21.dadgum.com/29.html

Sinan


--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
P

p.podmostko

Yesterday I thought about taking a math course. Do you think this will
help in solving various programming problems? I think that yes because
it will provide knowledge and theoretical tools for problem solving.
What do you think?
 
L

Lars Eighner

In our last episode,
<[email protected]>, the
lovely and talented (e-mail address removed) broadcast on
comp.lang.perl.misc:
Yesterday I thought about taking a math course. Do you think this will
help in solving various programming problems? I think that yes because
it will provide knowledge and theoretical tools for problem solving.
What do you think?

Symbolic logic, whether as a philosophy or a math course, would be a big
help.
 
U

Uri Guttman

pp> Yesterday I thought about taking a math course. Do you think this will
pp> help in solving various programming problems? I think that yes because
pp> it will provide knowledge and theoretical tools for problem solving.
pp> What do you think?

it totally depends on the course and how it would apply (if at all) to
the problem space. math course is totally a generic term and can be pure
theory or more practical. you need to ask more about the class to see if
it would be of use. we can't tell you anything without any real info.

uri
 
C

ccc31807

Yesterday I thought about taking a math course. Do you think this will
help in solving various programming problems? I think that yes because
it will provide knowledge and theoretical tools for problem solving.
What do you think?

Look at discrete math. You can buy an old, cheap text and skim through
it.

I may be wrong about this, but I think that the trio of courses that
separate the programmer from the computer scientist are (1)
algorithms, (2) data structures, and (3) discrete math.

CC
 
P

p.podmostko

Thank you for all your answers guys! I really appreciate it! All in
all I'm being given knowledge which you've been accumulating for years
as programmers so the fact that you're willing to share it means a lot
to me!

Regards
Przemek
 
U

Uri Guttman

pp> Thank you for all your answers guys! I really appreciate it! All in
pp> all I'm being given knowledge which you've been accumulating for years
pp> as programmers so the fact that you're willing to share it means a lot
pp> to me!

i just want to point out to some new posters here who flame at the
regulars. note that this OP and thread was civil and informative. it the
threads where the OP doesn't listen or keeps asking wrong questions or
such that get crazy. and then the peanut gallery jumps in with no real
help but useless and childish criticism. note how they didn't jump into
this thread? that is because they don't have the accumulated years of
experience to offer. nice of them (keel is the latest) to keep out of
this thread.

uri
 
P

p.podmostko

i just want to point out to some new posters here who flame at the
regulars. note that this OP and thread was civil and informative. it the
threads where the OP doesn't listen or keeps asking wrong questions or
such that get crazy. and then the peanut gallery jumps in with no real
help but useless and childish criticism. note how they didn't jump into
this thread? that is because they don't have the accumulated years of
experience to offer. nice of them (keel is the latest) to keep out of
this thread.

Sorry, but what does this have to do with anything? :) I don't follow.
 
U

Uri Guttman

pp> Sorry, but what does this have to do with anything? :) I don't follow.

see a recent thread with a nathan keel in it. you won't be amused.

uri
 
F

Franken Sense

In Dread Ink, the Grave Hand of (e-mail address removed) Did Inscribe:
Sorry, but what does this have to do with anything? :) I don't follow.

Uri and his ilk are why I would advise against thinking you can conquer the
many idioms of perl by relying on usenet. Post a few more questions as you
supplement your study and watch their tone slip as you don't follow Uri's
life advice.

clp.misc varies like any usenet group. Doesn't seem to be many OP's and Uri
is front and center: hmmm.

Other times, it's been nice. What's really helped me this time around is
that I have a sysadmin buddy who looks at this stuff with me. I don't
regret the fifty dollars I laid out for _Programming Perl_. YMMV.

BTW, I think it's unrealistic that you would pick up programming without a
background in it. My $.02 .
 
P

p.podmostko

BTW, I think it's unrealistic that you would pick up programming without a
background in it. My $.02 .

So you say that it's futile for me to continue studying it?

Przemek
 
U

Uri Guttman

FS> Uri and his ilk are why I would advise against thinking you can
FS> conquer the many idioms of perl by relying on usenet. Post a few
FS> more questions as you supplement your study and watch their tone
FS> slip as you don't follow Uri's life advice.

the fact you aren't learning perl quickly yourself is no reason to rant
about how usenet works or doesn't work. you have posted forever about a
trivially simple problem and have taken forever to grasp the simplest
perl idioms. you ignored coding and educational advice, you constantly
seem to compare perl ops to similar ops in c and can't see the
differences. your views on programming, and training aren't valid so why
did you jump in here? i can't wait for keel to stick his nose in too.

FS> clp.misc varies like any usenet group. Doesn't seem to be many
FS> OP's and Uri is front and center: hmmm.

huh?? try to make some sense.

FS> Other times, it's been nice. What's really helped me this time
FS> around is that I have a sysadmin buddy who looks at this stuff
FS> with me. I don't regret the fifty dollars I laid out for
FS> _Programming Perl_. YMMV.

so ask him to train you.

FS> BTW, I think it's unrealistic that you would pick up programming without a
FS> background in it. My $.02 .

speak for yourself. you have some programming background and can't pick
up basic perl that has been spoonfed to you. comment operator anyone?

uri
 
U

Uri Guttman

pp> So you say that it's futile for me to continue studying it?

no, i say it is futile for him to study perl given how slowly he has
learned from a simple problem he posted. look back for those threads and
you will see what i mean. so far you have asked intelligent questions
and responded with more. that bodes well for learning any technical
skill. so go ahead and learn perl and you can get help here if you need
it. you can even learn from scratch from a book called elements of
programming with perl. it teaches programming from zero and uses perl as
its language. pretty good book and you should be able to find cheap used
copies of it. the perl docs are another major resource and include
plenty of tutorials. there are other good books but they assume some
programming skills. also many extension colleges offer perl courses. the
question is what level of coder are you aiming to be? you can do fine
being self taught (especially if you like to read tech books). but to
aspire to something bigger would generally require some academic
background. i know plenty of self taught coders and some are pretty good
but they usually are weak in theoretical areas. if you are doing natural
language processing, then those are important areas to know well. so it
all depends on your goals, your time, your resources and how well you
learn new stuff.

uri
 
M

Mart van de Wege

So you say that it's futile for me to continue studying it?
That is what he seems to be saying, yes.

But don't be discouraged. This does not seem to be a majority
opionion. I myself disagree. If you're capable of building up a mental
model and know how to manipulate symbols in that model, you have gotten
through the most difficult phase. A few courses in math to make sure you
understand some of the most common algorithms, and you're done.

What branch of linguistics are you working in? If you've done work in
things like natural grammar, you should have little problems adjusting
your thinking to programming.

Mart
 
P

p.podmostko

Well, thank you all for keeping faith in me :)

I'm a translator originally. The thing is that I have several ideas
regarding several small modules like dictionaries or thesauruses that
I would like to materialise. And yes, I do realise that it's a very
long way to start writing my own programs from scratch.

I have become inspired to get into computational linguistics after my
BA thesis where I tested various concordance-based tools and how they
cope with translating collocations.

But I also see learning Perl as a mental challenge for me. I have
always wanted to know a programming language and I always envied
people who had absolutely no problems with solving mathemathical
problems. Having said that, I'm not aspiring to be the next Dijkstra,
I just have some personal purposes for doing that. Nuff said.

Thank you once again for hospitality

Regards
Przemek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top