LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2012, 08:02 PM   #1
kapilkumar
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Rep: Reputation: Disabled
Question Java vs C/C++


AS we know UNIX is developed in C.And we generally hear that 'C is the mother of all programming languages'.
My question is that how can we compare C,C++ and JAVA in following terms..
1. System level programming
2. Easy and fast development
3. In-build subroutines and support
4. Pentrating level in respect of cracking, hacking, security.
5. Network programming.
6. In respect of today's requirement

If one has read all these three languages than which language one should learn first to higher level as per above mentioned points?

Last edited by kapilkumar; 08-10-2012 at 08:03 PM.
 
Old 08-11-2012, 12:45 AM   #2
ghoultek
Member
 
Registered: Sep 2011
Location: New York City
Distribution: Testing Ubuntu/XUbuntu/KUbuntu 12.04, Mint 13 (all flavors)
Posts: 56

Rep: Reputation: 2
Sorting through tough choices

I'm not a super pro but this is my view point on the subject.

1) For operating system programming many are going to prefer the C language. It was designed to be a high level language that makes low level things like, memory access (through pointers) and using the free store, accessible. C++ was designed to be a better C language with new features/extensions. I would like to say that one could use either C or C++ for Operating System programming. Others may have a differing opinion on my last statement. As far as I know the GNU C/C++ compiler can take any C based source code and compile it using the C++ compiler. Certain switches may be needed to compile some C code, but C++ compilers are suppose to be 100% backward compatible with C. The pros. can jump in correct my last statement if I'm wrong. Java wasn't really designed for Operating system programming because of Java's virtual machine requirement.

2) Easy and Fast are very subjective. Based on developer skill level, time, other resources and constraints, one task may be easier to do in 1 language as compared to the other languages. The speed at which a task can be completed is based on the same items listed above.

3) There are vast code libraries for C, C++ and Java. All three have very good language features for expressing code, and for breaking up a large programming project into smaller manageable pieces.

4) I don't understand what you are asking. However, I would imagine that if one were looking to "crack", break, or circumvent security in an Operating System, server process, or application process, C and C++ would be the better options because there is no Java virtual machine requirement.

5) All 3 languages have robust libraries available for socket programming (network programming).

6) I don't understand what "today's requirement" means. Please explain.
 
1 members found this post helpful.
Old 08-11-2012, 10:57 PM   #3
kapilkumar
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
First I would like to Thank you for the reply, it helped me to some extent....
I want to clear my point about 'Pentrating level in respect of cracking, hacking, security'
suppose somebody wants to do some research work on above points like understanding actually how things really work, doing instant practical work, displaying the details of underlying protocols, their header and structure details, creating a new protocol, details about request structure of client and response from server i.e. all details about networking at programming level.

I would like to clear my another point about 'In respect of today's requirement' simply means as per job opportunity,productivity (without considering developer's skill), availability of developing tools.


One more thing ' I have learned C C++ in Turbo C++ compiler, I read that some people say its an old 80 fashioned compiler and advise to switch to other new compilers,but new compilers like DevC understands only ANSI coding and I m used to of using turbo c coding.And Dev C also alerts that some header files are not available like 'conio.h' etc. So what to do should I switch to other one or continue with TurboC++ 3.0.
 
Old 08-12-2012, 01:38 AM   #4
wigry
Member
 
Registered: Jul 2004
Distribution: slackware
Posts: 225

Rep: Reputation: 53
Hi,

I would have two ponts. First about Java. You do not want to use it for standalone progeams as Java has a very long startup time and also quite considerable memory requirements thus the possibility of feeling slowness is quite high with Java desktop apps. Thats where C/C++ shines with some UI toolkit for example. Then again the territory that Java has more or less conquerred is enterprise web applications. One the java engine is started and enough resources allocated, the speed difference between C and Java is almost vanished so the world of JEE is big and live. Thats where a lot of money is for the developers as many many enterprises want to do JEE development. So learn the JEE and you will become valuable on the market.

Secondly I am a bit astonished about your reluctance to learn ANSI C. That is the right thing to do! You will need this skill to remain relevant on the market of C/C++ development. Frget your age old turbo C conventions and please transition to the current day where ANSI C and compilers like GCC and LLVM matter.

So to ask about relevance for Java vs C/C++ I would answer that Java is more widespread with the popularity of JEE in the enterprises. There are however places that demand C/C++ skills like more lower level development for mobile devices etc (although you can do mobile apps without touching the C/C++). Security wise it all depends on the environment. With Java you have to keep your JVM current, with C/C++ you have to keep your OS current and more imprtantly make your app bulletproof and learn to program securely (this introduces way more security holes than underlying OS)
 
1 members found this post helpful.
Old 08-12-2012, 12:42 PM   #5
ghoultek
Member
 
Registered: Sep 2011
Location: New York City
Distribution: Testing Ubuntu/XUbuntu/KUbuntu 12.04, Mint 13 (all flavors)
Posts: 56

Rep: Reputation: 2
kapilkumar,

Cracking, hacking, and security penetration testing are not limited to writing code to perform those tasks. Individuals involved in those activities tend to use a variety of tools. If you are looking to:
- displaying the details of underlying protocols
- display the protocol header and structure details
then you are probably going to need network analysis tools such as a network packet sniffer and/or protocol analyzer. The above two items might be the same thing, be parts of a single tool, or be separate tools. There are lots of free tools for Linux to perform the above tasks. Do a Google search on the above items to learn more about them.

Creating a new protocol is much like creating any new system, which is going to start with a specification and/or design document and then develop from there. Creating a protocol isn't dependent on a specific programming language or development tool.

Network programming tends to be socket programming or writing code that makes use of sockets. The good thing about socket programming is that sockets are very similar to regular files and the interaction with sockets in code is very similar to the interaction with files in code. For example, in C/C++/Java there are facilities to do the following with files:
- create or open
- read
- write
- close
There are similar facilities in C/C++/Java to create, open, read, write, close, and manage connections with sockets.

I'm a long time Borland products user as well. Borland produced some great products. However, the Turbo C++ (TC++) is an ancient product. I first used TC++ for DOS in 1989 or 1990. Even though TC++ was great, Borland introduced many non-standard extensions to the C++ language in their product. The "conio.h" file is a Borland specific proprietary file for doing console IO in MSDOS and Windows. Also, the version of the standard C++ that TC++ was based on has been revised and improved.

It would be best to focus on the current standard version of C++. Your experience with TC++ will allow you to get up to speed quickly. After all its still C++. The GNU C/C++ compiler is free and available on all distros. of Linux. There are lots of text editors available on Linux and there are IDEs similar to the TC++ environment. There are many good books for C, C++ and Java. Search this site for recommendations. I believe Wigry has provided some good info. on where/how Java is used and how to get into that market.
 
Old 08-12-2012, 04:02 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,309

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
Network programming
http://beej.us/guide/bgnet/
http://www.kohala.com/start/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Java Woes: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available ... chytraeus Slackware 10 11-27-2010 10:04 AM
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: java.util.Hashmap doesn't work for a custom object kpachopoulos Programming 2 04-15-2007 03:25 PM
LXer: Java news met with cautious optimism in free Java community LXer Syndicated Linux News 0 11-14-2006 10:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:43 AM.

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