HNHacker News
TopNewBestAskShowJobs

raquo

3,253 karma · joined March 15, 2008

submissionscomments
raquo··on View Counting at Reddit
^ For big sites like reddit, which is why you don't typically run into this when using GA on your personal blog
raquo··on Ask HN: Do you think Electron is good for building Desktop Apps?
Wow, lots of unbalanced Electron hate in this thread. Sure it's ugly, but it's also an extremely productive and empowering platfotm, that's why it's so popular.

Building a web app and a cross platform desktop app is a common business requirement nowadays. Electron is the fastest way to achieve that with a small team or if going solo.

In many cases your only other feasible alternative would be to use Chromium Embedded Framework or system web views. Those two let you reuse your web app UI but are progressively more work than Electron. Those options don't require packaging a node server though.

PS. I don't think Slack is slow because of Electron. Other Electron apps like VS Code are fast.

raquo··on React v15.5.0
You could make some of the same arguments against prop types - what if you miss them, what if they are incorrect (too narrow).

Regarding third party libraries, with prop types you are effectively writing your own bindings to the parts of those libraries that happen to go through your props, except you fail far away from where the error is produced.

Prop types are also a very ad-hoc solution to a very general problem. Why are props for UI components especially deserving of type checking? What about the rest of your application code? Event your components' state is not worthy of type checking?

With JS or typed-JS languages like Typescript or Flow you will never get full type safety (Flow is better at safety than TS if you're interested). For me the solution is to either go 80% of the way for 20% of the effort with those languages, or go full Scala.js or something that is actually type safe. And the latter has many goodies like https://github.com/lihaoyi/autowire to make API calls typed.

raquo··on React v15.5.0
If you don't trust your JSON input to be of proper type, you should validate its type immediately when you receive it, before you start fanning it out to your code. Spreading this work to prop types just makes it harder to keep track of it, and harder to find the source of the problem.

Besides, some of that broken JSON data might never even be passed through proptypes (e.g. if that data lives only in a component's state).

Also, there are compile-time solutions to this in some compile-to-JS languages, e.g. like https://github.com/lihaoyi/autowire for Scala.js

raquo··on React v15.5.0
It is though. Runtime type validation is just a clutch that's needed when you don't have compile time validation.
raquo··on Ask HN: What do you want to see in Ubuntu 17.10?
- FLAVOR: Ubuntu Desktop

- HEADLINE: Saner App Switching

- DESCRIPTION: every other time I alt-tab I am baffled by what window gets focus. I have to actually think to use this feature. Compiz is no better. OSX has this done right. Another somewhat related problem is sometimes a window is not raised when expected but I'm not sure when exactly that happens. Something like "if an app is already open and you try to launch it" but more subtle than that.

---

- FLAVOR: Ubuntu Desktop

- HEADLINE: Universal Ctrl+W command to close windows or tabs

- DESCRIPTION: Somerhing I took for granted on OSX that I thought was coming from Linux, but apparently not. Yes, you could remap the close shortcut from Alt+F4 to Ctrl+W but that closes the window in browsers instead of closing the tab. And some apps don't react to this key binding at all.

Another thing I miss dearly is a universal shortcut to open an app's settings (Cmd+,) in OSX.

---

- FLAVOR: Ubuntu Desktop

- HEADLINE: Broken Apps in App Center

- DESCRIPTION: Even apps that are featured (on 16.04 which is latest LTS) like Maps have tons on 1-star ratings because their core features are broken. I installed myself to verify. That's just embarassing compared to other app stores.

raquo··on VPNs Are Absolutely a Solution to a Policy Problem
And yet anyone who says crime is not a problem worth fixing because we have guns will be laughed out of the room.

And that's despite crime being a very hard problem to fix. The privacy problem we're talking about here is actually trivially fixable with legislation alone.

raquo··on Ask HN: Will front end development ever move away from JavaScript?
There are plenty good languages today that compile to JS: Scala, OCaml, Clojure, just to name a few. And if you really like JS but want types, check out Facebook Flow, it's better than Typescript even though it's not as popular.
raquo··on Ask HN: Is there any apps out there built using single lang for the whole stack?
For a real life Scala.js app see https://github.com/jducoeur/Querki
raquo··on Trump’s F.C.C. Pick Quickly Targets Net Neutrality Rules
Wireless internet is not a solution – it's very obviously inferior to wired if you don't need the mobility. More expensive, lower bandwidth, higher latency, lower reliability.
raquo··on Not Everyone in Tech Cheers the H-1B Visa Program
Hm indeed, that seems to be the case now. They must have updated the rules since the last time I looked.
raquo··on Not Everyone in Tech Cheers the H-1B Visa Program
> What stops this from happening in the Schengen Area

EU countries are much more uniform than the rest of the world in their level of welfare support and social development (e.g. UK and even Portugal are much more alike than say Bangladesh and the US).

Besides, there has been a lot of movement from poorer countries to richer countries within the EU, and many people in the richer countries are angry about this. See Brexit etc.

raquo··on Not Everyone in Tech Cheers the H-1B Visa Program
> The entire industry is completely unregulated despite putting the nation's critical infrastructure and economy in grave danger, which artificially drives up wages by externalizing the risk onto everyone else.

I don't see how adding regulations to ensure safety of critical infrastructure could possibly reduce developer wages. If anything, they'd be increased because now you need more of them and they need more skills.

raquo··on Not Everyone in Tech Cheers the H-1B Visa Program
You can change companies, but your ~7 year wait for US permanent residence will reset. So you basically can't change companies if you intend to immigrate.
raquo··on High-Speed ES2015
sjrd is the author of Scala.js, he meant that strong mode support is now defunct, not Scala.js. Scala.js is doing great!
raquo··on International Entrepreneur Rule
FWIW Canada beats US out of the water on this one.

You can immediately become Canadian permanent resident by merely LOANING the province of Quebec $800K for five years. At current interest rates your actual monetary loss would be ~$80K.

You don't even need any qualifications. You don't even need to live in Quebec afterwards, you're free to move anywhere.

Oh and you can become Canadian citizen after three years of living in Canada, although because Canada does not reliably track people at its borders you can just fake passport stamps and other stuff. Recent revelations showed that people have been doing that at massive scale.

raquo··on 'Tooth repair drug' may replace fillings
You know what happens when other people sleep. It's not an issue.
raquo··on 'Tooth repair drug' may replace fillings
Well, sleep and cruise ships don't destroy and copy your body. Teleportation would be equivalent to being killed the way I see it, until we get a better understanding of conscience at least.
raquo··on $2T in Proceeds of Corruption Removed from China and Taken to US, AUS, CAN, NL
That home ownership rate includes everyone who lives in a dwelling owned by their family, so it includes the youth who lives with their parents because they can't afford to move out. Besides, all the home owners I know are not happy about constantly increasing prices either. Many of them think it's unfair, many don't like the foreign inflation aspect, and even pragmatically speaking it's harder to jump to owning a bigger dwelling now. So I don't know why this is going on, but it's not because most people want higher housing prices.
raquo··on $2T in Proceeds of Corruption Removed from China and Taken to US, AUS, CAN, NL
Don't know their source, but I can confirm that relevant Canadian laws are wide open for abuse due to both being toothless and because of near zero enforcement, at both federal and provincial (BC) levels.

You can google how CRA actively avoided auditing foreign buyers "for fear of racism allegations" (yeah right) or how people bring hundreds of thousands of dollars in paper bills on themselves and their children, paying only $2.5K if caught (cheaper than Western Union!).

Or the latest Vancouver 15% foreign investor tax designed to appease the population, but wholly ineffective because it relies on self reporting which no one ever checks and allows for other obvious loopholes. Much better proposals were ignored in favour of this purposely flawed one.

It's amazingly fucked up, I'm surprised Canadians are taking it so willingly.

raquo··on Be Careful with Python's New-Style String Format
Yes, but it's not obvious how to sanitize input in this case, or that it even needs sanitizing. Formatting a string sounds pretty innocuous.
raquo··on Apple to slice iPhone production 10% due to sluggish sales
> I'd want them to be super fast without the crazy slow animations

I wonder if you mean standard-duration animations or their really-slow variations. Adding Shift to any OSX hotkey that involves animation will slow it down 20x or so (e.g. Cmd+Shift+F3). I guess it was originally introduced for show-off purposes, but it's weird how that still exists.

raquo··on Larry Page is pouring millions into flying cars
I don't think L/D of more than 10 is realistic for a compact VTOL aircraft even in cruise mode, and then there's the vertical take off and landing component that will cause further inefficiency especially on short trips. But at the same time I don't think it matters that much.
raquo··on An American airline wins the right to weigh passengers on its Samoan route
"Unrestricted junk food marketing + 100% sedentary lifestyle between sitting in the office, driving, and watching TV" explains mass obesity trends better than anything else, no pandemic needed.
raquo··on Offline First – A Better HTML5 User Experience
I've once built a system (an outliner app) that actually encodes intent, and uses a command queue ("transaction queue").

Intent could be for example to insert this new item as a first child of that other one, or to move these items to a position right before some other item, or to set font size on this item to 4.

The data structure was a tree of item objects linked via next/prev/children/parent. Automatic conflict resolution works wonderfully in this case.

raquo··on Ask HN: How long did it take to release your side project in 2016?
Damn I really like those glitchy visuals.
raquo··on AdNauseam: Fight Back Against Advertising Networks and Privacy Abuse
Package & sell.
raquo··on Yahoo installed a backdoor for the NSA behind the back of the security team
Lots of secrets scale to hundreds of people just fine, and are enforced weaker than with a prison sentence. As far as any of those people are concerned, they are now actively monitored in the name of national security (same reasoning as why the NSL was issued).
raquo··on Yahoo installed a backdoor for the NSA behind the back of the security team
All that would accomplish is that you and everyone you sent this letter to would now be subject to another NSL with a gag order, and your fix would be undone.
raquo··on One More Sign World Is Shrinking – eBay Is for Suckers
You'd need to also record yourself putting a real phone IN the box when you're shipping it, but it seems that even if you did, your evidence would just be ignored by ebay.
← PreviousPage 9 of 31Next →