Jump to content
Eternal Lands Official Forums
Sign in to follow this  
Placid

...

Recommended Posts

Teranoz, u need to learn an OO language......

Procedural sucks!

 

10 print hello

20 goto 10

30 begin

 

 

 

.......the good ole' days!

Share this post


Link to post
Share on other sites

Lol.

 

Yeah, Visual Basic is not real OO programming.

You example is also not very OO.

 

But concerning Visual Basic I know what I am talking about.

I have even a Micro$oft certification for that one.....

Share this post


Link to post
Share on other sites
Guest

the whole point of my post was mocking procedural programming (i.e. basic and yes, vb). Im a Java Cert, so i know about OO programming......

 

 

Secondly, get rid of your microsoft cert, its embarrassing :)

 

 

 

 

...only kidding :wink:

Share this post


Link to post
Share on other sites

I wonder WTH is so much better about OO? I mean, what do you think is more concise and clear,

 

this (procedural):

 


++++++++[>+>++++<<-]>++>[>++>+>++++>+++<<<<-]>++++++++.>>>+++++.+++++++..+++.<<.<+++++++++++++++.>>>.+++.------.--------.

 

or this (object oriented)

 


#include <string>

#include <iostream>



class Hello {

 public:

   Hello (std::string msg) : _msg (msg) {}

   ~Hello () {}



   std::string message () const { return _msg; }



   void print () const { std::cout << message (); }



 private:

   std::string _msg;

};



int main () {

 Hello *hello = new Hello ("Hello World");



 hello->print ();



 return 0;

}

Share this post


Link to post
Share on other sites

You ment the posting about the Errorhandler ?

 

Thats very common in VB.

 

In all subs and functions in VB you can use a GOTO label command, but this is only used for jumping to an errorhandler (if you want to do good vb programming)

 

There are 4 ways in VB to handle an error :

 

1. Not (not really an option, makes the program crash)

2. On Error Resume Next (might mess up the rest)

3. On Error Resume (serious errors will force you to Ctrl-Alt-Del)

4. On Error Goto Label (catch the error)

 

So until there is no other option in VB I stick to #4

Share this post


Link to post
Share on other sites

Yes indeed, OO programming will save the whales, bring world peace, and solve the energy problem. :roll:

Share this post


Link to post
Share on other sites
then again, what about errors that you cannot forsee?

 

learn OO, its tastier...

 

They will also go to the errorhandler.

You can eliminate some errors in an errorhandler, by doing


Select Case Err.Number

    Case 13

           'code to handle errornumber 13

    Case -212243656 (or whatever)

           'code to handle errornumber -212243656 

    Case else

           'all other errors, mostly writing to logfile and a resume next

End Select

Yes indeed, OO programming will save the whales, bring world peace, and solve the energy problem

 

Yeah,

 

Set Whale.saved = True;

CreateObject("WorldPeace")

Set Energy.Problem = Nothing

Share this post


Link to post
Share on other sites
WTF is this post doing in the Help Me section?

 

No idea, I did not start it, but needed to reply it.

Should be in either offtopic or programming, so why don't you move it there.

Share this post


Link to post
Share on other sites

sorry it was I that created the thread. it was a reply to a help me topic.......nice to see it moved here......hmmm........nice.......

 

 

 

..........

 

 

 

...........im bored at work......

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×