View Full Version : Learning java script
sufc_tom 20-02-2007, 11:30 I start my course at Uni in September. My prospective tutor has told me that proficiency in java programming will be essential.
Is their any good software/online help guides/books or any sort of media that could enhance my (lack of) java skills?
JavaScript is not the same as Java.
If it is Java skills you want, I would recommend a book published by Wrox press called 'beginning Java' by Horton. There are a number of versions of java, look for a book that is aimed at 1.5 (aka 5.0) or higher. I believe 1.6 is the very latest version.
sufc_tom 20-02-2007, 13:37 doh i knew that but i still put it anyway. must wake up lol.
anyway java language for software programming.
for online turorials/sample code, try javaalmanac.com
basshedz2 20-02-2007, 15:46 You can download a free electronic book on Java by Bruce Eckel:
http://www.mindview.net/Books/TIJ/
I taught myself Java using Java Gently by J. Bishop, and i'd highly recommend it. After I'd learnt the (very) basics then I also used the Sun Java Tutorials and the Core Java books.
I'd also recommend finding an IDE (such as Eclipse (http://www.eclipse.org/downloads/) or NetBeans (http://www.netbeans.org/)) that you feel comfortable with and learning how to use it. I find it makes life a hell of a lot easier.
The VERY best way to learn how to program is to do it. Once you have learnt some of the basics, have a look at the mountains of source code that is available on the internet - and also books like the java cookbook - and try and customise it to do something you want to do. I found that this approach worked really well for me. I found myself absolutely incapable of learning java when we were (briefly) taught it at uni - my way suited me much better!
(Oh yeah, and avoid a book called Java First Contact - i learnt _nothing_ from it.)
Good luck,
sufc_tom 20-02-2007, 16:10 You can download a free electronic book on Java by Bruce Eckel:
http://www.mindview.net/Books/TIJ/
I taught myself Java using Java Gently by J. Bishop, and i'd highly recommend it. After I'd learnt the (very) basics then I also used the Sun Java Tutorials and the Core Java books.
I'd also recommend finding an IDE (such as Eclipse (http://www.eclipse.org/downloads/) or NetBeans (http://www.netbeans.org/)) that you feel comfortable with and learning how to use it. I find it makes life a hell of a lot easier.
The VERY best way to learn how to program is to do it. Once you have learnt some of the basics, have a look at the mountains of source code that is available on the internet - and also books like the java cookbook - and try and customise it to do something you want to do. I found that this approach worked really well for me. I found myself absolutely incapable of learning java when we were (briefly) taught it at uni - my way suited me much better!
(Oh yeah, and avoid a book called Java First Contact - i learnt _nothing_ from it.)
Good luck,
Your the same person who helped me with my algebra query correct?
Your a star, can I just take you into my lectures instead?
basshedz2 21-02-2007, 12:01 Your the same person who helped me with my algebra query correct?
Your a star, can I just take you into my lectures instead?
'Fraid not :hihi:
If you've got any programming questions you can give me a shout though.
Where is your course at anyway?
sallonoroff 21-02-2007, 12:12 This book (http://www.amazon.co.uk/Understanding-Java-Barry-John-Cornelius/dp/0201711079/) was written by the man who taught me Java. My year-group were guinea pigs for each chapter of this book as he wrote it.
Sadly it doesn't look like it's been revised recently, so some stuff might be 'old hat'...
.
sufc_tom 21-02-2007, 12:15 Course is at Huddersfield Uni in Sept 07 so you don't have no excuses plenty of notice :hihi:
alkatraz 21-02-2007, 20:44 I start my course at Uni in September. My prospective tutor has told me that proficiency in java programming will be essential.
Is their any good software/online help guides/books or any sort of media that could enhance my (lack of) java skills?
My dissertation was a Java program teaching and playing a board game. If you need any pointers, I am around.
POINTER ONE
GET ECLIPSE
GET FAMILIAR WITH ECLIPSE
USE ECLIPSE
MAKE ECLIPSE YOUR BEST FRIEND!!!
Also get familiar with notepad, and javac and java on the command line.
Most programming courses will start with no access to an IDE and lots of command line programming. Apparently it's a better way to learn, rather than having the IDE filling in the blanks for you.
You could start off now, download the jdk (java development kit) from java.sun.com, get it installed.
Google, "java hello world example" or java hello world tutorial, have a read, create some class files, compile some code, see what happens.
alkatraz 21-02-2007, 21:00 Also get familiar with notepad, and javac and java on the command line.
I must interject.. FORGET NOTEPAD. It might be quite decent and lightweight, but it's a dos standard e-turd.
If you plan to code in Java (or anything else for that matter) and you plan to do it for a Uni course - get EmEditor. You Can get an Academic License for EmEditor Pro for free so long as you tell them which Uni and course.
I work as a Unix sysadmin (among a myriad of other things - not the least as a coder of PHP, Perl, Java, C, etc) and I could not live my life (when in a Windows environment) without EmEditor.
Ok, I'm pushing it a little, but you won't regret using it. It's better thatn TextPad, and notepad shouldn't even be called a text editor in comparison.
http://www.emeditor.com/
alkatraz 21-02-2007, 21:02 But with regards to java and javac - he's right.. you must get familiar with doing it the simple way with the command line, it's very important. Once you start coding programs and bigger programs than little test pieces, you must get Eclipese. It's just how it is.
Dos standard? It's the windows text editor.
And since it's already on everyones PC it's a good place to start if all you need to do is produce a class file.
Personally I use textPad at work if i'm not using the IDE for some reason (oh and not everywhere uses it's eclipse, despite it's popularity). JBuilder, Sun One, intelliJ are all viable alternatives that you will find in use in some places.
I'd choose my weapon, jBuilder has very good support for constructing gui objects, Sun One comes with an appserver if you don't have one etc...
alkatraz 22-02-2007, 08:12 Dos standard? It's the windows text editor.
DOS-Standard as in DOS text standard instead of Unix text standard.
And since it's already on everyones PC it's a good place to start if all you need to do is produce a class file.
Indeed, but my thought was, if you are starting a course, start where you mean to go on. Don't spend time getting used to another system half way through.
Personally I use textPad at work if i'm not using the IDE for some reason (oh and not everywhere uses it's eclipse, despite it's popularity). JBuilder, Sun One, intelliJ are all viable alternatives that you will find in use in some places.
I'd choose my weapon, jBuilder has very good support for constructing gui objects, Sun One comes with an appserver if you don't have one etc...
I know a number of people who like textpad - but more often than not, they haven't been told about, or given a chance to, EmEditor until they're too used to TextPad to bother changing. If you haven't used either, try EmEditor, it's DAMN good.
I have tried JBuilder many many times, and although it may just be a personal thing, I could never get on with it. It just felt like bloated rubbish. I tried loads and loads of programs and all otf them just didn't hit the nail on the head and more often than not reduced my productivity instead of increasing it. The only one that REALLY worked for me is Eclipse. So much so that when I started doing a DB program with PHP&MySQL, I found an eclipse variant for that too. It's just that good.
sallonoroff 22-02-2007, 09:13 We were taught to use emacs (on Windows - incidentally, we were never shown an IDE at all), though i recall we had to add something to it to make it colour-code the code nicely...
Again, these were all the foibles of the author mentioned above... (If you're dunelm alumni alkatraz, do you remember him?)
.
basshedz2 22-02-2007, 10:42 I have tried JBuilder many many times, and although it may just be a personal thing, I could never get on with it. It just felt like bloated rubbish. I tried loads and loads of programs and all otf them just didn't hit the nail on the head and more often than not reduced my productivity instead of increasing it. The only one that REALLY worked for me is Eclipse. So much so that when I started doing a DB program with PHP&MySQL, I found an eclipse variant for that too. It's just that good.
I also disliked JBuilder - for the same reasons as you. Though it does do GUIs well. I didn't mind NetBeans (i was using version 3.5 or something) but then they upgraded it and i didnt like the changes. I then took the opportunity to try eclipse, and never looked back. I also like the way that you can have a consistent IDE for different languages - i use eclipse for java, python, and occasionally to write (really bad) c/c++.
Cyclone - if you need an app server within eclipse you can integrate eclipse with Tomcat.
alkatraz 22-02-2007, 12:21 (If you're dunelm alumni alkatraz, do you remember him?)
Remember who?
I also disliked JBuilder - for the same reasons as you. Though it does do GUIs well. I didn't mind NetBeans (i was using version 3.5 or something) but then they upgraded it and i didnt like the changes. I then took the opportunity to try eclipse, and never looked back. I also like the way that you can have a consistent IDE for different languages - i use eclipse for java, python, and occasionally to write (really bad) c/c++.
Cyclone - if you need an app server within eclipse you can integrate eclipse with Tomcat.
I know you can, but we were giving advice to a newbie.
I have eclipse and jbuilder X at home, at work I use intelliJ. I wouldn't get hung up on an IDE, chances are when you start work somewhere they'll tell you what to use.
Dos text as in /r/n instead of unix /n, so what. If you're just writing a java file to compile it and will be doing so on windows then who cares.
For simplicities sake you could write hello world in about 1 minute in notepad now and have it running in a dos console 30 seconds later. You don't need colour coding and syntax assistance to get started.
package com.cyclone.world
public class HelloWorld{
public static void main (String[] args){
System.out.println("Hello World");
}
}
javac HelloWorld.java
java HelloWorld
sallonoroff 23-02-2007, 08:53 Remember who?
Barry Cornelius.
(The author of the book i linked-to above.)
.
alkatraz 23-02-2007, 10:03 I have many issues with the teachings of cornelius. His ideas made logical sense, but did NOT make for good practice in the real world.
I mean c'mon, who calls ALL parameters $pParam and ALL return values $rReturnVar etc... it's makes sense, buyt it just doesn't work.. you'd have to be an anal administrator to handle it - and programmers just aren't.
sallonoroff 23-02-2007, 11:31 So you do remember him then?! :D
I expect you are right about the variable naming conventions for the real-world (although having never coded Java 'in anger', i wouldn't know), but i thought he was a reasonably good 'teacher'. The lectures were pretty slow going... but i always found the material easy enough to follow.
.
basshedz2 23-02-2007, 12:45 I have many issues with the teachings of cornelius. His ideas made logical sense, but did NOT make for good practice in the real world.
I mean c'mon, who calls ALL parameters $pParam and ALL return values $rReturnVar etc... it's makes sense, buyt it just doesn't work.. you'd have to be an anal administrator to handle it - and programmers just aren't.
People i've collaborated with actually do this! TBH, its like all coding conventions - once you get used to it its no effort at all. I dont use it for my personal projects though, i dont think it looks very elegent!
Sun coding guidelines say that all variables should be given descriptive names, simple as.
so
public boolean isLarger(int value, int comparator){
boolean larger = false;
if(value > comparator){
larger = true;
}
return larger;
}
Silly example, you'd never make that a method, but it illustrates the name convention normally used, including the camel casing. Method and variable names should all start lower case, class names start upper case.
bjcornelius 19-08-2007, 13:31 Ahh! Those coding guidelines that cornelius (aka Barry Cornelius) was espousing to Java students back in the late 90s. Essentially, it's just using a lower-case prefix in the name of an identifier that helps/reminds you of where the identifier was declared:
p to refer to a parameter
t to refer to a local (or temporary) variable
i to refer to a private (or 'idden) variable
I'm still using those guidelines (in PHP as well as Java). Here's some Java code I wrote in May 2007:
public String getDetailsFromLdap(final String pUsername) {
if (iAvoidLdap) {
return "";
}
if ( iDirContext == null ) {
return "getDetailsFromLdap says that iDirContext is null";
}
final String tFilterString =
"(&(objectclass=*)(oucsusername=" + pUsername + "))";
SearchResult tSearchResult = null;
final SearchControls tSearchControls = new SearchControls();
tSearchControls.setSearchScope(
SearchControls.SUBTREE_SCOPE);
final String tReturningAttributes[] = { "oucsAffiliation",
...
Aside: this method is part of some code for implementing single-signon for Google Apps for Stanford's Webauth.
The above code also shows the unusual overuse of final that I also taught students:
always use final for a variable's declaration if you only assign a value once to that variable;
always use final for a parameter's declaration if you don't intend to assign a value to it (within the body of the method).
I agree with the view given by cyclone about not using an IDE to begin with.
Finally, hello and best wishes to moonlight and alkatraz who seem to be former students.
--
Barry Cornelius
www DOT barrycornelius DOT com
|
|