Best Browser For Using Complex Web Applications? 347
yanyan writes "I'm fairly new to the field of web application development. Currently I'm working on a big online ticketing system for passage and freight for a local shipping company. It's a one-man show and the system is written in Ruby and uses Rails. Aside from the requisite functionality of creating bookings the system must also print reports and tickets, and this is where I've discovered (the hard way) that most, if not all, browsers fall short. I've had to switch from Firefox 3.6.3 to Opera 10.53 because of a major printing bug in Firefox, but the latest stable Opera is also giving me its own share of problems. To complicate things, an earlier version of Opera (10.10) doesn't appear to have 10.53's printing problems, but I'm wary. What browsers and specific versions do you end up deploying for use with big, complex web apps that include printing? Also consider CSS accuracy and consistency."
My experience: (Score:5, Informative)
In my experience, the easiest way to get a consistent and stable printing experience is by generating PDF. I have yet to have stability problems if this is done properly. As you're working with Ruby on Rails, using Prawn and Prawnto might be useful. However, if you absolutely positively must NOT use PDF for printing, then this probably won't help you.
Re:but I thought HTML was supposed to fix all that (Score:5, Informative)
Why not take advantage of a more advanced and mature UI widget set, such as that provided by Java
Java is 20 years old, Javascript is 15 years old, and Java is mature while Javascript is not? Does that extra 5 years really make that much of a difference? Was Java considered not mature in 2005? There are plenty of mature Javascript UI libraries around that developers can take advantage of (ExtJS/Sencha, jQuery, Mootools, etc). There are several use cases where Java is a pain in the ass and an offline application is not an option. A rich internet application implemented in Javascript is perfectly fine for many situations. There's no shoehorn involved when it's the best tool for the job.
PDF if at all possible. Otherwise coughFlashCough (Score:3, Informative)
The only way that anyone does proper printing of web documents is as PDFs, and to hell with the browser. This is for very good reason.
If your system absolutely must print from a web page, use Flash. Yes, I know. But it will print from within the page, it produces identical prints in all browsers/platforms, and everyone already has it installed.
Re:but I thought HTML was supposed to fix all that (Score:3, Informative)
Not that I disagree with you, but there are plenty of offline applications written in Java, using Swing. Java is not limited to applets and application servers, there is a mature library for standalone/offline application development. As I remember things, the reason we do not see more desktop applications written in Java is the bad reputation Java had in the 90s for taking a long time to loa, and to some degree the fact that Swing does not integrate with the desktop look and feel (or at least it did not the last time I checked, which was admittedly years ago).
Re:IE or Firefox (Score:3, Informative)
Sure you may be trying to do things the right way, i.e. fully standard compliant, but it isn't the real world answer.
I managed to write a web application a couple of years ago that not only displayed consistently in IE and Firefox, but also printed consistently from both of them, while remaining standards-compliant and not using HTML or CSS hacks. The printing was by far the harder part - the browsers initially returned very different printed results even though they rendered the page on-screen almost identically. Changes to the CSS would frequently fix the printing of one while breaking the other, yet not affecting the on-screen rendering of either.
I can see why people who do a lot of printing lean towards PDF.
Javascript, GMFB (Score:2, Informative)
Forget the comparison of years of age. "Javascript" and "mature" are not words which in any sense could ever be considered compatible. After one hundred years, Javascript will still not be a mature language. It is crap by its nature.
Re:My experience: (Score:3, Informative)
Just please give the Windows users a link/suggestion to download a good PDF viewer, or at least anything less evil than Acrobat Reader.
Re:My experience: (Score:3, Informative)
If we hadn't done a huge amount of form design around PS I'd switch em to PCL and be done with it.
I've had pretty good luck printing postscript to non-postscript printers using ghostscript as a filter. These days it's not even that computationally intensive, all things considered.
Re:Stop using the browser for print (Score:2, Informative)
use HTML/Javascript standard (Score:2, Informative)
Re:IE or Firefox (Score:1, Informative)
My 150k person company that services untold numbers of other users still requires us to be compatible with IE 6. Some of these people are responsible for very serious engineering and space and defense industries so it's not like it's an arbitrary industry.
The "real world" uses all kinds of crap and if you can't figure out how to make your code work on all kinds of different browsers and systems and applications and networks and security systems then you're just not doing it right.
It's not fun and it's not easy. I can't tell you how many times I've had to fix my applications to fix an obscure bug in an obscure browser or system. But guess what? That's the real world, asshole. Buck up or go home.
Re:but I thought HTML was supposed to fix all that (Score:5, Informative)
I will be flayed alive, but Silverlight 4 is a "Rich Internet Application" framework and with the most recent version, they built in some very tight and effective printing functionality. That, in combination with the ability to pretty much lay things out exactly as you want, export to an image or text format, export the app to an out of browser desktop app, and print in whatever format you see fit, makes it ideal for the kind of ticketing system you're talking about.
Here's a blog on how to implement it: http://wildermuth.com/2009/11/27/Silverlight_4_s_Printing_Support [wildermuth.com]
And another: http://www.silverlightshow.net/items/A-look-at-the-Printing-API-in-Silverlight-4.aspx [silverlightshow.net]
and here's Microsoft's page hyping it: http://www.silverlight.net/getstarted/silverlight-4/ [silverlight.net]
Here's a blog on linking Ruby on Rails with Silverlight as well: http://techblogging.wordpress.com/2008/03/26/using-silverlight-with-rubyonrails/ [wordpress.com]
Hope this helps.
Re:IE or Firefox (Score:3, Informative)
You are assuming it's for mass-consumption. Take a look at the actual post, and you'll see it's an internal application.
Re:For printing use PDF via LaTeX (Score:3, Informative)
It's really easy to make LaTeX not look like an academic article: just use the right documentclass. If your file starts \documentclass{article} then you probably will find it hard to play with settings to make it not look like an academic article...
Re:but I thought HTML was supposed to fix all that (Score:4, Informative)
NONE of you posting in this thread section can read, obviously. The question is what BROWSER is best for complex web applications. It is NOT what programming/scripting language is best for making such applications.
Heck, as wrong of an answer as it would be, "Internet Explorer would be best!!!" would be a better answer than the ones you all are fighting over. At least it's on the list of possible answers to the question.
Someone needs to mod you all to Off Topic oblivion. There's nothing "Insightful" in you all not even remembering what the question was...
Re:but I thought HTML was supposed to fix all that (Score:3, Informative)
The big difference is that all the browser has to do for java is host the runtime. For javascript, the browser has to support the entire instruction set. Java takes longer to start. But once it has started, it gives you much more control.
Re:but I thought HTML was supposed to fix all that (Score:1, Informative)
Should have used Adobe Flex, its way ahead of Silverlight and much more stable. It also has much better cross-platform support.
Re:but I thought HTML was supposed to fix all that (Score:3, Informative)
I could say I didn't want to burst your bubble here, but I do. Pop. Consider it burst.
Try to do what most software developers do once. Go into a company that has very complex requirements for their application. Try to do it in any of the more popular web-technologies today, Richfaces, JSF, Struts (you can see where I am coming from I guess) and develop this vertical LOB app. Sorry to tell you, you will spend at least 5-10 times as much time to get it to work than if you use something like Silverlight or Flex and put a SOAP interface on your server. Not only that, but it will easily scale 100 times better than you can possibly manage with an app that keeps all state on the server including conversation state.
In typical LOB apps you can easily cut network traffic and server hits by 50-90% over an Ajax solution by going with Flex or Silverlight. In most cases such things matter. Not for toy applications though.
Re:For printing use PDF via LaTeX (Score:1, Informative)
there is also prawn [github.com] for pdf generation with ruby.
Re:For printing use PDF via LaTeX (Score:3, Informative)
The amount of work to make LaTeX not look like an academic article is boggling.
Then you're doing it wrong. The usual first trick is to make sure you've chosen the fonts right; most people don't understand the difference between styles and fonts and you sound ignorant enough to also make that blunder.
Hell, the amount of work just to figure out how the fuck you escape basic punctuation so your file compiles is boggling.
You have a library for that. Going all hair-shirt and doing it by hand is just foolish.
Just use a normal PDF library.
Depends on the size and complexity of the document being produced. If it's really rather large and complex, then build it as XML, use XSLT to map to XSL-FO, and then convert that to printable form. (IIRC, at least one XSL-FO system uses LaTeX as a back end...)