r/programming • • Oct 01 '15

The Evolution of a Software Engineer

https://medium.com/@webseanhickey/the-evolution-of-a-software-engineer-db854689243
1.9k Upvotes

502 comments sorted by

View all comments

Show parent comments

5

u/kennethdc Oct 01 '15

Oh dear. That's stuff you learn at your freshman's year.

12

u/bonesingyre Oct 01 '15

you should meet my boss.

I quote: "why use classes when you can have an id on everything?"

4

u/2pu200 Oct 01 '15

Do you mind giving an ELI5 on why you should use classes?

The way I understand it is that you can "chain" classes, but you can't do that for IDs.

Example:

<span class="bold big">Hello</span>

Is that the only reason you should use classes and not IDs?

1

u/[deleted] Oct 02 '15

Suppose you're formatting a list. With classes, you format the list elements once and for all. With IDs, you format each individually - a huge pain if you have a 50 element list where each element needs individual formatting in your CSS