HNHacker News
TopNewBestAskShowJobs

philipwalton

1,007 karma · joined March 23, 2012

submissionscomments
philipwalton··on Solved By Flexbox – Cleaner, hack-free CSS
It depends on your company and your audience.

I know my company would never support a browser that wasn't even supported by its maker, and I'm sure a lot of companies wouldn't either.

If you have "customers" you'll probably drop IE8 support quickly in 2014. If you just have "visitors", and if those visitors are international, it might take longer.

philipwalton··on Solved By Flexbox – Cleaner, hack-free CSS
I mention that in the site; however, in my testing their implementation isn't as good as I'd like it to be. To be honest, neither is IE11s :(

http://www.browserstack.com/screenshots/78ef12e58dd1ba200600...

philipwalton··on Solved By Flexbox – Cleaner, hack-free CSS
That's a good point. I suppose I could try to detect if the click was accompanied by a CTRL/CMD keypress and open in a new tab accordingly.

Still, the 100ms delay isn't ideal, and the open in a new tab paradigm greatly simplifies things.

philipwalton··on Solved By Flexbox – Cleaner, hack-free CSS
It's actually not as bad as you think. IE updates are now being released as critical so they're being included in OS updates.

That means that most IE users will be upgrading to the latest IE of whatever OS they're using. So when Window XP is officially abandoned (scheduled for spring 2014), it won't be long until most IE users are on the latest version.

philipwalton··on Solved By Flexbox – Cleaner, hack-free CSS
Great question.

I use Google Analytics to track where users are clicking, specifically, when users click on external links that aren't otherwise tracked by the GA tracking code.

The problem is that if you click on a link that opens a new page, the functionality in the click handler may or may not run depending on how long it takes to redirect the request. That means that if I'm tracking clicks, I very well may be losing a good deal of data.

The alternative is to hijack the click event, wait for say 100ms, and then load the new page via JavaScript, but that also break the open in a new tab functionality.

In other words, there are no good options to track external click events via Google Analytics and still give users complete control over where the links go.

The best option I could come up with is to always open external links in a new tab, because that way the click handling code always has time to run. If you're curious as to what I'm doing, here is the code: https://github.com/philipwalton/solved-by-flexbox/blob/maste...

Anyway, it has nothing to do with wanting users to stay on my site. But I can't speak for why other people do this.

philipwalton··on Solved By Flexbox – Cleaner, hack-free CSS
This is in development: https://github.com/doctyper/reflexie
philipwalton··on Solved By Flexbox – Cleaner, hack-free CSS
Flexie provides a polyfill for the outdated syntax `display:box`. The library's creator (@doctyper) is working on a new polyfill for the new syntax `display:flex`, but as far as I know it's still in development.

https://github.com/doctyper/reflexie

philipwalton··on Tips for how to decouple your HTML, CSS, and JavaScript
I tend to be pretty picky in following the spec and only use HTML data-* attributes for actually passing data. That being said, I think it’s mainly a matter of personal preference. If the data-* attributes method makes more sense to you and your team, by all means use it.

I should note, though, that if performance is a concern, traversing the DOM for classes is significantly faster than for attributes. Here’s a jsperf example I put together a while back comparing the two: http://jsperf.com/class-vs-data-attribute-selector-performan...

Lastly, it's worth pointing out that it is still possible to style elements with attributes in CSS, so the data-* attribute approach doesn't actually prevent coupling between style and behavior, it's just another convention (like js-* prefixed classes). In both cases it's still up to you to enforce the convention.

philipwalton··on JavaScript tool that validates your HTML and warns you in the web console
Yes, you are correct. It's impossible to validate HTML from DOM traversal alone because the browser has already parsed it and forgiven any errors it was able to. (I didn't choose this title and agree that it's a little misleading.)

Technically, you could validate the markup if you did an AJAX request for the current URL and parsed the result yourself; however, if your app is generated dynamically and rendered primarily client side, you'd be missing a lot of the alterations done by your JavaScript in that validation.

This is why I think both tools have their place.

I try address this issue in my blog post introducing HTML Inspector under the section "How is HTML Inspector different than the W3C Validator?" http://philipwalton.com/articles/introducing-html-inspector/

philipwalton··on JavaScript tool that validates your HTML and warns you in the web console
That would certainly be cool. But part of the value of this tool is its ability to customize it yourself.
philipwalton··on Show HN: Introducing HTML Inspector - making markup testing easier.
The project repo can be round here: https://github.com/philipwalton/html-inspector/
philipwalton··on CSS Architecture
You pretty clearly didn't read the article.

Semantics weren't discussed at all. The focus was on making the best of working with a language that has a limited feature set, and learning to reexamine long held best practices.

philipwalton··on CSS Architecture
There are a few reasons I prefer the namespaced modifier approach to what you've described:

1) This approach is more error prone and less predictable. For a one-man job it's probably OK, but on a team it's harder to guarantee someone else isn't going to apply some styles to `.sidebar`, which will cause unwanted styles to be applied to your separator component. The namespaced approach is very intentional, so it's unlikely someone will add styles to that rule without knowing exactly what they're affecting.

2) chaining like this ups the specificity of the CSS rule, which means your other modifier/presenter classes might not work on the element anymore. In CSS specificity is everything, and keeping it nice and low is usually preferable.

philipwalton··on CSS Architecture
You left out Nicolas Gallagher and Jonathan Snook :)
philipwalton··on CSS Architecture
@thejerz, article author here.

1) I didn't write this while on the job at Appfolio. I wrote it at home, in my spare time, because I like sharing the things I've learned on the job with the rest of the Web community. Based on the upvotes and overwhelmingly positive responses I've received, I think it's worth my time.

2) My work on the CSS for Appfolio Property Manager has greatly helped the development team (mostly back-enders) and sped up the process. We can release features much faster because of it. I'm sorry they're not the features you want (that's not my call), but if/when we deliver those features they'll get to you quicker because of my work.

philipwalton··on CSS Architecture
Totally, I discussed this a bit in the article but probably should have stressed it more.

Nicole Sullivan (OOCSS creator) refers to this principle as "separating content from container".

philipwalton··on CSS Architecture
I was going to point you to this Github issue, but then I realized I'd be linking you to yourself :)

https://github.com/stubbornella/csslint/issues/380

philipwalton··on Jekyll 1.0 Released
Mainly parts from two of the rake tasks: 1) to create new posts 2) to deploy to Github pages
philipwalton··on Jekyll 1.0 Released
I started out using Octopress but in the end chose to go just plain Jekyll and borrow from Octopress only the things I needed. I'm pretty happy with my decision.

Ultimately, you just need to look at the feature-set of Octopress and decide if you actually want those things (custom theme, Disqus and GA integration, etc). If you do, great, if not, it's probably going to get in the way more than help.

philipwalton··on Do not use RJS-like techniques
Yes, but that doesn't actually solve the problem. How is that code going to interact with your existing objects unless those objects are in the global scope?

If both the requester of the AJAX call and the receiver are in the same closure, there's no need for those objects to be globally accessible.

philipwalton··on Do not use RJS-like techniques
One additional point the author didn't mention:

Executing JavaScript code sent from the server requires your JS objects to be in the global scope. Returning JSON (on the other hand) allows you to keep your objects and logic inside a closure.

philipwalton··on Poll: How much money have stock options brought you?
Yes, but there's a difference between your options being worth nothing and the value of your options being unknown. There's also a difference between the value of your options being unknown and the value of your options being known but you not being able to exercise them for whatever reason.

You may not care about that distinction, but I'd be interested to know what camp those "$0 :(" people are in.

philipwalton··on Poll: How much money have stock options brought you?
There should be an additional choice for people who have options but aren't able to cash them out yet.

That would offer a view into the percentage of people who stay at a startup long enough to exercise their options.

philipwalton··on Ask HN: What is the most amount of people you have had on your site at one time?
Yeah, I'd be curious to see traffic data from people who got to various spots on the front page and see what trends emerge.

Though, now I'm remembering that the post was also on /r/webdev and /r/web_design, so that skews things a bit.

philipwalton··on Ask HN: What is the most amount of people you have had on your site at one time?
700 at the same time. 40K in the 24 hour period after it made the front page. Yeah, I was not expecting that.

Luckily, I had recently converted the site from WordPress to Jekyll and was hosting it on Github pages, so I didn't worry too much about the load.

philipwalton··on Ask HN: What is the most amount of people you have had on your site at one time?
When one of my articles made it to the #2 spot on Hacker News, I was watching my Google Analytics Real-Time stats pretty closely. It got as high as ~700 people on at one point. (Here's the submission: https://news.ycombinator.com/item?id=5062761)
philipwalton··on Netflix now bigger than HBO
Yes, but obviously I'm wanting a streaming service to offer it.
philipwalton··on Netflix now bigger than HBO
I don't think so. The same issues would be there for music, but those apps all offer it.

As long as you can only watch it from within their app (so they can keep stats), it shouldn't matter whether it's online or offline.

philipwalton··on Netflix now bigger than HBO
<rant>

Netflix really needs to implement an offline mode for its mobile apps.

The vast majority of the times I'm watching something on my phone, I don't have a WiFi connection or the connection is too slow to stream an HD video (like on a plane, at the gym, in a car, etc.)

I'd love to be able to download something at my home and watch it in offline mode later. Both Rdio and Spotify do this for music. Why doesn't any video services do it? Are you listening Netflix?

</rant>

philipwalton··on New GitHub Logo
I wasn't suggesting anything's wrong with it. Certainly the creator of Bootstrap has liberty to copy himself. I guess I'm just a little surprised he didn't want to showcase his variety.
← PreviousPage 3 of 4Next →