ProgrammingThis 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.
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.
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?
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?
If you remember any C, it may make more sense to go to that first, but Perl is easier. (Speaking as someone who has used both in serious work).
For Perl you'll want to bookmark these:
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.
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.
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:
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...
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.