• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLyBird record number

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Record number starts with 0 or 1?
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic