Better HN
topnewbestaskshowjobs
Log inSign up

mkmcdonald

129 karma · joined Mar 5, 2012 (14y ago) · 84 submissions

Submissions

comment 14y ago · link · parent

Browser elitism benefits no one. The user is left insulted, and the developer strokes their own ego.

comment 14y ago · link · parent

> [...] the onus is on us as web developers to encourage [him/her] (in positive ways) to upgrade - through better web applications that require new features, better communicating the reasons for upgrading, etc.

I disagree. The onus is on those peddling the product (i.e. marketers) to sell its worth to users.

> Believe me when I say that I understand the frustrations that come from having to support outdated browsers

I read about “frustration” when referring to older browsers a lot. That has led me to question just how much people learn about supporting those browsers. Shouldn't supporting browser X become trivial once a certain amount of experience is accrued? Or do we just hunt and peck until a page ostensibly works?

> There isn't enough information in the original post to determine if the last one (auto-update occurring despite being turned off) is what happened here - I'd like to learn more. It would be worrying (and I'd argue an insecure design) if the software were even capable of self-updating with that setting turned off.

As someone who tests every whole number version of Firefox (1-14), I have experience with the force-fed updates. Imagine my frustration when viewing the version information (via Help > About) led to the browser paving over my existing installation. I really don't want to have to tinker with the settings for fourteen separate programs.

Conversely, Opera 8+ will ask before updating. Though this happens every time I open the program, I can easily decline and continue with my business. This is how to respect users.

Chrome is far worse, as it forbids the existence of an older build, even after the newer build is uninstalled.

comment 14y ago · link · parent

You've been misled into thinking that you need features X, Y and Z. Web pages can be functional without flashy new features.

Your browser is your choice, and we as developers need to respect that.

comment 14y ago · link · parent

UserAgent sniffing and Graceful Degradation do not mesh.

This sniffing in particular will fail for Opera 6-8, therefore excluding perfectly capable browsers by a very shallow criterion.

The sniff serves no purpose, and is furthermore based upon a thoroughly disproved anti-pattern.

comment 14y ago · link · parent

Oddly enough, I was working on a similar problem earlier today.

I've found that collecting the Text nodes and returning them in an Array is preferable. All it requires is some simple traversal. The developer (that should know what text goes where) can then map text to nodes.

comment 14y ago · link · parent

> I find that naming things descriptively and an 80 character limit are at odds.

I don't. I use descriptive names for functions and short, concise words for variables (sometimes clear abbreviations).

> Another nit, Google Style guides disallow formatting for readability except for comments?!?!

> Allowed

> [regularly formatted variable declarations]

> Not allowed

> ["pretty" formatted variable declarations with indentation]

Code Complete 2 explicitly discourages the latter style, and I tend to agree. It's too difficult to maintain.

comment 14y ago · link · parent

I'm pleased that someone else favours a sensible line limit.

I stick to 72 columns for width and 20 lines per function body. The result has been very concise code that's easy to follow. Only exceptional cases such as heavy recursion have eluded the line limit.

If popular JavaScript projects wrote code with cleanliness in mind, maybe more people would take the language seriously.

comment 14y ago · link · parent

I much prefer "responsive" Web pages to "mobile" sites. Many "mobile" sites cram way too many flashy graphics and bloated scripts into the client; compound that with features that disable zooming, and you have a UI disaster. Finally, don't forget URL fragmentation because of the "m.inane.com" nomenclature. "mobile" users then link "desktop" users to the "mobile" site, which is unnecessary.

Nonetheless, we're probably both guilty of selection bias.

comment 14y ago · link · parent

> Web technology is great for many things. Replicating a native app experience is not one of them.

Yep.

The client-side environment is far too unstable to build a "native app". There's a reason why monumental frameworks like ExtJS barely work in IE 9.

comment 14y ago · link · parent

> If there is something out there that is better by a wide enough margin to justify giving up that established ecosystem, I'd love to hear about it. The ecosystem has plenty of imperfections, but I haven't come across anything yet that seems nearly comprehensive enough to displace the incumbent here.

David Mark's My Library[0] is the best DOM library available by a wide margin. It has supreme browser support, and it's "modular" with a custom builder. The code is so solid that many people have borrowed from it, including the jQuery project and myself.

I've also created a DOM library, but with a more limited feature set (it's only a few months old). See my submissions for details.

[0]: http://www.cinsoft.net/mylib.html

comment 14y ago · link · parent

You do realize that IE 10 dropped conditional comments, right?

comment 14y ago · link · parent

I'll play the cynic here and try to diagnose why this is even being considered.

jQuery is a very invasive API. Its goal is to steal all the work from the developer, and to "guarantee" what it deems to be "correct" input for a certain subset of browsers. This approach may ostensibly work, but inevitably falls apart, which leads to thousands of "bugs" being reported.

Because the API has grown to be so massive, goalposts "must" be moved in order to create a lighter API. Once again, this is because of a design flaw. Goalposts will continue to be moved in cyclical fashion unless an alternative design is used. Fellow developers may denigrate me for it, but I will explain how this problem can be avoided.

An API that tries to cater to everyone cannot and will not succeed. This is evidenced by the upcoming "fork". Conversely, an API that provides a set of tools to developers without catering can work in many environments. The burden is then placed upon the developer to choose which environments matter. As has been outlined by mobile developers, object inferences for IE 6 really are unnecessary for mobile Webkit environments. I have written here on this concept before, mostly on the topic of "graceful degradation". Browser specificity can and will kill a client-side API.

comment 14y ago · link · parent

The browser versions here are never mentioned, which means this is "multi-browser", and not "cross-browser" (a large difference).

Furthermore, the following snippets are simply false:

> But Internet Explorer is the black sheep of the browser world. If your tests fail in just one browser, well, you get the picture.

Funny how older versions of browsers such as Opera are never mentioned. IE versions 6-8 seem to be the only "old" browsers that exist. Which of course is because they're still in use. Myopia reigns supreme.

I've often found that IE versions 4-9 will point out errors I've made in my code, as the IE platform is far more strict than browsers such as Firefox, which scramble to protect bad code.

> Accordingly, automating testing in Internet Explorer is much more involved than any other browser.

As someone that tests in 20+ browsers, I spend a lot more time on Firefox versions 1-13 than I do with IE versions 4-9, especially with scripting. Nevermind Google Chrome, which makes testing incremental versions nearly impossible (and no, auto-upgrades are no guarantee).

> Getting automatic cross-browser JavaScript testing working is a complex affair, and bound to involve some amount of trial and error.

Conclusion: test manually. There are no guarantees.

comment 14y ago · link · parent

Viewed in IE 4 (800px x 600px):

http://i.imgur.com/9NZgc.png

comment 14y ago · link · parent

Please feel free to comment on the project or the Web site.

I'll try to field every response.

16.

Show HN: Matt's DOM Utils—a modular HTML DOM library with wide browser support(fortybelow.ca ↗)

6 points · by mkmcdonald · 14y ago · 1 comment

comment 14y ago · link · parent

I guess my humble iPod Touch that sputters out on bloated sites like GitHub just isn't up to snuff.

Try loading a page without script bloat and you'll see a noticeable difference.

comment 14y ago · link · parent

…which is a façade for the existing CSS engine. Developers clamoured for it (right or wrong), and it was implemented.

comment 14y ago · link · parent

A massive script such as jQuery does not belong on a mobile device, minified or not. Surely mobile developers would know that minimal script is best.

comment 14y ago · link · parent

The DOM API is clear enough that silly abstractions like "selector engines" are unnecessary.

The C vs. Assembly argument is such a silly non-point; apples and artichokes.

comment 14y ago · link · parent

What the jQuery team either perceives or peddles as "modules" are simply split files; there's no encapsulation. All that's new is a shiny node.js builder.

I am interested, though, that the team has finally noticed that optional code should be the norm. Resig himself has been quoted as wanting nothing to do with it[0].

However, omitting every single "module" only truncates 2484 lines, which leaves the 1.8.1b source at a staggering 6763 lines of code. There is still a great deal of work to be done before "modular" is a fair term to apply to the API.

[0]: http://i.imgur.com/Ta223.png

comment 14y ago · link · parent

> I have made every browser crash and become completely non-responsive, many times over. Chrome. Firefox. Opera. All of them. Now, this is mostly through JavaScript, when I do something stupid by manipulating the DOM the wrong way or some other funny thing. I fix it and keep going. Because breaking the browser is bad.

We have a winner. Want browsers to play nice? Write good code.

comment 14y ago · link · parent

> Is [JavaScript] really an issue in 2012? I mean, people can hardly use Twitter.com itself without JS turned on.

That's an indictment on Twitter's shoddy front-end code. The clean-up has already begun, but I don't know how much progress has been made at Twitter.

As was outlined earlier, reliance on scripting is going to bite an author inevitably.

comment 14y ago · link · parent

> Unless your customers are paranoid computer geeks, you should completely ignore users who disable JavaScript.

Hypothetical: CDN X is having problems, and your scripts don't load. Errors pop up everywhere. Do you:

a) realize that scripting can and will fail for anyone, and tailor a page to work without it;

or

b) continue to plug your ears and point to statistics?

I have scripting enabled, but block Google Analytics and various advertising hosts. Do I count as someone to be supported? Or am I irrelevant because I'm a minute statistic?

comment 14y ago · link · parent

Of course, the problem with jQuery is that you're required to use an all-or-none approach. Feel free to send me an e-mail (check my profile) if you have DOM questions.

comment 14y ago · link · parent

> This framework is written to embrace the DOM rather than fight it.

And yet three separate libraries with DOM abstractions are required.

Why should I trust your opinion of the DOM if you require so much third-party code?

comment 14y ago · link · parent

Requiring four separate APIs is a client-side dependency nightmare; requiring around 15k lines of uncompressed code is a disaster waiting to happen.

comment 14y ago · link · parent

[from the link]

> Backbone UI depends on Backbone, Underscore, jQuery, and laconic.

That's a disaster waiting to happen.

comment 14y ago · link · parent

Though the GitHub repo was posted, I would prefer visitors to go to the project site, which is linked in the repo description.

I wanted GitHub to absorb most of the page hits since I'm only on shared hosting.

30.

Show HN: Matt's DOM Utils—an HTML DOM library with tangible browser support(github.com ↗)

5 points · by mkmcdonald · 14y ago · 1 comment

123