by niftich · 10y ago · 0 comments
- People are stuffing websites into Electron and packaging it as a native application
- HTML/CSS/JS is considered 'hackable' because it's widely understood by today's semi-power-user audience
Although the article doesn't say it, this seems to imply that:
- Full-native development unique on each platform is considered too much effort, when you can get a cross-platform app with Electron
- Other platforms are not very 'hackable'; why is this?
Is this purely because JS has a higher mindshare and marketshare than [preferred platform language] on [preferred platform toolkit] on [preferred platform], or do HTML/CSS/JS applications actually tend to hit a sweet spot in terms of separation of presentation, view logic, business logic? Or is it about the view-understand-edit-deploy lifecycle being easier with HTML/JS apps?
I think that's related to the high fault-tolerance in Javascript. A good developer is good in any language, so she can work with Javascript. A beginner or even a bad developer can make things happen in Javascript, when that is not always possible in other languages. So the entry point level is so low that a lot of people is using it.
> Other platforms are not very 'hackable'; why is this?
I prefer strong typed languages. I use TypeScript when I have to do some JS work as it is easier to maintain in the long term. But that means that you need to know what you are doing before starting to do anything. Compile, fix errors, repeat.
I can see that for starters JS is more fun and "hackable", as it was BASIC for me when I started.
> I think that's related to the high fault-tolerance in Javascript.
Also, in Electron apps you can access the Chromium Dev Tools directly in the app (unless the app author has disabled it). Chromium's Dev Tools are pretty much the gold-standard for hacking during runtime.
... if you don't include any IDE with a built-in debugger.
1) http://programmers.stackexchange.com/questions/221615/why-do...
...Because it gets the hell out of they way and holds your coffee for you and doesn't slap it out of your hand and throw a tantrum because it was actually a medium coffee...and it gives you the simplest no-BS object/array literals you can get...IMO opinion everyone wailing and beating their chest bemoaning the fact that JS got where it is fails to understand that it got there because it the "UX" of coding JS is just a lot more pleasant - and you can treat it as a compile target and do your work in a more type-obsessed thing like Typescript if that's your cup of tea without imposing on the underlying "hackability" of the language.
I really don't think that:
{
"foo": "bar",
"baz": ["quux", 1, true]
}
is simpler than: ((foo bar)
(baz (quux 1 true)))
Quite the opposite, really. [["foo", "bar"], ["baz", ["quuz", 1, true]]]
making it a non-issue?With the right predicates, anything is possible grin
I think that context unavoidable: one can't just read a JSON value into a generic data structure, or even into a typed structure: one has to apply the types of one's business logic (e.g. 'user-id' must not only be a string, but a string beginning with either 'E' or 'C'). In that context (pun intended), then it makes sense for equality comparisons to be at the business-object layer, not at the freshly-deserialised JSON object layer.
Well, S-expressions, which can be used for Lisp code, but can also just be used for plain data.
> a lot of what I consider the "No-BS object system" occurs after the literal is declared - adding and manipulating properties, etc.
Yeah, it's definitely convenient to use, even more so than Python's objects. I prefer a stronger type system for my own software though.
(map (foo bar)
(baz (quux 1 true)))
But you might reflect on the fact that JSON uses an ordered sequence of bytes to represent an unordered collection of properties and values.In practice, you can use as much or as little typing as you want, and the compiler will occasionally tell you "I think you're doing something dangerous here", but even then you're only one <any> away from ignoring its generally good advice (or more sanely, you would annotate the ambiguous bits a bit better so typescript understands you really meant to do that.)
But otherwise, all the usual js hacks still very much apply.
Anyway, that's why typescript is my cup of tea|coffee.
Is it pleasant UX that you can put petrol in your diesel car because the nozzle fits? Would it be pleasant UX to have your bank let someone withdraw money from your account without ID? Bleach bottle with no safety cap?
Also the laid back kid of JS will throw a tantrum if the coffee is not a coffee. He'll throw the tantrum at your customer though (at runtime), not your developer (at compiler time). Which arguably is a good UX for coding but not the bottom line.
I like that the kid just holds the cup and pours it when I tell him to. If I wanted him to pour coffee and gave him a cup of beer, I'm ok saying that's my fault. I'd still rather have the kid. Having a guy that only accepts "Large cups of coffee" is necessary at lower levels (c), but keep it out of my scripting language.
In Java you get an annoying compiler error.
In JS you get a trashed engine at runtime.
Yeah, and good luck dealing with that remote API that now gives you an extra field in the JSON or XML, and your compiled client in a few thousand workstations needs to be updated and redeployed because of said fit.
Java C# and every other decent typed language has good serialization and deserialization support. The extra field poses no problem.
Yes, it's this. Full native development is awful since every platform is completely different, and other cross-platform solutions like Qt are a bit behind the web in terms of modern look and feel and developer base.
But Electron is also awful, since a hello world app uses 100mb of RAM.
Desktop GUI app development is horrible... meaning it's slightly worse than mobile GUI app development. GUI development in general is a horrid ghetto where your choice is between bad and completely proprietary.
Is it that awful, though? Most computers come with 4-16GB of RAM.
You can say that it would be better to share a common Electron instance, but it's not an argument against the idea of using web technologies for desktop programming.
Furthermore in the attempt to woo developers from one popular platform to another a myriad of solutions will appear to allow the developer to move their existing tools, methods, and general knowledge from their comfortable and familiar platform onto the new one.
I'd suppose anyone that has more than 5+ years experience and has moved between at least two types of platforms can point to examples in their mind.
Personally I dislike this habit of using tooling to solve platform movement and escape the time constraints inherent in learning to develop for a new platform; I can however see the attraction, because, it really does ease time and effort in learning something new even if to provide this easing it acts a buffer to any deep understanding of the target platform.
For instance, when FB used React Native for building one of their ad manager apps, they had 87% code reuse between iOS and Android (https://twitter.com/brindelle/status/618114397098102785) The implications that has on a company's eng organization are huge.
Another example is the code sharing between client and server in Meteor. That has big implications too.
The main reason Javascript is winning as the lingua franca is that it's pretty much the only language you can use in a browser. The main alternatives are things that compile to JS, like Babel, TypeScript, and for a while Coffeescript and Dart were gaining traction too. If browsers could run, say, Python, I suspect you'd see more Python used in this way as well.
I agree, but it is my experience that this always comes with a downside that you don't know some of the platforms you are running on and there are deficiencies. The Native is better argument
[1]: one of many boilerplates - https://github.com/chentsulin/electron-react-boilerplate
Patching the byte code and having it run is a little tougher...
I don't get why people don't understand its popularity.
HTML lets you put boxes on the screen and CSS lets you paint-by-number(id/name/selector).
If you aren't doing any of those things, I am very curious to know what exactly you are doing.
x += 2;
call(param);
data.key = cache[0];