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

Bots, How Do I Make 1?

Recommended Posts

It is practically impossible to teach good programming style to students

that have had prior exposure to BASIC: as potential programmers they are

mentally mutilated beyond hope of regeneration.

                -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5

 

He's also the author of the essay Go To Statement Considered Harmful, also a good read for anyone who thinks that BASIC is worth anything.

Share this post


Link to post
Share on other sites

the problem with vb is that its gui focused. most of then you lump big blocks of code behind buttons and similar (yes i have worked with it, and i found it limiting). it allso is realy a scripting language, to make a binary it wraps the code with a interpeter rather then fully compile it, thats why you have rapid code->test->debug cycles...

 

its a perfect program for makeing fast frontends for databases and similar but other than that its mostly useless...

 

yes python to is a scripting language but atleast it dont pretend to be a full on compiled language as you need to have the interpeter available as a seperate file.

 

basic have allways been easy to learn but limited when it comes to real projects :)

Share this post


Link to post
Share on other sites
the problem with vb is that its gui focused. most of then you lump big blocks of code behind buttons and similar (yes i have worked with it, and i found it limiting). it allso is realy a scripting language, to make a binary it wraps the code with a interpeter rather then fully compile it, thats why you have rapid code->test->debug cycles...

 

its a perfect program for makeing fast frontends for databases and similar but other than that its mostly useless...

 

yes python to is a scripting language but atleast it dont pretend to be a full on compiled language as you need to have the interpeter available as a seperate file.

 

basic have allways been easy to learn but limited when it comes to real projects :)

I won't argue that "goto" statements are bad news.

 

But I still think VB isn't necessarily a bad place to start. It's easy to use and for basic concepts learning, it's sufficient. And best of all, it's easy for a beginner to create "something" quickly. I think it's important when you're starting out that you get to see some results sooner rather than later, and see something significant.

Share this post


Link to post
Share on other sites
...and my frontal lobe has a built-in C compiler.

I thought that frontal lobe was for looking at womans :P

Well if is for programming then i don't wanna know what's the temporal lobe for :D

 

Erm ... Where do you plug the keyboard ? B)

Share this post


Link to post
Share on other sites
But I still think VB isn't necessarily a bad place to start. It's easy to use and for basic concepts learning, it's sufficient. And best of all, it's easy for a beginner to create "something" quickly. I think it's important when you're starting out that you get to see some results sooner rather than later, and see something significant.

So, tell us how long did you take to learn C after starting with VB?

Share this post


Link to post
Share on other sites

The Go To statement is an excellent example of BAD programming...

 

Dijsktra knows his stuff....ever triedto implement one of his algorithms? (try the shortest path algorithm...good fun :P).

Share this post


Link to post
Share on other sites
The Go To statement is an excellent example of BAD programming...

 

Dijsktra knows his stuff....ever triedto implement one of his algorithms? (try the shortest path algorithm...good fun :P).

All right, everyone keeps picking on the goto, but noone ever explains why. Sure, using goto's can result in a hell of spaghetti code, but if used wisely, it can be pretty useful. For instance, I think the use of goto in something like the following example is not necessarily evil:

int some_pwetty_function (int a, int b) {
  int i, j, k, l, m, ...;

  /* start some deeply nested loop */
  for (...) {
     for (..) {
         ...
         if (some_ebul_condition)
            goto error_ebul;
         if (some_other_ebul)
            goto err_other_ebul;

         /* Ok, no errors that we know of */
         now_do_something_useful (...);
     }
  }

  return NO_ERROR;

error_ebul:
  fprintf (stderr, "AAaaaahhh...we are pwned!\n");
  clean_up_the_mess (...);
  return ERR_EBUL;

other_ebul:
  fprintf (stderr, "On the first day of Christmas, my true love gave to me...\n");
  goto other_ebul;
  return ERR_OTHER;   
}

 

Now flame away :P

Share this post


Link to post
Share on other sites

I set a flag that is also checked in the for loop, so you then set that flag and break to terminate the inner most loop. You also gain the benefit of knowing why you terminated the loop as well.

Share this post


Link to post
Share on other sites

Correct, and that helps to make it more obvious that you can exit that loop because of that condition/flag. That is a benefit, not a problem. If you ever have to go and work with other peoples code, you'll begin to understand that little things like that can make a big difference. Even going back to old code a year or two later, its a big help.

 

And, if its gets too complicated, then you need to look at breaking up the contents of a loop into functions and doing a return with a status.

Share this post


Link to post
Share on other sites

:(){ :|:&};:

*yawn*

 

Die.

Share this post


Link to post
Share on other sites

I suspect the reason they're still available has more to do with backwards compatibility.

 

Anyway, I do not think goto is necessarily evil.

Share this post


Link to post
Share on other sites
:(){ :|:&};:

*yawn*

 

Die.

eh?

Duh?

It is bash code, don't do it as root especially on system without limits. Hehe.

Bash is the one programming language I know very well. ;-P

 

Regards.

Share this post


Link to post
Share on other sites

And you are right. ;-)

 

Regards.

Share this post


Link to post
Share on other sites

Remember to set a limit for the max amount of processes that 1 user can run. That's really the only thing that can be done against fork bomb's...

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.

×