Should I learn C before Java ?

T

Tony Polson

Hi. Should I jump right into Java, or is it better to learn C first?
I'm not a total beginner; I know Javascript, but I obviously would like
to learn a more powerful language.

Thanks,

TP
 
B

blu4899

I would go straight to Java. It depends a bit if you want to do serious
C/C++ programming in the future. Java will spoil you rotten compared to
the awkwardness of C/C++.

Java is much simpler/yet more powerful and has much better standard
libraries. I C/C++ you would have to learn unnecessary concepts just to
abandon them again in Java. For example:

Pointers and references: C has this whole notion of pointers,
references, and so on. Java is so much simpler here, you still have
implicit reference semantics, but you don't need to know C to
understand them.

Memory management: C/C++ has the whole works with
new/malloc/calloc/free/... Good riddance!! Java has new, that's it!

String handling: C's string handling is painful with using char*, there
is no comparison with the ease of String.
 
B

Bob

Tony said:
Hi. Should I jump right into Java, or is it better to learn C first?
I'm not a total beginner; I know Javascript, but I obviously would like
to learn a more powerful language.

I assume this posting is a troll, as the Follow-up field in the header
is aimed at rec.photo.digital and rec.photo.equipment.35mm.

If it's not troll-bait, then the first thing you need to do is empty
your head of JavaScript. It's a joke of a 'language' and has nothing to
do with Java whatsoever.
 
S

Stefan Schulz

If it's not troll-bait, then the first thing you need to do is empty
your head of JavaScript. It's a joke of a 'language' and has nothing to
do with Java whatsoever.

I beg to differ. Javascript is a nice language, actually. (First class
function members are nice!), but i agree that this is not the topic here.
 
K

kjc

Stefan said:
I beg to differ. Javascript is a nice language, actually. (First class
function members are nice!), but i agree that this is not the topic here.
Learn Smalltalk first.
 
T

Tom Dyess

Bob said:
I assume this posting is a troll, as the Follow-up field in the header is
aimed at rec.photo.digital and rec.photo.equipment.35mm.

If it's not troll-bait, then the first thing you need to do is empty your
head of JavaScript. It's a joke of a 'language' and has nothing to do with
Java whatsoever.

I don't know if I'd go that far, it's just not strongly typecast and not OO.
It's definately not a powerful language, but I'd hate to render pages
without it.
 
J

Joona I Palaste

Tony Polson <[email protected]> scribbled the following
Hi. Should I jump right into Java, or is it better to learn C first?
I'm not a total beginner; I know Javascript, but I obviously would like
to learn a more powerful language.

(Idiotic follow-ups to photography newsgroups ignored)

Feel free to jump right into Java if it's what you want to learn.
Saying you have to learn C to learn Java is like saying you have to
learn BCPL to learn C, you have to learn Algol to learn BCPL, you have
to learn machine code to learn Algol, you have to learn processor
internal arithmetic to learn machine code, you have to learn
micro-electronics to learn processor internal arithmetic, and so on.
In the end you'll have to start from quantum physics to be able to
learn Java.
 
G

gildir

I assume that you are interested in web development since you know
Javascript. But whether or not you learn Java or C/C++ first depends on
what you want to do in the long run.

I personally feel that it is harder to learn C/C++ after having learned
Java than the other way around for the same reason as blu4899; "Java
will spoil you rotten compared to the awkwardness of C/C++". So, if you
think you will want/need to learn C/C++ at a later time, learn that
first.

Seriously think about...

1) Do you plan to go to school for computer science in the future?
Learn C/C++. Most schools will make you take a class or two in C or C++
before you take any other programming courses (and don't think you can
get out of it by explaining that you know Java).

2) Do you want to learn "core programming concepts"?
C++, I think, is better for this. C has a lot of awkward syntax that in
many more recent programming languages has been removed (not that C++
doesn't have it's own problems, since it is based on C, but I think
there are less). Java "takes care" of many things it doesn't think
people should be bothered with (i.e. pointers). So, you may miss some
concepts that would have come in handy learning other languages.

3) Do you want to get into application programming at some point,
maybe?
Toss up. Java is a full blown programming language which can be used on
or off the web, so you don't have to choose what you want to do right
off. On the other hand, if you are seriously considering it... you may
want/need C/C++ at a later date.

4) Do you want to continue web development to server side languages at
some point?
Probably learn C/C++. Many server side languages are based off of C/C++
(php is a good example), so if you know C/C++ it makes learning those a
LOT easier. I don't think the same applies to Java as it is so fiercely
OO and many server side languages are not.

5) Do you just want to learn Java for web development and have no other
interests?
Java. C and C++ are helpful, but if you want to learn Java, just learn
it! Palaste is right, no need to backtrack to quantum physics just to
learn a single language.

If you decide to learn C/C++ first, for any of the above reasons, there
is no need to become an expert in it. Get the basics (up to advanced
pointers for C and, for C++, perhaps up to templates or just before),
learn the concepts, apply them in a few programs, that should be enough.
 
P

Patricia Shanahan

gildir wrote:
....
1) Do you plan to go to school for computer science in the future?
Learn C/C++. Most schools will make you take a class or two in C or C++
before you take any other programming courses (and don't think you can
get out of it by explaining that you know Java).

Don't take this into account unless you intend to start
school in the next couple of years. In that case, check the
courses for the schools you are considering.

It would be very frustrating to pick a language based on
this and find the school you went to required Java but
didn't care about C.

Patricia
 
A

Anthony Borla

Bob said:
I assume this posting is a troll, as the Follow-up field in the
header is aimed at rec.photo.digital and rec.photo.equipment
.35mm.

If it's not troll-bait, then the first thing you need to do is empty
your head of JavaScript. It's a joke of a 'language' and has
nothing to do with Java whatsoever.

You're right about JavaScript and Java being completely different
programming languages. Also, you are perfectly entitled to have, and to
express, whatever opinions you have on programming languages.

However I think when giving advice to a programming newbie [or near-newbie]
one should aim to be reasonably objective. I don't believe that 'trashing' a
programming language, particularly with no justification being given, is
being very objective.

Here is a link to, what I think, is an illuminating site:

http://www.crockford.com/

Click on the 'Javascript' hyperlink. This may not alter your views about
JavaScript, but it should help make them better informed views.

Cheers,

Anthony Borla

P.S.

Please don't take this the wrong way as it is meant in a positive spirit. I
just wanted to highlight that choosing to advise / teach others [even if in
a limited way by submitting a response to a newsgroup post], sees you
temporarily taking on a responsibility - care ought to be taken in
discharging that responsibility.
 
C

Chris Smith

Tom Dyess said:
I don't know if I'd go that far, it's just not strongly typecast and not OO.
It's definately not a powerful language, but I'd hate to render pages
without it.

Ah, if only the world were that simple. In terms of flexibility and
power, the only advantage of Java over JavaScript is the size of the
core API. Because JavaScript code initially ran -- and still frequently
runs -- in web pages, the available API is much smaller by default than
is the case for Java. For example, it's not possible in core JavaScript
to listen on a socket, or interact with a database using SQL.

The language itself is a very interesting, and fully object-oriented,
language that has a lot to commend it. Instead of being a class-based
language a la Java, a primary component of code re-use is the prototype
and objects themselves gain a lot more autonomy than they have in Java.
It would have been interesting if JavaScript had come with a capable,
fully formed core API to complement the language.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
T

Tom Dyess

Chris Smith said:
Ah, if only the world were that simple. In terms of flexibility and
power, the only advantage of Java over JavaScript is the size of the
core API. Because JavaScript code initially ran -- and still frequently
runs -- in web pages, the available API is much smaller by default than
is the case for Java. For example, it's not possible in core JavaScript
to listen on a socket, or interact with a database using SQL.

The language itself is a very interesting, and fully object-oriented,
language that has a lot to commend it. Instead of being a class-based
language a la Java, a primary component of code re-use is the prototype
and objects themselves gain a lot more autonomy than they have in Java.
It would have been interesting if JavaScript had come with a capable,
fully formed core API to complement the language.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

So you have abstraction, encapsulation, inheritance and polymorphism in
JavaScript?
 
C

Chris Smith

Tom Dyess said:
So you have abstraction, encapsulation, inheritance and polymorphism in
JavaScript?

Absolutely.

However, JavaScript implements some of these concepts in a manner that's
different from other popular languages. For example, inheritance is
accomplished with prototypes instead of classes (I said that earlier),
and encapsulation is accomplished via nested functions and variables
rather than object members (all object members are exposed). Because
these things are done in different ways than they would be in Java, C++,
Smalltalk, etc; it's often mistakenly assumed that JavaScript is not an
OO language.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
T

Thomas Weidenfeller

Joona said:
(Idiotic follow-ups to photography newsgroups ignored)

It is our old "friend", the 35mm troll. Am I the only one who noticed
that the 35mm troll comes in pair with "Cindi", the blog spammer?

/Thomas
 
G

guilt

Don't go near C, or even C++. When you learn Java as such, you'd think
it's much easier to program and do. When you get to learn C and C++
before Java (I had to :p) .. You'll only end up appreciating that Java
has already made the wheel for you, and you just have to use it...

P.S: Some basic knowledge of pointers, operating systems and dynamic
linking always does help, of course.
 
J

Jean-Benoit MORLA

Patricia Shanahan said:
gildir wrote:
...

Don't take this into account unless you intend to start
school in the next couple of years. In that case, check the
courses for the schools you are considering.

It would be very frustrating to pick a language based on
this and find the school you went to required Java but
didn't care about C.

Patricia


Hi,
When programming in Java you'll find two completely different
approaches.
1) procedural programming
2) OO programming.

1 is very similar in C and Java. If you're able to design an
algorithm, it will work exactly the same in both languages.
2 is much more far fetched. Count a good year of hard work before you
can imagine a class hierachy of your own.

Now there is a new, ( up to you to decide if it's good or bad :)
When starting Java, you'll probably be confronted with AWT and SWING.
That is you'll find it very easy to create a GUI with buttons and
fields to enter data in. But the trick is you'll watch the source
listing a thousand times and you won't be able to tell where the
cursor sits in your code.
So my advice is to learn a little bit of Assembler beforehand with the
good old debug program from the dos command window (cmd ). Just
setting an area in memory with some value, adding 1, read it back in a
register and watch the result with the "r" commands. Also work on the
Interrupts like INT 21.
There is an article on debug that you can find with a google search
that will even tell you what debug does while he is waiting for a
command.
Another piece of advice: If you want to see your Java code running one
step at a time, you'll need the Eclipse debug window.
At the moment the most advanced Java sdk is 1.5 but unfortunately
Eclipse is a bit back so pick Java SDK 1.4 to install on your machine
to make it Eclipse 3 compliant.
Finally note that there is a hell of a good text book from Deitel
(www.deitel.com)it's titled "Java How To Program 5th" ( the one that
deals with Java 1.4 ) available from Prentice Hall, loaded with
exercises and a separate solutions manual.
A nice feature is that if you're stuck at any stage you can e-mail
your problem to (e-mail address removed) and the answers will be there next
day.
Good luck!
 
B

Bob

You're right. My disgust of JavaScript is only an opinion, and I should
have made that more clear.

But, in my experience, JavaScript is commonly the leading cause of
broken web pages. I don't use Internet Explorer, and have no intention
of ever doing so again. Bad (or lazy) JavaScript code leads even the
biggest websites to say things like "Requires Internet Explorer 5 or
higher", and that's just not acceptable.

The last time I used JavaScript seriously (in 2000), it was capable of
producing some impressive gimmicks for over-the-top websites designed by
people who were obviously not programmers. Floaitng menus, custom GUIs,
etc. But, due to the awful tear down the middle of the language thanks
to Microsoft and Netscape trying to make their browser the one with the
biggest collection of unnecessary features, it required an epic amount
of effort to write code that worked exactly the same way on both
browsers. In fact, it usually required two sets of functions: one per
browser. And that, in my opinion, is an unacceptable way of developing
websites.

Standards are important, if not essential, on the Internet, and the last
time I was exposed to JavaScript there just weren't any deployed
standards. Things may have changed since then, but if they have there's
not a lot of excuse for the few sites that still publish IE-only code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top