[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: camelCase or under_score ?
- From: Wesley Smith <wesley.hoke@...>
- Date: Mon, 28 Mar 2011 12:20:00 -0700
There's not native Lua style. Probably the best idea is to match the
API since people are generally familiar with it. For example, with
OpenGL bindings, I prefer CamelCase to match the OpenGL style.
wes
On Mon, Mar 28, 2011 at 12:16 PM, Gaspard Bucher <gaspard@teti.ch> wrote:
> Hi list !
> For a long time, I have been able to stick with the conventions inherited
> from ruby: PascalCase for classes, under_score for all the rest.
> Now that I am working with Qt, I have a problem: all Qt methods are camel
> case. After some time, my Lua code starts to look really weird:
> instance:setHue(def.hue or 0.2)
> instance:set_inlets(def.inlets)
> setHue is a method used in a QWidget, set_inlets is used in a sub-class from
> QWidget.
> At this point, I have 3 options:
> 1. rename Qt methods to use under_score (I subclass and rewrite methods
> anyway).
> 2. use camel case in the context of Qt and Qt sub-classes (but this means we
> will see setInlet for NodeView and set_inlet for Node which could be
> confusing).
> 3. use camel case everywhere (more work but doable on the long run).
> What is your advice ? Is there any "native" style for Lua ?
> Gaspard