Why is what I did (that worked), wrong? Genius or Jimmy?


#1

Initially, I couldn't input the correct command in CSS to net the result this exercise sought... so I added h, hh and hhh to the respective lines of html, which I then referenced in CSS to obtain the exact result. (text labeled h became bold, text labled hh became the correct color, text labeled hhh became underlined).

Despite my hack netting the correct result, CodeAcademy would not allow me to move on. So I was forced to ask my fiancé, who then showed me how to do it correctly. But what's bothering me is he couldn't explain WHY my solution is wrong... is it because others wouldn't understand? Because its less efficient? Because it wouldn't work in different browsers? Because it would have known consequences further on? I would argue that my code didn't require making something "wrong", only to have to override it to make it right a few lines later.

This is my third day (ever) of coding HTML, I'd like to think finding an alternate solution officially makes a "hacker" :stuck_out_tongue_winking_eye:, but the fiancé said it just makes me a "Jimmy"? :disappointed:

Joking aside, I'm not actually trying to validate what I did (I accept that its wrong), but I do want to better undersatnd specifically why it is wrong.

https://www.codecademy.com/courses/web-beginner-en-WF0CF/1/4?curriculum_id=50579fb998b470000202dc8b#


Oops, try again. Did you remember to bold the introduction and summary paragraphs?


Codeacademy Code: p{
    font-family:Garamond;
    font-weight:bold;
    }
div p{
    color:#7AC5CD;
    }
ul li p{
    color:#000000;
    text-decoration:underline;
    font-weight:normal;
    }
----------

My "Hacked" Code: p {
    font-family:Garamond;
    }
h{
    font-weight:bold;
    }
hh{
    color:#7AC5CD;
    }
hhh{
    color:#00000;
    text-decoration:underline;
    }


#2

The reason of why h, hh, and hhh (your hacked code) does not work is simply because there is no tag "h, hh and hhh".

Codecademy (the exercise) tells you instructions which require you to nest.

ul li p {  // Example of a nest

}

Another thing is that you probably referred to classes. Classes work adding a " . " before the name.

.class {  // Example of a class selector

}

Oh, and one more thing, HTML can't hack anything. t's just browser stuff. :stuck_out_tongue:


#3

Thanks for the feedback, @zolated. Its a bummer to learn, but I'll concede (for now) this did not qualify as hacking. :cry:. However, would you mind elaborating on "does not work" because, technically my h's did work. At least, they worked in the sense that they achieved exactly the same end goal as the nested code.

If you simply mean they didn't work in the sense that CodeAcademy played gatekeeper and didn't allow me to move on to the next exercise, then the heart of my question is absent a gate-keeper, what is actually wrong with my h's? In a hypothetical future where I'm doing this on my own, what would be the actual consequences of doing it this way?

Let me reiterate, I'm not trying to justify what I did. I have every intention of embracing the CodeAcademy way, but I do want to understand what would happen or what makes it wrong.

(I haven't learned about classes yet, I think that's in the next exercise though).


#4

If you type tags with your h's and set them CSS properties, they do appear, of course. It's not that I'm saying they are useless, I'm just trying to say those tags do not exist on the HTML5 world.

  • HTML: Yo man, for this tag I want you to get this properties.
  • CSS: Okay, but what does that tag do?
  • HTML: Nothin' to worry about, just make it colorful.
  • CSS: Okay then.

( There's an approximation, which is h1, h2, etc. Those are headers. )


#5

Where's the this-response-cracked-me-up button? Thanks for the laugh @zolated. So, to clarify, the real consequences of making up tags are

  1. revealing ones inexperience and ignorance

  2. confounding/frustrating others who might (for whatever reason) need to work within your code

  3. making Mr. CSS think you're "d. u. m." :joy:

But, as far as you know, it wouldn't corrupt the code or fail to net the correct result in a different browser?

Thank you for your patience in helping me work all this out.
(Also, you are spot-on for why I chose the letter "h". It was the best I could come up with, with what I had at that moment).


#6

There is no gatekeeper, only a Submission Correctness Test written by the course author with no direct influence by Codecademy. Most of the early courses were written by non-staff, volunteers who contributed to the start-up content and helped it grow. Also, most of that content is slowly disappearing as the new content is being rolled out by paid staff.

The old content is not so much product as bait. Anybody sniffing for learning material will discover this site. It will eventually lead them to the Pro side, the ROI side of the business.

For anyone who insists on having it all for free, they are stuck with the cannon fodder, warts and all. I, as a volunteer am not going to presume to apologize for this, but I will say, it is what it is. That much we can all get used to.