That's a LOT of code in the controllers. If I had to guess, it sounds like they're putting business logic in their controllers, which is a fairly well-established anti-pattern.
They have 452 classes in controllers and 41374 LOC. It's an average of 91.5 lines of Ruby per controller, not so many for the usual 7 scaffolded methods and some extras like strong params.
About performances, I always thought that writing logic in controllers, models or lib was a matter of readability and ease of maintenance.
Does it make a difference to the CPU if 50 lines of code run in a controller or in a model or in a file in lib or in a gem?
The very idea that somebody takes half and hour each to exclusively cook and eat three meals a day is absurd for a number of reasons, e.g. leftovers, the act of eating and reading at once, sandwiches, meal planning, skipping lunch, very-american-pre-processed-food, rice cookers, toast, etc.
A couple key points:
- More people in the US are struck each year by lightning than are killed by police. (373)
- Of the 1,491 persons that died from police use of force from 2009-2012:
915 (61.4%) were white males
481 (32.2%) were black males
48 (3.2%) were males of other races
28 (1.9%) were white females
15 (1.1%) were black females
4 (0.2%) were females of other races
- Of the 56,259 homicides from 2009-2012, 19,000 (33.8%) were killings of black males.
Comparisons by types of homicides of black males:
481 (2.5%) were the result of police use of force
152 (0.8%) were the result of a negligent accident homicides (i.e., child playing with a gun)
648 (3.4%) were the result of a justifiable homicides by private citizens acting in self-defense
17,719 (93.3%) were criminal homicides (murders)
More blacks are killed in justifiable self-defense scenarios than are killed by police. And overwhelmingly more are killed in homicides, mainly by other blacks.
Also note: According to the US Department of Justice, blacks accounted for 52.5% of homicide offenders from 1980 to 2008, with whites 45.3% and "Other" 2.2%. The offending rate for blacks was almost 8 times higher than whites, and the victim rate 6 times higher. Most homicides were intraracial, with 84% of white victims killed by whites, and 93% of black victims killed by blacks. (Whites are being lumped in with Hispanics here.)
It's fairly clear that there isn't an epidemic of wide scale police violence against blacks. Instead, a few incidents have been blasted onto social media, and uncritical leftists have picked them up and ran with them. I see Black Lives Matter more as an expression of intergroup competition and aggression against traditionally white power structures. Other leftist groups take the same approach, e.g. with feminist fabrications about mass rapes on college campuses - college campuses are in fact among the safest places in the world, but feminists treat them as though they're some Mad Max-esque raping dystopia by claiming nonsense like 1 in 4 college girls get raped. They're mysteriously silent about places where real mass raping occurs, such as Africa and the Middle East.
I could go on, but suffice to say, I believe we're in a period of mass hallucination and hysteria, with entire movements justifying their existence on statistically nonsensical claims. This has happened many times throughout history, and it's leaned to both the right and left axes of the political spectrum. This time the wind just happens to be blowing to the left.
These comparisons are senseless. We are talking about state violence and fear of the state.
I care far more about an armed agent of the state murdering someone than I do about some random guy murdering someone. Have you been to an inner city lately? Even New York, which is incredibly peaceful, has areas where there are palpable, reasonable fear of police violence from black people. The constant searches and seizures, the attitude of superiority and yes, the physical violence - these are preventable and they're plagues to having a peaceful world.
The problem is that police officers have good reason to be much more defensive when dealing with blacks than with whites.
Just look at these statistics and then consider how a police officer would feel when dealing with a black person that shows any kind of aggression, considering that most homicides are committed by blacks. (even though they are a minority)
The police officer wants to survive too.
Of course there are cases of excessive and criminal use of force by the police, but their general perception and caution when dealing with blacks will never change as long as this minority continues to commit most crimes.
Your comment is facile and, though you probably don't intend it that way, mean-spirited. But there's something to it anyways.
Set aside the reciprocal nature of racism and criminality and acknowledge the raw demographic reality of police encounters in major cities. It seems clear to me that yes, police officers are under far too much cognitive strain to accurately judge threats. Basic human cognitive limitations ensure that police will continue to prejudge risk through race.
To me, that, coupled with the fact that police encounters with strangers are far, far less dangerous than police training and culture mythologizes them to be, suggests a straightforward solution: disarm most police officers.
What you are proposing could help reducing aggression between police and civilians, though I do not know how well this would play out in the US.
It generally works in EU countries, but a lot is different there.
What I reject though is you suggesting my comment is mean spirited. The statements you feel are offensive are just facts as far as we can tell today. You would attack my statements instead of me personally if what I wrote was obviously wrong.
Regarding the linked comment:
> Most (not all) suspects who shoot at cops aren't doing it out of spite, but instead of out self-preservation.
How do you know this? Your comment is based on this being true, because if it were otherwise there would be no way your proposal could work. In that case disarmed police officers would continue to get shot but now without being able to defend themselves.
Can you please explain to me what exactly is wrong about these stats and my conclusions?
By the way, I don't need an excuse for having an opinion.
You seem to presume that are you holding the moral high ground allowing you to attack me (insinuating I am plain stupid) without even needing to deliver any facts that prove me wrong.
Sorry, but there was no explanation. I cite statistics from the US government and he calls me stupid and biased because he doesn't like that I refer to these statistics. It just clashes with his reality or the dogmas he believes in.
> You can see whatever pattern or proof you want if you look at the numbers long enough, to serve any narrative, to rationalize any opinon.
In most Western countries the governments release stats about crimes committed by type and by citizenship or in case of the US by race.
I don't have to search for a pattern there that fits a "narrative", the statistics bluntly state which race commits most crimes in different categories.
If you don't like what these government stats show please feel free to share with us why you believe that we shouldn't use these stats. But I'm not interested in trading insults, so please keep the discussion civil and based on facts.
The protests, and the black lives matter movement, are in response to particular kinds of state-sponsored violence. Tey tend to cover instances where police had ample opportunity to deescalate, but instead chose to use lethal force. We don't have statistics to cover these instances, but we do (now) have citizen-filmed videos. These videos show a pretty clear story of unconscionable police violence against blacks.
You're arguing against a strawman nobody said blacks were being subjected to de facto police genocide or that they were more likely to be killed by police than anything else. Nobody even suggested those things.
This is a great example of an entrenched incumbent/monopolist backlash against an earnest attempt to cut costs and increase the efficiency of government. This same story happens every day throughout the world in numerous ways, and solving it so the 'good guys' win is in my opinion one of the of the most important things a country can do to improve its institutions.
I've spoken to a number of developers who work in DC, and they pretty much tell the same story: huge tech companies/consulting firms who want to lock in a long-term contract use unnecessarily complex technologies and solutions (I'm looking at you, Java EE) that create big legacy codebases which are very difficult to switch away from, ensuring that the contractor has a job forever. Furthermore, once they've got the government agency 'by the balls' (AKA, the contractor has built a complex, poorly documented monster which only it can understand), it can charge a ridiculous amount of money for maintenance and new feature development.
You have correctly identified that this is a fight against the system dynamics which lead to government waste. Please please please actually contact your representative to give them rhetorical ammunition in the fight against it.
Lots of successful websites use J2EE though. Picking on that seems kind of unfair. It's not like giant codebases written in Ruby or JavaScript or PHP are somehow easier to maintain or switch away from.
Often times, you don't even need to use particularly weird solutions. The timeframe for some of these projects is so long that whatever you pick going in is going to be obsolete or at least obsolescent on go-live. But that's fine, either locking in maintenance or assuring a subsequent modernization effort.
Are you implying that the media obfuscates reality with selective reporting to push a politically correct/leftist narrative that implicitly demonizes white men? Why, that's absurd! #BlackLivesMatter
Agreed. Given the events the author described, the claim that Amazon sees its customers as 'disposable' is completely unfounded. If I were running a shipping business and a customer had three refunds issued in a brief period of time under unusual conditions, I would want to check in and see what was going on as well.