Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-17-2008, 04:41 PM
|
#1
|
Member
Registered: Feb 2005
Distribution: Debian, Kanotix, Kubuntu
Posts: 117
Rep:
|
Starting to program in c or perl?
I was thinking going back into programming, i programmed little with C a while back. My question is, should i learn perl or C or in that case C++ and then go back and pick up on perl (since i wanna know both). And How long will it take me to get the syntax down in perl, since I've never done any perl. So C or C++ or Perl?
|
|
|
09-17-2008, 04:50 PM
|
#2
|
LQ Newbie
Registered: Jan 2008
Posts: 6
Rep:
|
Quote:
Originally Posted by memo007
I was thinking going back into programming, i programmed little with C a while back. My question is, should i learn perl or C or in that case C++ and then go back and pick up on perl (since i wanna know both). And How long will it take me to get the syntax down in perl, since I've never done any perl. So C or C++ or Perl?
|
check out python or even better ruby.
|
|
|
09-17-2008, 07:23 PM
|
#4
|
Senior Member
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Rep:
|
Quote:
Originally Posted by memo007
Starting to program in c or perl?
|
Starting to program what? What kind of program do you want to write? Unless you answer that question, recommending anything to you won't be wise.
|
|
|
09-17-2008, 10:53 PM
|
#5
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
Joining the chorus which says: "We can't tell you what to do."
This is like saying: "I want to work on cars, what tools should I buy?" Are you into body work, engine overhaul, wheel alignment, or maybe interior detailing?
Enough harrassment---you can not go wrong knowing C. It teaches discipline and it teaches all the common constructs---as such, it makes learning other languages easier.
|
|
|
09-18-2008, 03:00 AM
|
#6
|
Senior Member
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Rep:
|
Quote:
Originally Posted by pixellany
Enough harrassment---you can not go wrong knowing C.
|
You can. AFAIK, using OOP with C won't be as simple, as in C++/Python/Java.
|
|
|
09-18-2008, 03:21 AM
|
#7
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
It used to be that the one language you wanted to learn first was Pascal. IMHO, the best learning language today is Python. The lessons and disciplines you learn will help later on if you want to learn C. C is the native programming language for most parts of linux including the kernel. C++ is the native language for KDE development. I've heard programmers say that when they write a graphical app, they do so for gnome because they don't care for C++. ( E.G. the person who started asterisk later wrote gaim, stated this in a TWiT FLOSS episode )
For web development, you would probably want to learn Java and Perl or PHP.
|
|
|
09-18-2008, 04:41 AM
|
#8
|
Member
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138
Rep:
|
Quote:
Originally Posted by ErV
You can. AFAIK, using OOP with C won't be as simple, as in C++/Python/Java.
|
Can you use OOP in C? I know you have structs but there's no concept of class methods, inheritance, objects or encapsulation is there?
|
|
|
09-18-2008, 05:44 AM
|
#9
|
Member
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493
Rep:
|
Quote:
Can you use OOP in C? I know you have structs but there's no concept of class methods, inheritance, objects or encapsulation is there?
|
Yes you can...
since the C syntax doesn't able you to implement these concepts, you have to use programming trick. Take a look at my answer to a previous post there:
http://www.linuxquestions.org/questi...semble-670270/
I give some link where these tricks are explained.
And to go further, "gtk" is written in pure C but is fully OO. And many parts of the linux kernel, and many other porjects...
|
|
|
09-18-2008, 05:48 AM
|
#10
|
Member
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138
Rep:
|
What advantages does it have over using C++?
|
|
|
09-19-2008, 07:32 AM
|
#11
|
Senior Member
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Rep:
|
Quote:
Originally Posted by elprawn
What advantages does it have over using C++?
|
Isn't bloated, compatible with more compilers, and you have control over everything.
|
|
|
09-19-2008, 07:48 AM
|
#12
|
Member
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493
Rep:
|
Quote:
Isn't bloated, compatible with more compilers, and you have control over everything.
|
I add that:
C is the best defined programming language regarding to its international normalization, there's "just" about 200 undefined / unspecified behaviors, this is far less than the C++ (and any other standardized languages) standard undefined / unspecified behaviors. This issue is _REALLY_ important for portability.
You can found a C compiler for almost all arch you can meet all over the world, from the smallest micro-controller to the biggest super calculator...
|
|
|
09-19-2008, 08:07 AM
|
#13
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,311
|
A programming language is just "a tool for the job." So, probably the best thing to consider in each case is, "what's the job (this time)?"
Perl's strong suit is text-hacking... ripping strings apart to get things out of them, building so-called "hashes" to do lookups and counts, and so-on. Also, Perl gives you access to the vast CPAN library of (generally...) well-tested code.
Other languages that are in-vogue these days, like PHP and Ruby, of course provide similar capabilities. All of them are very-competently and efficiently written, all things considered. But... what language were they written in?
All of these languages are written using C or C++ or both, as well as "in themselves." And this, for me, pretty well sums-up "the job" that these two languages are best at: fairly low-level programming to do things, like "building other languages."
A single line of a high-level language program might involve the execution of tens of thousands of lines of underlying "C" code, all of which is therefore "at your beck-and-call." All that code, and you didn't have to write it, didn't have to debug it, don't even have to think about it.
I don't know what to tell you specifically about "what to learn." In time you will need to learn all of them. ("Tools for the job.")
Last edited by sundialsvcs; 09-19-2008 at 08:08 AM.
|
|
|
All times are GMT -5. The time now is 03:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|