3 ms·
Knockout is architecturally sound and the DOM is very much available to the developer. Disagree with much of this.
by shaydoc 13y ago
Knockout is architecturally sound and the DOM is very much available to the developer. Disagree with much of this.
- EdgarVerona 13y agoIt sounds like you're finding faults with things I'm not saying. First, I wasn't questioning the architectural soundness of Knockout. I think it's very sound, and I like it. Second, I also agree with you that the DOM is available to the developer - however, if you go about blowing away and re-creating DOM elements that should have bindings on them (for example), you're going to have a bad time. This was something counterintuitive to our Frontend developers. In situations where you want to create or remove DOM elements with Knockout bindings, you really should be using Knockout's bindings (or your own custom Knockout bindings) itself to do it, otherwise you're working pretty hard against the grain. I don't personally see a problem with that - so I agree with you that the DOM is available for change - but that was hard to sell to others. :shrug: maybe I'm just a bad salesman. EDIT: Ah, I think I can see why you feel this way. I should put the counterpoints I put above in quotes, as they don't actually reflect how I feel. I can see how someone skimming would think I actually believe them to be true. I personally have a very favorable opinion of Knockout. I can, however, see why it's a hard sell for some frontend developers. I can't blame them for feeling that way given their points above, though I would like to believe that I can win them over with my counterpoints to it over time. Whether that actually happens... we'll see. I could also use some more ammunition in that fight, so if you have good alternatives or approaches that I'm ignorant of, I'd be extremely glad to hear them!
- shaydoc 13y agoI understand what you are saying. Convincing people about new styles that are alien to their traditional style is difficult. Consistency and maintainability of a codebase is a big factor for me. If I have a large project with knockout I can nearly guarantee a fairly similar style across the codebase. Time spent being the owner of a large project convinces me that a framework like knockout is important. So for the life time of the project it gives new developers coming onboard a good idea what to expect from the outset.
- EdgarVerona 13y agoI totally agree with you, 100%. I can't lie, it made me sad when I saw the team starting to turn against Knockout, as the benefits it brings in the points I made above (as well as consistency and maintainability, as you brought up) are real - and often frontend projects suffer greatly for want of these very benefits. I've never been good at convincing people of things, however, so it's been an uphill battle - one that I lost a lot of ground on early, and I feel like a lot of our frontend codebase suffered as a result. I do feel like they're slowly starting to warm up to the benefits of it now that they've had some maintenance problems with the current approach, but that's similar to sending an innocent man to prison for several years before discovering he's innocent - it'll take a while to undo what's been done, if it can be undone. Now, none of this is to say that they're bad developers. They make amazing UIs that I couldn't even conceptualize (me being a backend jockey who is terrible at making things look good). It's hard for someone to hear about an entirely new approach to what they've been doing for 5-10 years and to accept it off the bat, so I don't blame them at all. I do still hope that they'll come over entirely to the concept. We'll see what happens. :)
- veemjeem 13y agoSeems like the frontend developers who are told to never use onclick= handlers have never used a more advanced UI framework before, like Apple's Interface Builder for example. In more advanced js frameworks like Ember.js, all the click handlers are essentially onclick= style. "this is the right way of doing things" I feel like many of your team's complaints are due to the fact that they are old school web developers who have probably never wrote apps on the desktop before, where 2-way bindings are standard. The jQuery style of event binding is extremely brittle because it requires the DOM to have a specific structure.