Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Stop conflating your non-understanding of something with inherent difficulty. You might find the code

  (defmacro unless (cond &body res)
    `(if (not ,cond) ,@rest))
rather opaque; but it's actually pretty darn simple. You might find

  body {
    width: 800px;
    position: relative;
    left: 50%;
    margin-left: -400px;
  }
impossible to pull out of one's ass; it's not, you're just unused to negative margins. To you, TeX macros or M4 or continuations or macros or dynamic typing or static typing or dependant typing or manual memory management or garbage collection or all sorts of things might look complex. But surprisingly, there's a whole industry of people who don't.

You're not too lazy to be an HTML developer. You're too lazy to become an HTML developer. But that, after all, is just you being lazy.



You've also got to make a distinction between necessary and accidental complexity. That example would be better written as:

    body {
        width: 800px;
        margin: auto;
    }
(This also has the benefit that the left hand side of the body does not disappear off the side of the screen in small browser windows.)

There's a similar problem with the css in the article he links to - it is more complicated than it needs to be, which just confuses the subject. Anything is hard to learn if it is taught badly.


Negative margin as used in pavpanchekha's example centers the box also in browsers that do not support margin:auto. It's not complex if you know why it's done that way.


The latest browser which doesn't support margin:auto is IE5.5, and even there the text-align:center hack is a better option. There are cases where you might want to use negative margins, but for horizontally centering block level elements, it is at best outdated.


Unless you use a strict doctype. http://stever.ca/web-design/centering-a-div-in-ie8-using-mar... I don't think text-align: center on the parent box is significantly different in principle: confusing until you know why it's being done that why and roughly how it works.

Personally I like negative margin better than text-align: center since the style is only applied to the box being centered rather than the parent box and the box itself, but surely this is a matter of preference or the design of the particular page in question.


Yea, that IE8 bug is unfortunate.

Here's an example of text-align: center and margin: auto side-by-side: http://jsfiddle.net/wH5Pd/

Try making the window narrower so that the html pane in the bottom right gets horizontal scroll bars. (In the real world, there might be a two column layout, such that the textual content fits in the narrow window, but the full width of the content doesn't.)

Even when the window is narrow, all of the content in the top div can be accessed by scrolling horizontally. In bottom div, the left hand side of the content gets clipped because it is positioned to the left of the window, and scroll bars don't extend into negative offsets. If you're positioning an adornment which doesn't actually need to be visible, the negative margin trick might be OK. But for normal body content, margin: auto is the way to go.


I'm inclined to agree. I read the whole post, and found myself sort of agreeing with it, since I have been bitten by random browser specific (and not just IE!) quirks, and I can sort of understand having difficulty getting to know JavaScript if you're not used to it. Then I got to this line:

> Take a look at the CSS in step 2 of the Lightbox example. Are you kidding me? There’s no way in hell any of that follows logically.

And the other shoe dropped. I took a look at the example step referenced, and it was all very straightforward to me. I realize that this was because I'm already familiar with CSS, but I can't imagine it would take a motivated learner more than a couple minutes to learn what was going on in the code listed.

Programming in general is about always learning new things. The industry is always evolving and if you get complacent, you'll get left behind. This shouldn't be news to anyone, but if your reaction to hearing it for the first time is "that's too hard, I don't want to do that", then maybe you should go work on your carpentry skills.


Didn't you just concede and repeat what the post said? Or I fail to see the argument.


No. The post is saying "HTML is too complex". The comment is saying "No, it's actually no more complex than anything else you already understand, it's just that you don't understand it yet".


In my reading, the post is saying that the "HTML/CSS required is needlessly complex if you look at how simple things you want as an end result".

A very different claim.

You might understand the code but you might not understand how it was reached from the requirements. There's a bit too much obscure and mystical stuff.

Well designed systems require you to know the basics and you can behave logically from there on so that you can deduce by yourself how things can be made to work.

Relative positioning and divs or styles inside other divs/styles, text linebreaks and all that has no real dependable logic in CSS, at least didn't a few years ago when I last tried doing it by hand. It required a huge amount of trial and error.

http://www.timjpriebe.com/wp-content/uploads/2009/12/css-mug...


Shouldn't that be (cond &body rest)?




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: