aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird record number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird record number" Watch "URLyBird record number" New topic
Author

URLyBird record number

Jair Elton
Greenhorn

Joined: Jan 19, 2007
Posts: 9
Record number starts with 0 or 1?


Jair Elton<br /><a href="http://jairelton.com" target="_blank" rel="nofollow">http://jairelton.com</a>
Lucy Hummel
Ranch Hand

Joined: Apr 07, 2005
Posts: 232
Hi Jair,

I think that can each of us decide. I think there is no yes, or no.

Array starts with 0 but if you invoke this java.sql.PreparedStatement#getLong() or java.sql.PreparedStatement#setLong() then you start with 1.

If you are afraid of that issue, just write a comment to your choices.txt.


----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi,

I'll recommend the 0, it is more intuitive, BUT don't forget to document this.

Regards,
M


SCJP, SCJD, SCWCD, OCPJBCD
Lucy Hummel
Ranch Hand

Joined: Apr 07, 2005
Posts: 232
Hi Mihai,

I do not get to document why to mention whit wich index I started. May I ask for an explanation.
Jair Elton
Greenhorn

Joined: Jan 19, 2007
Posts: 9
Really.

I think it's a design choice. Maybe the test software consider the 0 or 1 as record number, but I think not, I leave 0 as it is and document in choices.txt.
rinke hoekstra
Ranch Hand

Joined: Apr 06, 2007
Posts: 152
Personally, I do not think that Sun is looking at our assignments at this level. I would be surprised if these kind of details will cost you points.


_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi guys,

When I mean to document this I refer on the first line on the java doc documentation(comments). There are plenty of example in this way in the java API doc.
On the other side the documentation is quoted with 70 points, will be a peaty lose some point here.

Rinke, you make a serious assumption here ("Personally, I do not think that Sun is looking at our assignments at this level. I would be surprised if these kind of details will cost you points"), if a documentation lets paces for doubts then you'll lose some points.By example if someone will try to build a test for your class and for this he(she or it) needs to read your source code for this you risk to lose more points. In opposite if you "program with contract" the test builder need only to read the contract and to build the test.

Regards,
M
[ May 08, 2007: Message edited by: Mihai Radulescu ]
rinke hoekstra
Ranch Hand

Joined: Apr 06, 2007
Posts: 152
Mihai,

Of course, your javadoc comments should mention if your recordnumbers start with 0 or with 1. Of course it is of importance for any other developer who might use your methods, to know if a rec number index starts with 0 or 1. So put in your javadoc at any method using a recnumber as param what your choice was.

What I meant is, that I don't think that Sun will bother if thus choice was startig at 0 or at 1. I even think it is such a tiny issue that it is not worth mentioning in choices.txt.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: URLyBird record number