Completed my Product Landing Page

Hey guys I’d love to get feedback on my product landing page and how I can improve on this Product Landing Page (codepen.io). Thank you

Hi @teamie !

I think your page looks really good.

The only nitpicky thing would your use of comments.
When you are your learning, I think it is fine to place comments in as notes for yourself.

But as you are inching closer to applying for developer jobs and working as a professional developer, you don’t need to leave comments like this.

// ** date **
const date = (document.querySelector('#date').innerHTML =
  new Date().getFullYear());

You are already using a variable name of date so you don’t also need to write a comment that says the same thing.

It is just something to think about.

Hope that helps!

1 Like

Thank you @jwilkins.oboe for your review. Will also take out the comments that are repetitive.

Very clean page. I especially like your hover effects, which is a nice touch.

1 Like

@emendoza06 Thank you for your kind words

@jwilkins.oboe

Jessica,

If you have the time, could you possibly Delineate what the Best practices would be for Commenting…? Or, suggest a good resource with the best Information.

@ALLESS Hopefully Jessica answers but what I understood from her message was “Don’t make comments about obvious code sections”.

  • If your code has a complex structure I believe it’s fine to add some meaningful comments to help other developers go through your code.
  • Comments should pass a message to yourself and also other developers regarding what’s going on in that particular section “if there’s need to clarify”.
  • In my example it was clear I was working on the “date” yet I added a comment saying “date” which is repetitive and redundant. I hope you could understand a little from my explanation haha.
2 Likes

This was a very Good Delineation… : )
Thank you.

I think denoting sections of code is fine even if the code is self-explanatory. It can be helpful in very large files with a lot of code.

What isn’t helpful is long comments that explain what the code does when it isn’t needed. They are also not a fix for poorly written code.

Comments can actually become actively harmful as well if care isn’t taken. If they do not correctly explain the code, or if the code is changed at some point but the comment isn’t updated to reflect the change.

There isn’t really a universal consensus on code comments. Some go as far as to say you shouldn’t use comments at all, others say they should be “this” or “that”. The only real consensus is they should stay in line with the project style guide (the comments should function and look the same throughout the project code).

https://www.google.com/search?q=code+comments+best+practices

3 Likes

This is a good point to remember.
This would be the kind of mistake I’d make:, ‘Leaving old, outdated comments.’.

There are is a lot of good advice here already concerning comments.

IMO, I always think about if the comments I leave would be helpful to me and the rest of the team.

If so, then I will keep it in.
Otherwise, I’ll rewrite it or leave it out completely.

As long as you choose strong variable names, function names and your code is well organized you probably don’t need to many comments in your code.

I think this is a good article on comments in code

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.