Information
By: Mush
Asked: September 27, 2011
Answered: December 31, 1969
Worth: 10 Member Points
Question answered:
The member points were handed out this way:

PY (10)
Moikle (0)
sirxemic (0)
Kilin (0)
Deza (0)
marbs (0)
Alert Games (0)
SkidRunner (0)
Am I Stupid?

In Java:

Which variable is named properly by standard naming conventions?
Choose one answer.
a. String name;
b. String N;
c. String Name;
d. String NAME;

It's a, right?


Dev - Warning
Dev - After editing rating, make rating display change
Dev - When editing, update "edited" column
Dev - Restore deleted comments
Dev - Display deleted comments if mod (hidden, then with dropdown)
Dev - After deletion or during edit, make rating dropdown appear again
Dev - Stricter rating rules. Prevent user from rating again
Dev - Pages
Dev - Reporting
Posted by PY September 27, 2011 18:28 - 1.6 years ago
| [#01]

I put 'a' and got it wrong...
Posted by Mush September 27, 2011 18:29 - 1.6 years ago
| [#02]

maybe he was answering the question posed in the title
Posted by Moikle September 27, 2011 18:30 - 1.6 years ago
| [#03]

Correct answer: depends on the context.
If it's a public property of a class I'd say c, otherwise a.
Posted by sirxemic September 27, 2011 19:08 - 1.6 years ago
| [#04]

Agree with Xemic. B and D are blatantly wrong, but A and C are interchangeable as far as I've seen them. But A is the more common, to my experience, and C is what a lot of people do for function/method naming.

In other words, your test/exam/whatever seems poorly thought out. Programmers are notorious for having poor communication skills, and that goes in my academic experience as well. Exams from the computer science department are the worst exams I've ever seen, next to Japanese class.
Posted by Kilin September 27, 2011 19:18 - 1.6 years ago
| [#05]

^I've noticed that, even after just 3 classes.
Posted by Mush September 27, 2011 19:21 - 1.6 years ago
| [#06]

I meant I thought you were right, at least the way I understand Java's conventions for local-scope variables, which I assumed it was, given the total lack of context.
Posted by PY September 28, 2011 7:23 - 1.6 years ago
| [#07]

I would name it a. If it is a constant I would name it d, and use underscores instead of camel case.
So it would be
CONSTANT_VARIABLE
or:
inconstantVariable

First upper case letters are for objects only.

I would look up the naming conventions for the language your using.
Posted by Deza September 28, 2011 11:12 - 1.6 years ago
| [#08]

The correct answer is whatever naming convention is currently in use for that project. The most important thing is consistency, especially in a project with more people than just yourself working on it.
Posted by marbs September 28, 2011 12:16 - 1.6 years ago
| [#09]

I assume when saying "in Java" they're talking about how the standard library does it.
Posted by PY September 28, 2011 13:26 - 1.6 years ago
| [#10]

I wouldve said c. Though if it were camel case i wouldve done: thisFormat.
Posted by Alert Games September 28, 2011 14:49 - 1.6 years ago
| [#11]

A and D
A standard
D public static
i have a java stanfards document to back it up.
Posted by SkidRunner July 10, 2012 19:45 - 10.4 months ago
| [#12]

Recent Activity
 
Active Users (0)