Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Java Class
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
goboenomo




PostPosted: Thu Sep 08, 2005 9:02 pm   Post subject: Java Class

Im starting a Computer Science course at school
we're spending like 3/4 of the year working on Java..
any tips or hints.. or basics anyone could tell me?
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Thu Sep 08, 2005 9:29 pm   Post subject: (No subject)

Tutorials are available in the tutorial section... http://www.compsci.ca/v2/viewtopic.php?t=9576
goboenomo




PostPosted: Thu Sep 08, 2005 9:36 pm   Post subject: (No subject)

thx
wtd




PostPosted: Thu Sep 08, 2005 9:57 pm   Post subject: (No subject)

Don't think that experimenting with other languages will somehow detract from learning Java.

In particular, languages which have interactive interpreters available. Makes a good way to quickly write throw-away code. Smile
rizzix




PostPosted: Thu Sep 08, 2005 10:23 pm   Post subject: (No subject)

yea he can try out beanshell in that case...
wtd




PostPosted: Thu Sep 08, 2005 11:36 pm   Post subject: (No subject)

For basic concepts, most interactive interpreters will work, though Haskell might be a bit too far removed from Java in philosophy.

One serious problem I have with Beahshell for learning purposes is that it doesn't show the value of expressions.

For instance, something as simple as:

code:
1 + 3


I should be able to see the result of that expression. The interactive interpreters for Ruby, Python, Scheme, Haskell, SML, O'Caml,
Common Lisp, Pike, and others behave this way.

code:
insaneones@ubuntu:~ $ irb
irb(main):001:0> 1 + 3
=> 4
irb(main):002:0> exit
insaneones@ubuntu:~ $ python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 + 3
4
>>>
insaneones@ubuntu:~ $ mit-scheme
MIT/GNU Scheme running under GNU/Linux
Type `^C' (control-C) followed by `H' to obtain information about interrupts.

Copyright 2004 Massachusetts Institute of Technology.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Image saved on Tuesday October 19, 2004 at 6:00:49 AM
  Release 7.7.90 || Microcode 14.11 || Runtime 15.3 || SF 4.41 || LIAR 4.116
  Edwin 3.114

1 ]=> (+ 1 3)

;Value: 4

1 ]=> (exit)


Kill Scheme (y or n)? Yes
Happy Happy Joy Joy.
insaneones@ubuntu:~ $ ghci
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.2.2, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
Prelude> 1 + 3
4
Prelude> :q
Leaving GHCi.
insaneones@ubuntu:~ $ sml
Standard ML of New Jersey v110.44 [FLINT v1.5], November 6, 2003
- 1 + 3;
val it = 4 : int
-
insaneones@ubuntu:~ $ ocaml
        Objective Caml version 3.08.2

# 1 + 3;;
- : int = 4
# exit 0;;
insaneones@ubuntu:~ $ clisp
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2004


[1]> (+ 1 3)
4
[2]> (exit)
Bye.
insaneones@ubuntu:~ $ pike
Pike v7.2 release 580 running Hilfe v2.0 (Incremental Pike Frontend)
> 1 + 3;
Result: 4
Terminal closed.
insaneones@ubuntu:~ $ gst
GNU Smalltalk ready

st> 1 + 3 !
4
st>
insaneones@ubuntu:~ $
goboenomo




PostPosted: Sun Oct 30, 2005 5:05 pm   Post subject: (No subject)

wtd wrote:
For basic concepts, most interactive interpreters will work, though Haskell might be a bit too far removed from Java in philosophy.

One serious problem I have with Beahshell for learning purposes is that it doesn't show the value of expressions.

For instance, something as simple as:

code:
1 + 3


I should be able to see the result of that expression. The interactive interpreters for Ruby, Python, Scheme, Haskell, SML, O'Caml,
Common Lisp, Pike, and others behave this way.

code:
insaneones@ubuntu:~ $ irb
irb(main):001:0> 1 + 3
=> 4
irb(main):002:0> exit
insaneones@ubuntu:~ $ python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 + 3
4
>>>
insaneones@ubuntu:~ $ mit-scheme
MIT/GNU Scheme running under GNU/Linux
Type `^C' (control-C) followed by `H' to obtain information about interrupts.

Copyright 2004 Massachusetts Institute of Technology.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Image saved on Tuesday October 19, 2004 at 6:00:49 AM
  Release 7.7.90 || Microcode 14.11 || Runtime 15.3 || SF 4.41 || LIAR 4.116
  Edwin 3.114

1 ]=> (+ 1 3)

;Value: 4

1 ]=> (exit)


Kill Scheme (y or n)? Yes
Happy Happy Joy Joy.
insaneones@ubuntu:~ $ ghci
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.2.2, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
Prelude> 1 + 3
4
Prelude> :q
Leaving GHCi.
insaneones@ubuntu:~ $ sml
Standard ML of New Jersey v110.44 [FLINT v1.5], November 6, 2003
- 1 + 3;
val it = 4 : int
-
insaneones@ubuntu:~ $ ocaml
        Objective Caml version 3.08.2

# 1 + 3;;
- : int = 4
# exit 0;;
insaneones@ubuntu:~ $ clisp
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2004


[1]> (+ 1 3)
4
[2]> (exit)
Bye.
insaneones@ubuntu:~ $ pike
Pike v7.2 release 580 running Hilfe v2.0 (Incremental Pike Frontend)
> 1 + 3;
Result: 4
Terminal closed.
insaneones@ubuntu:~ $ gst
GNU Smalltalk ready

st> 1 + 3 !
4
st>
insaneones@ubuntu:~ $


wait....
what is that?
goomba




PostPosted: Sun Oct 30, 2005 9:01 pm   Post subject: (No subject)

wtd is just showing examples of different languages that have interactive modes, which means that you can type in commands at a prompt and get immediate output, compared to Java where you have to properly set up a class file, compile and run it. Interactive mode are definitely very useful, but you shouldn't worry about them if you are only focusing on Java since they basically don't apply.

When you learn Java, try to apply Object Oriented concepts whenever possible, even if they seem unnecessary, redundant, or a waste of code. If you get into the habit of keeping code encapsulated properly in methods and classes, making bigger programs will be much easier for you. Don't write Turing in Java!
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sun Oct 30, 2005 9:16 pm   Post subject: (No subject)

goomba wrote:
wtd is just showing examples of different languages that have interactive modes, which means that you can type in commands at a prompt and get immediate output, compared to Java where you have to properly set up a class file, compile and run it. Interactive mode are definitely very useful, but you shouldn't worry about them if you are only focusing on Java since they basically don't apply.


Interactive interpreters aren't as important in the Java world because for the most part they aren't there. Java programmers can't come to love the interactive interpreter that doesn't exist.

Yet, if they're not important, why do we have Beanshell, Groovy, Jython, JRuby, etc.?
goomba




PostPosted: Sun Oct 30, 2005 9:29 pm   Post subject: (No subject)

Since they aren't "natively" part of Java, 3rd party interactive shells should be left to more advanced Java coders who already know how to program in Java without them.

Obviously there's the demand for these Python emulation layers, but then again Java leaves much to be desired in pretty much ANY area compared to Python and friends. Razz
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: