Anonymous2012

Java.

19 posts in this topic

On certain sites, I have tried challenges which involve a good knowledge of Java/Javascript. I haven't bothered to learn it yet because I am unsure if I will need it.

Could someone please explain to me the ways Java can be used/ what it can be used for, and if it would be better to learn Java or C++ because at the moment I only have time to work on one.

Thankyou!

0

Share this post


Link to post
Share on other sites

Thankyou johnnymanson for that link to Wikipedia, but I am still unsure.

The reason I began to think about this is because I have seen challenges on netforce.nl, listed under the Java/Javascript section which involves logging in using applets, and I cannot do these challenges w/o learning Java. But I am wondering apart from just these challenges, could Java be of use for anything of the same sort e.g. Could knowing Java actually help you to log in/access a website or something, for real, not just as challenges?

And finally, could I get someones opinion (who has learnt Java) of how easy/hard they think it was. I have only learnt one language before, Python, so I am not used to programming as much as you probably. Would it be an easy 2nd language to learn?

0

Share this post


Link to post
Share on other sites

No. Those hacking challenges are not based on real world situations. In the real world, login processing is not client side. It's server side, using PHP/ASP/etc. and a database like MySQL.

The major difference between Java and C++ is that Java is compiled to bytecode, while C++ is compiled to machine code. What that essentially means is that Java requires some middle-man, the Java Virtual Machine, in order to interpret that code. This costs Java in performance, but it makes that code work on any machine that has the JVM. C++ meanwhile is much faster, but the code only works for the OS/architecture it was compiled for. It's a trade off.

Is Java easy to learn? Yeah I'd say so. It's more complex than a high-level interpreted language like Python, but so is C++. I don't think you could go wrong learning either one.

0

Share this post


Link to post
Share on other sites

Well, in that case I think I will try... C++.

Based on what you guys have said that seems to suit me the most.

Thanks for your help :)

0

Share this post


Link to post
Share on other sites
Well, in that case I think I will try... C++.

Why? Do you plan on developing some low-level software? If not, C++ is one of the worst options.

0

Share this post


Link to post
Share on other sites

C++ is also widely used in the gaming industry. While you'd normally use a higher-level language to write things like games, you just can't beat the speed that C++ provides. For general purpose programming, I would recommend neither C++ nor Java. Why is the choice between C++ and Java?

0

Share this post


Link to post
Share on other sites
C++ is also widely used in the gaming industry. While you'd normally use a higher-level language to write things like games, you just can't beat the speed that C++ provides. For general purpose programming, I would recommend neither C++ nor Java. Why is the choice between C++ and Java?

It's probably because, aside from .NET platform and C, they are two of the most widely used languages in industry. Which he should choose depends on his needs. C++ is good for low level stuff, games, and maintaining/extending apps written in C++. Java can write standalone, embedded and server-side software. Its performance has increased considerably over time, thanks to HotSpot. Most jobs right now are for J2EE or C#/.NET developers. If you want a RAD platform with most OS support, open-source, and plenty of jobs, Java is way to go. C++ is better if you are, say, looking for new vulnerabilities in Firefox. ;)

Also, it should be noted that C++ is not faster, but can be faster. Python beats it on string operations, and even functional languages are occasionally as fast as C. If you code C++ right, you can make it significantly faster. The problem is that the optimizations also tend to make the code unreadable or unmaintainable. If you can code it to perform fast enough in a easily read/maintained language, why not use that?

0

Share this post


Link to post
Share on other sites

Well... see at the moment I am not exactly sure what I will use my choice of programming language for.

I learned Python because I was told it was an easy langauge for beginners, and I'll admit, that was true.

But now I have learned Python and grasped it easily, I am looking for a bit more of a challenge. For me learning Python was quite dull, too easy and I felt I was not being challenged enough.

This may sound wierd in a way, but I want to learn a harder, very challenging programming language, to see if I can learn it and also I would find the feeling of grasping it to be very satisfying.

My choice isn't just between C++ and Java, I have considered learning others aswell, but these (e.g. Ruby) seemed to be harder to find good tutorials for. I want to learn some of the most popular languages, which I can easily find tutorials for, and be able to discuss them with a large number of people. C++ seemed to be one of the most popular.

If anyone else has suggestions on popular, commonly used, challenging programming languages, could they please post them here.

Thankyou.

P.S. If someone suggests a programming language they have learnt before, could they please provide a link/links to a good place to buy/read tutorials on it.

0

Share this post


Link to post
Share on other sites

Learning a Lisp is a very rewarding experience. There are some very advanced concepts involved in the languages and they could get you started on writing interpreters and compilers.

Also, you can use one of the best books in the field of computer science to learn it:

Structure and Interpretation of Computer Programs

The book teaches you Scheme, which is a Lisp-1. PLT Scheme is a nice Scheme implementation you can use.

0

Share this post


Link to post
Share on other sites

Thanks everyone.

This has really helped :)

0

Share this post


Link to post
Share on other sites

If you want something challenging, learn functional programming. LISP is nice because its imperative or functional. For Common LISP, get Practical Common LISP: it's an awesome free book online that will give u practical experience, like writing an MP3 parser and streaming server, i think. Purely functional languages like Haskell (most popular) and Clean (has IDE/dev tools) are good. Essentially, functional programming describes what a program does in math-like terms, while traditional languages describe steps to perform using variables and operators. It has advantages: easy parallelization; concise; sometimes self-documenting; easier to formally verify correctness. Standard ML, OCaml, and Microsoft's F# are others.

Another to experiment with is logic programming: PROLOG or Mercury, which is native compiled). You can try the new inherently parallel languages DARPA is working on: Fortress and IBM's X10. Heck, if you just want a potentially better imperative language, try Ada. Ada is a standardized language used heavily in defense and aerospace. It's compiler and syntax makes it easier for you to write highly reliable programs with real-time characteristics. It's often used in place of C in embedded systems because its very readable and meets its other goals. Google it for Ada vs. C++ comparisons and free compilers or dev-tools.

Hope you enjoy these!

0

Share this post


Link to post
Share on other sites

Oh, btw, Javascript has nothing to do with Java. It is more like python, or basic, or applescript.

0

Share this post


Link to post
Share on other sites

Javascript is nothing like basic or python other than that it is an interpreted language. I don't know anything about applescript so I can't comment on it's similarity to it, but javascript is a derivative of the ecmascript standard. If you want to compare it to anything, actionscript would be a fairly decent choice as they are both based on ecmascript.

0

Share this post


Link to post
Share on other sites

Hey.

Just out of curiosity, what is Object Orientation/ Object Oriented Language...

I hear this phrase all the time, and I am confused... Could someone please tell me what it is.

P.S. The reason I posted this in the Java topic is because I want to know is Java, or C++, is Object Oriented.

Thanks.

0

Share this post


Link to post
Share on other sites
P.S. The reason I posted this in the Java topic is because I want to know is Java, or C++, is Object Oriented.

Thanks.

JAVA, as well as C++, are both Object Oriented languages in that they have direct support for objects.

0

Share this post


Link to post
Share on other sites

Object Oriented Programming (OOP) is a programming language paradigm in which the programmer creates "objects" as a way to organize code. I suppose this isn't a great definition, but the main goal of it is to more closely relate programming to the problem domain which usually is life. Pretty much everything in the world has some kind of blueprint or definition, which in OOP is the object's class. It is the definition of all of the object's functions and variables. When you instantiate an object it creates a specific instance of the thing using that class as the blueprint. There are many more concepts that are closely related to OOP and probably much better explanations out there. Both C++ and Java are considered object oriented languages.

0

Share this post


Link to post
Share on other sites

Yes C++ is compiled and Java is JIT compled but Java isn't slow. It gets compiled into byte-code and then just-in-time compiled but the reality is that that really doesn't cost you much. You're really not going to notice the difference unless you're writing a computer game or flight similator and even then, Java has been making some good headway into these areas too. People use Java to write games for mobile devices and have even used it for 3D applications too, although I would argue that that is not what it's primary aim was.

Don't confuse Java with Javascript, they are completely different. Javascript is for client-side web-page scripting (as apposed to server-side, like php or Java Servlets) and Javascript doesn't have anything to do with Sun or Java - God knows why it's even got Java in the name, which is confusing.

Java applets are as defunct and depricated as ActiveX. If you want to look at client-side code deployed over the internet, take a look at Java Web Start.

If you want to write computer games and flight simulators, go learn C++, Open GL or DirectX or something. If you want to learn to write web-apps, maybe start with php or ruby on rails - Java does this well but it's not exactly easy to pick up if you've never coded before and it seems to me that php has the widest and cheapest hosting support.

0

Share this post


Link to post
Share on other sites
Javascript doesn't have anything to do with Sun or Java - God knows why it's even got Java in the name, which is confusing.

At the time of Javascript's introduction Java was the hot new web-programming language. Naming it Javascript was a marketing ploy.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now