15 ms·
I'm still looking for "just use links". So many frontends I see use fancy onclicks to emulate links (including updating window.location). However they are eit
by aidenn0 8y ago
I'm still looking for "just use links". So many frontends I see use fancy onclicks to emulate links (including updating window.location). However they are either not links or are void links. This breaks all sorts of useful things (copy link location, open in new tab &c.).
- rayiner 8y agoSo that's why that happens. Why on earth would you break one of the most foundational aspects of HTML that way?
- rpeden 8y agoBreaking it is completely unnecessary too, even with single page apps. It's not all that hard to build a React or Angular apps that use proper links along with the browser history API. Designed properly, the apps should be able to load their state and render correctly even when deep-linked to somewhere other than the app's top level. This isn't a new concern - I remember paying attention to this back in the old days of SPAs using GWT back in 2009/2010. Unfortunately, many web apps choose to ignore this. On the bright side, lots of them get it right, too.
- vanderZwan 8y agoIt's such an extremely simple litmus test: if it breaks the back button of the browser, it's the wrong design. The closest thing to an exception being cases where one needs to be logged in to see a page, or when links are consciously invalidated for some other reason. And even then the website/webapp should still just signal this to the user without a bazillion redirects.
- jahewson 8y agoNot necessarily: I do not want to click back 30 times to get out of your slideshow and back to my Google results. Thank you.
- ergothus 8y agoBut the problem there is that they used a carousel in the first place. Were it content that justified clicking 30 times into it, it would also justify backing out of it 30 times.
- rpeden 8y agoFor something like a slideshow, I think you could have it both ways - default to a scroll view that shows all of the slides at once, and make it so clicking a slide shows the slide on a single page that is deep-linkable. The user could then navigate forward and backward between each individual slide page if they so desire. I suppose it's all a matter of trying to do what will best match user expectations. Or just whatever will make them happiest. Maybe call it the principle of least annoyance. Of course, if you make an ad supported slideshow app, maybe you want to show one slide per page to get more ad impressions. I suppose that would be the principle of maximum revenue, along with its corollary (from the user's perspective): the principle of maximum indignation.
- beat 8y agoThe problem is that it might take a half-dozen clicks to realize it's not worth reading the other 24, then you need to click back a half-dozen times (worse if there are page reloads during that).
- ergothus 8y agoThat's my point though - if it takes a half-dozen clicks to decide it's not worth it, then they weren't using a good format anyway. You likely did the last 5 clicks hoping things would be different after the click - the click itself was NOT a value add. I'm not saying it isn't useful to bypass that to get back, but then you're literally asking the people that made the bad design decision in the first place to make the good one to let you out - and they likely won't, for the same reasons they gave you that UI in the first place.
- dylan604 8y agoOr, use another built-in feature of the browser's back button. Click-and-hold the back button so that you can see a contextual menu with the steps you can go back to quickly. If I click back more than twice, the third is a click-and-hold.
- SilasX 8y agoVirtually every site breaks the back button now. Even reddit will suddenly forget discussions I had closed, and where I was on the page, and then have to reload something, when I all I need it to do was take me back to the same state on the page that I had before.
- madeofpalk 8y ago> Virtually every site breaks the back button now This is just not my experience, at all. I'm extremely sensitive to this issue, and its just not something I see all that regularly any more.
- SilasX 8y agoI was including "fail to return to page state at time link was followed" as "breaking the back button". Reddit, Quora, and sites using Disqus fail that.
- qudat 8y ago> if it breaks the back button of the browser, it's the wrong design. Some people don't care about a back button in a single page application and it isn't "trivial" to implement properly. It requires libraries, polyfill support, etc. And in a world where everyone is complaining about js bloat, it should be no surprise why it exists.
- tomjakubowski 8y ago> if it breaks the back button of the browser Good luck getting a group of people to agree on what "non-broken" back button behavior is.
- oneeyedpigeon 8y agoAll those cases where pressing back repeatedly doesn't actually go back? They're broken. We may not be able to define 'broken' perfectly, nor catch every case, but we can definitely spot the worst! Unless you mash the back button really quickly ...<sigh>
- msla 8y agoYour back button is "broken" every time your last transition from the previous page to the current page changed information on the server, and that information change isn't reflected in the cached version of the previous page your browser helpfully shows you when you hit back. Cache invalidation is a technical solution, and it could conceivably be done with header magic or something, but the real problem is people thinking the back button undoes history and the server (and, possibly, reality) disagreeing.
- ycombobreaker 8y agoGoing "back" and showing the old information is accurate. I'm not reloading the prior URL. I'm viewing the last page I looked at. In fact maybe I don't even have network access at the moment (on a subway). I can always opt in to reload the page if I want to see refreshed data.
- vkou 8y ago> It's such an extremely simple litmus test: if it breaks the back button of the browser, it's the wrong design. What if state should be destroyed when you press the back button? What if I open an image in a photo app, click a button to delete it, and go to a 'deletion successful' page. Should clicking the back button return me to a page containing the image? A page containing 'this image has been deleted'? The website I was on before I was on the photo app? Which actions defines a history-worthy state change? Should clicking around a menu generate 10 history events? What about toggling a checkbox? What about an action that changes most of the information on a page? Should that generate a history event? What if that action is bringing an in-app tab to the forefront? What if there is an obvious history event that should be generated, but there is no good reason for why a user would want to go back to that state? It doesn't even matter how you answer all of the above questions - other people will have different answers for them, and have different expectations for how the back button should work, on the same app.
- petee 8y agowhich really cuts to the core of it: shoehorning something that should be its own app into a website -- all your above problems solved. The web was not designed for such use, yet we continue to stretch and abuse whats there and wonder why most sites suck and get it wrong.
- vkou 8y agoHow will someone on a laptop run my website as an 'app'? Should I download a Wells Fargo app to my desktop, so that I can do banking with them? And a Google Docs app? And a Seattle City Lights app? Maybe a Progressive app, so I can manage my insurance policy? And one for the Washington DMV? How many problems is running random binaries from random developers at those organizations going to give me? How much more expensive is it to develop apps, over websites? How will you make these apps run on Android, IOS, Linux, MacOS, and Windows? [1] All of these websites have rich app-like functionality. The web was designed as a document store, yes. This is 2018, though - its not used as a document store. It's the place where I do my banking, my shopping, keep my spreadsheets, and make image macros. Turning all of that into non-web apps will just make development more expensive, degrade my user experience, and negatively impact my PC's security. But hey, the upshot is that the sanctity of the back button will be protected! [1] Maybe we could sandbox them... And have a cross-platform 'operating system'[2] where they can run. Maybe even have several such 'operating systems', with similar functionality, but built by different vendors. Vendors like Microsoft, Apple, Mozilla, and Google, maybe? [2] We can even make this 'operating system' support opening static .HTML pages, so that we can 'browse' through them.
- briandear 8y agoEmber does this out of the box.
- rhizome 8y agoUnfortunately, many web apps choose to ignore this I wouldn't be surprised if most if not all tutorials ignore it as well.
- komali2 8y agoAs I recall when learning angular (2) and react (whatever 2016 version was), almost every tutorial on the subject of routers would just go "the easy route" that inevitably avoided using the browser history API. I haven't checked in a while, I wonder if this situation improved? A lot of these frameworks market themselves as dead easy, but I always found a gap between the "dead easy start-up" documentation, and the documentation that essentially amounted to "read the source code."
- ChrisSD 8y agoYes what will they break next? Scrolling?! It's almost as though web devs enjoy reimplementing the browser in javascript...
- Ezhik 8y agoWell, there was that smooth scrolling script menace a few years back.
- dredmorbius 8y agoHorizontal scroll. Orbpageflipping. Just don't. PubMed. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3968624/ https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3968624/ (There's still a legacy fallback.)
- munchbunny 8y agoMy guess is somebody over-engineered a "make anything into a link" helper function and then decided it was easier to just use it everywhere, rather than preferring <a> tags in the 90% of cases where it would make more sense. How do screen readers handle these script-based links? I don't mind it from a "I have working eyes and arms" perspective, but I imagine it's kind of a pain for assisted vision?
- ljm 8y agoI think some of it is possibly just ignorance, too. For example, I've worked with a fair bit of code full of `<a onclick='...'>` tags, where the click handler basically invoked the router and redirected to a new page. Seems to happen a lot in React/JSX code.
- astura 8y agoThere is a special place in hell for whoever does this... I guess it might just bother me so much because it shows a fundamental misunderstanding of how the web works.
- komali2 8y agoI've done that before, when I was noobish and couldn't get the damn framework to work like I thought the internet worked. There was this hellish twilight area of my learning web dev where I was transitioning from how i thought the internet worked (HTML pages with anchor tags) to how it actually worked in 2015, which is slapped together framework routers that I couldn't fenangle to work with the History API.
- ddebernardy 8y agoBy the same token, why reinvent things like scrolling, break the back button, or throw font sizes so small at your readers that they need to zoom to read? (To say nothing about top and bottom bars that follow you around on your 13" laptop screen.) Humble suggestion: design fads. My own question would be whether this gets taught anywhere. Because if it does, a few someones need to get fired.
- komali2 8y agoMost web devs I know are self taught. That includes the computer science majors scoring jobs at Google and Facebook - I haven't heard of anybody getting an "education" in web development, outside the bootcamps, and as a bootcamp attendee I recall us focusing on just learning how to program over anything else. Like, there wasn't a web design sprint. Is this everyone else's experience? How has web design been taught lately?
- vthriller 8y ago> throw font sizes so small at your readers that they need to zoom to read My problem is usually the opposite: I constantly stumble upon websites that use ridiculously large fonts like I'm a grandma that tries to read something on an overkillishly-retina display from meters away. However it doesn't usually bother me when I'm browsing from my desktop 'cause I have options to zoom out; however most of mobile layouts feature something like <meta name="viewport" content="..., minimum-scale=1"> (edit: also mentioned in the article albeit in a bit different context), which makes me choose between intensive vertical scrolling in regular mode and constant horizontal scrolling if I "request desktop site". (Yeah, I know, "reader mode"; it's a reasonable hack but I'm not quite satisfied with any of implementations either, and it only works for whatever browser thinks the main body of the page is.)
- reaperducer 8y agoSo that's why that happens. Why on earth would you break one of the most foundational aspects of HTML that way? To track clicks.
- rhizome 8y agoBecause nobody hires sysadmins anymore, they don't know how to parse plain webserver logs.
- cs02rm0 8y agoOff the top of my head, for one, because my HTML sits on top of a REST API and links can't hit a DELETE endpoint. I've no idea what people expect right clicking a delete link to open in a new tab to do?
- ohazi 8y ago> I've no idea what people expect right clicking a delete link to open in a new tab to do? I expect it to issue the delete, and then dump the response to the delete into a new tab rather than navigating away from the page that hosts the delete link. There might be ten other delete links on the original page, and I don't want to delete-back-delete-back-delete-back, when I can just open all of them in a new tab, then go through the tabs to look for errors.
- adrianratnapala 8y agoThat sounds like the right behaviour to me, although there is an arguably nasty non-idempotence. Click it the first time and you get a DELETE response. Click it the second time and you get a 404.
- spockz 8y agoThat is still idem potent. In both cases after the request is performed the resource is still deleted.
- cs02rm0 8y agoWhat if the response to the delete were a redirect back to the same page - would that be reasonable?
- adrianratnapala 8y agoYes, but application developers have long faked it using GET .../thing?op=DELETE When you get sick of faking it you look into why there is no way to get browser to send real DELETEs and PUTs and w3c verbiage says "because application developers don't seem to need it" ... because they fake it ... because they have to fake it ... because browser don't do it ... because devs don't need it ...
- GoToRO 8y agoOne reason is that if you have a link, that link will be copied and sent. Then when the receiver clicks on it, the user has an expectation that they will see the same thing as the person that sent it. For the developer that means you have to recreate the state of the app, from the link. This further means that the link must contain all necessary data to do that and the developer has to write more code to recreate the state (sort order of a column in a table f.e.) There are two choices: don't recreate the state -> people will call each other stupid over the phone because they see different things for the same link, -or- Recreate the state -> more money, more time, -or- Just don't have links at all. Which is what people usually choose because is faster and cheaper. What changed was that before, "to do the right thing", i.e. have real links, was the easiest and the cheapest. Now to do the same, you need real developers. Even in Angular there is/was a discussion of where to put the state of the app in the url? put it in the path part of in the hash part? the difference being that the hash is not sent to server. So for search engines all those links are just one actually... Which is ironic because Angular is made by a search engine.
- jahewson 8y agoI agree for cases where the text is supposed to behave like a hyperlink - it should be one. But in cases where its behaviour is that of a button (even a button which has the appearance of blue text - think iOS) then onclick is a good choice. Especially for contexts where “open in new tab” makes no sense. I can’t see any valid reason for using a void link - worst of both worlds?
- lhorie 8y agoI recall reading a story about someone who had implemented some sort of table using links for actions. At some point the app data mysteriously got wiped out. Turned out a user had Alexa toolbar installed and it crawled the "delete" links on each row (as well as all the pagination links)...
- nicoburns 8y agoThis is easily solves by using an invisible form with hidden elements...
- billysielu 8y ago2 wrongs don't make a right
- CGamesPlay 8y agoThe web server had a deficiency where it modified data on HTTP GET requests. We could probably agree that navigation should be links and other actions should be buttons. Visual appearance of such should probably be left alone, but is technically a decision that can be made independently.
- JimDabell 8y agoThis happened repeatedly with 37signals/Rails and Google Web Accelerator: http://blog.moertel.com/posts/2005-10-25-google-web-accelerator-vs-unsafe-linking-round-two.html http://blog.moertel.com/posts/2005-10-25-google-web-accelera...
- 8y ago
- crunchlibrarian 8y agoRemember flat html? Remember servers that would generate pages? Remember when CSS preprocessors didn't peg the CPU for 50ms? Maybe we should investigate this ancient tech of the old ones.
- ralusek 8y agoI've never seen a setup where a css preprocessor didn't just generate the output once at build-time.
- zlynx 8y agoOh, people can abuse anything. Maybe they want their CSS all in-line at the top of the dynamic HTML. So they run the preprocessor during page generation on the server. Use a separate CSS via link tag? Oh no, I heard that was slow. Set expires cache header for 1 day? Oh no, that makes testing hard for me and what if the CSS changes? Web developers sometimes use the dumbest reasons to avoid doing good things.
- jdhawk 8y agoMore likely, they're completely oblivious to the impact their changes are making, and they're just looking to "make it work" on their computer for that one page load a minute.
- wild_preference 8y agoCSS generated in the server still means it’s not pegging user CPU for 50ms like they said. I think these meandering rants are a tad silly.
- zlynx 8y agoI read it as using 50ms of CPU and it didn't say where. Using an extra 50 ms of server CPU happens all the time in my experience and no one seems to think this is a problem. At least not until they try to solve the C10K problem or survive the "Slashdot Effect." That's when people discover that static pages are king.
- edflsafoiewq 8y agoI especially love when these not-links can't be clicked (for God knows what reason) using a stylus, rendering them unusable unless I hook up a mouse.
- deleted 8y ago[deleted]
- SilasX 8y agoAnd extensions like Vimium/pentadactyl/VimFX that let you do all your browsing from the keyboard without a mouse, and which therefore have to be able to detect and send a signal to follow links. And probably accessibility tools for the blind.
- SamUK96 8y agoa good developer would do a simple *ngIf and do a toggle on either using <a href=...> or <my-fancy-button (click)="navToPage()">. Call it "olde time mode".
- Pxtl 8y agoSo how do you handle something like filters on a product listing? Make every filter option its own link?
- tomp 8y agoThis. LinkedIn is particularly terrible. I cannot believe such a huge, successful website can have so horrendous UX.
- LarryMade2 8y agoI noticed that one day while playing with lynx and now add regular links inside the on-click areas.