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

I guess it's a personal preference. I tried it, and it looked a mess in my eyes.

Take a strong tag:

    Div(
        "If you click '",
        Strong('Accept all'),
        "', we and",
        A('our partners', href='/v2/partners', target='_blank'),
        ... 
It just verbose, very Java like, and feels like a step back in a commercial setting. It's absolutely fine if you're a single developer, HTML disgusts you, and Javascript is an abomination. I know people who think that way and I know they would love it. But I'm as comfortable with JS and I am with Python (after over 25 years using both). Someone likened JSX to it - but it's not even close - JSX brings the tag structure INTO JavaScript, not takes it away, to achieve the exact opposite result of fastHTML.


This is html building not js. It’s not any more verbose, in fact slightly less because no need for closing tags. Main difference is parens instead of angle brackets. Now you can use tools.

I do prefer lower case callables but that’s a minor nitpick, and “htpy” and other libs can do that.


Yes, it is HTML, and it loses all the benefits of HTML, by adding complexity of code and loss of structure. I'm uncomfortable with HTML and JS obfuscated by Python like that. I'm not using the word "verbose" as a character count comparison, but as an overall feel of weight when I see such code. It just takes me back to Java Swing, or ExtJS in the JavaScript world. It's not bad if it's the only way to describe an interface or layout. But there are better ways - HTML.

Please don't get my comments as criticism of the project itself, I think it's lovely and has a lot of merit. I've had to deal with the aftermath of these kind of things before, which makes me very aware of where it usually ends up at: Devs in language X don't like Html/JavaScript/Y/Z, so they wrap it with language X until X is all there is. Then one day, the business realises they have a codebase nobody other than it's original creators can or want to deal with, and any change becomes a behemoth of a project. It always starts with the best of intentions.


The complexity and structure are near equivalent. S-expressions are an html precursor.

Python is one of the most popular languages and easy to read. People are more resilient than given credit.

I tend to agree with your closing comment about over abstraction in general, however you may have forgotten that a Jinja/html template is an abomination of conflicting concepts.

I’m more worried about the rest of this framework to be honest. :-D




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

Search: