28 comments

  • Ivan PrignanoIvan Prignano, almost 5 years ago

    I think this is a terrible idea for some reasons.

    1. If you're building a web page and considering animations/class toggles there's a very high chance you have at least a little knowledge of JavaScript (or jQuery, probably) – implementing these examples in JS is trivial.
    2. Adding another abstraction layer using another library that compiles to JavaScript just for some class toggles? Again, there's high chance your codebase already has JavaScript code for any other purpose (forms, etc). That would mean scatter the codebase without any reason.
    3. Using <code> tags is the worst part. You're abusing HTML elements and that's a bit too hacky to be the foundation of your library.
    41 points
    • Ivana McConnellIvana McConnell, almost 5 years ago

      I agree with this - animations and class toggles are some of the easiest things one can do in jQuery, and the use of <code> makes very little sense to me. Chances are you'll be using JS/jQuery in the project anyway, and it seems strange to add another layer on top of it.

      That said, I think his intentions were good, but if he truly wanted to simplify the language, I think that it could have done with being more comprehensive, extending into more complex examples rather than click events/class toggles.

      5 points
    • Julian LengfelderJulian Lengfelder, almost 5 years ago (edited almost 5 years ago )

      Here is why the creator build it: https://medium.com/@bdc/the-educational-side-of-uilang-92d39da94c13

      He does not clearly state this on the uilang website. But I think it is quite interesting to understand the thought process and the concept that went into this.

      3 points
    • Sam GarsonSam Garson, almost 5 years ago

      This.

      I just can't see the point of this when not only is learning do this sort of basic interaction in Javascript is trivial, but it's a great start to learning more complex javascript.

      Inventing a language and framework which can only toggle class states is like inventing washing machine which can only wash socks, to sit next to your other washing machine.

      1 point
  • Ohad RonOhad Ron, almost 5 years ago (edited almost 5 years ago )

    Just remember this and you don't need it:

    $('.element').on('click',function(){ $('.otherElement').toggleClass('hide'); });

    15 points
  • Jim SilvermanJim Silverman, almost 5 years ago (edited almost 5 years ago )

    why the hell is it <code> instead of <script>?

    9 points
  • David BarkerDavid Barker, almost 5 years ago (edited almost 5 years ago )

    Shorthand.js is something similar (but uses <script> instead of <code>, amongst other benefits).

    4 points
    • Kevin HaggertyKevin Haggerty, almost 5 years ago

      David - thanks for the mention, author of Shorthand.js here.

      Yes it uses script tags, allows observation of any event, not just clicks, and does a few more things than just toggling CSS classes.

      The major idea is to provide a simple english-style language that is to jQuery as Markdown is to HTML.

      1 point
  • Wojtek Wojtek , almost 5 years ago

    Now that's cool. I can see myself using it instead of jQuery for interactions.

    2 points
  • Daniel EdenDaniel Eden, almost 5 years ago

    Agree with the reservations discussed here, but it’s nevertheless a novel idea and would be handy for prototyping, if nothing else.

    2 points
  • Julian LengfelderJulian Lengfelder, almost 5 years ago (edited almost 5 years ago )

    [moved into the reply to the comment by Ivan Prignano]

    2 points
  • Catalin CimpanuCatalin Cimpanu, almost 5 years ago

    The idea is cool, but I can see some problems using this in production environments.

    1 point
  • Lucian MarinLucian Marin, almost 5 years ago (edited almost 5 years ago )

    <a onclick="document.getElementById('toggle').className = 'visible';">

    I’m using this instead of jQuery. It’s simpler. The only downside is you have to use an #ID.

    1 point
  • Patrick SmithPatrick Smith, almost 5 years ago (edited almost 5 years ago )

    I think it’s curious that the examples show HTML, CSS, as I thought they would be quite tricky to pick up too, with their precise syntax and required boilerplate.

    I reckon this is pretty cool after seeing the thoughts behind it at https://medium.com/@bdc/the-educational-side-of-uilang-92d39da94c13

    Remember, not everything has to be a final, that’s it, I have so-ouullved the prob-lemmmmm! kind of solution, so I’ve got to admire that this was remembered as a particular hard hurdle, using JavaScript, and this is one way way it could made easier. Like the way the creator says that if this can be used as training wheels to get someone moving that can be then knocked off after a few weeks, that’s a pretty worthwhile idea!

    0 points
  • Pasquale D'SilvaPasquale D'Silva, almost 5 years ago

    I think if you consider it to be throwaway code, it could be a very valuable prototyping tool.

    There's nothing wrong with being wasteful in the design process. If you're worry about making it production ready, chances are, you'll be more precious about your work and be afraid to scrap it.

    0 points
  • Shawn BorskyShawn Borsky, almost 5 years ago

    I appreciate the sentiment behind this but I guess I just think that HTML/CSS/JS/jQuery is easy enough for a designer to learn...

    0 points
  • Peter MüllerPeter Müller, almost 5 years ago

    I believe for me it's cool.

    0 points
  • mewo a, almost 5 years ago

    I get why he did it after reading the medium post and find the idea kind of interesting. I guess I would still feel uncomfortable teaching someone DOM manipulation with a different syntax that might ultimately confuse them.

    I worked for a short time as a teacher's assistant at a private college last year, the foundations of Javascript were taught as vanilla JS before introducing any libraries or frameworks.

    I guess I kind of think this is the right approach to teaching design and development but I might be wrong.

    0 points
  • T AT A, almost 5 years ago

    I think the uilang.com site is really beautiful but this is kinda pointless - it's basically just as easy to do all this stuff with jQuery

    0 points