Method Overloading?

BlitzMax Forums/BlitzMax Programming/Method Overloading?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I stand corrected on the "True OOP Environment Statement". Thanks for keeping me in check about that.

But how can Function/Method overloading be attributed to lazy programmers?

Wouldn't it make sense if you have multiple ways to carry out the same task, but each method requires different data to do so, that they should all be called by the same name? They aren't different features, they're the same feature.

Sure I could have created a function called:

Function Create()

And another function called:

Function CreateAndAssignValues(val1, val2,...)

But that's just sloppy and cluttered code (IMHO).

I love Function/Method overloading because it helps you clarify the specific functionality of your code.

A class should only have one 'Create' function/method IMO. But there s/b more than one way to create the object (if the situation so requires it).

Sometimes you may need to create an object and assign values to it later, other times you may need to assign values to an instance of the same object at the point of creation. Sometimes you may need to create a new instantce of the same object and assign different types of values at the point of creation.

You are all right. Itt IS a matter of choice. But I think that Method/Function overloading just leads to easier to read/understand code (IMHO).

I've been spoiled by doing Java and C# development over the past several years.

I'm really likeing what I'm seeing with BMAX. Can't wait for the official Windows release, and the 3D module. I like the fact that it's an easy to use Object Oriented programming language that isn't compiled to some byte code.

-Jim