AutoHotkey Community

It is currently May 25th, 2012, 7:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: May 20th, 2007, 9:10 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Out of curiosity, I downloaded and installed BlueJ.
I ran it and without looking in the manual, I was able to create a class, to modify a bit the template it created:
Code:
/**
 * Write a description of class Hello here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
public class Hello
{
    // instance variables - replace the example below with your own
    private int x;

    /**
     * Constructor for objects of class Hello
     */
    public Hello(int x_)
    {
        // initialise instance variables
        x = x_;
    }

    /**
     * An example of a method - replace this comment with your own
     *
     * @param  y   a sample parameter for a method
     * @return     the sum of x and y
     */
    public int sampleMethod(int y)
    {
        // put your code here
        return x + y;
    }
   
    public static void main(String[  ] args)
    {
        if (args.length < 2)
        {
            System.out.println("Usage: Hello "1" "2"\nAny integer value is OK.");
            System.exit(-1);
        }
        Hello h = new Hello(Integer.parseInt(args[0]));
        System.out.println("Hello World!\n" + h.sampleMethod(Integer.parseInt(args[1])));
    }
}
and to compile it.
Then I was stuck. I tried right click on the class in the main window, I saw the main function in the menu but I supposed it was to jump to the method: most IDEs have this functionality.

So I downloaded the tutorial, skimmed the start until I saw 3.4 Execution and read:
BlueJ Tutorial wrote:
Now that you have created an object, you can execute its public operations. (Java calls the operations methods.) Click with the right mouse button on the object and a menu with object operations will pop up (Figure 5).
So they suffer of too much flexibility... By default Java runs the main() function, but BlueJ allows to start using any public method.
I selected void main(String[] args) in the context menu and I got a prompt to input the parameter values. I typed { "1", "2" } (the braces are provided by default) and I got Hello and 3 in another terminal window.
Not super intuitive, but usable.

Eclipse might be more confusing, its interface is very flexible, but hard to navigate at first...
Note there is a BlueJ extension for Eclipse.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Last edited by PhiLho on May 21st, 2007, 8:54 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 20th, 2007, 4:21 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
Nice ha, imagine how i felt :lol: . I actually downloaded eclipse already, and so far i haven't had any problems with it. Java looks a lot like C++ btw.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 20th, 2007, 5:14 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8647
Location: Salem, MA
If you want to know why it is like C++, please read this book: Goto, by Steve Lohr

I recently read it ant it was at least interesting.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 21st, 2007, 8:18 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
so neXt, like I said, just take Delphi and you will be more then happy.

Quote:
Java looks a lot like C++ btw.

They just share syntax.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 21st, 2007, 9:04 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
neXt wrote:
Nice ha, imagine how i felt :lol: .
Well, as I wrote, it isn't super intuitive for a program targeting beginners. Of course, the usual RTFM applies here, even more for learning something, yet it could be improved, eg. by prefixing the method name by a Call: or Run:

Quote:
I actually downloaded eclipse already, and so far i haven't had any problems with it.
Good. Learning to use Eclipse is a good asset.

Quote:
Java looks a lot like C++ btw.
Yes, I believe I wrote that above... They improved some things (better object model) but they omitted other useful stuff (enums, introduced only in Java 1.5!) and they should have thrown away some features (if (a = b)). String support is half baked IMHO.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 4:00 am 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
I actually decided not to rush. I'll learn VBA first, since it's not that hard + it's an OOP language, hopefully this will make it a lot easier later :D
+ i'll have a lot more use for VBA at the moment than from anything else (besides AHK off-course), since i work with excel A LOT.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 9:10 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Wrong choice. VB can only learn you wrong programming habits.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 11:26 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Aha! You think that AutoHotkey can give good programming habits? Sorry Chris... :-)
I just mean that AHK is roughly at same level, ie. mostly procedural. VB has even a kind of primitive OOP.
And neXt is right, knowing VBA is useful if you use MS Office a lot. I am not sure it will allow him to "move forward" in programming knowledge, but at least it will widen a bit his vision of programming.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 3:55 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
I mean you have to declare all variables and their types, syntax matters, you have 3 types of arrays + you are working with objects, and language is easy to learn. I can't understand how it gives you bad programming habbits :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 4:27 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
And neXt is right, knowing VBA is useful if you use MS Office a lot
If you use MS Office it might be...

Quote:
I am not sure it will allow him to "move forward" in programming knowledge, but at least it will widen a bit his vision of programming.
I am sure that Delphi does that to ppl. Pascal is initaly made to be model for learning.


2neXt
Quote:
I can't understand how it gives you bad programming habbits

I do. You asked a question. I gave you the same answer as to every man trying to learn real programming.

I am not going to stay here convincing you what to do. I told you what I think you should do. From now on, the choice is yours.

Anyway, its not by accident that Delphi designer is bought by MS to design dotNet which is state of the art VM IMO, and it is a lot influenced by Delphi.

Well... you can always use VB.NET for the same power as with any other dotNet language, although its syntax is discussting for me.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2007, 10:59 am 
Offline

Joined: June 12th, 2006, 9:14 pm
Posts: 18
Location: Jakarta, Indonesia
Don't forget that Pascal has a free compiler (FreePascal) and even a free Delphi-like visual builder (Lazarus).

_________________
Image Image Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group