Project directory structure

Dirk Hohndel dirk at hohndel.org
Wed Apr 3 09:56:24 PDT 2013


Alberto Mardegan <mardy at users.sourceforge.net> writes:

> Hi Tomaz,
>
> On 04/02/2013 09:30 PM, Tomaz Canabrava wrote:
>> I just pushed to my repo the modifications that Dirk asked, reduced the
>> number of files, updated the mainwindow a bit. It's in a state that's
>> 'workable', I tried to follow the codding style ( where did I failed? o.o )
>
> you didn't do anything wrong; we are just using different styles. :-)
>
> So, here's a list of questions for Dirk and Linus:
>
> 1) tabs or spaces?
>    - I know you prefer tabs, but what about continuation lines?
>      Is this the desired indentation?
>       void function()
>       {
>       <tab>do_something(param1,
>       <tab>..<spaces>...param2)

In general always tabs. But you caught the ONE exception. When breaking
long lines over multiple editor lines things are easier to read if you
have tabs and then a few spaces to allign the paramaters (just like you
indicate here).

> 2)
> MainWindow::MainWindow()
> : ui(new Ui::MainWindow())
> , var2(0)
> , var3(stuff)
> {
>
> vs
>
> MainWindow::MainWindow():
> <tab>ui(new Ui::MainWindow()),
> <tab>var2(0),
> <tab>var3(stuff)
> {

DEFINITELY the second one. The first one is too ugly for words (sorry)

> 3)
> class ClassName{
> vs
> class ClassName {
> vs
> class ClassName
> {

I think a class is very much like a function when it comes to
indentation, so I'd go with the last.

> 4) (look at the ":", not at the "{")
> class ClassName: parent ParentClass {
> vs
> class ClassName : parent ParentClass {

I don't feel as strongly as I did about the first three... I think I
like the second better.

> 5) Text width: 80 chars? If you have a limit, how many spaces is a tab
> worth?

We don't have a hard limit. We try to be done around 120 chars but will
deal with longer lines if it improves readability (i.e., don't push
people to use non-descriptive names just to fit an arbitrary line
length).
tab = 8 chars

/D


More information about the subsurface mailing list