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

It's pretty bad in Canada - you get really convincing scammers pretending to be our taxation agency pushing you to pay back taxes in iTunes Giftcards.

This is an obvious scam, but for people who aren't up on this and fearful of "the man" I expect these kinds of scams work for every 1 in 100k people at best and are still probably lucrative enough for them to keep going.

The answer for the OP problem and the Canadian problem are the same: the government never calls you, Microsoft never calls you, no tech company will ever call you.


There was a fascinating story I read (which now I obviously can't find), which explained why spam emails/pop-ups appear to be so bad. It's because the scammers don't want thousands of responses, they want tens of responses from people who'll believe a shonky looking scam is real. Allows you to triage your potential market down to those more likely to complete the second more expensive (needs a scammer) and unbelievable (government wants taxes in gift-cards) step.



the government never calls you, Microsoft never calls you, no tech company will ever call you

And none of them will ever ask for payment in gift cards.


But then you're forced to use React...and as soon as you need to do anything outside of what it provides it all falls apart which happens pretty quickly in my experience with it.


You don't have to use React. The template gives it to you, but if you delete all the code and never import React, you're never using it. I use CRA nowadays for either simple vanilla JS/SCSS brochure-ware sites, or for simple TypeScript sites


What have you been doing that React doesn't handle?

I'm one of those people who is very, very suspicious of imports, and barely ever uses anything outside Vanilla JS, but even with that mentality I have to admit that some libraries have their place. These days I usually use Preact (basically a stripped-down React) and I've not really come across much that it can't handle.

The key for me has been to just write isolated components, and avoid the "full page application" anti-pattern that is so common in web applications today. React doesn't force the anti-pattern on you like other frameworks, so I've had pretty good luck with this. It results in fairly clean, reusable code, and users see positive benefits because it allows me to create consistent, predictable interfaces.


I’ve been doing React for years and haven’t experienced this. What kinds of apps are you building?


React Router used to be a mess. And should I use Redux? I thought it’s not cool anymore. If I do, do I store everything in a global state? Maybe I’ll use Context and Hooks. Or was it HoCs? And what about mobX? I heard it’s like Vue. I like Vue. And I absolutely need something to handle requests. Saga? Maybe some GraphQL? Now that I have my views, my state, and my data, how do I test this? Jest or something else? But why write tests if I have Types! How to configure TS? A few any never hurt anyone, did they? Too many questions. I’ll let Create React App answer this for me. Or is it Gatsby? Or even Nextjs? Oh, and is Lodash the new Underscore? And what is different about those and Ramda? We need more FP! But how do I structure my Code? Dan “Daddy” Abramov tells us to organise it any old way. But how? [0]

Angular and to a lesser extent Vue give you more direction.

This is of course not inevitable in a React project, but it does take good technical leadership not to be hindered by analysis paralysis before you even set off.

0 - An exaggerated summary of what I gather on various forum and discussions.


Everyone worries about these choices in react, but you don't need to, for most apps, they're all good choices: use redux or mobx, doesn't really matter. Use lodash or underscore, doesn't really matter.

There are minor advantages to some of the tools, and the nice thing about the react ecosystem is that it lets you pick if you really need to, but for getting started, just pick one and move on.

IMO this is highly preferrable to the angular world, where some things just can't done without digging through poorly documented internals (at least this was the case wirh v4 when I last used it)


> Everyone worries about these choices in react, but you don't need to, for most apps, they're all good choices: use redux or mobx, doesn't really matter. Use lodash or underscore, doesn't really matter.

I'd argue that they're all bad choices.

Redux/Mobx are just causing you to use global state, which forces you into a single-page application anti-pattern. I've stopped using either and my code has become massively less complex.

Lodash/Underscore are massive libraries that you end up using only a few functions from. Many of these functions can be written in <10 lines of code yourself, and some are equivalent to ones that already exist in newer versions of vanilla JS. In the latter case I'll often use polyfills, and remove them as support for the new features gets good enough.


Mobx state is local by default. Observable are just scoped to the component they are created in.


That's true, but in that case observables are little more than syntactic sugar over callbacks. The way I've seen them used in codebases a lot is to decrease the pain of global state--but that's only delaying that pain, and global state SHOULD be painful.

That said, I suppose the answer is just, "don't do that". I may have spoken out of ignorance of how people frequently use mobx, since my experience with mobx is very limited. I probably should have constrained my statement to only talk about Redux, since I have a lot more experience with that.


I agree. And since much of that is often superfluous, you end up with a “minimal” setup. Though this does require at least one experienced dev to make those choices.

And my experience tells me that fewer than 1 in 10 React devs can make those calls.


I've used React for a while now, and I agree with you that most of these libraries are pretty garbage. I've solved this problem by just not using any of them.

These days I use two libraries: Preact and Immer. And I only introduce Immer to a project if state management becomes a pain point in the project, so I often don't even use Immer. I import these in my project with:

    <!-- in my base HTML template -->
    <script src='path/to/immer.js'></script>

    // in my JS
    import { h, Component, render } from './path/to/preact.js';
    import produce from immer;
This is sort of janky because Immer doesn't provide a real JS module, but basically all this does is pull in a total of four variables: h, Component, render, and produce.


i think this is what happens when you do a lot of reading about web dev instead of just building and trying things out


- web components

- runtime plugins

React is great if you stay in the design constraints, which is to be expected. This covers the vast majority of web apps.

edit: [removed svg snippets] I think I was confused with WebComponents not supporting svg elements that don't include the root tag


The app I currently work on is 100% runtime plugin based. React has not been an issue there at all. I haven’t tried using web components, though, so can’t speak to that.


it's not impossible, I have something working with react-registry. With Vue it would work out of the box since it comes with a registry out of the box.


>need to do anything outside of what it provides

Can you elaborate on what you run into?


They have an eject function which lets you modify The environment and extend it however you want.


This is awsome for web development too! You can have two tabs open to test out sending messages to eachother, you can have an admin and regular session open simultaneously. So usefull!

Firefox Dev Edition with Multi-Account containers is my GOTO web frontend dev browser.


This extension is super useful for that, it lets you instantly create new temporary containers: https://addons.mozilla.org/en-US/firefox/addon/temporary-con...


Yup - I LOVE temporary containers. I feel so cripple when developing outside of Firefox now.


That's why the communists take the guns first.


“Under no pretext should arms and ammunition be surrendered; any attempt to disarm the workers must be frustrated, by force if necessary.” - Karl Marx


Name an actual communist/socialist regime that didn't confiscate weapons first. China, NorKo, Venezuela, Soviet Union - hell, even the Nazi's confiscated weapons from the Jews "legally" before loading them into the trains.

Gun confiscation is the canary in the communist coal mine.


See present day Virginia.



The lesson I learned from Hong Kong is you will never take the 2nd Amendment from me. Just come and try and take them. Take a cursory glance at what is going on in VA right now to know what is in store for you if you do.


I think that the protestors would lose local and international support the moment they started shooting. Most successful protest movement have tried to stay nonviolent.


This line of thinking never made sense to me.

How are you going to defend against SWAT teams with whatever guns you have?

Organize a militia? Then how do you defend against the army?


We've run this experiment several times and gotten the same result every time. Hence the forever wars. Hillbillies with guns and IDEs have shown to be pretty effective against militaries.


By being willing to take significantly more casualties, usually because the fighters are ideologically motivated. If you want to be a martyr, keep your guns. How much do you want to bet you'll still be around to see that bright future you take up arms for? Or that once you win, the leaders of your rebellion won't toss you out onto the streets? If you want to stay alive, being a refugee is a much better bet.


The only reason being a refugee works is because places like America exist where everyone wants to go. You know, the place where everyone has guns...


"...Hillbillies with guns and IDEs..."

ROFL. You most likely meant IEDs.


Lol! Those too! (Auto correct for the win?)


Against foreign militaries.

Even if you are right, that would imply that the US would enter a protacted civil war that would impoverish everyone. I have a feeling popular support would swing away from the millitias very quickly, just how long do you think millenials will survive without their avocados, yoga classes and fair trade locally brewed artisanal beer.


> Against foreign militaries

I'm not sure why you started with this. Your odds are way better if it's against your own military, especially in the West. There's going to be a ton of defectors. Have you met anyone from the South? Those same people who are extremely anti government are usually vets. This isn't just speculation either, there's very clear examples.

But something people constantly forget is that you can't rule the dead. People are a resource. You need them to produce your economy, make your food, tax, etc. But there's also an argument here on the converse side, to make your people rich to make your ruling class even richer. But short term thinking...


Just take a look at what is happening in Virginia right now - police and veterans are siding with the militias in opposition to the incoming gun laws. I have a hard time believing that the men and women of the military would side with the government when the orders are to kill your neighbours.

Maybe in a failed state like California or New York, but that's not the entirety of America.


one dude armed with pretty much any portable weapons is not gonna be able to hold out against police for too long. still, you read a lot of stories of one or two armed citizens who can resist arrest in their home for a couple days. in cases where there are more citizens resisting, this can go on a lot longer. the waco siege lasted 51 days. the police literally had to (or maybe just didn't care enough not to) drop bombs on a rowhouse to end the 1985 MOVE standoff.

a bunch of people with rifles inside a building can be pretty hard to deal with if the government isn't willing to level the place. a large scale revolt of armed citizens could never "win" against the us military, but the conflict wouldn't leave much left worth controlling.

decisions are made in the margins. it is much less risky for a government to impose unpopular laws on an unarmed populace.


How are we going to do that? That same way the rice farmers in Vietnam kicked the ass of the most powerful military in the world.


It wasn't rice farmers who took on the US. It was the battle hardened vietnamese army who fought imperial japan and then imperial france for many years. Also, even though they ultimately won, they didn't really kick ass. More than 4 million vietnamese died in the vietnam war. Less than 60 thousand americans died. It was one of the most lopsided bloodbaths in human history. That's with tons of sino-soviet military aid to the "rice farmers".


I don't agree with your premise, but for the sake of argument let's say that you're right and armed civilians have no chance of winning against an organized state military.

Don't people have the right to die trying to win their freedom?


Somebody that knows zilch about Rust with a question: I like to write CLI tools with Go, the built-in libs and the simpleness of the language make it really easy for writing good tools quickly. What advantages does Rust have over Go that one would use it for this purpose?


I don't know the current state of go package management but I do know the equivalent Go project cited Rust's package manager Cargo as a good reference for developing their own. You forget Rust's standard library is quite minimalist and you get to sample competing libraries which often use interchangeable interfaces. In particular there are several crates (libraries) which make handling CLI arguments convenient.

If your code is stateful the typestate pattern is particularly easy to write in Rust - http://cliffle.com/blog/rust-typestate/


I've never heard of the TypeState Pattern, thanks for the link and it even got me interested in getting to know more about Rust. Thanks a bunch!


I'm not certain, just learning it. You might find this blog post that does a code review of ripgrep interesting, though. It's a deep dive into a serious-scale cli tool.

https://web.archive.org/web/20190401042439/http://blog.mbrt....

Here's what the main function looks like:

    fn main() {
        match Args::parse().and_then(run) {
            Ok(count) if count == 0 => process::exit(1),
            Ok(_) => process::exit(0),
            Err(err) => {
                eprintln!("{}", err);
                process::exit(1);
            }
        }
    }


As terrible as this is, access to Wikipedia is hardly a "right".


If a right is something that makes society better if people have it, then access to Wikipedia or something like it is definitely a right.

And in fact it falls under freedom of speech and freedom of the press.


> If a right is something that makes society better if people have it.

That's not what a right is. Saying that access to Wikipedia is a right implies the ability to coerce somebody to give it to you if you lack it. At best it's a privilege.


YouTube has become the thing that it was originally created for. Thanks Google.


* created to avoid.


VS Code does a lot more than "edit text" even out of the box with no extensions.


Personally, I think the best thing to come out of Fortnite is the revenue stream making it feasible for Epic to create its own game store and compete with Valve/Steam.

Steam had been pretty stagnant for years until EGS came along and started poaching exclusives (opinions of this tactic aside) and got them to finally improve their platform.


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

Search: