Connor Wilson
  • Home
  • About
  • Archives
  • Contact

Established October 2006.

connorwilson: People, you don't need PHP to switch a CSS file! or AJAX! Jeez.

Follow me »

« I use Visual Editors
Stats and Lots Pretty Graphs »

On the Road to Java

Posted on September 24th in General — 7 Comments so far. Got something to say?

The Computer Science course my school offers puts you through Visual Basic for a whole year before actually doing anything worth while, and then you get to Java. It’s been a couple of weeks and the first bit of code is likely to come tomorrow, after an extended bit on Binary, programming history and Java’s background.

It’s actually pretty interesting, where Java comes from and how it came to be. The abridged version, in my own words, is as follows. Story time!

James Gosling, a top engineer for Sun Microsystems in 1989-1990 was working with a series of the other top Sun engineers on a top secret project codenamed “Green”. The project was to develop a “Jetson’s” style house.

jetsons.png

And by that, it’s meant to be something that can be fully automated. You can tell your house what to do… sort of. Speech recognition wasn’t exactly going down in 1990, so it would be controlled by a remote. The “Star 7″, I believe.

And This has What to do With JAVA?

Back to Mr. Gosling, he was absolutely infuriated with the C++ language and how it crashes constantly, so he apparently locked himself in a closet/room/whathaveyou for a period of time where he either wrote the language or thought of the idea.

Green project, OAK language? Who would have thought computer scientists were all environmentalist types?

Anyways, fast forward an unknown (to me) amount of time, and Gosling had produced the programming language OAK. OAK, indeed. As he went to copyright and trademark this name and language, he was faced with some legal issues. The crack legal team at Sun, circa 1990, couldn’t let him use OAK, as it was already in use. As a thanks to the lawyers’ long nights, he renamed it JAVA, supposedly after all the coffee that went down late at night.

Hello World

As always, the first thing you write in any language, class or whatever is the ubiquitous “Hello World”. I’ve already have a couple languages under my belt, namely PHP, JavaScript and the like, so I figured I’d skip this step on my own and go further.

Java, while small in file size, didn’t seem to offer the easiest way to output text. That’s all you need to do in this. PHP has echo(), JavaScript has document.write(), but this is what I’ve found for Java:

class HelloWorldApp {

	public static void main(String[] args) {

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

	}
}

It’s not that it doesn’t make sense to me, but it has me wondering if there is anything more simple. I’ve done a little research and apparently that is correct.

If one line of text requires five lines of code, I can’t wait to see the final project’s source. For the final assignment we have about 4 weeks to make whatever we want. Though we don’t even touch on GUI stuff, I’m thinking about a desktop application for Twitter. It’s been done, of course, but not anywhere near this class. It’ll help me get the GUI aspect of things down, as well as working with the Twitter API.

Any thoughts on JAVA? Better yet, is anyone actually good at it?

Comments

Leave a comment

  • Jim
    September 24th, 2007 at 9:43 PM

    Congrats on your foray into Java…

    Java is very in demand at the enterprise level, big companies pay top dollar for competent Java developers.

    Mastering a strongly-typed language such as Java, or c/c++ will make you want to pull your hair out since you are coming from a PHP background. Things that you can do in PHP in a few lines of code will take many more…

    I learned c++ first, and when I picked up PHP it seemed much simpler.

    Best of luck to you.

  • Vincent
    September 25th, 2007 at 4:01 AM

    I’ve started with c. I used to like it until I found PHP. It’s true what Jim said, PHP seems much easier after c/c++

    But haven’t yet touch JAVA. A friend told me to go for C# or the .net. But I have planned to play a little bit with delphi.

  • Acopic Web Design
    September 25th, 2007 at 4:34 AM

    I started out using Java about 10 years ago. I personally really like it although I admit the learning curve can be pretty sharp, especially if you’re coming from a scripting language like PHP.

    OOP just feels right to me and it’s something that I’ve transfered across into my PHP work. Obviously PHP5 has helped with this a great deal.

    I used to love working with Tomcat, JSP and Servlets, and the Struts framework is great for anyone looking for a rock-solid web application framework.

    Anyway - congrats on discovering Java (although I agree with the post above this one - .net is much more in demand these days - atleast here in the UK).

  • Razor
    September 25th, 2007 at 1:49 PM

    Were learning JAVA in my college (UK). In the 2-3 lessons we had, we started off with command lines then to a simple popup box GUI thing.

    The main things i have learnd is that u cant define a var with VAR. You define it on what u want the variable to hold. for example

    int var1; // can only hold numbers but no decimals.
    
    double var2; // can hold decimals.
    

    i forgot how to create a string var…

    and for our gui stuff, look into the swing class that java comes with.

    heres a lil code for u, compile and run it:

    import javax.swing.JOptionPane;
    
    class PopUp
    {
    
    public static void main(String[] args) {
    JOptionPane.showMessageDialog(null, "Hey connor!");
    System.exit(0);
    }
    }

    * u have to put System.exit(0); when using gui stuff as even when its not visible (closed) it takes up resourses so u have to close the actual program with System.exit(0). well thats wat our teacher told us :P

    one last thing thats a pain, your file name has to be exactly the same (case sensitive) as the main class. basically, to run the above class, u need to save it as PopUp.java

  • Connor Wilson
    September 25th, 2007 at 5:49 PM

    Nice Razor. What IDE are you guys using?

    Also, for the future, HTML works here and blocks of code go in the PRE tag, with inline code in CODE tags,

  • Razor
    September 26th, 2007 at 2:52 PM

    lol thanks, i was like omg all that writing has vanished.. :S

    well the IDE were using at college is Editplus 2 which is shareware… but is absolute shit compared to Netbeans 5 which is FREE !!! my advice is download netbeans, really good to use and is like dreamweaver were it tells you all the attributes of each class n wat not

  • Mauritian
    September 27th, 2007 at 4:03 PM

    It took me sometimes to realise that what you mean by Jetson house was the automation it has.

Respond

Login »

Need an account?

Blog Categories
  • Apple (12)
  • Blogging (44)
  • Design (32)
  • Free Resources (4)
  • Freelance (4)
  • Friday Roundup (4)
  • General (43)
  • Ideas (16)
  • Improve Your Blog (7)
  • Learning Ruby (4)
  • My Sites (16)
  • Personal (27)
  • Quick (9)
  • Ramblings (30)
  • SEO (15)
  • Site Development (31)
  • Sports (1)
  • WordPress (22)
Subscribe

Get updates to the RSS reader of your choice by subscribing.

    Subscribe to RSS

  • Subscribe in a Reader
  • Subscribe by email
Search

You can search all posts on the site, or visit the full archives to look around some more.

Top Commenters
  • Marketing (3)
  • Brady Valentino (2)
  • Como Emagrecer Rapido (2)
  • SJL Web Design (2)
  • Maria (2)
  • Jekyll Island Vacation (2)
  • Online Photo Editor (1)
  • hosting (1)
  • RandyBrown (1)
  • paulette (1)
Recent Posts

All content is copyright © Connor Wilson 2006-2008. If you want to use something just ask. Powered by WordPress.