lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Mon, Aug 19, 2013 at 12:56 AM, steve donovan <steve.j.donovan@gmail.com> wrote:
On Mon, Aug 19, 2013 at 9:50 AM, Hao Wu <wuhao.wise@gmail.com> wrote:
> out to be a so-good solution because implicit type conversion could give you
> the "wrong" result

Which is why Lua is so refreshing - very few implicit type conversions
(1 + "2" is one of the few warts it does have, I think)

> ostream& foo(ostream &os, Obj* obj) {
>    return os << obj;        // instead of os << *obj
> }

C++ people have all kinds of anxieties about the compiler telling them
their problems.  Test and see ;)


This could be a bit off topic: 

I do C++ a lot too, but just like few people would use multi-inheritance, those are confusing
and error-prone features that are not ready for production and team use - they tend to be
using simplest or error-detectable features. I use templates, but really, even the code I
wrote myself, I need to take a while to think about how and why I did it that way.

From my understanding, printf is a de facto function that does simple thing but no simpler
while C#-style is a high-level formatter that gives you extra features that free you to focus
on things you care more.