Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

variable naming style #399

Closed
jfirebaugh opened this issue Aug 2, 2014 · 7 comments
Closed

variable naming style #399

jfirebaugh opened this issue Aug 2, 2014 · 7 comments
Labels

Comments

@jfirebaugh
Copy link
Contributor

We're currently using a mix of camel-case and underscore variable names. My vote is for camel-case simply to be consistent with JS.

@incanus incanus added the parity label Aug 2, 2014
@mourner
Copy link
Member

mourner commented Aug 2, 2014

I thought this was a common C++ convention — underscores for local variables and properties, camelCase for function names.

@incanus
Copy link
Contributor

incanus commented Aug 2, 2014

underscores for local variables and properties, camelCase for function names

That's the lead I've been following in the project, but I don't have strong feelings either way. In Cocoa, camelCase is used for both.

@jfirebaugh
Copy link
Contributor Author

@mourner This is about variables only. We seem to be more consistent with function names.

@ljbade
Copy link
Contributor

ljbade commented Dec 4, 2014

The current adhoc conversion from old_style variable names to newStyle is rather annoying and confusing.

It is too easy to keep using the old_style because you copy some code etc. when adding new code.

We need to carefully go through every file and change everything at the same time.

Otherwise with branches and merges happening all the time we will never switch over completely and be left with a mix which is just bad.

@jfirebaugh
Copy link
Contributor Author

We're getting to be in good shape here. Let's continue to make things camel-case when we encounter variables that aren't.

@tmpsantos
Copy link
Contributor

I would like to suggest suffixing class attributes with a _ as in myAttribute_.

@tmpsantos tmpsantos reopened this May 15, 2015
@jfirebaugh
Copy link
Contributor Author

@tmpsantos If we were starting from scratch, I'd agree. But none of the existing code uses that convention, and in fact much of it uses a _ suffix on parameters to avoid shadowing a member (the opposite convention). I think it's too much churn to make a change here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants