Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird record number

 
Jair Elton
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Record number starts with 0 or 1?
 
Lucy Hummel
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Regards,
M
 
Lucy Hummel
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic