IITDU Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Opinion needed : which one is looking better ?

+2
BIT0208-Shuvo
BIT0112-Rokon
6 posters

Go down

Opinion needed : which one is looking better ? Empty Opinion needed : which one is looking better ?

Post by BIT0112-Rokon 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:))
BIT0112-Rokon
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

http://blog.codexplo.org

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by BIT0208-Shuvo 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#.
BIT0208-Shuvo
BIT0208-Shuvo
Global Moderator-RC

Course(s) :
  • BIT

Blood Group : B+
Posts : 87
Points : 124

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by BIT0122-Amit 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.
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by BIT0112-Rokon 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.
BIT0112-Rokon
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

http://blog.codexplo.org

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by BIT0122-Amit 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
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

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

Its its fine.. right?
BIT0112-Rokon
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

http://blog.codexplo.org

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

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

offtopic:
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by BIT0102-Mohaimin 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?
BIT0102-Mohaimin
BIT0102-Mohaimin
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 415
Points : 715

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by BIT0112-Rokon 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.
BIT0112-Rokon
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

http://blog.codexplo.org

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by adamricky 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

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by BIT0130-Shakkhor 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.
BIT0130-Shakkhor
BIT0130-Shakkhor
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 209
Points : 328

Back to top Go down

Opinion needed : which one is looking better ? Empty Re: Opinion needed : which one is looking better ?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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