Computer Science Canada

Array conventions...

Author:  Aziz [ Tue Jul 11, 2006 4:41 pm ]
Post subject:  Array conventions...

Which would be proper?

int[] nums;

or

int nums[];

Author:  wtd [ Tue Jul 11, 2006 4:45 pm ]
Post subject: 

The former.

Author:  Aziz [ Tue Jul 11, 2006 7:00 pm ]
Post subject: 

thought so. the book i'm reading (killer game programming in java) uses the latter, along with other forms I don't really like :S (like typing methods public void run( ) , notice the space). I've wondered it for a while, though.

Author:  wtd [ Tue Jul 11, 2006 10:22 pm ]
Post subject: 

Probably written by someone who thinks knowing C means knowing Java. Not that knowing C is necessarily bad for an aspiring Java programmer.

Author:  Krabjuice [ Tue Jul 11, 2006 11:35 pm ]
Post subject: 

Remember, you're making an array of that type. Not an array of that name >_>

Author:  McKenzie [ Wed Jul 12, 2006 9:09 am ]
Post subject: 

int nums[] is the old C style way of doing it. I know they allow it in Java to make that transition easier for C programmers. What don't understand is why people who are teaching Java, like your book, still use the old style when they know it is frowned upon. I've seen a University prof do the same thing.

Author:  Aziz [ Wed Jul 12, 2006 1:48 pm ]
Post subject: 

Poopey people. Razz I've got my programming college program starting up in september, i hope they're not gonna start us off with newbie things (though they probably will). it'll be breasy anyways, i guess

Author:  wtd [ Wed Jul 12, 2006 2:09 pm ]
Post subject: 

Pay attention to the "newbie" stuff anyway. They might say something it would benefit you to know. Smile

Author:  Aziz [ Wed Jul 12, 2006 5:57 pm ]
Post subject: 

Yeah, i've taken the (basically) same course in highschool 3 times. Well, each course had no prerequisits, so he started basic. I had already done the assigments the year before. Each time I usually make them more effecient, prettier, and a whole lot frikkin' needer. Not to mention, I was just reading you're Java tut, and I'm learning niftah things too. Not afraid to learn (or experiment, be glad I'm not going into chemistry)


: