Lately, I have been getting fairly good at C programming with the help of about 6.1 thousand online tutorials. I chose c because
1. It is a compiled language
2. I heard it was "portable assembly" from a few good sources, and you have a lot of control over the computer without the major difficulty of assembly code.
3. I heard it ran quite fast once compiled.
4. Both Python and Java are interpretted, and my 8th grade training told me 'slow as hell'
But for kicks i did a search for "c vs. Java" and most websites have been saying Java is better.
I dont really want to learn java (i became morally opposed to it when it was able to crash my computer AND my blackberry), but if it is a much better language, would it behoove me NOT to learn it?
Is c better than java?
C and Java both have their good points and their bad points. Java might be a little slower than C because as you say it is interpreted. But I don't think you or any other human can see the difference except for the slow initial load. Once loaded, Java programs execute lightning fast on my computer. A benchmark program, of course, could detect that a C program does indeed execute faster.
Java is easier to learn than C, even though they both have a very similar syntax. C is portable to more systems than Java is because all platforms don't support Java... although more and more are picking it up.
I personally prefer Java, but your mileage might vary.
Reply:At University, my year was the last to take C++ rather than Java. We also had to learn C since Unix system programming was predominant. If you'd like to do something like graphics, I'd recommend that you learn C/C++ and after C# or managed C++. Java is good for rapid development, being less "powerful" overall than C++, and is recommended when making a web program or program for multiple OS or mobiles.
I can not testify to the speed issue. I would say if you were going to write a program in Java in the first place, you don't really need it to be fast, you just need to be able to write it and deploy it fast.
Reply:see basically it depend how u use it....................
if u wanna design somethin on web u should use java but if u wanna do simple programmin u should try c or c++
Reply:it is an objective language, meaning it more like html and arguably easier to work with, but it requires runtimes on the client end to run, and although it has become more prolific, c will be able to run on almost anything. so c is better in my opinion.
Reply:As a consumer, we have a mindset of "what is best?". We generally try to use a metric like 'how much it costs' or some indication of value to gauge 'better'.
The same isn't true of programming languages. Well, not directly. A programming language is defined by its characteristics. There are positives and negatives, and using the wrong one in the wrong situation is disastrous. You'll probably hear the term "right tool for the right job". It's accurate.
You might think it looks a bit ridiculous to use a screwdriver on a nail. Similarly, with programming languages, each language has a number of strengths to exploit. An example is string manipulation. C is terrible at it. It has very limited string manipulation capabilities.
C is a system level language. And while the justification for using it has been performance, this justification is starting to pale a bit now. Hardware has advanced enough that using C for everything is just tedious. You can take a bit of a performance hit, (and believe me, this performance hit is not as big as you think it might be) for a level of abstraction. The benefits are probably worth it.
I used to have a degrading opinion of Java when I was a rookie C programmer. But then you have to start writing real world apps. You have to deal with things like an ORM, design patterns, frameworks, and so on. You look for various libraries of code to use. And believe me, when you advance as a programmer, you shed a lot of degrading opinions. Knowledge and experience have a sobering effect.
I did a lot of programming in C++ and Python. Don't look down on non-directly compiled languages. There is a performance hit, but depending on the situation (a) the use of good coding, plus the languages use of JIT compiling, native code for modules, etc. mitigates the performance hit and (b) barely noticeable performance hits are better than a non existent program or buggy one.
Again, picking a language is a matter of tradeoffs that you will be able to appreciate as an experienced programmer. It sounds deadly simple to brush of Java, Python, etc. as I did when I was a green coder. But there is a reason all those languages are in use. Because they have their uses that other languages cannot supply.
So should you learn Java? Well, you know, there's more languages than Java out there. The closest relative to C is C++, which you might like for it's added power. Get a book like Accelerated C++ by Koenig, or take a look at Modern C++ Design by Alexandrescu to appreciate the true power of C++. Or go with C# and the .NET platform. Or try Python and Ruby and see what they offer. That high level coding + huge libraries make them extremely versatile and useful tools for any professional. Pick them not because they are "better", but to expand your knowledge and views.
EDIT:
No there's no large driving force to learn Java. It's a very popular language yes, but there are other languages that can be used on the application level. If you're happy with what you know, don't worry about Java.
Reply:I program in c and java, although i am probably a lot more proficient in Java.
The speed problem with Java might have been a problem 5-10 years ago, but with machines these days there si no real issue.
You can achieve a lot in Java very quickly as it is all OO, I suppose the biggest selling point is that you can code on a mac and run it on linix/windows or vice-versa wiithout having to change anything.
Reply:Hi dear !
I don't like to give you bumpy definitions , just in a single line you can say
"C is designed for all purpose while JAVA for specific purpose!"
Thanks and Regards !
Prince M. Premnath
florist shop
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment