840 karma · joined Dec 21, 2012 (13y ago) · 954 submissions
comment 9y ago · link · parent
Falsely shouting fire in a crowded theater is ALSO protected by first amendment (Supreme Court reversed their opinion in 1969 btw). I clarified more in this other comment[1].
comment 9y ago · link · parent
Under this, distributing communist fliers is protected by the first amendment. What is not protected is Antifa's call to 'immediately' riot against their perceived enemies. The element of time is important in imminent lawless action test.
1. https://en.wikipedia.org/wiki/Brandenburg_v._Ohio
2. https://en.wikipedia.org/wiki/Shouting_fire_in_a_crowded_the...
comment 9y ago · link · parent
It is one thing to quickly be able to understand that the person is doing a xor, then a rofl and then a lol of each element of an array, and a whole another thing to understand what the combination of these three actions over an array means. The python school of "code is read more than it's written" heavily stresses on explaining how easily the code should be understandable the first time someone reads it, but not whether it's easy to reason about or not.
The beauty of declarative style programming isn't to get more readable code immediately, but rather that once you understand the vocabulary, how easy it is for you to understand and reason about the code.
For instance, imagine reading a novel which is written like this:
"After Jack was done from the place where he went to do things for money everyday, he entered an establishment which served drinks that get you inebriated for money. This establishment was one he frequented regularly and preferred it over the others. He asked the man behind the counter for a wheat fermented brewed drink. After putting the drink to his lips and pouring it in to his mouth, he felt a sense of calmness enter his mind. It pushed all the thoughts which occupied his mind away, as he earlier desired before entering this establishment."
As opposed to:
"Jack really needed a drink after hard day at work. He went to his favorite pub, and ordered his favorite beer. After finishing the pint, he finally felt relaxed."
The Python philosophy (which is permeated everywhere in imperative world) is to describe everything in the simplest possible terms just in case there are people who may not understand what work, pub, beer, bartender, and relaxed means. But this just prevents from understanding of the actual purpose of the code.
This is at least the basic philosophy behind not using for loops everywhere.
comment 9y ago · link · parent
I'd take those ex-soviet commonwealth welfare abusers anytime over welfare non-abusers any time.
These projects are one of the nicest and the most well maintained projects in the city. They bribe the city housing dept to win the lottery, and take the money they would have to spend on purchasing the property to maintain it.
Its almost like giving UBI to those who don't need it, give you a better society, and giving UBI to those who need it, you get more 'needs'.
comment 9y ago · link · parent
Composing xor, rofl, lol isn't any better (esp in terms of readability) than it is individual maps.
What would be better is this:
const makeHilarious = compose(rofl, lol, xor);
things
|> pluck('bar')
|> map(makeHilarious)
|> reduce(differenceWith('id')comment 9y ago · link · parent
Ideally this is how it should be written for maximum readability.
things
|> pluck('bar')
|> map(xor)
|> map(lol)
|> map(rofl)
|> reduce(differenceWith('id')
The code is written equally well without using pipe operator but the proposal to introduce it is in works [1].Here is it using lodash (not even lodash-fp), and this is going to do a single for loop when executing because this is lazy.
_.chain(things)
.pluck('bar')
.map(_.xor)
.map(_.lol)
.map(_.rofl)
.reduce(_.differenceWith('id'))
.value();
It's no less readable than the code you'd write using using unfolded transformations.comment 9y ago · link · parent
For instance, if you want to write something on the log, then loop and collect everything into a single array (using map) and then perform the side effect with a single command (which is a lot more performant in most cases).
For asynchronous side effects, create an array of promises using a map, and then run a Promise.all() on that array if you need to resolve all of them.
But again, if your experience is different or in your requirements, it is not possible to create a map/reduce/filter transoformation for side effects, then I'd love to hear about it.
comment 9y ago · link · parent
As I said, there are fast plugins for that task and slow plugins. Command-T and Ctrl-P are megafast because they are run as native binaries.
comment 9y ago · link · parent
I joined that school when I used FP for my own project (I use Elm, and RamdaJS+JS) and found how amazingly handling bugs and complicated logic became. This clearly came with a higher barrier to entry for other people to understand my code (but this cost only needs to be paid once, I look at other people's functional code and I got no problem understanding it btw).
I understand large companies where logic needs to be written so simply so that anyone can understand it (Python philosophy "Code is read a lot more times than it is written"), but they don't end up with fewer bugs, it's just a LOT LOT BIGGER codebase, with 5 million for loops, doing 1500 things in one for loop.
In fact, before I fully went to FP side, I started writing my JS code without using for loops or forEach. Even this simple change of writing code using map/reduce/filter/drop/reject/take etc made code lot simpler to maintain, reason with, and eliminate bugs.
comment 9y ago · link · parent
You don't because the purpose of all the actions you take while editing text is to not think about it. As a non-vim users, you have trained yourself to not think about the time you spent editing text. You want to move an object of options from one file to another file and move it to another object (something which I did moments ago), then the moment you come to the conclusion that you need to make that change, you start using your mouse, select the object, Ctrl-C, then move to the other file, Ctrl-V, and press the shortcut to auto format. But you don't think about it any more than you think about switching windows when moving from one app to the other.
In vim too I probably think about it no more than you do about your own text editing, but with vim, I don't press modifier keys, I don't reach out for mouse, and opening a file is the same speed as IntelliJ (an editor my coworkers use), using Ctrl-P, if not faster. Traversing files is much faster. Splitting screen and navigating is a billion times faster than what you can achieve on any of these editors. All without using the mouse or modifiers.
But these are only small benefits when compared to the biggest difference I've seen between Vim/Emacs users vs non-Vim/Emacs users. Take for instance, few minutes ago I was doing pair programming with my coworkers, and I noticed that there were thousands of productivity shortcuts that he wouldn't use, and he is not the only one, majority of non-vim using people I've met, fail to make use of these productivity enhancements.
* Pressing Ctrl-C/X without selecting text just cut/copy the whole line. * Pressing double click on a line selects the word, triple click selects the whole line (or paragraph in text) * Using Alt-Tab to switch windows * Ctrl-Backspace deletes the whole word/token * Ctrl+Arrow key for navigation * Split Screen, nearly all their editors support split screen functionality, but opening multiple files in multiple panes is like crazy person talk
Even with this minor experience I have with their editors, I look like a magician using their IDE. Not to mention how slow their editor is while trying to help me by auto-completing. I was done typing the name of the class before their auto-completion kicked in. You call that slight convenience of marginal utility, but to
My point is that, productivity enhancements is a desire people have, which makes these people to move towards Vim/Emacs. For the people who don't even use Ctrl-A to select the whole text, they fail to see what they're really capable of doing on their editor.
> As I've said, I've used Vim for 15+ years (still do, a decade after every time I'm in a shell). I've known all these shortcuts, used them, etc. Haven't seen it make any great difference in that respect.
Considering you complaint about speed of navigating between files, I highly doubt that you know "all these shortcuts", because even if you do, the philosophy of vim is to keep optimizing your workflow, so you create a shortcut for shortcuts. I think it would be a cool idea to hold competitions where two people are given a codebase, and their own completely configured editor on the same machine with same processes running and then they are asked to do a number of tasks, like open UserController.js, UserView.html, UserService.js and refactor a variable and change some data.
comment 9y ago · link · parent
For instance while writing functional Javascript code, I never curry my methods, instead I use helper methods from functional libraries such as lodash or Ramda to curry.
Where currying is useful is in cases like this:
```javascript
//Definitions
const filterUsers = (fieldName, value, users) => //Implementation
const sortUsersBy = (fieldName, users) => //Implementation
const takeUsers = (count, users) => //Implementation
//Without currying
UserService
.getUsers()
.then(users => filterUsers('active', true, users))
.then(users => sortUsersBy('age', users))
.then(users => takeUsers(3, users));
//If these methods were curried
UserService
.getUsers()
.then(filterUsers('active', true))
.then(sortUsersBy('age'))
.then(takeUsers(3));
```
Here is a video which explains proper uses of currying (and does it very well) [1]. Here is another article if your coworker start using functional programming and you want to stop them [2].comment 9y ago · link · parent
Taxi Cab industry is a heavily regulated industry which was screwing only one group of people, i.e. the consumers. This is why there is little love for the cab industry in America. For more economic analysis on this, check out the lecture by Murray Rothbard given in 1989 at NY Polytechnic [2].
1. https://cityroom.blogs.nytimes.com/2011/10/20/2-taxi-medalli...
2. https://mises.org/sites/default/files/Government%20Cartels%2... [Part about taxi cab medallions start from 29:21]
comment 9y ago · link · parent
So tell me why don't multinational companies pay less to their American engineers, the same as their Canadian engineers?
> Canadians do pay more for things than Americans do
I oversimplified when I said "paying higher", it's more about profit margin. So lets say if a market is located in a much more geographically difficult area then people of that market could be paying more, but still that wouldn't result in higher profit margins when compared to a market which is easier to access.
These restrictions could be geographical, economic, political, regulatory, etc or a combination of these.
comment 9y ago · link · parent
Dtube (distributed Youtube) is see it for yourself. People are complaining about alt-right and conservative refugees being the early adopters of any distributed/decentralized/free speech platform:
https://www.reddit.com/r/dtube/comments/6zlza1/please_dont_m...
comment 9y ago · link · parent
That's not how prices work. Labor isn't a consumer good, wages aren't determined by the employer, they are determined by the goods they're eventually producing which the end user or consumer is willing to pay. If they pay less than what end user is willing to pay, then they lose labor to competition, if they pay more, than the increased price of the final good results in consumers going to the competition.
Canadian employers can't control the fact that their consumers don't pay higher prices for the things they producing/providing.
comment 9y ago · link · parent
For instance, if someone says that alternative medicine fails for n different reasons, would you say that the person is committing Nirvana fallacy or that there is something to say about the fundamental failures of alternative medicine?
The qualitative fault I'm trying to point out is that trying to tax 'rich people' is a failed attempt because no matter how effective you can implement your tax measures, at the end of the day people can move to other countries and your own country starts to suffer more than it benefits from the increased taxes.
It is a Nirvana fallacy if someone says "No matter how hard you try to curb murders, serial killers always keep finding new ways to commit crime", because at the end of the day, if all the serial killers move out of your country to a more serial killer friendly country, you don't actually suffer, you did your job.
On the other hand, in terms of taxes, you don't want your tax paying population to move out or be rendered incapable of producing wealth. That kind of 'equality' is not worth it.
comment 9y ago · link · parent
This would eventually reach to a point when new currency would die out in the hands of the old currency. Why? Because what Indian govt has done is not 'demonetization' rather they have announced that they would stop printing more old currency and start printing a new currency. But it's like USG issuing Bitcoin like currency (without the electronicy parts, but with the fixed supply, and anonymity of cash).
In other words, the old Indian currency is the perfect black market currency created, and it will just keep gaining value over time as new currency keeps losing value.
My prediction was for at least 4-5 years, but pleasantly surprised to have it come true in only a few years.
comment 9y ago · link · parent
But aren't you just saying that when you have $1 Billion then paying $500k more to a contractor doesn't seem that bad based on the net benefit it would bring to have a dream home.
But imagine if this was a charity (something which govt is, if we look at it a certain way), that inefficiency means more people could have benefited out of it.
comment 9y ago · link · parent
This is how Grammarly's premium edition would have corrected your post:
> Grammarly is a great tool. I never forget to check my article ~~with~~/on (Incorrect correction, think 'with' makes more sense here) it before publishing. If you had asked me a few years ago how much would anyone pay for a Grammar-checking tool, I would have guessed it would be no more ~~that~~/than (Probably a typo on your end, rather than a grammatical mistake) $3-4 / month. Grammarly charges $29 a month. Of course, its value can be measured with the improved communication but $29 _is_ a lot. It's amazing that it convinced people that it's worth it.
>~~High~~/The high (probably the most common mistake non-native English speakers do) price point is the only reason why I haven't gotten around purchasing its premium plan even though I think it would very beneficial for me.
comment 9y ago · link · parent
If you're already doing all these things, what's illegal voting added to it.
comment 9y ago · link · parent
Exactly, and it isn't just 'Work Ethic', I wanna work with these guys [1] in 'Silicon Valley' tv show who would go around doing a Jerk off calculation just because it is a fun calculation to do. Not just people with strong 'Work ethic'.
comment 9y ago · link · parent
The way I convinced my buddy to get out of that 9/11 conspiracy mode was to ask him questions about the shitty conspiracy theories he thinks US govt comes up with.
For instance:
* Why claim that it was an airplane which hit Pentagon, when they can claim that terrorists got hold of a rocket launcher, or a cruise missile. Since they claim that it was a CIA agent who launched the missile, then it would be even better to claim that there is a 20th terrorist who is hiding among us, and thereby getting more advantage of what they did by claiming conspiracy (i.e. to create an environment of panic in public).
* After I told about the ridiculousness of the 'conspiracy theory' like the point above, they would talk about Hitler's quote "bigger the lie, the more they'd believe it". When I tried to do more research on it, it turns out that there is no documented proof of Hitler claiming bigger unbelievable lies. In fact that quote was used by Hitler to claim the grand Jewish communist conspiracy theory of blaming Germany for the loss of WW1, which he had no proof for. Other than that, that's it.
* Since the purpose of govt officials who conspired is the same as the purpose of 'alleged terrorists', i.e. to create widespread fear and panic (just for a different end goal), literally everything govt did, can be attributed to the terrorists. The terrorists performed the demolition, they destroyed WTC7 after stealing gold, etc etc. This way govt ends up with having an even more foolproof conspiracy. In fact, if the conspiracy theorist questions that by making terrorists do that many things, it would make things more ridiculous, then you can point them to "bigger the lie, more they'd believe it" statement.
* Finally I asked my buddy, "Imagine if I was the person behind the attacks, I was one of the terrorists, how could I convince you that I did it, what proof can I provide you that I did it". Thankfully, my buddy hadn't lost all touch with reality, so he didn't really blame me for being a govt plant. He didn't really respond to me, but as far as I know that was the last time he advocated the conspiracy theories to anyone. And now we laugh at other conspiracy theorists.