I stumbled on Cobra recently while looking for alternatives to Python that ran faster and didn't make me write "self." I was hoping to run a few questions by the community.
1. Is it possible to feed C# files directly into the Cobra compiler and use the classes defined therein? Or do I need to compile the C# first and @ref the classes?
2. Given that there are no free functions, what's the reason for accessing methods with the dot operator? If the call didn't look like some_object.method(...), you'd know it was a self/this call, so it wouldn't be ambiguous, right? Or am I missing something?
3. In this post, Charles explains his reasoning behind requiring a "base.init" call in every constructor:
I presume you mean letting the developer skip calling "base.init" or ".init" at the beginning of an initializer/constructor. Note that I gave two examples: "base.init" and ".init". I find that in C# and Java, developers don't seem to appreciate that there is an invisible call there whether they want one or not. The requirement for the explicit call is to make the developer decide what should really be done. When you have multiple initializers, say 4 of them, the correct answer is usually to chain the initializers, but in languages like C# and Java, developers almost always get this wrong and end up with 4 base/super calls instead of 1.
I'm used to C++, where the compiler will in fact insert a call to a no-arg base constructor if that's appropriate. I'm not sure I understand how someone could end up with multiple calls to a base constructor -- can anyone give me an example where this would be a problem?