PDA

View Full Version : C or Java as a first language



CorJava
10-20-2002, 12:33 AM
I am considering using C or Java as a first language. Which would be easier to learn first? You may think its ridiculous for someone to come to a C forum and ask for a comparison with another language. But, I am not asking which is superior, but rather which is better for a beginner. I've heard many say Java is easier to learn than C++. But I'm just talking about C. I haven't seen any C/Java comparisons really. Just C++ and Java. I guess thats because C++ is OO like Java. I figured if I am going to learn OOP, I might as well use Java since it is more simple than C++. However as I am a beginner, OOP might not be a good idea for me yet. So, in that case, maybe I should go with C. To the contrary, I've heard C has these things called pointers(is that like a goto type thing?), that are often very difficult for beginners to comprehend; while Java lacks that.So my decision has been narrowed down to C or Java, which should I start with? As you can see, I need some guidance in this decision. I appreciate any help you can give me.

PS:
Although I am pretty much set on using one of these two languages, I am open to some other suggestions if I happen to be terribly mistaken in my selections.

daticus
10-20-2002, 12:49 AM
Go with C, there are some concept in Java that might overwhelm u if this is your first language; stuff like inheirtance, polymorphisim.

Right now i'm re-learning C and it's perfect for any beginner.

Troll_King
10-20-2002, 12:55 AM
You need to acquire a compiler to use C/C++. The book to get is C++ Primer 3rd edition. It's a 1,200 page book and it will give you a full introduction to C++ like no other book on this planet. It's the most comprehensive book on C++, and it is aimed at beginner/intermediate.

The C programming language is the easiest to learn, but you might be able to learn it through C++.

If you go with Java, that would be good too. C/C++ and Java should not be compared with each other. If you want to learn Java, than ask questions at < www.flashdaddee.com >. There isn't many posts there, but the programmers will answer any Java question, especially the webmaster.

Prelude
10-20-2002, 07:46 AM
>Which would be easier to learn first?
It depends on what you want to do with it. C and Java are used for wildly different purposes. The generic answer is that Java is the simpler language to learn and use for non-trivial projects quickly. C requires low level knowledge and a certain amount of 'tricks' to be able to write a useful level of code. If you just want to get started programming something useful as quickly as possible then I would recommend Java, otherwise I would recommend you determine exactly what you want to do with the language and then choose which language fits that need the best.

-Prelude

Mister C
10-20-2002, 10:21 AM
Agree with prelude on this. I have taught Java and C for over 2 years my students with C background tend to do better. You will also see that the non OOP stuff in Java is almost exactly like C.


To Troll_King

C++ Primer Plus and C Primer Plus are now on there 4th edition. Good Books.

CorJava
10-20-2002, 02:39 PM
Thank you all for the advice. I'm not exactly sure what I want to do with the language. I would say its more of just me wanting to acquire some solid programming skills. General-purpose, all around programming, would be my goal, I guess.
I'm still confused, because everyone has made some valid points.
Take what daticus said for example:


Go with C, there are some concept in Java that might overwhelm u if this is your first language; stuff like inheirtance, polymorphisim.

(hope the quote tags worked)


That kind of confirms what I've worried about so far as OOP is concerned. Troll King also said C would be the easier language.

But then Prelude and Mister C, made some good arguments too. I've heard that C is definitely more low-level than Java, and I've also heard the concept of pointers can throw some beginners off as well. So I'm getting good arguments from both sides. Hence the confusion. :)

I have a book and a compiler for each language, and I've done some basic "hello world" type things in each language, so I'm pretty much ready to get started. I'm just waiting to see which I'm going to dedicate my time to.

(However, I would like to have a smarter text editor other than notepad for Java. You know what I mean? Basically, something similar to the one in my Borldand IDE I have for C, except for Java. Know where I can get a freeware one? It would just make it easier for me.)

Salem
10-20-2002, 03:12 PM
More editors (http://directory.google.com/Top/Computers/Software/Editors/?tc=1) than you can shake a stick at.

Sargnagel
10-20-2002, 03:27 PM
@EDITORs:
As a freeware IDE for JAVA I'd prefer the Lite-Version of JCreator (Windows).
http://www.jcreator.com/

But if you want to spend some money, I suggest buying UltraEdit32 if you're programming in the windows environment. I love this editor!
http://www.ultraedit.com

master5001
10-20-2002, 06:16 PM
I don't know what to say. I'm going to tell you my experience. I learned JAVA in high school. I learned C the following summer with little trouble. I know not everyone is the same so I can't say which would be most benificial in learning the other. JAVA's syntax is based on C++ which is the same syntax as C. Generally speaking once you have a general grasp on key programming techniques you can learn any language using your experience with another. For example, before knowing JAVA I knew HTML and PERL. Pointers were the only big new thing to deal with when I was learning C. Because of my JAVA background I was able to pick up on C++ in an afternoon. Last week I took about an hour of my time to learn pascal.

The point is you could choose a language at random here. Once you have an understanding of what you are doing the other should be no big deal to learn.

olive9
10-21-2002, 09:46 AM
there is one company with a programmer training course that starts with 4 weeks of C and then 4 weeks of Java to train Java programmers.

if your goal is to gain good, solid programming skills, i'd recommend C first and then Java since Java can be considered a grandchild of C.

Troll_King
10-21-2002, 02:18 PM
Originally posted by Mister C

To Troll_King

C++ Primer Plus and C Primer Plus are now on there 4th edition. Good Books.

The only problem dude, is that those are not the books I am talking about.

< http://www.amazon.com/exec/obidos/tg/detail/-/0201824701/qid=1035231567/sr=8-2/ref=sr_8_2/103-5583861-6899002?v=glance&n=507846 >

This is the book, and it is the best book on C++.

CorJava
10-21-2002, 03:04 PM
Thanks Salem and Sargnagel for the links. I downloaded the IDE Sargnagel posted the link to, and it looks like it will work out for me just fine, should I decide to go with Java.


The point is you could choose a language at random here. Once you have an understanding of what you are doing the other should be no big deal to learn.

You just might be right, master5001. I don't know if I can do that though. But I think I'm goint to try to hurry with a decision. I guess for your point, it doesn't matter how I arrived at it, random or not, but rather that I arrived at a decision at all. I'm going to choose right now, and I think I'll go with Java. The reason is, I really want to learn OOP. As a novice, I don't know if attempting OOP is a good idea, but I might as well give it a try. Besides, someone else here said that I could do more with Java quicker than I can with C. Or something to that effect. I'll just post the quote, and perhaps Prelude will elaborate or clarify if he wants:


If you just want to get started programming something useful as quickly as possible then I would recommend Java, otherwise I would recommend you determine exactly what you want to do with the language and then choose which language fits that need the best.


On another note, the book I have is Sam's Teach Yourself Java in 21 Days. Is anyone familiar with this?

Also, I must admit, I was tempted to choose C for the fact that I found a knowledgeable and active community for the language. I just have not seen anything like this for Java. If anyone knows of any active, helpful, and beginner-friendly, Java forums out there, please let me know. Troll King mentioned one already, but he said they are not very active. Did I understand right?

Thanks to everyone for all the help.

(By the way, I forgot to ask: Which is the harder concept for beginners to grasp?:
The OOP of Java, or the pointers of C?)

Troll_King
10-21-2002, 03:18 PM
You really should get the C++ book mentioned above if you have the opportunity, because you can't get away with just Java.

As for Java, I'm going with the Sun Microsystems series:

Core Java Volume I -Fundamentals 6th edition (2003)
Core Java Volume II -Advanced Features
Just Java 2 Fifth Edition

Here is a Java Forum < http://forum.java.sun.com/ >
And:
< www.javaranch.com >

Troll_King
10-21-2002, 03:29 PM
If you want to know what the difference between C++ and Java is than it would take about five pages of reading. There is a very big difference, but asking that, basically requires an essay.

CorJava
10-21-2002, 07:00 PM
Thanks Troll King. I definitely plan to learn C++ eventually. From what I understand it is the most widespread language out there. I understand how important it is, and I do not want lack proficiency in it for long. As a matter of fact, if I could pick one language to be an expert in, I would pick C++. But I'm trying to be realistic here. Many experienced programmers, who definitely know more and are more intelligent than myself, didn't take on C++ as a first langauge.
Besides, I wasn't trying to decide between C++ and Java for now, but C and Java. When I do decide to take on C++ however, I will definitely look into the book you recommended. But by the time I am ready, the edition you liked will probably be nearly impossible for me to obtain.
I'm not going to buy any more Java books for now. I have this one book I spent enough money on. So, I will try to make the most out of this one first. But the books you recommended probably have some things that my book doesn't cover(especially the second volume) and they are written by the creators of Java so that is a plus. I might end up looking into those as well. But that will probably come later. My book is more of an introductory text, whereas yours are probably more of a thorough reference.
I'm not the brightest bulb in the box, so I expect this(my learning of basic Java) to take a while. Thanks for the forum links though. I'm sure those are some things I can make use of very soon.

CorJava
10-21-2002, 07:15 PM
Hey Troll King. By the way, I read on that site you first recommended flashdaddee.com the conversation between yourself and the gentleman who invented C++. You seem to know what you are talking about. Not that I would be able to tell, since the majority of what you guys were discussing is over my head. Still, it was pretty impressive that you were able to talk to the guy in the first place. I have a hard enough time getting non-famous people to reply to my emails.

master5001
10-21-2002, 09:20 PM
I know of a few schools around the country that have gone to teaching java to the newbies. All biases aside, with one weeks worth of java knowledge you can make buttons, images, write files, poll the user's mouse, etc. With one weeks worth of C++ (assuming that c++ is the person's first language of course) you can do memory allocation, write small console applications, and write files. It is a good choice. that last sentence was very ambiguous, what i mean to say is: Java is a good choice

Troll_King
10-21-2002, 11:23 PM
We should have a Java board here.

master5001
10-21-2002, 11:54 PM
JAVA is a fantastic language, yes. But we shouldn't have a java board here. This is cprogramming.com not programming.com. Besides C# is m$'s blatant rip-off of JAVA and I think the C# folks are familiar enough with java to answer questions there.

On that topic, someone did put a link to a java message board. I'm sure they will be kind enough to re-post it for the sake of those who are interested.

Troll_King
10-22-2002, 12:15 AM
If they have a rip off C# board here, than there should be a Java board, or else this is nothing more than a Microsoft Programming Website (MPW). This website should not have the title cprogramming.com.

Lynux-Penguin
10-22-2002, 12:20 AM
C
C
C
Not C++, but C
START WITH THE CORE and then move up, sure everyone will say but C++ is better. THAT IS NOT TRUE!
C++ has many problems that people don't want to admin, though I can't name as many as I'd like to I have talked to many people in the computer science department and they all know some errors. I started with C from a college Text called Programming Applications in ANSI C (old but one of the greatest books there are for C)
and that IS a great book if any. I learned C from that when I was 12.

Here is why you should learn C.
1] Linux ( an operating system) was written in mainly C
2] C++ is a superset of C (meaning it came from C)
3] C has some of the most basic to advanced concepts about programming
4] From C you can learn ANY computer language (my opinion)
5] Its easier to spell than C++
6] YOU JUST GOTTA LOVE THE FILE *fp , better than fstream<<
7] C++ was written in C (ask Bell Labs if you don't believe me!)
8] Java was written in C (might be C++ but C came before that)
9] C is sexy
10] C is really Sexy
11] have you ever seen a gnu program programmed in c++, I haven't
12] so if all the PROFESSIONAL programers whom program OS's chose C, then there must be a good reason.
also...
13] MS uses C++ and you don't want to grow up to program for money and purposly put bugs in so you get more money on tech-support... right?

edit: oh and not Java either, gets too complex too soon, and after C you can learn Java from the book in days (expression-wise)

Troll_King
10-22-2002, 12:49 AM
I think that C++ is a better language than C, however not too many compilers supported Standard C++ until very recently. Standard C++ and generic programming is leading edge but it's largely misunderstood. Educational institutions have done a poor quality job teaching C++. The fact that many legacy systems are built in C doesn't mean that it is a better development language. Bjarne Stroustrup recently told me that the STL is now being targeted by code optimizers in the newest compilers. Maybe that's not the exact wording he used, but I don't remember the exact words. Something to that effect. Personally I would much rather program in C++ than C, however there are not many high quality graphic or window libraries with bindings to Standard C++.

Troll_King
10-22-2002, 12:51 AM
...because of that I will pay attention to Java. It is a high quality system for writing internet (and windows) based solutions.

CorJava
10-22-2002, 01:22 AM
Originally posted by master5001
I know of a few schools around the country that have gone to teaching java to the newbies. All biases aside, with one weeks worth of java knowledge you can make buttons, images, write files, poll the user's mouse, etc. With one weeks worth of C++ (assuming that c++ is the person's first language of course) you can do memory allocation, write small console applications, and write files. It is a good choice. that last sentence was very ambiguous, what i mean to say is: Java is a good choice

One week of Java knowledge for the normal person=one year of Java knowledge for me. :)
Anyway, I see what you are saying.

Lynux-Penguin,
Although you've made many compelling arguments for the superiority of C over C++(especially the arguments pertaining to the C's sexiness), my decision was between C and Java. And I found your argument in favor of C against Java to be vague. If you would care to elaborate however, then I would certainly like to hear what you have to say.


By the way, I am experiencing a technical issue with this board. My mouse cursor keeps blinking. Anyone else having this problem?
I posted something about it on the tech board, but that forum seems to be as dead as COBOL right now, so I figured I would just ask now.

(Oh ha ha ha. dead as COBOL, dear god....) :(

Troll_King
10-22-2002, 01:43 AM
The difference between C and Java is that C/C++ is a systems implementation language and Java is a solutions implementation language. They have different values.

All major system in the world of computers are witten in C/C++. At it's core, the programmer builds from the ground up, and because of that C/C++ is mostly used by vendors that control the implementation of the operating system, or else the systems are build ontop of a standard, or architecture neutral hardware.

Java is a system that was constructed in C/C++. It is a middleware framework that hosts virtual machine components, an interpreter, etc. Some of the components are also built underneath the operating system kernel and directly ontop of hardware.

Java is used to build solutions that leverage systems. It is supported by libraries that offer graphics, sound, networking functionality, etc. This is not built into C/C++ (for a reason). The utility of Java is that you can rapidly create domain centric applications that are cross platform compatible, and are focused on business logic. You don't have to do very much plumbing. In C/C++ you have to do all the plumbing.

If you are a C/C++ programmer you goal would be to build a middleware framework, or an operating system, or some platform, or a server. On the other hand, a Java programmer would build a business solution for ecommerce, or some management system that processes data and presents a nice user interface to clients.

Java is changing. It is acquireing more C++ like additions to the langauge and some non C++ like additions such as XML. It is also maintaining a larger library. The focus is on distributed computing, and web based technology, but it's also more than that. I wish that I could say more, but I'm too new to Java. I just know what C/C++ are, and I have a sense of what Java is.

The biggest difference is that one is a systems implementation langauge in which you work from the ground up, and the other is a solutions based language which is hosted by middlware (a framework). In Java you use tools that are already built for you. In C/C++ you build your own tools.

CorJava
10-22-2002, 02:00 AM
Thanks for the background on C/C++ and Java. It would seem that the information contained in your post confirms Java is the less complex language to learn. I know you did not necessarily intend to convey this, and I know my interpretation of the information you provided could be incorrect.

Troll_King
10-22-2002, 02:13 AM
There is less chance to cause damage in Java because there is more safety mechinisms built into the middleware specification. The libraries in Java number in the range of 3,500 while there are less than a hundred or so functions in Standard C. The Java language features are less broad based than C++ because it doesn't support templates and generic programming (...yet).

I don't know if I've even recommended anything, did I? I would say, learn C/C++ and Java together. In reality, once you become a C/C++ programmer, you will always be a C/C++ programmer. When you use a middleware langauge like Java you will be trying to understand how the system was implemented in C/C++.

Troll_King
10-22-2002, 02:15 AM
Let me simply break it down for you. Java is going to be way more interesting and more fun, but you should also learn some serious C/C++.

CorJava
10-22-2002, 02:56 AM
I have a question I just thought of. This might sound stupid:(Okay it is stupid)


You know how people learn some basic programming logic in pseudo-code? Well, is there some type of way one can learn some object-oriented programming logic using psuedo-code? The reason I ask such a question is that I want to really focus on the OOP stuff independent of syntax and language before I dive into Java. Could you give me some basic examples of some OOP psuedo-code, or could you give me like an exercise or something to do?







I ate some hot-pepper cheese a couple hours ago. And I kind of like half-burp-vomitted some of it back up into my head. It felt like it went up into my nose and inside my mouth. It really burnt my nose mouth and throat and it tasted pretty bad. I drank some pop. Its okay now.

Troll_King
10-22-2002, 03:06 AM
It's called UML (Unified Modeling Language).

General Link:
< www.omg.org/uml >

Specific Link for downloading the specification:
< http://www.omg.org/cgi-bin/doc?formal/01-09-67 >

Go ahead and download it. Also note the beginner tutorials at the first link.

If you really want to learn OOP though than get: C++ Primer 3rd edtion by Lippman and Lajoie.

CorJava
10-22-2002, 03:07 AM
That's odd. I seem to have accidently placed an unhappy smiley in the above post. I didn't want to put any smiley there. I think I know what caused it though(colon immediately followed by left parentheses) Anyway, the smiley doesn't mean anything.

CorJava
10-22-2002, 03:13 AM
Thanks for the links. I didn't see your reply when I posted my post about the smiley. I will check out those links. By the way, I don't know if you seen it or not, but I made a post about the books you recommended. If I recall correctly, one of my concerns was that I the 3rd edition of the C++ book will be nearly impossible to obtain by the time I actually get around to learning the language. About when should that take place? As a matter of fact, how long should it take me to be learning these things? How long should it take the average person to acquire a basic understanding of a language? For example:

"Any person of normal intellect should have developed a high level of ability with Java in two months. After this point, you should immediately move on to C++. Learning that should take three months. Mastering it should take a couple years...."

Troll_King
10-22-2002, 03:33 AM
C++ Primer 3rd edition will only become dated when the new compilers are built.

The C++ language is Standardized. This international standard is revised every five years. It will be revised in 2003. The compilers will not adopt the new standard until 2004-2005. If you are using Unix or Linux than g++ will adopt the new standard more quickly, but Microsoft will lag behind.

You should go to the bookstore and purchase C++ Primer 3rd editon and begin reading it immediately. It's an extensive beginner/intermediate text (1,200 pages). If you want, we will walk you through it.

Warning, chapter 2 is advanced. The book is organized in such a way that it presents the big picture of C++ in chapter 2, just to demonstrate what OOP is in the context of different paradigms (procedural, object based, object oriented, generic). The slower pased tutorial stuff begins on chapter 3, and chapter 1 is okay as well. It's worth reading chapter 2 even though you won't understand it, but if you can't read it, than skip it and come back to it at the end of the book.

If you want, you can email me as you read the book. Ask me a question or just ask questions here. I'm actively reading this book right now. The writer worked with Bjarne Stroustrup at AT&T while developing the C++ programming language.

Go for the best.

kermi3
10-23-2002, 09:17 AM
CorJava -

Here is your thread that accidently got deleted, and here is why:

A moderator moved the thread to the Deleted Post Archive, in order to take some offensive and irrelevent posts off of it and then return it to the GD. However, before he was finished the job he lost his internet connection.

In the future if something like this happens and you are registered then you can PM me or another mod and find out what happened and why. In fact, if you are registered the chances are that you will be PMed by a mod when your thread gets deleted. You of course wouldn't have been in this case since it was an internet problem but....

Sorry for the trouble,

Kermi3

CorJava
10-23-2002, 05:12 PM
No problem. Thanks for the explanation. The only thing I was worried about was whether or not I said something wrong. I think your effort to make me feel welcome here says much about you and what this forum stands for . I appreciate the invitation to continue posting and to register, but like I said before, in light of some of the comments that were made, I don't think this is the right place for me so I won't be hanging around much longer.