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 trialMichael Escribano
Full Stack JavaScript Techdegree Student 5,221 PointsWould anyone be so kind as to review my first project for my Javascript Techdegree? Please and thank you!
So, I've been a TechDegree Student for a while now and when I first started it, I was under the impression that my projects would be graded by the staff and all that good stuff.. probably like a lot of you older students out there. But I have come to the realization they there are tiers and different prices for the program and that I was wrong.. So, I submitted this project a few months back and didn't hear anything obviously. Was wondering if anyone would be willing to take a look and give me some feedback on the project. It would really help my self-esteem I guess lol. Thanks in advance. My github account is github.com/mikeescro
3 Answers
Dylan Rainwater
15,537 PointsI just want to preface this with something: it's perfectly natural to have low self-esteem when it comes to programming. Computer programmers are probably the most common sufferers of "imposter syndrome": feeling like you're the only one around who doesn't really know what's going on. Don't worry; we all use Google and StackOverflow a little more than we think we should.
On to the review! I think your interface looks lovely. I haven't been through the full stack javascript techdegree program personally, but the aesthetics definitely look pretty good, in my opinion. And, as far as the javascript goes, it seems to function perfectly well! Since you're focusing on javascript, I'm just going to review the script.js file.
script.js: Pretty straightforward stuff.
Comments It's an excellent habit to comment, and I'm glad that you've picked that habit up; however, there is an idea of "overcommenting." I think it's fine for this specific project just because in context it was designed to teach you some fundamental javascript ability, however I think you should let your code speak for itself just a tiny bit more. Here are some specific examples:
// event listener to respond to "Show another quote" button clicks
// when user clicks anywhere on the button, the "printQuote" function is called
document.getElementById('loadQuote').addEventListener("click", printQuote, false);
Anyone reading this code should be able to figure out exactly what it does, so I don't think the comments here are necessary.
//Array to hold quotes, sources, citaitons & years
var quotes = [
/// ...
]
Again, the quotes variable is self-explanatory so a comment wasn't really necessary and just by glimpsing over it one can easily tell what it is for. This is a good thing on your part, you have organized the code in such a way that I can easily tell what the variable is for and what it holds! Nice!
//Print quote function
function print(quote) {
// ...
}
Let your code speak for itself! Simply renaming this function to printQuote would completely eliminate the need for a comment here. But that name's already taken! Yeah, but it shouldn't be. print()'s functionality can be put directly into printQuote's body, because you only ever call print() once and it's inside of printQuote.
I won't continue criticizing your use of comments, just keep these examples in mind when designing code in the future.
Style
var color = ["pink", "blue", "orange", "grey", "red", "black", "purple", "green", "brown"];
var viewedQuotes =[];
//...
```javascript
function changeColor(){
// ...
}
function printQuote() {
// ...
}
See the difference? It's really subtle and may seem unimportant, but the difference is your style! When creating the color variable you left spaces around the equals sign, but you didn't do the same for viewedQuotes. Your changeColor() function doesn't have a space before the left curly brace and your printQuote function does. Why? Probably just a bit of lazyness or an honest typo. Regardless, it's always a good habit to be consistent. This one isn't really a big deal at all when you're the only developer, but imagine working on a team of a few other people and they saw these inconsistencies! Gasp! I recommend picking a style and sticking to it, whether it's whatever comes natural to you or something that you sit down and develop. You can also pick a style guideline that has already been developed and documented and try to use that! Here's Google's for reference.
Conclusion Don't let this discourage you! You should be really proud, you created a working website with a cool function! It's awesome! The few mistakes you made were super common and many industry experienced pros make the same mistakes (trust me...), you're doing just fine! You just have a little room for improvement, but it's nothing that can't be done. I hope I was able to help you improve just a bit.
stjarnan
Front End Web Development Techdegree Graduate 56,488 PointsHi Michael!
Dylan's review was pretty spot on, so I'm not going into details as I would probably go on repeat :)
The thing worth repeating though is that you've done an amazing job for a first project! You should be really proud over yourself!
"So, I submitted this project a few months back and didn't hear anything obviously. ", your projects should be reviewed in a timespan of somewhere around 48 hours. Something must've gone wrong and I recommend you to contact support about it.
Anyways, keep working just as hard on your upcoming projects and you will do great. Good luck!
Jonas
Michael Escribano
Full Stack JavaScript Techdegree Student 5,221 PointsDylan Rainwater and stjarnan Thank you guys. I really appreciate the feedback. And I do see now, that I was over-commenting. I did the project over a few days so I guess I didn't even realize I got carried away. And the spaces that I left out, honest typo. I'm going to have to stay a bit more aware of what I'm doing and practice getting better at my composition/style. But I'm happy to know that even professionals have a bit of self doubt or imposter syndrome lol. It's nice that this is such a supportive and tight-knit community. You both have reassured me that I'm a bit more knowledgeable/capable than I thought.
And as for the reason why my projects aren't reviewed is because I have the $99/mo TechDegree plan rather than the $399/mo plan.
Thanks again for the boost of confidence and taking the time out of your day to review my project.