Basically I want to hear some opinions on the languages: C, C++, Java, and Perl.
Which is your favorite, what does it have that other languages don't have, what does it lack that would make it better, and if you had to learn another, which would it be?
TheLinuxDuck
10-11-2000, 10:25 PM
I have always liked C because of the infinite amount of control you have over everything that happens. C definitely doesn't baby you through anything. Once you're done, and the program is compiled, it starts fast, runs fast, and is generally pretty qool. However, comparisons, searching in data, etc, can be a little complex.
Perl is nice because it doesn't take a gazillion lines of code to make something that is pretty functional. It handles a lot of stuff behind the scenes that sometimes can be a pain in the poohole to have to fuss with. And, if you edit the code, you don't have to wait for it to recompile. But, it can take a little longer for the script to execute, especially if you are using some complex namespaces (I think that's the right word.. like use GD, or use CGI). Perl has regular expressions, which rock. http://www.linuxnewbie.org/ubb/smile.gif
C++ is like C that you control all the little bits and pieces. I think classes are pretty groovy. I get a kick out of overloading operators with my own data types. http://www.linuxnewbie.org/ubb/wink.gif I don't know C++ very well, so I can't comment too much on it.
That's about all I know, really. http://www.linuxnewbie.org/ubb/smile.gif
------------------
TheLinuxDuck
Wait... that's a penguin?!?!?
:wq
JoniMitchellRockedMyWorld
10-11-2000, 10:43 PM
My favorite language is C because it's the only one I know/am learning. http://www.linuxnewbie.org/ubb/tongue.gif
Once I become relatively competent in C I'll give C++ a shot and probably Java too. But that won't be anytime soon.
Strike
10-11-2000, 11:25 PM
C, probably. There's not a thing you can't do with it, pretty much. If it can be done with a computer, a program can be written in C (with perhaps some inline assembly for the necessary low-level stuff) that will do it. Plus, it's also the one I know best (along with C++). It is also definitely the fastest of the ones you mentioned.
Perl is great for scripty-type things, though. I've seen some seriously good stuff written in Perl that would have taken a long time in C to write (though, as I said, it could be done). It gets rid of a lot of the overhead in a lot of programming tasks. Plus, there are a lot of Perl scripts already out there.
Java is also pretty cool. It's like C++ with a twist. A lot of classes are provided for you, and basically you build off of that. I think sometimes that it is more C++ than C++ is in terms of programming paradigms, because C++ gets hung up on C compatibility whereas Java was designed as an OOP language from the start. Plus the cross-platform compatibility can't be beat with Java (at least, not as far as I know).
And, they are all good to know. Perl is just used for different stuff than the other three. Big applications are generally not written in Perl (though they can be), whereas C, C++, and Java are often used for big apps. C is by far the most coded of the three, but Java is making the most growth in terms of projects using that particular language (I think).
And if I had to learn one, I'd learn them all, because ... I am http://www.linuxnewbie.org/ubb/smile.gif
[This message has been edited by Strike (edited 11 October 2000).]
Darth Tminos
10-12-2000, 01:40 AM
C: you name it, C can do it.
C++: same as C, but with extra "enhacements". Some people like them, others don't.
Java: it works on nearly every platform known to man, but it can be SLOOOW.
Perl: great text searching abilites, and great for simple hacks.
StarWeaver
10-12-2000, 04:26 AM
PHP: The web script that is just about as powerfull as C, and just about as easy as PERL. The syntax is almost like C though, except for $variables and a few extra keywords, and it's easy. :) Hell it's the only language i've really written anything serious in ... (500-1000 lines of php and some REALLY complicated (AFAIAC) functions -- my website :)
-RASX
mastersibn
10-12-2000, 05:26 AM
I'm partial to C, because it's the only language I know -anything- about which also happens to have a name that I can spell correctly every time.
------------------
grab my gnupg key (http://jove.prohosting.com/~msibn/sibn-p.asc) if you feel so inclined.
do the world a favor: give an employee something to smile about.
kmj
10-12-2000, 08:30 AM
I suggest you all take a look at the J Programming language. It's definitely the coolest there is...
The following line of J code will give you the first n digits of pi
(10x^n) %~ <.@o. 10x^n
J is definitely the coolest language out there. Someday, I'm going to go into the mountains for 5 years and come back a J master.
Edit: Here's a link (http://www.cs.ualberta.ca/~smillie/Jpage.html), since I'm sure you're all terribly interested.
[This message has been edited by kmj (edited 12 October 2000).]
Strike
10-12-2000, 10:04 AM
Originally posted by StarWeaver:
PHP: The web script that is just about as powerfull as C, and just about as easy as PERL.
Hmmm...this claim sounds a bit far-fetched to me.
Originally posted by kmj
I suggest you all take a look at the J Programming language. It's definitely the coolest there is...
...for modeling processes and functional programming and/or heavily math-related programs. But it's just not as versatile as any of the four mentioned, I don't think. Not to mention the codebase (i.e. functions already written in that language) is way smaller.
kmj
10-12-2000, 11:40 AM
I didn't say it was the best, just the coolest. http://www.linuxnewbie.org/ubb/biggrin.gif
Plus there are places you might not expect where it shines. My professor was big on using it to manipulate graphics. Of course, your right, there are alot of places where you wouldn't even consider it, and the investment that it takes to be able to read even a single line of code is tremendous. Still, it's funkin' groovy.
Strike
10-12-2000, 12:27 PM
True, it's pretty slick. The very little I know is pretty neat. It's an interesting mix of a bunch of different types of program. It's kinda like MATLAB in that it's command-line driven like it is, but it's just ... more interesting (though not as useful for some tasks).
klamath
10-12-2000, 12:57 PM
I know Perl, Java, C (not much), and Python.
Perl - A very handy language. You get work done quickly, and it adapts to your style. You can write both 30-second oneliners and 25,000 line projects (although both require a change in coding style). Very good at text manipulation, and web programming (with mod_perl & Apache).
C - The language of UNIX. I've never really liked it, so I won't comment.
C++ - Object-oriented C. It tries to be backwards compatible with C (which, IMHO, is a bad idea). It also doesn't include automatic garbage collection, which is the source of lots of bugs. I've never much liked C++ either, although I haven't spent a lot of time looking at it.
Java - C++ done right. Relatively 'pure' object oriented language. Good for a lot of general applications. Very portable. A like it a lot.
Java: it works on nearly every platform known to man, but it can be SLOOOW.
Not really. It works on every platform with a JVM, which isn't really that many. Also, Java isn't that slow.
And PHP is a *scripting* language for wussy web designers, who aren't smart enough to learn a real programming language http://www.linuxnewbie.org/ubb/biggrin.gif
------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
StarWeaver
10-12-2000, 01:28 PM
Originally posted by Strike:
Hmmm...this claim sounds a bit far-fetched to me.
Yeah, hehe. It's not as powerfull in most senses, it just seems like you can do just about every damn thing with it :)
Was tired. :)
-RASX
StarWeaver
10-12-2000, 01:30 PM
Originally posted by klamath:
And PHP is a *scripting* language for wussy web designers, who aren't smart enough to learn a real programming language :D
Actually _I_ like it cause i already know C and it just seems very similar to me :)
-RASX
jemfinch
10-12-2000, 02:39 PM
Perl: I use it for everything that doesn't require absolute speed or a tiny memory footprint. It's incredibly easy to write once you know it; it also reduces the amount of typing I have to do. I use it for *tons* of one-liners, like checking the md5sums of a bunch of files I've downloaded and comparing them to a file (which undboutedly has a different format every place I get it from), or finding out how much music is actually in the 6gb of live phish I downloaded yesterday (42 hours or so). If *nix is all about glueing together lots of different tools that do their job and do it well, Perl is some damn good duct tape, and it tapes well.
C: If I need speed or a small memory footprint (like network daemons for my firewall) I use C. It's logical and decently pure, not to mention that it feels deterministic (yes, all languages are deterministic, basically, but some just don't feel like it -- C does).
C++: I hate OOP.
Java: I hate OOP.
Jeremy
nanode
10-12-2000, 03:21 PM
Jemfinch,
I thought you didn't know any OOP? :P
For the things you do (from what posts I've read) OOP doesn't do anything valuable for you.
Try designing a WYSIWYG builder tool in C or Perl - it can happen, but with so much code reuse, OO starts to make sense.
dunno
10-12-2000, 03:51 PM
Thanks for your input eveyone. It seems I picked a decent language to learn first (C) and I believe I may have to check out Java.
pdc
10-13-2000, 01:40 AM
I like perl a bit, C alot, C++ I am not sure about, IBM BAL (basic assembler language) is cool, REXX (also from IBM) is, IMHO, a much better interpreted language than perl, never liked Intel assembler (any idiot knows that bytes should be stored in memory exactly as they appear in registers), pascal is kind of fun, vbasic is easy (but written by evil weenies, so I try to forger what I have learned).
Your choice of C is not bad. Make up a .c file of the functions that you have written that can be re-used, make up a little header file to define and extern stuff and start building a base. Steal very little #define you find that looks cool and stick it in your .h file. You will find yourself writing programs where main() is about five lines of code.
Paul
[This message has been edited by pdc (edited 13 October 2000).]
Gweedo
10-14-2000, 03:03 PM
I like C, C++, and java. I like the whole group.. I pretty good with C and building up my skills with C++. If ya know C++ then ya pretty much know Java. http://www.linuxnewbie.org/ubb/smile.gif
lazy_cod3R
10-15-2000, 01:07 AM
perl : is cool and good for quick scripty type things, need more practice tho, lacking the style http://www.linuxnewbie.org/ubb/biggrin.gif.
java : to me was the easiest to learn because of the oop i had already known.
c++ : if the first language u learnt was java and u then try to move to c++ it can be a bit of a pain in the backside, syntax looks the same but there is alot of difference in the way things work.
c : neva tried it b4 http://www.linuxnewbie.org/ubb/frown.gif
Mazarin
10-15-2000, 04:03 PM
Perl: I'm a Perl freak, It was pretty much my first programming language. The regex is to die for, you can write a 1 line regex that can do things most languages can't do in less then 20.
C/C++: I'm pretty new to both of them. C is really spiffy, C++ is even nicer because of classes. Both can do anything.
Java: Great if your programming for more than 1 OS. But I can't seem to get over the speed issues.
Strike
10-15-2000, 07:52 PM
Addendum - Java with Swing is pretty cool for whipping up a quick GUI. Really makes the C++ coder in me happy, because I didn't like the way GTK did some things, and Java is (like I said) more C++ than C++ sometimes. So, what I've seen so far of the Swing stuff is pretty neat. Though, to be fair, I'm going to also be trying to find time to learn GTK-- (the C++ wrapper for GTK) at the same time so I can pick which I like better.
gboutwel
10-16-2000, 06:15 PM
Hmm... Each language has strengths and weaknesses, complete with situations where it fits better than any other language. It most-likely possible to accomplish the same thing in virtually all languages, some it's easier to do in than others.
That said... I like C and C++. These two languages have stood the test of time (C++ a little less than C), are standardized (unlike Java), and have been used to program in multiple 'paradigms'. You CAN do OOP in C, it just isn't as easy as C++ which was extended and intended to make OOP easier. But you can use other paradigms (such as Generic Programming) with C++ and even C.
Most other languages have been 'locked' into a paradigmn of one type or another, or have to go through substantial changes to make them support new paradigmns. I think one of C/C++ greatest features is it's flexibility.
But like I said it depends on the fit of the language to the problem. In the end learning more than one language keeps you sharp, and helps you konw the strength and weakness of the languages that you work with.
George
Dru Lee Parsec
10-16-2000, 06:56 PM
Re: Java Speed Issues.
Oh Man! If I hadn't signed that Non-Disclosure Agreement I could tell you some cool stuff about how fast Java will be.
Seriously, this is not a joke.
justlinux.com
Copyright Internet.com Inc. All Rights Reserved.