Click to See Complete Forum and Search --> : Can someone really learn Perl or C++ from a book only??
RedOctober
10-31-2000, 03:21 PM
Can someone really teach themself Perl or C++ my reading a book. I have no programming knowledge, never ever wrote a letter of code but is trying desperately to learn a programming language. I was told that Perl was easier to learn. Well after a week and a half I am still on chapter 3 of "Perl5 by example". I know my way around windows so I installed the software from the ActivePerl website (the one that came with the book did not work). I have been in this book every day and still cant make sence if anything, I am so lost. I am thinking I may just try C++ since I heard that it has a visual interface and not just comand line like Perl. What do you guys think. can I do this from a Book.
Nuff respect
------------------
big up to all a de linux man dem ina de place
TheLinuxDuck
10-31-2000, 03:29 PM
Originally posted by RedOctober:
Can someone really teach themself Perl or C++ my reading a book.
Reading a book isn't enough. You've got to look at sample code, you've got to ask people who know something about the language lots of questions, you've got to hack other peoples code, you've got to try different things and see how they work, or what doesn't work.
It takes a lot of time to get used to perl, especially not having any prior programming experience. http://www.linuxnewbie.org/ubb/smile.gif
but don't give up just yet! It took me a month to get a grasp of perl. http://www.linuxnewbie.org/ubb/wink.gif
kmj and I have started a 'programmers reference' type site (with contributios from kmj, me, druleeparsec, and strike), that is quite small at the moment, but maybe it will have a few things you can look at and maybe give you some understanding.. here is the link: www.geocities.com/bfkester/ccae.html (http://www.geocities.com/bfkester/ccae.html)
Take a look at some of the perl examples, or whatever you wish to peruse, and see if any of it helps you understand anything you were confused on.
Of course, you are also more than welcome to post any questions or anything in the programming forum here at lno.. there are lots of people there that will be glad to offer advice or assistance to you.
http://www.linuxnewbie.org/ubb/smile.gif
------------------
TheLinuxDuck
Wait... that's a penguin?!?!?
:wq
RedOctober
10-31-2000, 03:41 PM
Thank you LinuxDuck, I am just so fusrtated. I really do not have anyone around that knows programming of any sort. I help all my friends turn their computers on.....(literaly) So I am kind of on an Island. I think its the comand line thing that bothers me the most. I taught myself HTML in a day using a book and Homesite HTML editor.....it helped that I could see results immidately. I want to be able to write myself small programs like have my computer email me if certain things happens, write small .exe programs etc. Perl or C++??? I dont know, I just have an eager to learn
YaRness
10-31-2000, 03:46 PM
it's like deja-vu all over again, i just posted on a thread that looks exactly like this over in the programming forum.....
http://www.linuxnewbie.org/ubb/eek.gif
------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
------------------
TheLinuxDuck
10-31-2000, 04:01 PM
Originally posted by RedOctober:
I really do not have anyone around that knows programming of any sort.
What about us here at lno? I'm no perl whiz, but I can maybe give you some insight or some pointers...
I want to be able to write myself small programs like have my computer email me if certain things happens, write small .exe programs etc. Perl or C++??? I dont know, I just have an eager to learn
My advice would be:
Stick with one language long enough to determine whether or not you like it. I'd say give it at least a month or two before you decide to quit trying to learn (or switching to a differnt language)
Also, I do system analysis and email notification purely in shell scripts. There are always cases when one language will suffice over another.
The bottom line is that it just takes some time and patience. (which I personally don't have very much of in certain areas.. http://www.linuxnewbie.org/ubb/smile.gif)
Can you give me a lowdown on what is causing your frustrations and confusion?
------------------
TheLinuxDuck
Wait... that's a penguin?!?!?
:wq
RedOctober
10-31-2000, 04:15 PM
I cannot seem to tie what I am reading to real life. So I am writing script to tell my computer to do things but I have to evoke it from the command line. Programming is not plain english. Eg. this book give an example using { } in the middle of the example I should try to run but what are these { } for??? The book do not say.....every page I turn so far is another new command to go with the one on the previous page from the previous chapter. I get the basic arrays, strings and variable but cant seem to move on from there.
RedOctober
10-31-2000, 04:18 PM
I guess it would help if I could see what Perl can do meaning how does a program run by itself.....what exactly can I do with it...can I write programs for everything and have these tasks automated??
TheLinuxDuck
10-31-2000, 04:57 PM
Originally posted by RedOctober:
I guess it would help if I could see what Perl can do meaning how does a program run by itself.....what exactly can I do with it...can I write programs for everything and have these tasks automated??
You mentioned ActivePerl earlier.. I know nothing about the differences between an activeperl script and a script for a *nix machine..
However, the { } are block identifiers.. they are used with if statements, defining subs, etc.. some examples are:
#!/usr/bin/perl
# First, we define our two numbers, and
# assign values to them.
my($number1)="30";
my($number2)="40";
# Then, we're going to test whether or not
# one is greater than the other, and execute
# blocks of code, depending on if's return
# if() sets up our loop statement
#
# The first set of {}, or block identifiers,
# is executed only if the if() returns a true
# or 1. The else block gets executed only if
# the if() returns a false, or 0.
#Examine the following if() else
if(1) {
print "True\n";
call_some_made_up_function();
}
else {
print "False\n";
call_some_other_made_up_function();
}
# This example will always print "True",
# because 1 is always true, and the if
# executes the first block of code upon
# the receipt of a true. If we changed the
# first line to "if(0) {", it would always
# print "False", because 0 is always false.
#
# In our example, we're going to check to
# see if $number1 is greater than $number2.
# If so, the expression '$number1>$number2'
# will return a true, thereby executing the
# first block of code.
#
if($number1>$number2) {
print "$number1 is greater than $number2";
}
else {
print "$number2 is greater than $number1";
}
I hope that this has been instructive, and answered your question about the {} block identifiers.. There is much more to them, but this example will give an example usage. If I have covered something you already understand, then let me know, and we can move to something else. ' http://www.linuxnewbie.org/ubb/smile.gif
Btw, why don't you post the code snippet from the book, showing how the { } and being used that you don't understand.
------------------
TheLinuxDuck
Wait... that's a penguin?!?!?
:wq
Big_daddy
10-31-2000, 05:07 PM
You cannot learn it from a book. You learn it by doing it and using the book as a reference.
Strike
10-31-2000, 05:16 PM
Originally posted by Big_daddy:
You cannot learn it from a book. You learn it by doing it and using the book as a reference.
The man is smart. http://www.linuxnewbie.org/ubb/biggrin.gif Seriously, this is right on point. You can't be good at programming without actually doing it, so you have to code, not just read. But you have to read before knowing how to code. So, it's just a cycle of read, code, read, code, etc. That's how you learn how to program.
RedOctober
10-31-2000, 05:24 PM
TheLinuxDuck, I have read over your post with the sample code several times and I am slowly getting it. I will continue to toil on and hopefully someday I can arise from my cahir and say I am a Perl Programmer. Wish me luck as I enter the new world.......to emerge a programmer. Thanks man. If I come across anything I will drop you a line.
------------------
big up to all a de linux man dem ina de place
Linuxman
10-31-2000, 05:25 PM
I agree with the above post by Strike - learn by doing. Years ago when I was in college, I took a course that used Pascal. Going to class was a joke, I never learned anything from the teacher. What I was required to do was write code by trial and error and use the manual as a reference. Although Perl and C++ are not Pascal, I'm sure the same principal applies today.
------------------
ADOPTION not abortion. Proud father of an adopted boy.
NFL Week 9
Ravens 6, Squealers 9
Can we score a ****ing touchdown please!.
W 5
L 4
Next Week at Cincinnati. This may be the gift the Ravens need.
[This message has been edited by Linuxman (edited 31 October 2000).]
TCaptain70
10-31-2000, 05:26 PM
I have to agree with most of the opinions stated previously here. Basically you can't ONLY rely on the book. You have to look at examples, try things out yourself to see what works and what doesn't.
Although someone said to give it a few weeks or a month to see if you like a given language...I don't know...maybe I'm particular but unless that's full time for a few weeks, I don't think you can learn enough of a language to know all its failures/successes to make an informed decision really....
However, more important than the language (to a point) is the theory behind the code. The specific problem-solving/analysis way of thinking that turns a mediocre hack into a cool application, THAT I don't think can be learned from a book.
Its not just the language, its the logic. There is elegance in a good piece of coding, but is that because of the language or because of the author?
krupa
10-31-2000, 08:25 PM
Just wanted to put my 2 cents in.
I'm trying very hard to get a hang on C/C++ through books.
I found that the way I started understanding it was keeping some kind of program in my head the whole time, and seeing how what I was reading would relate to it. (For me it was Blackjack).
Also, you have to pay a LOT of attention when you're reading because, so many programming books have so many typos it isn't funny. You can spend a long time tracking down a bug in a prog you copied word for word out of a book...and the bug turns out to be a typo.
Another place you might want to look once you get the basics down is SourceForge.net.
People are looking for programmers with any experience, and working with other people WITH a lot of experience can only help you.
But that's just my opinion, I could be wrong
RedOctober
11-01-2000, 10:23 AM
thanks all.
11000
11-01-2000, 02:48 PM
Originally posted by krupa:
Also, you have to pay a LOT of attention when you're reading because, so many programming books have so many typos it isn't funny. You can spend a long time tracking down a bug in a prog you copied word for word out of a book...and the bug turns out to be a typo.
No kidding! If you can, find a book that's got the code samples on their website, because the typos have more then likely been updated or fixed on the website, and if you hit a deadend you can check there.
Alex Ethridge
11-01-2000, 08:48 PM
Keystone Learning Systems has the best training materials I've seen on about any computer program.
PERL Training:
http://www.keystonetraining.com/cgi-bin/ncommerce3/ExecM acro/Category/keystonecat.d2w/report?cgmenbr=7020&cgrfnbr=2951 (http://www.keystonetraining.com/cgi-bin/ncommerce3/ExecMacro/Category/keystonecat.d2w/report?cgmenbr=7020&cgrfnbr=2951)
Keystone Learning Systems main page:
www.klscorp.com (http://www.klscorp.com)
[This message has been edited by Alex Ethridge (edited 01 November 2000).]
dharmabums
11-01-2000, 09:17 PM
Books are good if you know programming basics and want to learn the syntax of a new language. Grab some source and study it, this is a good way to learn
Morganth
11-01-2000, 10:51 PM
I learned all of the languages I know by the vicious read/code cycle aforementioned. I'm currently taking a course in school for C++, but I have known all of the standard C libraries for awhile. I learned them from a book called "Programming in C" and another one called "C++: The Core Language." Neither of these books came with CDs, but the way I learned it was by reading of a concept, and then trying to code a program using it. And then I did that for practically every chapter. I remember, when I learned about special character keys, like the \d (delete) character, I quickly coded a function I called "slashanim()", which allowed you to do one of those cool spinning forward slash animations that are so popular in the Linux crowd.
Just try to read and then code a little program from what you read. It doesn't really have to help you, but just so you see if you know how to apply the concept you've learned. If that gets you nowhere, take a course (though I don't find courses to be very helpful).
Also, do *not* start with Perl. I know Perl but I could have never learned perl as my first language.
-Morg
RedOctober
11-02-2000, 09:54 AM
Ok...I got a lot of great responses. I am 5 chaperts deep in this "Perl5 by example" book and I am getting a mixed feeling that I should be learning C++ instead as its easier but then I also hear its harder to learn. HELP.
Also this book up to know consists only of mathematical examples .eg. areaofretangle, areaofcricle etc. I just want to write programs...do I need to learn all this maths stuff. HELP ME PLEASE
------------------
big up to all a de linux man dem ina de place
HuggyBear
11-02-2000, 10:51 AM
Linux and programming can seem very overwhelming to most people. If you have the desire then see it through. If you are frustrated stay away from it the rest of the day. Give yourself little projects and see them through. For me I will learn the basics and then code a project. Along the way I may want to see if I can do something a certain way so I will research and find function or set of functions that will. Learn as you build is probably the best way to learn for myself. I seem to remember most everything after seeing it work.
Dont give up
Huggy
TheLinuxDuck
11-02-2000, 10:53 AM
RedO:
Learning any language as a first language (minus basic) can be a challenge.. because it's not only the particulars of the language you're learning, but the concepts in general. If you think perl is too much for right now, I can understand.
It just will take some time to get used to the ideas and concepts behind the structure of a program. Once you start getting a few of your own endeavors behind you, it will start to focus a little more, and you'll start having a mental picture of how the program will work before you even sit down to start coding.
In fact, sometimes, I take a few days and just think about the project I'm going to attempt, to give myself enough time to think about how the programs flow should be, to think about what steps I need to go through, etc..
Have no fear, you're not alone! http://www.linuxnewbie.org/ubb/smile.gif
And, ask anyone in the programming forum for help, and I'm sure you'll get it!
------------------
TheLinuxDuck
Wait... that's a penguin?!?!?
:wq
RedOctober
11-02-2000, 10:57 AM
OK....I am starting this book over again. I am thinking that I should get a second book maybe Perl Cookbook........I hear its not for beginers though. mmmmmm
I just got the book "SAMS Teach yourself C++ for Linux in 21 days". So far it seems really good. It comes with a CT with Drake w/compiler. I just finished the first day and wrote (copied) the code for the Hello World! program, compiled and ran. I've noticed this book has exersizes throughout each day's lesson.
So to make a long story short, or at least to end a long story I would recommend this book, though I know very little about programming.
------------------
The Hills of Defeat are covered with the bleached bones of those, who with victory in sight, paused to rest. Hurry up everytime you think about it.
Sorry, meant to say it comes with a CD. I look at CTs all day and just got confused. http://www.linuxnewbie.org/ubb/cool.gif
------------------
The Hills of Defeat are covered with the bleached bones of those, who with victory in sight, paused to rest. Hurry up everytime you think about it.
PimpHolic
07-27-2001, 01:59 AM
i have no programming experience...well a bit of scripting with extremely basic javascript..but i am also in the midst of learning perl as my first language..and so far it doesnt seem too bad..this is a tutorial i would recommend im not too far in it but it seems pretty good Roberts Perl Tutorial (http://www.netcat.co.uk/rob/perl/win32perltut.html)
sincka
07-27-2001, 02:20 AM
I have to comment on this. I've been doing C/C++ for about 6 months now. It's my first language(s). At the beginning I hated it... but the more I hated it the more I got into it. When I can't do something I never give up. My computer is full of dents and crap because of my frustration.
Only now am I able to understand what I am doing and why the program acts the way it... well acts :p
Really... C/C++ is not easier to learn that Perl.
My whole point is 'stick with one thing' and give it time. You will most likely make a few dents in your computer but it will pay off.
Stick with Perl!!!
ps. Taking your anger out on pillows causes a lot less damage.
Malakin
07-27-2001, 03:03 AM
The best advice I can give you is to use several books not just one if you can afford them. Also find several good reference web sites and sample code and bookmark them. If you ever get frustrated on something move onto something else and get back to it the next day. It does help to have someone around to ask questions but I'm self tought in a bunch of languages so it can definitely be done, but without someone around who's willing to answer your questions you will end up banging your head against the wall at times when you're stuck over when ends up being something simple which is why it's nice to have multiple sources for your info.
I'd also suggest starting in C since it's a lot easier to learn then Perl or C++ or Java but that's just my opinion, if you have a specific reason to learn Perl keep going and don't let me stop you :)
One more piece of advice, if you have a day where you don't have enough time to do any programming always try to at least read for 15 minutes to keep your mind on it.