Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEric De Wildt
Courses Plus Student 13,077 PointsNon intuitive line numbers
In code line 1 should be 0 and line 2 should be 1. The user should see line 1 and line 2 but in code it should be different. For everything else we follow that practice but this one problem doesn't and that is confusing and frustrating. I ask that something be done to rectify this issue.
1 Answer
Ken Alger
Treehouse TeacherEric;
I understand where you are coming from, but in this particular scenario I think Line 1
should indeed be Line 1
. Mostly because we are not attempting to reference the line number in code exactly, but are kind of thinking of the line assignment as an object, correct? So, if we assign Mr. Smith to Line 2, would it not be more confusing as you are coding to have to remember that Line1 == Line2?
I suppose to make it easier to stick with the coding conventions for 0 indexed languages we could assign folks with last names A through M to Line 0 and names N through Z to Line 1. Hopefully it is a developer's convention otherwise the poor customer service person would have to do quite a bit of explaining.
Great thought, and I hope my ramblings make some sense.
Happy coding,
Ken
Eric De Wildt
Courses Plus Student 13,077 PointsEric De Wildt
Courses Plus Student 13,077 PointsYou make alot of sense and I'm happy you understood what meant. I was not aware that a customer service person was going to the code that made the product. I thought they would just see the finished product. I am also not able to see the whole program in its finished state so I was unaware how the name actually got inserted into the list from a programmatic level. I guess Line1 could be an array and line2 another array. The arrays could have the names added to them as they got plugged in to the program.
Or even better yet you could use the Realm API to build a very efficient database and have the names in Line1 and Line2 be populated by the Realm. I guess now that I really think about it does make more sense to label them the way it's labeled in the challenge.
Thanks for getting back to me.