4 ms·
> you won't get that nice "new" syntax What's nice about that syntax? In every language that I've used which has it (C++, Java, C#, JavaScript), it's been a ro
by snprbob86 14y ago
> you won't get that nice "new" syntax
What's nice about that syntax? In every language that I've used which has it (C++, Java, C#, JavaScript), it's been a royal pain in the butt. It makes it harder to swap in alternate factory behavior and requires remembering a few arbitrary extra rules, like operator precedence (no matter how many times I write `new Foo().bar()`, it still doesn't parse right in my head).
Ruby, SmallTalk, and Objective C get this right: Allocation is distinct from initialization (new vs init) and both use standard message passing / method call semantics.