Page 1 of 1

DuxTell's Programming Resources

Posted: Tue Jan 14, 2014 1:11 pm
by Dux_Tell31
This is a collection of downloads and other stuff to help the new dev team learn programming. Please note that most of this was designed for use with VB, however the concepts carry over well.

Powerpoints
Spoiler:
Cheatsheet
Spoiler:
Programs
Spoiler:

Re: DuxTell's Programming Resources

Posted: Tue Jan 14, 2014 5:57 pm
by Keon
This is a video series. It is fantastic, but it doesn't have any exercises so it's kinda static. http://thenewboston.org/list.php?cat=31, and just in case you watch all 87 of those videos, here's forty more: http://thenewboston.org/list.php?cat=25

Re: DuxTell's Programming Resources

Posted: Wed Jan 15, 2014 12:35 am
by Iv121
Well here's an exercise for you then - what is the differece between static and non-static variables and functions ? :P

Re: DuxTell's Programming Resources

Posted: Wed Jan 15, 2014 1:42 pm
by Keon
Iv121 wrote:Well here's an exercise for you then - what is the differece between static and non-static variables and functions ? :P
For me?
Spoiler:
A static function or variable is called using the class. For example, Math.cos().

A non-static function is only used in the context of an instance. For example, other.setDead() (Is that a thing? It's been a while. Other instanceof EntityLiving, btw.)

Re: DuxTell's Programming Resources

Posted: Wed Jan 15, 2014 1:55 pm
by Iv121
Well you don't have to call it using the class, you can call it from INSIDE the class if you wish. What is important is that once a static variable or function is declared it will only ever exist in ONE instance and all modification made to it will effect the program as whole.

Re: DuxTell's Programming Resources

Posted: Thu Jan 16, 2014 9:56 pm
by fr0stbyte124
A static function, class, or variable is something that only one exists of and only one will ever exists. You can think of it as a global scope but the implications are more far reaching than that. The more you use them, the more you will get a feel for what role they play. Frequently, they are used to centrally manage instanced objects, such as counting how many instances there are or keeping track of the references to each so you can access them again.

The Vector and BoundingBox classes in Minecraft, for instance, keep a static pool of pre-instanced objects to avoid the overhead of reallocating memory each time you need a new one.

Other times, static functions simply exist because there is no reason to allocate memory for an object containing something like a Sqrt() function.