LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 06-20-2005, 06:24 PM   #1
mandrakelinux
Member
 
Registered: Apr 2005
Posts: 55

Rep: Reputation: 15
different between c and java


hi
i just want to know some info to decide how can i choose between programming languages to learn
1- what are the advantages and disadvantages between interpreted and compiled languages ?
2-what are the differences between java and c++ ?
3-if i learned any compiled language , i'll be able to use the rest of them or at least understand
please any explanation will help me

Last edited by mandrakelinux; 06-20-2005 at 06:26 PM.
 
Old 06-20-2005, 07:16 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Interpreted langs are usually at a higher level than compiled ones ie more results with less code.
OTOH, compiled ones make you think/understand what's really going on... can be very useful in lots of ways later.
Interpreted are thus more forgiving ie less fiddly to code, so easier.
Intepreted langs are run by translating each line as needed, therefore slower than compiled+linked langs, which pre-translate everything before starting.
NB: this goes double for loop constructs; in interpreted langs, each line is re-translated into machine code EVERY time it's used.
In general, scripting langs are interpreted, but note there are exceptions eg Perl which, although known as a scripting lang, is actually pre-compiled on the fly before being run, thus giving a nice compromise between ease + speed.
HTH

Last edited by chrism01; 06-23-2005 at 02:10 AM.
 
Old 06-20-2005, 07:25 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Learning one compiled language will NOT make you able to understand them all. There are dozens out there.

As for Java vs. C++: what do you want to do with it?
If cross-platform development is your thing, go for Java.
If you want something that is more system level, hit C++.
I personally dislike both and prefer pure C myself.
 
Old 06-20-2005, 07:34 PM   #4
mandrakelinux
Member
 
Registered: Apr 2005
Posts: 55

Original Poster
Rep: Reputation: 15
thanks chrism01 but still want a lot of explanations to decide between them or i have to learn one interpreted lang and one compiled
thanks Matir . why do you prefer c not c++ as i think c++ derived from c . could you explain cross-platform expression
 
Old 06-20-2005, 11:35 PM   #5
oblivious69
Member
 
Registered: May 2005
Distribution: debian
Posts: 79

Rep: Reputation: 15
Learn a functional language and an object-oriented language. C and C++/Java are fine. If you are going to go through the trouble of learning them, learn both types.

Each type and language has benefits versus others.

I think the compiled/interpreted stuff is useless. If you learn the basic types and how they work, you'll be learn the others quickly.
 
Old 06-21-2005, 02:41 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If you are just starting out and on Linux, I'd suggest (in this order):
Bash shell scripting
Perl
C

each one is lower level/more detailed/more fiddly (ie slower development time) than the prev one, but faster in execution time.
It's really not worth getting hung up about the finer differences until you have done some programming (at least 6 mths).
Others may choose different langs at each stage eg Python instead of Perl, Java instead of C.
It's really highly subjective.
The general rule for serious programmers is to use the right tool for the right job, so most know 3 or 4 langs.
For webpage layout it's usually HTML (often with PHP), SQL for Databases.
 
Old 06-21-2005, 07:57 PM   #7
mandrakelinux
Member
 
Registered: Apr 2005
Posts: 55

Original Poster
Rep: Reputation: 15
thanks guys
chrism01 i want to immerse in programming but i need to know where to start cause if i started worng i'll fed up soon i think you understood me . everyone here could recommend language , this recommendations confuse me . i've read a lot of tutorial but still don't know where to start ?
all i need is somewhat good starting point
oblivious69 could you explain what do you mean by functional language and what about what you said (compiled/interpreted stuff is useless. If you learn the basic types and how they work, you'll be learn the others quickly).
again thanks a lot guys
 
Old 06-21-2005, 08:10 PM   #8
sekelsenmat
Member
 
Registered: Apr 2005
Location: São Paulo - Brazil
Distribution: Mageia Linux 1
Posts: 353

Rep: Reputation: 30
Quote:
Originally posted by mandrakelinux
thanks guys
chrism01 i want to immerse in programming but i need to know where to start cause if i started worng i'll fed up soon i think you understood me . everyone here could recommend language , this recommendations confuse me . i've read a lot of tutorial but still don't know where to start ?
all i need is somewhat good starting point
A good starting point: Download NetBeans. This is a Java IDE. This means you will be able to draw Windows and play with it´s help system and learn with it: http://www.netbeans.org/

If you go for c++, download Eclipse, it is another IDE. Just google "Eclipse".

Quote:
oblivious69 could you explain what do you mean by functional language and what about what you said (compiled/interpreted stuff is useless. If you learn the basic types and how they work, you'll be learn the others quickly).
again thanks a lot guys
He meant that it doesn´t metter if you learn one language or the other. You need to learn the concepts and this applies to all. Of course those are quite hard. Just pick one language and you will learn the concepts naturally and slowly.

About cross-platform he meant that: A Java program is very easy to port to Windows (just rebuild), while a c++ may not be (depending on the code it may only work on linux or Windows). Java was created thinking about different platforms / OSes.
 
Old 06-22-2005, 01:04 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Assuming you are on Linux , you'll need to understand Bash shell anyway, just for basic tasks and automating little things you'd repetitively.
Ie building small tools for yourself.
After that, it's really a qn of what you want to do ie what's the application? Remember, "right tool for the right job" Also, as I mentioned, there's always more than one option.
To be honest, if you just want to learn 'programming', but don't have a specific program/application you want to create, you prob won't keep at it.
Learning to program the basics isn't rocket science, but if you don't have a goal, it's going to be difficult to keep going through the problems that arise.
What exactly do you want to achieve??
 
Old 06-22-2005, 10:41 AM   #10
mandrakelinux
Member
 
Registered: Apr 2005
Posts: 55

Original Poster
Rep: Reputation: 15
thanks
chrism01
1- i like to understand linux and how it works deeply
2- i need tools that help me as i'm systems engineer
you know internet and intranets contain a lot of hackers and people these two always try to breach securety and policies . my responsibility is secure my company lan inside and outside , monitoring , automate tasks
 
Old 06-22-2005, 12:43 PM   #11
mohama
Member
 
Registered: May 2005
Location: solar-system->earth->northern hemisphere
Distribution: ubunutu+knoppix+suse
Posts: 197

Rep: Reputation: 31
???

hi ,

i didn't know what is programming is and what is linux is befor less than one year , i am a secod year computer engineering during the first i studed java and oop and the last thing i made was a game , so from my experiance go for java first , emacs is the best text editer ( all the colors there helps u understand what u are writing )!!! , mmmmmm and what chrism01 said
Quote:
Learning to program the basics isn't rocket science, but if you don't have a goal, it's going to be difficult to keep going through the problems that arise.
is definetly right , there is things that u will not be able to imagine or understand unless u go throw like compilation errors and bugs which could make u crazzy ... this is the first thing ...
the second thing is if u interested in internet i know that java is the strongest language on the net ...i know also that some of it's standard library definitions where changed because of SECURITY ...

third thing , it is not enough to learn programming language , u have to know also dast ( data structure ) because it's as powerful as language some times it's even more powerful ... the buttom line is that without it the language can't do a lot ...

one more thing , search in any university u like for a cource called intro ( introduction to computer scince - using java - ) and solve it's exercises ..... good book ---->> bruce eckel 3d edition thinking in java is good .

ps - u will need alot of patiance !! :-)
good luck ,

bye ,
 
Old 06-22-2005, 12:51 PM   #12
mandrakelinux
Member
 
Registered: Apr 2005
Posts: 55

Original Poster
Rep: Reputation: 15
thanks mohama
what do you mean by (data structure)
 
Old 06-22-2005, 07:38 PM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Ok, now I know where you're coming from (sic), I'd recommend Bash first, becuase that's the std cmd line lang.
Secondly, for more advanced scripts that run faster, use Perl, it's what it was designed for originally ie sysadmin automation aka a glue language..
For security you need to get a good book on firewalls look into tools such as nmap (http://www.insecure.org/nmap/), chkrootkit (http://www.chkrootkit.org/), bastille-linux (http://www.bastille-linux.org), rkhunter (http://www.rootkit.nl/), . In fact see the sticky threads in the Security forum here.
Obviously use ssh/scp/sftp, not telnet; see this article http://www.bastille-linux.org/jay/stupid-protocols.html
See this page: https://netfiles.uiuc.edu/ro/www/Lin.../security.html
Start reading up on TCP/IP (& UDP) (unless you already know this stuff. eg http://www.kohala.com/start/tcpipiv1.html
Let us know if you have any specific qns.
Check out the home pages for any tools you use eg Apache, they usually have good security hints.
Track this site: http://www.sans.org/
HTH
 
Old 06-22-2005, 08:16 PM   #14
mandrakelinux
Member
 
Registered: Apr 2005
Posts: 55

Original Poster
Rep: Reputation: 15
thanks chrism01 maybe i got my starting point
i'll try perl
why did you recommened bash while the main language that used to make linux was c ?
there are still some explanations to start :
could i start without studying bash ?
what can i do with java ?
what is the relation between java and game industry ?
 
Old 06-23-2005, 02:19 AM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You need Bash because that's the (default) cmd line shell in Linux. Other choices are avail.
If you are a network engineer, you'll spend a lot of time at the CLI, so you need to know how to handle it.
You're most likely to be checking/extracting info from other tools automatically, so bash or Perl (more powerful) is a good lang.
If you want to write your own kernel or device drivers then C would be the lang, but it's not usually something that you'll (net eng) need to program in.
You can get the abilities you'll need from Perl, and easier/faster development. Try not to re-invent the wheel ie leverage other people's work eg see CPAN for specific modules.
I'll let someone else deal with Java/games industry.
I suggest you get started and come back with specific qns & we'll do our best to help.

Last edited by chrism01; 06-23-2005 at 02:22 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 03:04 AM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 12:57 PM
Updated Java... now java apps dont work zidane2010 Linux - Software 6 05-04-2004 08:02 PM
2 Questions: java calling system commands? PERL vs Java? randomx Programming 28 11-28-2003 08:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration