Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript DOM vs Virtual DOM

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #179702
    nixnerd
    Participant

    So… I took the red pill I suppose. I ventured into #javascript on IRC and started asking some questions. Before long… these people were telling me that DOM manipulation is not the best approach. I was pretty baffled. I thought that was the whole point of Javascript! Not really… but that’s mainly the part you see and clients love. So… I inquired a bit further and they told me about the virtual DOM and tools like React and Elm, etc.

    Has anyone used these?

    #179705
    Alen
    Participant

    This comes down to Front-End vs. Back-End. No?

    Over-engineering? I mean, what is the qualifier where this makes more sense to use? I don’t know.

    Has anyone used these?

    No.

    #179824
    nixnerd
    Participant

    Dude, So I looked pretty extensively into Elm. Looks VERY promising. The fact that it could replace three languages is huge.

    That being said, It’s not to 1.0 yet. AND… it’s going to take a LONG time for devs to adopt it. It sort of exists in this niche movement that is against MVC for the most part. Which… is kind of heretical to many devs.

    However… it interests me, so I’ll probably give it a whirl.

    #179827
    shaneisme
    Participant

    If you ask the titans of web development if they could build the web all over again, it would look nothing like what we have now.

    It would be something like what Elm is doing, but even Elm isn’t taking it far enough – it still compiles down to HTML/CSS + JS.

    I messed with React a while ago, I should revisit it as they’re a few feature versions ahead now. I do remember being really impressed with it back then.

    #179832
    nixnerd
    Participant

    Well @shaneisme,
    That’s sort of the journey I’m on right now. Some stuff in web just makes NO SENSE. I was just bemoaning the complexity of contact forms. But, let’s scrap that and just talk about photos. That’s right… simple images.

    Anyone who has tried to take a photo and make it always fill it’s container knows this is a pain. Your only option is treating it as a background image… when it’s actually content. Some will say, why put images in containers? Because it’s the only way to easily change the size/aspect ratio of an image without stretching. This becomes increasingly important in theme development… where I have no control what the end user uploads.

    That’s one trivial example but I give it for a reason… it should be simple! Same with vertically centering and many other little nuisances.

    If you ask the titans of web development if they could build the web all over again, it would look nothing like what we have now.

    I couldn’t agree with this more. It’s in my nature to question things. It’s what I do. I come from a very non-traditional background… so I’m not really into the status quo. I’m starting to question a lot of things in this industry that many people regard as the immutable truth and get very dogmatic about. Here’s the short list of things I’m questioning:

    1. Responsive web
    2. MVC
    3. Trendy frameworks
    4. CMS
    5. CSS… in general

    I’m not against these things per se… but I’m VERY MUCH looking forward to a new way of doing things… and the first chance I get, I’ll adopt that new way.

    4 languages and about as many frameworks to develop one site is not the way it should be. To me, complexity is almost never better.

    #179836
    shaneisme
    Participant

    1) Whatever you call it, we’re going to need to display content to anyone, anywhere and on any screen. Some of things that are really backward now are being worked on by W3C, they’ll be much more intuitive in the future.

    2) MVC has been around for a long time. Even React is sorta like that pattern, it’s all about compartmentalizing and keeping code simple and reusable. Like RWD, anything else is going to be a cousin or sibling of MVC.

    3) Trendy frameworks are only as useful as you make them. I long ago decided to take bits and pieces of what I want and meld it into whatever project I’m working on.

    4) CMS will always be around in some way… we’re always going to have people that don’t know what we do needing to display content on the web. The best one will always be a point of argument among devs.

    5) CSS, as I referenced in #1, is getting better every day. As long as HTML is the primary way to frame a website, CSS will be there (abstractions notwithstanding).

    As for using 4 languages, you can already only use one: JavaScript.

    #179838
    nixnerd
    Participant
    1. I’ve been trying REALLY hard to put myself in the shoes of the end user. To do this, I examined my own browsing habits. I looked at the issue from the perspective of a consumer… not a creator. What I discovered is… I’ve never met a mobile/responsive site I actually liked using. Ever. As much as I didn’t want to admit that. It’s true. I’m the guy that goes and requests the desktop site because everything is where I know it to be. Now, this is pretty much like dissenting from the Catholic church during the Inquisition. So, I don’t really talk about it. When I do, everyone is like “Oh, you’re doing it wrong.” No, I’m not. I just work for real clients with real problems. How you get a site with 40 different sections into a working and maintainable mobile layout is beyond me. The menu alone is a gigantic undertaking and a lesson in futility. We go to extraordinary lengths to make sure no one has to pinch to zoom … even if that comes at the cost of them scrolling for days.

    Prominent webdevs RAIL against the hamburger menu… without offering up a viable alternative. Look at this article:

    http://techcrunch.com/2014/05/24/before-the-hamburger-button-kills-you/

    Their alternative is to splay out four icons. Really? Four content sections? If my clients only had four main content sections… I’d be the world’s best golfer from all the free time I’d have.

    When we make the web responsive… we also make assumptions. It’s a trade-off like everything else… and it may not even be a solvable problem. But… it’s worth trying.

    Also… I’m not convinced that responsive design has any advantage over a separate mobile site in terms of speed/performance or dev time.

    In a nutshell, I think resizing/re-arranging the same content for every device is shortsighted at best and unnecessarily complex at worst.

    1. I must be misunderstanding you. I thought React was completely opposed to MVC.
    2. I refuse to use them until they prove their value to me or until I ABSOLUTELY need them. For something like Backbone or Angular. I’m just not there yet and probably never will be.
    3. A CMS is so unnecessary for the vast, vast majority of people that have them. People have them because they think they need them. I can hear them now. “B-b-but what if I need to change a photo?” The level of complexity and security risks introduced to avoid this trivial task is absolutely astonishing. It’s exponential.

    If you’re working with actual enterprise… fine. CMS all the way. Small business? Completely overkill in most cases.

    1. CSS is as good as it can be. That’s all I can really say about that. It occupies a piece of time and space that make it useful and relevant. Like you said… if we could re-do the web, I don’t think it would be around. If we were on Elm 5.0 right now… no way.

    Sorry for the rant but I’ve been pretty frustrated professionally as of late.

    #179840
    nixnerd
    Participant

    In a nutshell, I think resizing/re-arranging the same content for every device is shortsighted at best and unnecessarily complex at worst.

    I hope you know that here, I’m not talking about a dedicated site for each device. I’m simply talking about making things flex/grow/fluid/etc.

    Which… I’m not totally opposed to. But that CAN’T be the only strategy.

    #179841
    shaneisme
    Participant

    We can talk about RWD until the cows come home, but I think there are solutions for even the most complicated website. When you start stripping things down to their most basic form, and then adding on only when you want to it gets better. This mode of thinking takes a lot of trial and error – and let no one state to you they’ve figured out the best way of doing it. RWD is still in its infancy, but that’s what I like about it.

    I’ve personally proven to myself that having a single codebase far outweighs any possible pros of a separate “mobile” site.

    Regarding React – it still has models, views and controllers… the path it takes is just different. MVP is another cousin of MVC, but the core concept is the same – that was my point.

    Regarding CMS, with a small business you’re absolutely correct – most of the time. But when you’re talking about an individual, a CMS actually makes the most sense. They are overkill in a lot of situations, but the individual isn’t going to want to pay you to update that photo or post that update. What about the small business that needs to constantly update their site? I would argue most large-scale enterprises actually have the infrastructure to have their in-house devs handle things, or create a custom CMS (like Vox for instance).

    It’s easy to get frustrated, we all get that way at some point. Just be thankful you weren’t here for IE6 being top dog :P

    #179842
    nixnerd
    Participant

    For the record, I don’t disagree with anything you’re saying… and I’m not ok with the status quo. They’re not mutually exclusive.

    As far as RWD, I’m convinced that it can either be massively better or there’s a massively better solution. And I will find it… even if it kills me :)

    What you say about stripping things away is pretty much how I live my life… like in every regard. I’m a minimalist by choice. I like simplicity. However… sometimes people take simple to mean shitty. And that’s REALLY what rubs me the wrong way.

    There are a lot of prominent web devs that bang the responsive drum all day long and then you go to their site/blog/whatever and my only thought is “If you can’t make this simple ass website responsive… you don’t deserve a seat at our table.” Of course it’s responsive. There’s barely anything of note on it. In the real world, websites are much more complex than celebrity coders quaint little blogs.

    That being said, what you said still applies. Stripping things away is ALWAYS good. But… the thing I’ve yet to see in RWD is a TRULY optimized experience for all devices. Sure… the layout doesn’t break… but is that enough? Not for me. I want a site that takes on a new form and functionality, purpose built for the device viewing it. And I think most users want that too.

    #179844
    nixnerd
    Participant

    I want a site that takes on a new form and functionality, purpose built for the device viewing it. And I think most users want that too.

    Again, I’m not saying literally make a new site for every little functionality that you COULD take advantage of. But… I am talking about much more than what most people would call “progressive enhancements.”

    #179845
    nixnerd
    Participant

    And like I said… I’ve never seen it done well… which is why I request the desktop version.

    Again… maybe it’s not even a solvable problem. But… I’ll try.

    #179847
    shaneisme
    Participant

    Keep tappin’ away.

    Cheers.

    #179849
    nixnerd
    Participant

    Eat tapas by the Bay.

    Cheers.

    #180576
    __
    Participant

    Hey, going back to your original red pill:

    web components (polymerjs)

    Looks a lot more mature than when I last checked. Looks usable in the real world, actually.

Viewing 15 posts - 1 through 15 (of 27 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.