PDA

View Full Version : Java apps/where to go next.



Frerunr722
04-13-2010, 02:38 PM
Hello, I am 13 years old an been playing with Java the last few days. I know the "hello world" stuff:

System.out.println("Hello World.");

And I can have the computer ask a question, you type something in, and it will reply back: "What is your name?" You type in Jack. It says "hello jack."

I can do that basic stuff, what should I do now? Keep with java? Learn another language like C#? (I don't really know what that is.) Should I watch some more tutorials? Thanks,
Hunter :)

djr33
04-13-2010, 06:29 PM
Java and C++ are languages that are designed for desktop programming-- making "programs".
They both have their uses, but their distributions are different-- Java is more dependent on "Java" itself (as a component of the operating system), and C# can be made easily into an .exe. But both are used for creating programs-- I'm not sure of the technical differences, but basically either one will be useful for that.
One big consideration is what operating system(s) you want to target: a C# program will be hard to transfer to Mac OSX, but will be easier to use on windows, etc. For all of this, it's time to do some reading (wikipedia?) to see what will be best for you.

In general, learning anything is a good idea because learning to program teaches you how to think like a programming language and most of them work in similar ways. Once you know Java, it will be a lot easier to learn C# (though you WILL have to learn it still), so if you don't know yet, just pick one and keep practicing.


Because this forum is mostly focused on web design, if you are interested in that, then Java and C# are both not very useful. JSP (Java Server Programming) is an option but it's not the same as regular "Java" (just related) and C# is possible to use on a server, but not common or easy. PHP is a language based on C# (so it's similar in form) and it is a very common server programming language (for example, you can use databases and create dynamic pages that generate different output in different situations). ASP (the microsoft version of PHP, basically) is another option.
PHP is open source and most supported/used. The others are not bad, but in general if there's no other reason to do something different, it's a good idea to use the most widely used language so that more people can help you, there are more tutorials, etc.

Javascript is NOT Java, just related by name (due to the same company starting them, I believe). The code looks roughly similar, but it works in a very different way-- this is client side programming, so that you can do things like have things change on the webpage AFTER the page is loaded. It's more for "fancy" effects than for real solutions to practical problems because it can't interact with the server (that's for PHP, etc.). Basically Javascript is a way to make great looking/working webpages and improve the user's experience, but server side languages will actually add significant things to your site like using databases and other big things like that.


Personally, I use PHP and I think it's a pretty easy language to get started with, though it does require a web server (and it's all but useless for creating a desktop 'program'-- like an .exe). If you want to do that sort of thing, look into it.
If not, Java and C# are both options. It really depends on what your goals are, though. I think that C# is the old, stable language that used to be used for everything, and Java is slowly becoming the main one used now, not to say either is really 'better' than the other.

As for how to learn, that really depends on your style. For many people, tutorials are good, for others (but not many) a technical manual is fastest, and for people like me just trying things out until it works is usually the best. Regardless, just keep programming.

For specific advice, I'd suggest choosing a project (not overwhelming-- something you can accomplish but is still useful/fun), and using that as motivation to learn.


And by the way, if you plan to make webpages, the FIRST place to start MUST be HTML and CSS. Having a good understanding of these will always help, whether you are just using them or using Javascript and/or PHP to add to the pages. But you can't use either of those without HTML and CSS. Be aware, though, that these are not 'programming' languages, but instead 'markup' languages in the sense that they don't "do" anything but are just 'information' and instructions about how to display that info. Basically they are information+formatting that can THEN be used by programs/programming languages (like your browser or PHP or Javascript).

Frerunr722
04-13-2010, 10:37 PM
Thanks for the info, I have played around with HTML, and was wondering: about those "arcade style" games ( www.addictinggames.com www.miniclip.com ) what kind of code asre those written in? I think (not sure) that most games are written in C++.
I did make some sample webpages with HTML, but I don't know what CSS is. I have heard of it before, but what is it really used for? My best guess is that it is an aid to help with HTML webpages.
Thanks for the reply,
Hunter.

djr33
04-14-2010, 03:11 AM
CSS stands for Cascading Style Sheets, the most important word being "style". CSS is a way to define certain properties of your page. In HTML you define properties right on the content:
<font size="...">Hello</font>
Using CSS, you can do it indirectly and not need to write it every time:
<p class="stuff">Hello</p>
CSS code: stuff { size:...; }

(That's not 'real' code, just an example.)

Then you can take that 'class' called stuff and apply it to other elements on the page.

Basically CSS separates design from content which is great for larger scale projects.

With the way that the web works right now, CSS and HTML are basically one thing that works together to create webpages. CSS is not really 'needed', but it's helpful, makes things simpler, and you can do more with it than with HTML alone. It's a little more to learn, but in general just a good idea.



As for 'arcade' games, almost all of those are made using Flash now. (Right click on a flash plugin and you can tell-- the right click menu will be different). Flash is actually a graphics program that is NOT a programming language. However, it has its own programming language called ActionScript that can expand what you can do with the graphics alone (basically customizing things). For example, in a game, you'd draw the characters and use the basic options in Flash THEN use some extra programming in ActionScript to add things like keeping track of number of lives, and lots of other things.

Java also can be used in this was, as a "Java Applet". Many (most) older games on the web were made using Java, and you can still do this now. The problem is that this can be slow (and annoying) on many machines and flash is faster. And flash is MUCH more common now, so some people might not have a Java plugin for their browser, only flash.

Flash is made by Adobe (recently bought from Macromedia). Look at adobe.com for more info. It is expensive and will take some time to learn because you must learn the program (the graphics parts) AND ActionScript. There are also some free/open source programs out there for Flash, but they don't have many features.

'shockwave' is another term for flash, but as far as I can tell it's basically the same thing (just in a different 'shape' or something).


By the way, ActionScript is similar to Javascript in style and both look generally similar to Java, but they aren't really connected.


ActionScript and Javascript are both 'event' based languages-- something happens (a mouse click? a timer runs out?) and then the program executes code. Many/most other languages (Java, C#, PHP, even HTML in some sense) operate in a 'linear' way-- start at the top and work toward the bottom, continuously and NOT based on events. Of course that can be in very complex ways made to work like 'events', but that's at a very high level of programming.

Frerunr722
04-14-2010, 04:46 AM
Wow, hehe, thanks for typing all that! It was helpful. I know, that sounds weird. But, what is C/C#/C++ used for? Are they the same? Are they similer? THX in advance, Hunter?

djr33
04-14-2010, 06:58 AM
C is the original language (at an early time in computing-- it might have been one of the first very useful languages, but I'm not sure on the details), and I guess it can refer to all versions ('C' and later). C+ must have existed at some point (I don't know...). C++ is the long way to write C# (since the symbol has two +s). Or, I guess, C# is the short way to write C++...