Opinion needed : which one is looking better ?

View previous topic View next topic Go down

Opinion needed : which one is looking better ?

Post by BIT0112-Rokon on Thu May 05, 2011 11:33 pm

We all know that, a variable name starts with small letter in Java. Now looks carefully my example :-

Take One:



Take Two:



Now tell me which one is looking good. Whats you opinion..?

Edit:
removed specific language terms, thanks to Amit:)


Last edited by BIT0112-Rokon on Fri May 06, 2011 1:17 am; edited 1 time in total (Reason for editing : removed specific language terms, thanks to Amit:))

_________________________________________________________________


Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী
avatar
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

View user profile http://blog.codexplo.org

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0208-Shuvo on Fri May 06, 2011 12:56 am

Definitely the code written in Java is looking good because it's easy to differentiate between a class and a variable which isn't possible in the next code written in C#.
avatar
BIT0208-Shuvo
Global Moderator-RC

Course(s) :
  • BIT

Blood Group : B+
Posts : 87
Points : 124

View user profile

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0122-Amit on Fri May 06, 2011 1:01 am

Are you sure?

Because in C#, if I remember correctly, variable names are started with small character. In case of private members, it is started with an underscore(_) .

Starting with small later is also called Camel Case notation.

The only time when .NET uses Pascal case notation is when the variable is
given property. I.E.

Code:
int Name{ get; set; }

Where we can directly get or set the value of that variable. The reason is that the variable, when property given variable becomes the function itself. And we know that in C#, function names are Pascal Case.

Can you provide the references based on which you are claiming that variable names are PasCal Case in C#?


Edit:
Can you please improve the topic title? It does not exactly represent what is being compared here.

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0112-Rokon on Fri May 06, 2011 1:09 am

Thats great! Amit!
I knew that,
But i just wanted to know your opinion guys, which one is looking better.
there are no references available man, it was just a thought.

Im also agree with shuvo, its better to start with small letter.

_________________________________________________________________


Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী
avatar
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

View user profile http://blog.codexplo.org

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0122-Amit on Fri May 06, 2011 1:13 am

>.> Dude, maybe it was just a thought for you, but you presented like it was the convention. Look at Shuvo, he now thinks that .NET convention is to write variable names using Pascal Case notation. Neutral

And I went through 3 websites containing C# naming conventions because I had to make sure that what I was saying was correct.


edit: Erm, did you notice the edit in my previous post? Neutral

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0112-Rokon on Fri May 06, 2011 1:17 am

Its its fine.. right?

_________________________________________________________________


Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী
avatar
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

View user profile http://blog.codexplo.org

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0122-Amit on Fri May 06, 2011 1:21 am

offtopic:

A whole lot more better Very Happy Thanks man.
And RPP for this topic. it is kinda interesting!

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0102-Mohaimin on Fri May 06, 2011 2:12 am

Both are good.
Its all about being used to.

I think the class name in C# example should be login, not Login. Is it?
avatar
BIT0102-Mohaimin
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 415
Points : 715

View user profile

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0112-Rokon on Fri May 06, 2011 3:04 am

nope man, its Login, class name always start with capital both in Java and C#.
You probably confused about string.
string is an alias for System.String in .Net. They compile to the same code, so at execution time there is no difference whatsoever.

_________________________________________________________________


Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী
avatar
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

View user profile http://blog.codexplo.org

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by adamricky on Mon Aug 01, 2011 3:49 pm

The code written in Java is looking good because it's easy to differentiate between a class and a variable which isn't possible in the next code written in C#.


_________________
Overseas consultants in India

adamricky
Pre-Alpha Release
Pre-Alpha Release

Course(s) :
  • N/A

Blood Group : NULL
Posts : 5
Points : 5

View user profile

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by BIT0130-Shakkhor on Tue Aug 02, 2011 12:12 am

Personally, i like the first code.

Also, the second code doesn't follow C# convention either. For variables, both Java and C# have the same convention.

_________________________________________________________________
I'm not a driver with drinking problem.
I'm an alcoholic with driving problem.

Blog | বাংলা ব্লগ
avatar
BIT0130-Shakkhor
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 209
Points : 328

View user profile

Back to top Go down

Re: Opinion needed : which one is looking better ?

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum