methodoverloading

are there PHP-like optional parameters in C#?

with PHP optional parameters, if you don't send a parameter it will be assigned to a default value: public function getCustomer(id, optionalMessage = "(no message)") { ... } in C# I generally solve this with C# method overloading, e.g.: public void GetCustomer(int id) { ... } public void GetCustomer(int id, string optional...

ruby operator overloading question

i've been messing around with ruby and opengl for entertainment purposes, and i decided to write some 3d vector/plane/etc classes to pretty up some of the math. simplified example: class Vec3 attr_accessor :x,:y,:z def *(a) if a.is_a?(Numeric) #multiply by scalar return Vec3.new(@x*a, @y*a, @z*a) el...