HTML5?


Norfen

Still Fresh
Joined
Sep 6, 2010
Messages
77
This thread made me wonder about HTML5, it *should* work, right? But how does it perform? Since flash is under construction, and Java webgames may or may not be possible HTML5 is actually looking like a pretty decent idea, and there's even some games for it.
 
Last edited by a moderator:
It works as good as the browsers support it, if what you're planning to do on your panda works good in FF, it will be working good in FF on the panda as well. The only issue could be performance, but I think it would need to be very complex and demanding to run into any problems with that.
 
oh god. Kill me now.


It's java all over again. But worse. Since people are convinced it's faster; It will replace 'those nooby low-level languages'. And I will live in my personal hell. No people, learn real languages! Opensource your base engines and port like a rabbit!


And i'm not trolling. I'm scared. Scared for the sanity of the world. I trusted you, Mozilla! (kills firefox-bin and then Xorg, fires up elinks. Enjoys teh web. Remembers the php scripts on his server, a quick rm -rf of cgi-bin later...safe. cd ~/code/ASM, ed www.asm, as www.asm, ld, etc)


Anyone know a good webbrowser, WITHOUT HTML5, without javascript JIT, that isn't webkit? Elinks even with its basic javascript is pretty much unusable, thanks to the world relying on this interpreter fueled world.


Can't we go back to telnet and, incase you want it super pretty, (n)curses?


Remember dial-in bbses? I of course don't, never had/got to dial-in. But yeah. What was so bad about those, other than that in the case of dial-in only, there could often only be one active user at a time(and oftern there was no multiuser anyway). As fast as nginx is, it's tempting to fall back to the bbs I wrote back when learning C (unfinished, *works*(!) but is more like a mailing list).
 
It's java all over again. But worse. Since people are convinced it's faster; It will replace 'those nooby low-level languages'.
I really wish Java had worked.


It had a full VM and standard libraries in a browser applet.


Except the libraries kind of sucked, the language wasn't great, it took a while to load, it always whines about updates in Windows, and I couldn't even test my applet because it cached it and refused to update.


But I don't get the low-level languages part.


Isn't JavaScript higher-level than Java? It has things like anonymous functions and closures.


I also don't get why people keep worrying about HTML5.


It's already being implemented, and it already works pretty well, at least for the video, audio, and canvas tags. One rarely sees a decisive fight between technologies that results in one instantly evaporating, so I'm sure a bunch of idiots will keep using Flash for a while, possibly just to enforce DRM. But the existence of Flash isn't stopping anyone from using video tags or canvas tags. It's basically a matter of personal preference and familiarity.


Ideally, some powerful company would have said "fuck off" to the HTML/CSS/JS/PHP stack a long, long time ago and replaced it with some kind of remote widget toolkit that can actually do trivial GUI tasks like arranging items in a layout, or trivial networking tasks like connecting to a server and receiving events pushed by the server. And isn't based on freaking text documents.


It's possible that Qt is actually doing this with QML, but if they are, they don't seem to have announced it.


In summmary: I hate HTML, but there since HTML5 isn't an actual thing, there's nothing wrong with it. It's a series of tags and new ways to do things without Flash. It's not what I'd like, but it's much better than what most people are using, since at least it will have usable open-source implementations.
 
It's possible that Qt is actually doing this with QML, but if they are, they don't seem to have announced it.

Funny you should mention that. I thought about the same thing. Qt programs (and QML by extension) support loading QML widgets from a network location (identified with URL) by default. So you could make a QML-browser, that can be pointed to a remote application (collection of QML files). The application would then be exectuted as local, with resources being loaded as needed. With a smarter browser you could add more custom elements to give the programs limited access to different services on the system. I haven't quite figured out all the securiity implications here, but I like how it sounds :) .
 
I also don't get why people keep worrying about HTML5.
It's already being implemented, and it already works pretty well, at least for the video, audio, and canvas tags.
So far, the only part I've played with is the canvas tag, because that's what I'd like to implement games with. But performance, at least on Linux, is stupidly slow--far worse than flash, where somewhat smooth animation is possible on my fastest computer.


Most of my computers are on the level of a 1.8Mhz Sempron or 1.6Ghz Pentium M. Flash struggles...Farmville and Frontierville are just barely playable. Canvas tags? Forget about it. And these computers should be quite a bit faster than the 600Mhz Pandora.


Could someone point me to an example of a canvas tag game with smooth animation? Something with better than 1fps on an older computer.
 
Last edited by a moderator:
I seem to start media format wars wherever I go -.- Can someone with a Pandora do me a favor and try and run this game?
 
Except the libraries kind of sucked, the language wasn't great, it took a while to load, it always whines about updates in Windows, and I couldn't even test my applet because it cached it and refused to update.
Slow loading and the update nagging, OK, can understand that. But what do you have against the libs and the language itself? Exemplify please

Isn't JavaScript higher-level than Java? It has things like anonymous functions and closures.
you can't really compare the two. JS is a scripting language that has nothing in common with java beside the name.


Java may not have anonymous functions, but I don't see how that is that good of a thing anyway. I never had a situation where I would need it (you only need it in JS because it is so dependent on callbacks) and they don't really fit in an object oriented design anyway. Hell, you could even put a method in an anonymous class with a proper interface and use that.

I also don't get why people keep worrying about HTML5.
IMHO, the main problem with it is.. Currently, HTML, CSS and JS are a pain in the ass to work with, not because they themselfes are horrible but because there are some browsers that don't care about standards. You can't make a page and put it up if it looks right, no, you have to test it in every single mayor browser, across various browser versions.


HTML5 will probably take this up to eleven.


btw, that canvas rider, while looking nice, has to be the worst motocross game I've ever played :eek:
 
Last edited by a moderator:
btw, that canvas rider, while looking nice, has to be the worst motocross game I've ever played :eek:

Whole point was finding a game that looked nice. I spent a while with it seeing how it worked in different browsers and different computers, but the pandora probably performs different than anything I have.
 
But what do you have against the libs and the language itself? Exemplify please
Well, I think I once tried to get input from the console or something.


I had to do something like create a Reader, and a BufferedReader, and LineReader, I had like 3 or 4 objects stacked on one another just to get some input.


IIRC it handles GUI events by subclassing? So to make a button do something when you click it, you subclass it. Then to make a form, you subclass a JFrame and tell it to add buttons to itself.


It seems like there was way, WAY too much object orientation in places that didn't need it at all.


I could probably give it another shot, but I don't know why I would. Qt seems to work very well for similar tasks and has the advantage of C/C++ libraries such as GStreamer.


If I could get applets to work, that would be great, but my browser plugin kept caching them, so I couldn't reload the page to test an applet. And the appletviewer didn't work at all. I said to myself, "FFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUU-" and played video games instead.

you can't really compare the two. JS is a scripting language that has nothing in common with java beside the name.
I know, I was trying to understand where someone said something about one language being low-level. Maybe they were talking about something else.

IMHO, the main problem with it is.. Currently, HTML, CSS and JS are a pain in the ass to work with, not because they themselfes are horrible but because there are some browsers that don't care about standards. You can't make a page and put it up if it looks right, no, you have to test it in every single mayor browser, across various browser versions.


HTML5 will probably take this up to eleven.
Possibly, but I'd rather have that than continuing to use Flash.
 
Last edited by a moderator:
Well, I think I once tried to get input from the console or something.


I had to do something like create a Reader, and a BufferedReader, and LineReader, I had like 3 or 4 objects stacked on one another just to get some input.
OK, using it for commandline is a bit ugly compared to C++.. Probably because the keyboard input in the console is a Stream just like the Stream you have when you open a file and so on.


Currently, it's like this:



Code:
System.out.println("Enter smth"); // note that you can just type "syso" and use autocomplete magic in most IDEs

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

String reply = br.readLine();

Not that bad, but a bit uncommon when you come from another language.



IIRC it handles GUI events by subclassing? So to make a button do something when you click it, you subclass it. Then to make a form, you subclass a JFrame and tell it to add buttons to itself.
You don't need to subclass. For example, adding a panel with some text in it can be done like this:



Code:
frame.add(new MyPanel());

[...]

public class MyPanel extends JPanel {

    JLabel lbl = new JLabel();

    public MyPanel() {

        lbl.setText("bla");

        this.add(lbl);

    }

}

or you could just do this:



Code:
JPanel pnl = new JPanel();

pnl.add(new JLabel("bla"));

frame.add(pnl);



Some times, subclassing is the cleaner solution, for exaple if you want to reuse it (a panel that contains an image that is automatically stretched to its dimensions would be such a case), but most of the time, you don't bother with it. Personally, I just subclass the JFrame, but you most often only have one per app anyway (just for clarification, JFrame is a window, complete with window title bar etc, JPanel is just an area inside a Window)



For the button one, I never subclassed a button. You probably only have to do this if you want to style it youself or something. Usually, you do something like this:



Code:
JButton btn = new JButton("click me");

btn.addActionListener(new ActionListener() {

    actionPerformed(Event e) { // note, this is out of memory, the function could be named differently

        // handle click

    }

});

Of course, you don't have to add an action listener using an anonymous inner class, you can also just implement the ActionListener for all buttons in your frame, panel or whereever you want to. (Java has two forms of subclassing - extending and implementing. Extending is used like it is in C++, but you can only extend from a single class. Implementing is just used with interfaces and you can implement as many classes as you like. This seems weird at first and I suck at explaining, but it actually does make sense.)

I could probably give it another shot, but I don't know why I would. Qt seems to work very well for similar tasks and has the advantage of C/C++ libraries such as GStreamer.
I never really liked Qt. It's not bad or anything, I just never really liked the whole signal/slot mechanism and I miss the TableLayout layout manager. But this may be just because I almost never use it and lack the familitary :)


You have many multimedia stuff included in the java library (java.media.*), more than enough for simple tasks (and more than C++ without Qt offers ;) ). If you need something more powerful, you can always use other libs, like... http://code.google.com/p/gstreamer-java/ :p


If you really need it, you can also invoke native compiled code from java - http://en.wikipedia.org/wiki/Java_Native_Interface (I never needed to, tough)

If I could get applets to work, that would be great, but my browser plugin kept caching them, so I couldn't reload the page to test an applet. And the appletviewer didn't work at all. I said to myself, "FFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUU-" and played video games instead.
Can't help you there, I never made an applet.


Sorry for the offtopic, I'm just kinda sick of all the java bashing
 
Last edited by a moderator:
HTML5 is a world of hell right now.


Some browsers work for some features, others don't; you want transparent pngs to work? be careful; you want canvas to work.. be careful; you want svg's to work, be careful; people could be using opera mini with some js on the client, some on the server. Its truly a nightmare ..


The _promise_ is there.. it _could_ and _will sometime be_ great when all browsers work, bug free, the same way, supporting all these features; but for now, god help you, every browser implements a different subset of features, and a whole pile of different bugs :)


jeff


* edit: .. when you factor in handhelds; desktop, IE and FF and so on are reasonmably predictable, but its when you throw in handhelds or pandora or iphone etc, you go into the barrel


For fun I'll add to the java discussion; java is an okay language, derived from algol like most others we love; you can argue for/against the huge mega giant library that comes with it, and ou can argue for/againtst the fact every VM includes a different set of libs to try and lock you in and destroy the write-once mentality. But the biggest problem imho with java is that its a huge verbose language -- code to achieve a goal is 50% larger than C/C++ imho ;. its just more typing to express the same thing. (And as a result, people use giant mega IDEs like Eclipse, and auto-geneate 3/4 of their code, making big over-classed codebases.) Thats not java's fault -- the tools just lend to it to go out of control. Anyway, my thought is -- with C ase a baseline, you can say hava is +x% more typing to express the same idea, and the opposite is somethign like python which is -50% code size to express something. Whethor or not you don't mind spending X anmoutn of code to express it in java is your business, and entirely valid either way. (JVM's have a lot going for them, especially for servlets.) I just wish writing java was shorter, and that when someone uses their IDE to write hello-world I didn't get 25 classes and xml descriptors for it :)
 
Last edited by a moderator:
Well, yeah, W3C recommends that people would not yet use HTML5 because it's not ready. People use it anyway and then complain when a barely draft version of the standard isn't perfect. The standard still lives, and a good example of that is the web socket mess. Different browsers implement different versions of the draft, which are incompatible with each other. Stick to the features that work the same everywhere and you'll probably be fine (my current project is based around HTML5 canvas and works in every canvas-supporting browser I've thrown at it). Just keep in mind: it's not ready yet!


EDIT: typo
 
Last edited by a moderator:
Back
Top