Hacker Newsnew | past | comments | ask | show | jobs | submit | ahoge's commentslogin

Most of the weight comes from images. The average website (Alexa top 1M) contains over 1.4 MB of image data:

http://httparchive.org/interesting.php

Be sure to pick the most suitable format and to optimize your images. You can also try to serve WebP to browsers which support it. When it replaces JPEG, you save about 30%. With PNG8, it's somewhere between 5 and 50%. And with PNG32, if you substitute it with a lossy WebP, easily 80%.

Scripts come 2nd with ~363 KB. ES6's will thankfully help with that. Creating the structure of your application declaratively enables better tooling. Not only does this make your editor a lot smarter, it also paves the way for tree-shaking.

If you tree-shake your application, only the actually used library features will be included in the shipped bundle.


Those lines are showing up because the old algorithm can't produce all possible values in the 0-1 range. 32 bits of internal state simply aren't enough for that.

The problem is highlighted by the images in this article:

http://jandemooij.nl/blog/2015/11/27/math-random-and-32-bit-...


You can write your Angular 2 application code in ES5, ES6, TypeScript, Dart, or to-JS languages like CoffeeScript.

TypeScript is pretty popular and it does work really well. Writing larger applications in a team is much easier if there is tooling to assist you. With most projects, about 80% of the work is maintenance and tooling does immensely help with that.


> Want to bang up a quick solution, as in MVP? Use bare-bones Javascript

Actually, adding the bare minimum of type annotations (fields & function signatures) and type casts (e.g. casting whatever you get from querySelector into the concrete type of element) results in fewer key presses, because you can auto-complete everything and because you get additional machine-assistance like call tips and type checks.

So, you'll be actually faster if you add some types. Type inference does cover quite a lot. In practice, you'll need very few annotations and casts.

This Dart demo, for example, only needed a single type cast to be fully typed:

https://dartpad.dartlang.org/e23e4d137570c652591e


WOW ! this code is impressive - do you have more examples like this?


Man type inference is so nice.


Edge 13 does support generators.

http://kangax.github.io/compat-table/es6/



> Research found that the number one cause of errors in learning Python was its case-sensitivity

You don't make that kind of error in other case-sensitive languages which offer better tooling.

E.g. you start writing "canv" and auto-complete that to "CanvasElement". You just auto-complete everything. And if you actually do screw something up, you get a squiggly line and a hint.

Simply ignoring all kinds of errors does not make the language easier to use. In JavaScript, for example, there are many cases where semicolons can be omitted. However, they aren't actually optional. There is a list of exceptions. It didn't actually make the language any easier.

Another example are things which should be type errors (`'foo' - 123` and so forth), but you get NaN instead. Or when you go outside some array's bounds you just get undefined instead of an exception. This stuff does not make the language easier to use.


E.g. you start writing "canv" and auto-complete that to "CanvasElement". You just auto-complete everything. And if you actually do screw something up, you get a squiggly line and a hint.

By the way, I have all of that when writing Python, using PyDev on Eclipse, and other IDEs certainly offer the same.


Atom and VS Code are built on top of Electron.

http://electron.atom.io/


I'm quite happy with VS Code and this Markdown CSS theme:

https://github.com/mahonnaise/vs-code-markdown-theme

The automatic table formatting was pretty cool though (even if it's purely cosmetic).


The timing of the beam racing down the screen is used by the more modern guns which were used by the SNES, PlayStation, or the Dreamcast.

So, it's really not much of a "myth". Most light guns worked that way. The zapper is an outlier.


Even the Sega Master System used that technique.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: