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 trial

C#

Mehmet Ali Ertörer
Mehmet Ali Ertörer
1,847 Points

AddressBook Application

Hello, after I've finished C# Objects Course, I wanted to practice my skills and build and AdressBook Application. It's still in the alpha stage :P and I am still a beginner. If you guys want to check out: https://w.trhou.se/vrjinab87b Keep in mind, I used Visual Studio. Don't know if any bug comes on Workspaces.

1 Answer

James Churchill
STAFF
James Churchill
Treehouse Teacher

Mehmet,

Thanks so much for sharing your project! And great job using the skills that you've acquired to create an interesting project!

What was your favorite part of the process? What part of the application was the most challenging to implement?

Here are some of my thoughts:

1) Nice job writing clean, well-organized code. It code was easy to follow and understand!

2) I love all of the feedback that you give to the user as they interact with your application. Very nice!

3) When defining fields, properties, and methods in C#, it's a convention to use PascalCase instead of camelCase. So, resultOfSearch should be named ResultOfSearch for example. This is a small thing, but something that'll help others to be able to quickly read and understand your code.

4) In the Person class, you've repeated this code a number of times:

resultOfSearch = (Environment.NewLine + person.firstName + Environment.NewLine + person.SurName + Environment.NewLine +
person.Adress + Environment.NewLine +
person.PhoneNumber + Environment.NewLine + person.EmailAdress);

Maybe you could define a method to create the value for the resultOfSearch variable? And then call that method everywhere that you need to format the search result?

5) It's a convention in C# to have the names of files match the class names that they contain. So the AddressBook.cs file should be named Person.cs in order to indicate that it contains the definition for the Person class. It's fine to not follow this convention when the file contains multiple classes, as you did with the Exceptions.cs file.

6) In the Program.cs file, creating a non-ending loop with this code is a creative, if unconventional approach:

for (index = 0; index < Single.PositiveInfinity; index++)
{
    ...
}

You might take a look at while loops in C# to see how they might be used to solve the same problem.

Again... great job developing this application! Keep up the great work :)

Thanks ~James