Microsoft hires 14-year-old Modern Warfare 2 server hacker - <AUTHOR> http://www.geek.com/articles/games/microsoft-hires-14-year-old-modern-warfare-2-server-hacker-2011069/

<comment><USER2> One thing that is not really talked about is how Big Corps are probably more careful about going after geek enthusiast who may violate a gray area of their IP in fear of angering hacker groups like Anonymous. Now, they would never admit this publicly but I'd bet the whole PSN thing will cause Corps to at least think before doing the once knee-jerk reaction thing of sending the lawyers.

</comment><comment><USER3> Citation needed. Press release by MSFT please.</comment>


Show HN: New Foundations for Permissionless Byzantine Consensus [pdf] - <AUTHOR> https://www.dropbox.com/s/80cpk4ss5ossd4u/KRNC%20Technical%20Paper%201.0.pdf <comment><USER2> This looks fantastic, I can't wait to read this all the way through. It seems to solve a supreme fundamental issue of removing competition from the proofing.

> I want to use the money for effective altruism and existential-risk > reduction.

Since the absolute most fundamental nature of any organization is risk reduction, I believe you mean the underpinnings of what the poli sci world is calling the 'network state' :)

However, with that said, to me the most promising goal of crypto will forever be the exchanging of computations for social mobility, ie PoW, PoS, PoST, etc. There needs to be some way to actually earn semi-passive income. Why work when a mining rig can do it for you? Banking the unbanked is cool or whatever, but unbossing the bossed is where the ultimate potential for humanity is at, imho. How does this consensus mechanism help with that, if there is no staking or mining?

Thanks again, I can't wait to read it!

<comment><AUTHOR> Thanks for the kind words.

In a sense, it's an alternate form of Proof-of-Stake. As Section 8.4 explains, the conventional wisdom is that Proof-of-Stake's flaw is that it's circular. We've proved that actually it's not circular enough, i.e., the stakes it assigns are different than the stakes in society's existing monetary game.

Proof-of-Balance allows "stakes" (what we call "weight") to be issued in proportion to monetary balances. Once those stakes are in users' hands, the protocol can run using the algorithms designed for PoS, including all of their reward and governance mechanisms.

It turns out that to fully unleash the power of those algorithms, you need a verifiably secure stake-distribution mechanism. That's what we've invented. (It's harder than it sounds, of course...)

</comment></comment><comment><USER3> This is really awesome, I'm going to keep digesting this but hope to get more people to read this for debate. Thanks.

</comment><comment><AUTHOR> Hi HN,

Lead author here. The mods have graciously given me permission to announce some computer science work as a Show HN. It concerns permissionless Byzantine consensus – the notoriously difficult problem of how to securely replicate a state machine in the absence of a reliable identity system, which is the underpinning of Bitcoin and other decentralized ledgers.

By copying the signaling techniques used by animals, my co-author and I have achieved a 40,000x improvement in security and performance over the prior state of the art. This vindicates a prediction made 10 years ago by a Chinese researcher, one of the world's rare dual-PhDs in biology and computer science, who believed that reverse-engineering animal-communication networks could produce a consensus-protocol breakthrough similar to the invention of public- key cryptography.

The parallel between asymmetric encryption and our discovery goes beyond the scale of the advancement. It actually concerns the mechanism that our protocol uses to protect itself from pseudo-spoofing or "Sybil" attacks, in which an entity uses sockpuppets to hijack consensus by casting extra votes. Existing technologies, like Proof-of-Work and Proof-of-Stake, are _symmetric_ in the sense that they require correct agents to "outbid" the adversary by verifiably expending more money or computing power. If the adversary's budget for an attack is greater than the security budget of honest protocol participants, then the entire system collapses.

Our paper introduces the first _asymmetric_ system, Proof-of-Balance. It guarantees that honest protocol participants will remain in control of the consensus protocol, even if their security budget is many times smaller than the adversary's budget for an attack. This verifiable asymmetry yields not only an exponential improvement in security, but also a corollary increase in performance: because the adversary's maximum fraction of total voting power is tightly constrained, transactions can be processed on the open internet using speeds that were previously possible only on permissioned networks.

Asymmetry is nothing new in access control – e.g., a lock increases the security of a house by more than its purchase price, so homeowners aren't forced to "outbid" burglars to keep their families safe. However, it has been ignored in resource-weighted consensus, because the field has been guided by the "handicap principle" – which claims that the reliability of a signal depends on its verifiable cost to the signaler. Bitcoin enthusiasts often expressly invoke this principle to justify the waste inherent in Proof-of- Work, claiming that it is a universal law of nature, which applies with equal force to biology and computer science.

Not so. That is close to what biologists believed in the 1990s, when formal game-theoretic modeling first substantiated the concept of handicap- authenticated signaling. However, subsequent work revealed that it is actually the verifiable cost of _faking_ a signal that determines whether information can be transmitted reliably. If the cost for a dishonest entity to spoof a signal is sufficiently high, then honest agents can transmit reliable signals at zero cost. This is known as cue-authenticated signaling, and it is the key to our protocol, KRNC ("Key Retroactivity Network Consensus").

An intuitive example of the difference between handicap-authenticated signaling and cue-authenticated signaling is how male peacocks and tigers signal their fitness to potential mates. Male peacocks waste resources growing oversized tails, a handicap that proves their fitness based on the amount of self-inflicted punishment they can endure. Male tigers compete with one another to grow as large as possible to gain an edge in lethality, and their size happens to have the added bonus of providing a cue of their fitness.

We adapt the "cue principle" to obtain a novel solution to Goodhart's Law, the adage that a measure ceases to be accurate once it becomes a target. Our rejoinder: if whatever you measure will become a target, measure the thing that is already a target. (The math confirms this.)

For human agents, the universal economic target is money, so that is what Proof-of-Balance uses to assign weights in a consensus protocol. Specifically, it uses mean bank-account balances during a specified window of time in the past – analogous to a "hard fork" of the data in the commercial banking system onto a new cryptographic protocol. Everyone with online banking can unlock their pro rata share of voting power for free. No buying stake, no wasting computing power.

The other major upside to this approach is that it eliminates the need to introduce a new currency, like Bitcoin. Instead, cryptographic weight functions in a similar way to a "symmetallic standard," in which the base money is a meta-resource derived from gold and silver in a specified ratio. In KRNC, base money is a combination of an original fiat unit of account like a U.S. Dollar, plus the corresponding quantity of cryptographic "weight" needed to "back" that dollar.

The difference from the gold standard is that the "backing" isn't entrusted to a Central Bank, which can renege on its word. It's held by the actual users of the money, who transfer both the original dollar and its backing to one another in each transaction. This provides inflation-protection like Bitcoin, but it's added to the world's existing money. No pyramid-scheme like distribution, no risk of technological disruption destroying innocent people's savings.

Formalizing the discoveries in this paper has been, by far, the hardest thing I've ever done. I'm nervous but excited to share the results with the world. I believe they can be used, not just to build faster distributed ledgers, but to protect humanity from the risk of a global monetary crisis. If anyone would like to get in touch, I'll be around to answer questions in the comments, and my email is footnoted on the first page of the paper.

p.s. I'm patenting the technology as part of getting the protocol off the ground, but it's not my goal to be the next Mark Zuckerburg or Larry Ellison. I got involved in this because I freed an innocent man from prison and wanted to see how much more good I could do in the world. If KRNC succeeds on the scale I think it could, I want to use the money for effective altruism and existential-risk reduction. It's the right thing to do.

<comment><USER4> Can your mods give you permission to stick it on a website that doesn't want to vacuum up all my gmail contacts?

<comment><AUTHOR> Sorry about that, here's a dropbox link: [https://www.dropbox.com/s/80cpk4ss5ossd4u/KRNC%20Technical%2...](https://www.dropbox.com/s/80cpk4ss5ossd4u/KRNC%20Technical%20Paper%201.0.pdf)

<comment><USER5> Ok, we've changed to that from [https://www.academia.edu/40335340/KRNC_New_Foundations_for_P...](https://www.academia.edu/40335340/KRNC_New_Foundations_for_Permissionless_Byzantine_Consensus_and_Global_Monetary_Stability)

</comment></comment></comment></comment><comment><USER6> I found GOLD.</comment>


Ask HN: What cloud storage can you recommend? - <AUTHOR> I have 6 machines.
1x Android smartphone 1x Android tablet 1x PC desktop (Windows) 1x PC notebook (Linux) 1x MacBook Pro 1x EC2 based cloud dev machine
What is the best way to have directories that are synced between all these machines?
There are so many solutions out there, I just don't know where to start.
I want my images on all but the EC2 device, but I want my dev stuff on all but the android devices, and such things. <comment><USER2> OneDrive, Google Drive, Dropbox etc. ...they all can sync selectively and can be used on Android, Windows, Linux and macOS.

<comment><AUTHOR> Aren't there any differences?

<comment><USER2> There are some subtle ones. It depends on what you need. :)

If you simply want to sync some directories, there isn't really much difference and you can pick one or the other.

<comment><AUTHOR> Thanks.

Then I will probably go for Google Drive.

</comment></comment></comment></comment><comment><USER3> If you want something that you can host yourself, Nextcloud might be worth a look.

[https://en.m.wikipedia.org/wiki/Nextcloud](https://en.m.wikipedia.org/wiki/Nextcloud)</comment>


A Customizable "DrudgeReport" for Linux - <AUTHOR> http://linuxreport.net/ <comment><USER2> Why would you deliberately compare your site to drudge report?

<comment><USER3> Knock the politics all you want but Drudge Report is an effective website in that it clearly conveys info to it's Target population. Website looks really cool @OP!

<comment><USER4> And for what it's worth, I always hit Drudge and CNN throughout the day to get a sense of how things are being spun from both sides.

</comment></comment></comment><comment><USER5> This is really cool.

Why is it called "Linux report" instead of something else like "Nerd Report" or "Tech Report" or "Keith Report"? How do you filter for Linux relevance? E.g., the top article under Slashdot is "Apple Has a Putin Problem", which doesn't obviously seem to have anything to do with Linux. Thanks!

<comment><AUTHOR> Glad you like it! It is Linux focused. Unlike Drudge, I'm not choosing the articles. The Slashdot feed is the main feed. The Linux-only feed has only about one article per day so it would be too boring. However, it is customizable, so add your own RSS feeds if you think it is missing something. Or send me a URL and I'll think about adding it to the default page.</comment></comment>


Staying Motivated as a Software Developer - <AUTHOR> https://www.codingame.com/blog/the-secrets-to-staying-motivated-as-a-software-developer/ <comment><USER2> Spoiler alert: there are no secrets. EVERY person in EVERY occupation suffers from periods of lack of motivation, some occupations more so than others. As programmers, we're lucky that our job is a combination of mostly interesting problem solving and high pay, so I'm thankful every day I've been able to carve out a 20+ career doing something I love. Others aren't nearly as lucky.

And yet, I've had burnout twice, once during the dot com bust, and once a few years ago where I had quit my job for almost 1 year. I'm pretty happy these days, but things go up and down, like everyone else.

<comment><USER3> _> mostly interesting problem solving and high pay_

Arguably the "high pay" factor can be detrimental to professional motivation. I'm pretty sure some developers would hesitate less in switching to a completely different career when they are not happy at work if their compensation weren't better than average... But it's a good problem to have for most of us.

<comment><USER4> This is definitely a big part of it. Around 10 years back I was super bored coding, I just felt like things had become so stagnated, esp. in the web-space where IE6 and MS in general were a constant source of frustration and demotivation. It seemed things weren't going to ever get better, and the thumb of Microsoft would stay firmly on the backs of all web devs forever.

Around this time I became obsessively into cooking. I decided I wanted to be change careers and even went to several schools to check out the programs. My then wife at first was supportive but at some point it went from 'this is a cute dream' to 'this is real' and she wasn't having any of it.

Long/short we split up, I realized I couldn't really afford to go back to school solo, and ultimately I took a big step back and realized I had it pretty good, that my 9-5 life didn't have to be my entire life and things were a lot easier once I got my social life back in order.

I stuck with coding, the iPhone came out around that time and that started the wheels turning (along with other factors of course) that really kind of revitalized the entire dev scene. It became exciting and new again, and caused a sort of cascading effect of progress. MS wasn't able or willing to sit on IE6 and let things ride, a whole host of new exciting JS libraries started to emerge, etc etc.

Point being, finding your mojo outside of work might be a better approach than trying to 180 into a new career. I also think it's easy to forget how cushy most dev jobs are... typically you aren't expected to be in as early, dress code tends to be more relaxed even at stodgy companies I've worked at, there is a sort of acceptance that coders are different. And course it's hard to take a 50% or more pay cut, which would have been the case for me going from a lead dev role to a line cook at best, or struggling 'chef' sinking every dime of my savings into opening a restaurant with no prior experience.

</comment></comment></comment><comment><USER5> This article is pretty high on platitudes and pretty low on actual information conveyed in an english language. Kind of disappointing to see it immeditely rocket to the top of HN. Do people game this site too? Sigh

<comment><USER6> The other problem is that lots of people upvote without reading - or even skimming.

Great title? I'll upvote it now and read it later. Maybe.

<comment><USER7> Upvoting to save for reading the article later. I've done this a few times, though I try to be sure the article seems good enough.

</comment></comment></comment><comment><USER8> I don't know if it just this article or am I getting tired of these "startup heavens".

"you probably dream of working in a start-up"

no

"awesome platform and changing the world"

Oh yes, changing the world indeed with your awesome! product. I think not, or do words mean anything anymore if everything is awesome and world changing.

"Lunch Random Meeting"

Sounds horrible. And how many developers like to socialize and do (or watch) presentations all the time. Some maybe, but I think not most (and not the ones who like coding). I rather read about new stuff, and don't like doing presentations, I would rather "blog" about it but that also sounds forced if it's some company blog advertising how cool and hip and in touch the company is.

 __* edit Had to edit this one more comment. Check the last image on their main page. Are there really guys driving around with pedaling cars (or something like that) at the office. Looks ridiculous. Must be a startup without any actual customers stopping by at the office.

</comment><comment><USER9> Communities are key to me. For many years I worked remote contracts from home very much focused on just doing a good job. Only in the last couple of years have I attended hackathons (winning a few) and becoming involved in the local start-up culture through a work hub (If you live in Bath,Uk the Guildhub is an awesome space).

I also discovered meetup.com and started attending a few groups (Bristol JS is awesome). I even did the odd presentation and lightning talks.

Community engagement has been, from a developer point of view, a real life- changing experience for me. Being surrounded by intelligent people excited to be coding and doing hard stuff just because they want to is brilliant, exhausting, fun, but most importantly, has given me immense energy.

<comment><USER10> Can you shed a little more light on what it's like joining one of these communities for the first time? As someone who's always heard of these programming communities, and been interesting, I've hesitated to join one largely due to misunderstanding their utility / purpose. What does one DO at a meetup, for example?

<comment><USER11> I organized an iOS development Meetup for years in a fairly low-population area, and I had no idea what our Meetup would actually do when I created it! I didn't even know if other people in the area were doing much iOS development; I literally knew nobody who truly wanted to attend when I started it.

Primarily I wanted to meet other smart folks who were interested in similar tech problems as myself, hopefully learn something, maybe make some friends (which I did - many I still keep in touch with!), and have fun.

So the specifics of what one does at a meetup include, but are not limited to: * listen to talks * meet new people * say hello to people you've already met and - important to avoiding burnout - ask how their projects (or life in general) is going * grab a beverage or a little food after the event

Bonus if you organize it: people start to think you're an "expert" in this field, even though you may have really just wanted to meet some people. I went on to help organize other meetups and events with great people because of it, too.

Whether you organize or attend a meetup, simply approach it as a way to meet some new people and talk about the topic at hand, and you shouldn't be disappointed.

If you think you'll make lifelong friends after attending one or two, or think you'll find your cofounder for a new startup after attending one meetup, temper your expectations. Just like any community or relationship, really getting to know people takes time, and there's very little substitute for that.

Get out and meet some people!

<comment><USER12> Personally, while I like doing solo technical projects at home in my free time, I really have little interest in spending my socializing time with more techies. I get enough of that at work. One thing I've been sick of for a long time was a lack of diversity in my social circle, which is a big problem in tech because there's almost no women there, it's a big sausagefest and in many workplaces has a frat-house feel to it. I really don't want more of that. So these days, I look for social opportunities with a lot more diversity. There's a lot of great groups on Meetup.com (outside the tech-focused ones) where the participants are far more diverse, and I mean that in every way: not only in gender, but also ethnically, age, career background, national origin, etc. Personally I like the outdoor activity groups. This also helps me be more physically active, something else that's wrong with this career field where we sit in a chair all day long in front of a monitor at arm's length.

<comment><USER10> What is with this "diversity for diversities sake" thinking?

I don't care if I'm in a room with nothing but all _ race or _ gender. If they're interesting people, with an interesting perspective, thats what matters.

<comment><USER12> Maybe you like being in a frat-like sausagefest. I don't.

</comment></comment></comment></comment></comment></comment><comment><USER13> Burnout is the other side of the coin of spending too much time on meetups/hackathons/blogging/opensourcing/lectures. Sometimes staying motivated means stepping away from writing code and clearing your head.

</comment><comment><USER14> After reading this I threw up a bit in my mouth. This feels like it was written by a marketing person.

<comment><USER15> Indeed. I believe "Content Marketing" is the term.

</comment></comment><comment><USER16> I've found the biggest thing for me being able to continue to be motivated is to have the freedom to really craft the software I'm working on. Nothing is as soulcrushing as having to pump out a substandard delivery.

</comment><comment><USER17> > _Now, you probably dream of working in a start-up ..._

whoa. i don't.

i know many others have had wonderful startup experiences, but my experience with startups has been characterized by long hours, unnecessarily difficult work environments, mission confusion, stress about funding, dysfunctional working relationships and ultimate company/business failure.

<comment><USER18> Don't forget mandatory surfing lessons and having to listen to how AWESOME everything is while watching your dorky boss stumble around in five fingers. I figured I'm better of starving...

<comment><USER17> never had the surfing lessons. that's a whole new level.

we went bowling once.

</comment></comment></comment><comment><USER19> Stay motivated by your love of writing software! It's a blast! Tests and tickets! Organizing the code! Fun! All you need is a passion for sitting for hours at a time every day at a computer and writing code! Weee!

It's all about passion for code! And hit your deadlines!

That last part is very important.

<comment><USER20> Your post is in the uncanny valley of Poe's law.

> _And hit your deadlines!_

In past jobs, my deadlines were impossible to hit, mostly b/c they were set by my pointy haired manager. The estimates given to product/project/program managers were met with looks of "that's nice but I already told the higher-ups a different, sooner figure".

> _Organizing the code!_

This is literally the last thing to be prioritized. Pay down technical debt?

<comment><USER19> I was being mostly sarcastic as that is the actual "life" of a software developer so it's not shocking to me why many wouldn't be intrinsically motivated.

</comment></comment></comment><comment><USER21> The greatest way to stay motivated is to publish something and see it succeed.

<comment><USER22> I always felt this way about the "Autonomy" "Mastery" "Purpose" thing... Like, Autonomy and Mastery, when applied to Purpose lead to Achievement, and that's the real deal.

Do stuff that matters, stop doing stuff that doesn't matter, make sure all parts of the team and management know what does and doesn't matter, and why. People will be happier, more productive, and they'll things they produce will be more important for business, everyone wins.

But instead, lets beat the drums, sail into the wind seeking the white whale... which turns out to be some petty ego-driven nonsense that customers/users won't buy into (since it's not made for them, just at them) and won't still exist two years from now.

Pat yourself on the back, pat each other on the back, when your significant others ask "how'd it go" you can actually have something to say "I made a change to our checkout page that boosted sales by 5% +/\- 1% and got a little bonus out of it, lets go get that dessert you love at that place you like." instead of "I sat in a meeting arguing with Salesforce admins about how many weeks it will take for them to add a new field to the object that backs a form on a landing page that gets a few tens of visits a year, then another meeting with business about why their new field doesn't exist yet."

</comment></comment><comment><USER23> This is an advertorial. No real answers.

</comment><comment> zeal-technology It is time that companies start to recognize that they need to measure and address Autonomy, Mastery and Purpose. Companies need to listen to their internal people as much as they listen to their users and develop more personalized improvement programs. I feel that a lot of us are just hired to fill a single task or role by the company and are expected to stay that way when in reality people need to grow with new experiences in order to be happy.

</comment><comment><USER24> Author is not that passionate about programming clearly ...

</comment><comment><USER25> Motivation comes and goes. Discipline is what counts.

</comment><comment><USER26> So the author says the obvious, what motivates developers is autonomy, mastery and purpose. But he didn't say a single tip on how to overcome demotivation when all these are denied, as is in majority of corporate job positions. Communities won't bring you autonomy, mastery or purpose to your job.

It might bring these things to some side project you are doing, but you are still as shackled by higher ups, as denied of personal growth and as purposeless as it was before joining the community. So money is the only real answer. Money and a threat of being fired because of bad performance, which would result in very bad economic situation.

<comment><USER27> I have a VP who told me the same thing about autonomy, mastery, and purpose - do you have any material where the three words are used and in more detail?

<comment><USER26> I think author got it from this book: [https://www.amazon.com/Drive- Surprising-Truth-About-Motivate...](https://www.amazon.com/Drive-Surprising- Truth-About-Motivates/dp/1594484805)

I haven't read it, but at least for me it seems like common sense that these 3 things have positive effect on motivation.

If you have autonomy over how you complete your tasks for example, you will do it in, according to you, most efficient way, and that will make you feel satisfied. Mastery is from the same desire to be as efficient as you can. Purpose is something different, but you can clearly imagine how much more willing to do your best you are when you know that the thing you do will be seen and used by other people and how it will make people's life easier, for a primitive and simple example.

Compare it to my job - software is bloated, something I myself would never use, our customers are actually forced to used, almost nobody, except the people who earn money from it at the management, likes it, and often you find out that some bug that existed for a year and that completely disabled some functionality was never noticed because no one, not even testers bothered to check those parts of the system. Combine that with heavy restrictions on what can be done, both by time restraints on tasks and by accumulated technical debt that makes any improvements economically not viable, and add the natural tendency of such systems to resist to anything new and you get individuals with gradual decline in motivation over time.

I understand why there's such an ageism "problem" in the industry - the only way to make these companies with these systems afloat is to hire only young people who aren't worn out from these things yet to keep it alive. From my experience, I don't know how it was a couple of decades ago, but it seems like younger and younger people are getting their motivation destroyed by such environments.

You don't often see occupations where people are already sick of their job in general by late twenties to the point of considering switching profession that would pay considerably less.</comment></comment></comment>


Spartan Programming - <AUTHOR> http://www.codinghorror.com/blog/archives/001148.html <comment><USER2> Interesting concept. Certainly struck a nerve with me.

I've found one of the easiest ways to minimalize my code is to _require_ less code.

How? Better program _design_. Tighter structure, more efficient algorithms to accomplish to same thing. Reverse the order of two functions and suddenly that conditional is no longer necessary. Adding a parameter to a function may make it larger, but useful in more places. Only handle 90% of cases and send the outliers off to custom-land. You get the idea.

It then becomes a whole lot easier to minimalize 50 LOC than 100 LOC.

[EDIT: The timing of this post couldn't have been better. I struggled with some pretty complex code all day yesterday. I woke up at 5 a.m. and thought, "Just switch the order the functions are called." I did and it simplified beautifully, working perfectly, and eliminating about 50 LOC.]

<comment><USER3> This can also sometimes be achieved with math. For example, I was writing code that handled velocity and animation based on the arrow keys. The character had to change animations depending on 8 directions - nesw & diagonals. At first I had an ugly if-elseif statement handling all the keystates. But then I realized I could come up with a cool scheme to simplfy and beautify the code. I also needed to solve the problem of having a constant max-velocity that stayed the same even when going in a diagonal.

            //which direction to go
    	dirX = 0;
    	dirY = 0;
    	if( keystate[SDLK_LEFT] ) dirX--;
    	if( keystate[SDLK_RIGHT]) dirX++;
    	if( keystate[SDLK_UP] )   dirY--;
    	if( keystate[SDLK_DOWN])  dirY++;

    	if( dirX == 0 && dirY == 0){
    		//stand still
    		heroVelX = 0;
    		heroVelY = 0;

    		heroAnimation = heroStill[oldHeroDirIndex];
    	} else {
    		//run in a direction
    		angle = atan2(dirY,dirX);
    		heroVelX = heroSpeed * cos(angle);
    		heroVelY = heroSpeed * sin(angle);

    		oldHeroDirIndex = (dirX+1)*3 + (dirY+1);
    		heroAnimation = heroRunning[oldHeroDirIndex];
    	}

    	//step to next frame in animation
    	if( ++heroAnimation->curFrame >= heroAnimation->numFrames ) heroAnimation->curFrame = 0;

    	heroX += heroVelX;
    	heroY += heroVelY;

-removes conflict from pressing left and right or up and down at the same time -uses a formula to calculate which animation to use, instead of using switch statement -uses a little bit of trig to keep max-speed constant

Programming like this is very rewarding, if only for the feeling you get when it works. I guess this isn't really a big deal to any of you, but this sucker used to be 70 repetitive and buggy lines, rather than the pretty 29 it is now.

</comment></comment><comment><USER4> I like a lot of the concepts, but I'm dubious about terse naming. The long e-mail example simplifies "msg" to "m", for example. Now, while I would agree that veryLongVariableNames can get tedious and annoying, and while I'm also in favor of standardized generic loop indexes (i,j,etc..), I think this may go to the other extreme. I could see going from "message" -> "msg", perhaps, but I'm not sure "msg" -> "m" is a win. Why is saving two characters that important?

<comment><USER5> _I could see going from "message" - > "msg"_

There are dozens of possible abbreviations for "message" but only one correct spelling of "message". Abbreviating a word forces the reader to remember both what it is, and what its abbreviation is. One of the seldom-mentioned gifts that java has given the world is killing the horrendous C practice of insane abbreviations. I can't tell you how many times I've had to look up itoa(). It just wouldn't stay in my brain. But I guess it keeps my teletype's ink from running out too fast.

<comment><USER6> I'd upvote you twice if I could.

You don't even have to look at the screen if you follow a consistent rule of not abbreviating.

If you do abbreviate, does your buddy use the same scheme? Consistently? Why optimize for typing speed when memory and "variable lookups" are the bottleneck?

</comment></comment></comment><comment><USER7> Hmm... It's amusing to me that spartan programming has a name like this. To me, it's simply about efficiently using resources. I am reminded of the time I asked Miguel de Icaza about design patterns. He said he never saw the point of having them in a book because people would just invent them when they needed them.

<comment><USER8> I agree, this could have been described as good programming. :)

There's a quote by a well-known author whose name I cannot recall at the moment, concluding a lengthy letter: "Forgive me for writing such a long letter, I did not have time to make it brief."

One of the reasons that I've almost invariably been more productive than most other coders I've worked with is that I write a lot less code than they do. Another side effect of that is that my code has never been a bottleneck, so I've never had to do any further optimization.

It also takes significantly less time to debug :)

<comment><USER9> "I have made this letter longer than usual, because I lack the time to make it short" - Blaise Pascal (French mathematician)

</comment></comment></comment><comment><USER10> Some kill-OOP rules in addition:

* Rewrite your code so that you have more static functions that only deal with their arguments and possibly return something (no access to global data or class data). In other words, localize and isolate parts of your code that have minimal side effects. Such parts would be easier to write, debug and maintain.

* A class that contains only ctor/dtor and one method should be rewritten to a single static function.

* A class that returns a reference to a single instance (singleton) is a sign of terrible design. Rewrite.

* If the amount of lines in your unit tests is comparable with that of the original code, it means you expose too much in your interfaces. Rewrite your classes by making their interfaces smaller and simpler. This will reduce your unit tests and make them more meaningful as well.

</comment><comment><USER11> Yeah, there's a few things here that set me on-edge.

For one, early returns means you have to go poking around for the returns. That highly-indented style is a much clearer "bad code smell" that makes it easier to clean up the routine.

And their "reduce curly braces" is just SCREAMINGLY awful. If you have a one- line block, you STILL want curly braces around it. The eye just loves to skim over this mistake:

if (condition)

        i++;

        applyTaxes(order);

<comment><USER12> I am a reformed indentaholic. Now I adore early returns and use them often. If you follow the first cardinal rule of OOP, keep methods short, then early returns are easy to spot.

This kind of short-sighted nesting annoys me:

      function foo(bar) {
       if (bar == 1) {
          doThis();
       } else {
          var x = doSomething();
          if (x == 2) {
             doSomethingElse();
          } else {
             var y = doThat();
             // ... more code here ...
             for (var m=0; m<y; m++) {
                doBoo(m);
             }
          }
       }
      }

Yuck! I much prefer:

      function foo(bar) {
         if (bar == 1) {
            doThis();
            return;
         }

         var x = doSomething();
         if (x == 2) {
           doSomethingElse();
           return;
         }

         var y = doThat();
         // ... more code here ...
         for (var m=0; m<y; m++) {
            doBoo(m);
         }
         return;
      }

The difference here is not drastic in this short example but in functions with 50+ lines of code it's very clear.

The average person's short term memory is only 5 - 7 items deep. 3 of those slots are already occupied with what they are doing, so you have 2 slots left, maybe 4 slots if they've had their coffee and are really paying attention. Every time you make a code indent, whether it be a loop or nested condition, then you're asking the reader to remember that context switch. Once you have indenting more than two tabs deep then you're in hazy territory where the reader is unlikely to remember all of the conditions that lead to those lines of code being executed.

<comment><USER13> One other heuristic I follow that's not mentioned in the essay is: If one branch of an "if" statement is much shorter than the other, change the condition so that you can put the short branch first.

My reasoning is also involves memory: While the reader is reading the first branch, he needs to hold the possibility of an "else" branch in his head, along with the condition. By minimizing the length of the first branch, you minimize the amount of time he needs to remember this.

<comment><USER14> I disagree. I think it depends on context. Generally, one branch is the more common case, and I prefer to put that one first. It's the main flow of the code.

<comment><USER15> Yes but, say you've got a longish chunk of code with several error conditions; you come across an 'else' after a lot of closing braces. What the heck does it match with? What other error conditions need handling and got forgotten in the forward rush of common cases? Error handling is easy to forget; the common case remembers /itself/ you might say, and can be put off for a moment while you get the clutter out of the way. My MO, anyway.

<comment><USER14> I stress the common case for the same reason that when I construct sentences, I try to put the main point up front, and save the side comments for later. Example:

"I ran into Bob while walking to the store."

"While walking to the store, I ran into Bob."

The point I'm trying to get across, in this case, is that I ran into Bob. I try to do the same with code.

</comment></comment></comment></comment></comment></comment><comment><USER16> One thing I think is missing from this exposition is a discussion of tradeoffs. You can't blindly apply these rules, because they're to some degree contradictory. Example: you can make all your variables private to better "minimize accessibility of variables", but that requires elaborate accessor methods which increase "vertical complexity".

Which is the right path? It depends, and the solution is a sense of aesthetic. _That_ , not the rules themselves, seems to me what this techniques is all about. It's really just a different, more specific way of rephrasing PG's essay about taste in software engineering.

<comment><USER12> I've programmed in many styles until I read Martin Fowler's "Refactoring Code" and it taught me the best style is simple READABILITY! The only thing that matters is "Is it reabable"? For example, don't be afraid of replacing 5 lines of code with a descriptively named function whose only content is those 5 lines of code. It may seem pointless to have a function that is only called once but if it makes the code more readable then do it.

<comment><USER17> Extracting a single-use function can get in the way of future refactorings that cross the function's boundary. I inline single-use functions whenever I see them, and almost always after that, other, more useful possible refactorings become visible. This can happen with multiple-use functions too, but much less often.

</comment></comment></comment><comment><USER18> Sounds quite a bit like what Rob Pike has to say about programming style:

<http://www.lysator.liu.se/c/pikestyle.html>

<comment><USER2> Nice reference. Thanks.

 _I don't expect you to agree with all of them..._

I don't.

Even index variable names should be meaningful. Just drop down a couple of nested levels, use "i" again, forget to make it local, and see how much fun you'll have.

But I love the disclaimer at the beginning. Made me feel a whole lot better, no matter what he said. I'll have to remember that one.

<comment><USER19> Code Complete discusses this. When only at a single loop level, follow convention and use i.

However, as soon as you drop to 2 iteration levels, you should rename your index variables so that they are meaningful. Do not use j or k.

<comment><USER2> Right. Problem is that it probably won't be you adding the next level. Here's what really happens:

\- You code a proper loop iterating with "i".

\- Programmer 2 adds 50 LOC.

\- Programmer 3 adds 100 LOC.

\- Programmer 4 drops a level, but since he doesn't see the whole routine (too many LOC for one page or one screen), he uses a global "i" again. But nothing breaks because "i" is always 0 in both levels, both in testing and in production.

\- Data changes and it breaks. _You_ get the call, "What's wrong with your program?!?"

That's why you should have never used "i" in the first place. Call it "SkuNdx", "RecCtr", "ClassNbr", "Ctr1", anything but "i".

<comment><USER20> Wow, different strokes. I wouldn't want anything to do with code that used variables like "SkuNdx" over a simple i, j, or k.

That said, ideally I prefer using languages with each or foreach or a similar construct. If you want to iterate over a set of objects, you should only have a variable for an object. Who cares about the index?

        foreach( sku in skus )

Or

        skus.each do { |sku| .... }

If you reserve i, j, k for cases where you actually need an index, I think you'll find that i has even more meaning: i is an index and it's presence means the index is actually important. That's a lot of meaning for a single letter.

With respect to what other programmers might do, I think "defensive" programming is a waste of energy. A bad programmer will screw up your code regardless of what you name a variable. The best you can do is avoid working with such people. If that doesn't work, write unit tests. Seriously, at least then you know that a bad programmer broke your code _before_ you get a call.

<comment><USER21> _With respect to what other programmers might do, I think "defensive" programming is a waste of energy. A bad programmer will screw up your code regardless of what you name a variable. The best you can do is avoid working with such people._

Exactly. I had a really hard time working with normal programmers... I would explain why I did something that wasn't brute force, they wouldn't get it and their way also worked... so the codebase was one big festering pile of shit.

Now I work somewhere where my coworkers are arguable some of the best programmers in the world... and I don't have this problem.

Life is too short for bad jobs. As a programmer with a clue, you are a very hot commodity. So go somewhere where you won't want to kill yourself at the end of the day. (Or start your own company, of course. Then you _really_ get to pick who you work with.)

</comment></comment></comment></comment></comment></comment><comment><USER22> This is madness.

<comment><USER23> No.. This is Sparta!

<comment><USER24> Geez. Please tell me these pun threads are not spreading here from reddit.

</comment></comment></comment><comment><USER25> This reminds me my 9th grade "Computer Science" class. Mr. Brown taught us some of the same principles with Applesoft Basic. I'm always surprised when I work with other programmers who don't think it's important to write spartan code. Which isn't to say I haven't been guilty of the same thing a time or two - but this article reminded me of my first exposure to programming in the 9th grade. Here's to you, Mr. B.

</comment><comment><USER26> I now have a name for my coding style! The email-send-function-case-study he links to pretty much follows the way I write code (when forced to write Java here at work).

</comment><comment><USER27> Hot damn I've been practising Spartan Programming for years before I read this article. People thought I was crazy then :-)

</comment><comment><USER28> Isn't this a fanciful expression to label DRY programming?

<comment><USER16> Uh... More like DRY is equally a new, fancy acronym given to a whole bunch of techniques that have been in use for years. This stuff isn't new at all, it's just experiencing something of a renaissance after the dark ages of the late 90's Big Design Madness.

The "Spartan Programming" stuff Atwood talks about is focused mostly on C, Java and other low level imperative languages. "DRY" tends to be most used in the context of web development. Other than that, I agree: they're mostly the same idea.</comment></comment>


Show HN: Turn your work into a game, but don't tell your boss - <AUTHOR> http://itemzapp.com

<comment><USER2> Wow, those testimonials really speak to the quality of this app!</comment>


Ask HN: Any startup standing against Amazon? - <AUTHOR> More specifically, is there a challenger in USA against Amazon? While I'm sure Amazon people have worked hard to earn this stature, I hate monopolies (AMZN is 48% of retail business). Probably big corporates have already accepted their second rate position against this Goliath but is there any David still in making or worth supporting? <comment><USER2> Wayfair, Walmart, BestBuy, Google, and Target are all working very hard to beat Amazon in their respective categories. They haven't "accepted" anything.

Jet.com was a high-profile Amazon competitor that was acquired by Walmart a few years ago.

<comment><USER3> I don't think I would consider those "start-ups"

<comment><AUTHOR> Yes, I'm not convinced either. They are neither startups nor appear to be competing hard. Jet.com was probably only good challenger which ran for sometime but I dont know what's their status now.

</comment></comment></comment><comment><USER4> Bloomberg last week: This No-Brand Startup Won $240 Million to Fight Amazon on Price and Quality

[https://www.bloomberg.com/news/articles/2018-07-31/brandless...](https://www.bloomberg.com/news/articles/2018-07-31/brandless- is-battling-amazon-with-240-million-from-softbank)

<comment><AUTHOR> "And what about the $800 billion gorilla in Seattle? "It could crush them," Kodali says."

Great!! now this is the spirit of startup.

</comment></comment><comment><USER5> Check this out:

[https://github.com/open-source-ideas/open-source- ideas/issue...](https://github.com/open-source-ideas/open-source- ideas/issues/78)

<comment><AUTHOR> Yes, ~this post~ HN front page news about Nile is what prompted me to ask the question.

</comment></comment><comment><USER6> Where were you when Walmart was the worst monopolist in town? Before that it was Kmart, then Sears. This is an overplayed tune.

<comment><AUTHOR> Probably was not anywhere :) But that now that I am here, I am willing to support AMZN's competition, and Tesla's and Google's ...</comment></comment>


OVH acknowledges back office security issue - <AUTHOR> http://pastebin.com/skGagP0X

<comment><USER2> Translation from french :

Hi, To change your password, you have to go on ovh website and ask for a change with a given id. An email is sent to the email address associated with the id which includes a unique url. This url is randomly generated with 21 characters, generated from 3 different algorithms for randomess generating each 7 characters. The client who receives the email can then click on the link and get a new password for his id. A confirmation email is sent announcing the change of password. In all emails sent, ovh includes the IP of the person who did the request.

This is a procedure that was set up 7 years ago and hasn't changed since.

On april 26th, we have discovered internely an issue with the function that generates the 21 characters. Two of the three random functions were generating a not-so-random string. It was hence possible to ask for a password change and then to brute-force the password reset url. This problem was found by one of our developpers on apr 26th at 11:03:14 and was fixed at 12:54:13. The origin of this problem was linked to the rand() function used in this part of the code that hasn't been patched to the same level as the rest of the code when we activated the script execution cache (?). We have replaced the old function returning 21 characters from 3 "random" functions with a new function using two really random functions each providing 64 characters.

We have then started searching in our databases to check if the vulnerability had been exploited, and when it could have been. To do that, we have looked at 3 years of history of password resets. We are authorized by the CNIL (commission nationale informatique et liberté, french agency regulating databases containing personnal data) to archive and use all logs for the last 10 years, specifically for this kind of issue.

We have found 3 active ids which had a password reset done by brute-force. These three occurences were targeted attacks against a part of the "bitcoin" community that uses ovh. The hacker seems to have found the flaw on apr 23rd at 22:00, and did a lot of testing for one hour to make his method work. At 23:00, his method was working and he has hacked the first id, then the two others ids the following day, still for bitcoin related sites. We have been in contact with these clients but the quality of our exchanges did not allow us to get enough information that would help reveal an vulnerability on our side. Our developpers have in a completely independant way found the issue mentionned above, and only then have we realised that there was a link between our flaw and these 3 customers. We certainly have something to learn here about the best way to ensure dialog with clients about this kind of issue.

It took us some time to communicate on the subject, because we have quickly realised that the impact was very limited (3 customers) and we wanted to take enough time to verify everything in depth and make sure that this had not impacted any other customers. Having finished our search today going back three years, we can now assert that no other customers have seen this issue. We are going back 10 years now, but the probability that this happened ealier is null.

I think that despite the small impact for our customers, it was our duty to inform everybody of this security incident that we had to deal with last week. We have added a code-review process on some very old code that hasn't been rewritten for years, to check that there are no other similar issues. We are also trying to see how we can improve communication with clients for this kind of incident, knowing that 2 of the 3 customers are actually customers of our affiliates/branches.

TL;DR : Yes, we had a security vulnerability allowing a password change using some complex brute-force procedure. We advise all clients running critical services to limit access to the manager from some IP only. Yes, 3 clients of the bitcoin community have been impacted by this security flaw. It is very important to read the emails that ovh sends automatically, especially the notification of password change emails, when they aren't initiated by you. If you see a request for a password change that you haven't initiated, you should call our incident support 24/24 which will block your account until everything is clear. No, our clients database hasn't been compromised. No, there was no impact on other clients than these 3.

We are deeply sorry for the three customers that have been impacted, and invite them to contact our commercial team (in french).

Regards Octave

<comment><USER3> Really good article on the pitfalls of a weak random number generator. I think it's been on HN before: [http://www.cigital.com/papers/download/developer_gambling.ph...](http://www.cigital.com/papers/download/developer_gambling.php)

For me, this was the article that made it crystal clear why you cannot use current time as a seed for a RNG.

</comment></comment><comment><USER4> A pastebin link is not a source worth reading.

Here is what I found as more official, the email@example.com account is often used for official announcements: <http://forums.ovh.net/showthread.php?p=548183>

tl;dr: Bad random string generator in password change URLs, 3 customers affected, all Bitcoin related.

edit: OVH, if you are reading this. The 4 character string for receipt protection is creeping me out ever since I saw it. Why not simply use a longer string?

<comment><AUTHOR> Thanks for the link. I've been looking for the list archives on <http://ml.ovh.net> (as advertised in the email itself) but the domain doesn't seem to exist anymore; hence my (unreliable) copy on pastebin.

</comment></comment><comment><USER5> I'm 6 for 5 at the moment - of the 6 companies I've hosted pet projects with over the years, 5 have been compromised at the control panel / infrastructure level while I was a customer:

      * Layered Technologies, dedicated OpenBSD (Sep 17 2007) [0]
      * Hetzner, dedicated Linux (Oct 21 2010) [1]
      * Dreamhost, shared Linux (Jan 19 2012) [2]
      * Linode, VPS Linux (Apr 15 2013) [3]
      * OVH, VPS Linux via reseller (Apr 23 2013) [4]

      [0] http://what.entwinedstudios.com/?p=21
      [1] http://mybroadband.co.za/news/internet/16021-Hackers-hit-Hetzner.html
      [2] http://www.dreamhoststatus.com/2012/01/20/changing-ftpshell-passwords-due-to-security-issue/
      [3] http://blog.linode.com/2013/04/16/security-incident-update/
      [4] https://news.ycombinator.com/item?id=5632479

Food for thought.

</comment><comment><USER6> There we go. I suspected that Oles was misinforming/lying to the community when he initially denied the existence of a security vulnerability, and I was right: <https://news.ycombinator.com/item?id=5627487>

When you think about it, this whole situation with the hacks of Linode, OVH, etc, is completely _insane_. Bitcoin has become so successful and valuable, that bitcoins thieves are compromising _core Internet infrastructure_ that so many companies rely on.

People say "use more serious/professional hosters", but OVH is the world's largest server host and is very much a "professional" service. I bet that within 2-3 years we will see more and more stunning hacks of other hosters like Amazon EC2, etc.

<comment><USER7> The flip-side is now OVH is more secure than they have been in the past. Nothing like a pot of gold to motivate people to try to break your security. This is probably more effective at exposing weakness than paid pen-testing.

Not that you ever want customers to lose money/data/whatever in the process, but it's not all down-side.

</comment></comment><comment><USER8> From the post on the french forum: they were generating a 21 characters string from 3 different sources of random (each source contributing 7 characters to the final string) and it looks like that among these 3 sources, 2 of them were flawed and were not really random. They say they fixed this flaw by now generating 64 characters random strings from 2 sources of random which they think secure.

<comment><USER9> How hard is /dev/urandom? Or without that, read /dev/random every so often and mix it with SHA1?

</comment></comment><comment><USER10> TL;DR: Here's what happened. When a password reset is submitted, the user receives a random URL by email containing a random 21 letter string. The algorithm used was bad, so the random string could be brut-forced.

The OVH team researched 3 years of password changelogs and found 3 customers who had been brute-forced that way, all in the "bitcoin community"

</comment><comment><USER11> "oles" is Octave Klaba, the CEO of OVH. I'm quite impressed by how transparent they are in dealing with this issue, and the degree of technical details they are willing to provide.

</comment><comment><USER12> Vision of the future: Hosting companies which do not provide insurance against such losses, subject to intensive security auditing, justifiably lose business.

<comment><USER13> If you decide to stash your life savings into your local swimming pool's locker, don't be surprised when they are taken away.

For $40~$100/month, OVH offers adequate securit for your regular daily deals site or micro-SaaS. If you expect the level of security that comes with PCI/HIPAA compliance, expect to pay two orders of magnitude more. At some point, someone in the Bittcoin community will bite the bullet and pay the price, and that will be a huge competitive advantage.

<comment><USER14> This. OVH is a budget provider. While this doesn't excuse them from fault here, you definitely get what you pay for in this case.

</comment></comment></comment><comment><USER15> Not sure how relevant this is but there is a huge amount of spelling errors in this email, which makes it look all the more authentic but very unprofessional.

Also surprising that this email (if the pastebin is authentic) appears to have been written by a mail client from 2006 suffering from at least one public GnuPG-related vulnerability.

<comment><USER16> Octave Kabla, aka Oles is native from Poland, his french has always been quite approximative (like my english, I guess).

</comment></comment><comment><USER17> Oles, what a CEO. I have had direct contact with him, as OVH is a partner of one of my projects, and it's not that easy to find someone so passionate, humble and responsive as he is.

</comment><comment><USER18> Can someone proficient in French provide a tl;dr?

I have been thinking about renting a server from then so this interests me greatly.

<comment><USER19> 21 character reset was generated via 3 separate functions each generating 7 characters each. 2 of these were old and weak, resulting in a URL that could be brute forced.

Once discovered, they analyzed 3 years worth of logs to see who was exploited (not clear how they matched it..maybe scanning for brute forces?) and found 3 sites all related to bitcoin.

The weakness in the algo has been resolved by using a 2 real random functions to generate 64 random characters</comment></comment>


Lisp Meta-Programming for C++ Developers: First Macros - deque-blog https://deque.blog/2017/05/09/lisp-meta-programming-for-c-developers-first-macros/ <comment><AUTHOR> Imagine the power of your whole programming language available to you at compile time. That is a Lisp macro. It gives you the ability to write simple and elegant code, which can then be compiled down into the unreadable nasty code after, while still being as fast as if you wrote the nasty code by hand. Another term for this is zero-cost abstraction. What is nice in Lisp is you can also use the (macroexpand ) function to see what Lisp code will actually be generated.. it's Lisp all the way down!

If you look at the Servant library [1] for ClojureScript, they wrapped the callback-hell mess that is Javascript web workers (read: the only way to actually multi-thread on the web), into beautiful Go-style channels, via the use of macros.

[1] [https://github.com/MarcoPolo/servant](https://github.com/MarcoPolo/servant)

<comment><USER2> Typically you are limited at compile time because Lisps -- especially Clojure -- do not allow the same computing resources you get at runtime to be used at compile time, so there are some clear limits.

This can be true in C++ as well, but those limits are quite high and are easily set to something else. Perhaps Clojure also allows you to reset what these limits are.

<comment><USER3> Sometimes the situation is completely reversed: you get a lot more computing resources on the development system where the code is compiled, than on the target system where it ultimately runs (e.g. small, embedded target).

The computing resources required to process the code (macros, and whatever) is usually unrelated to the computing resources of the application.

A program that works with gigabytes or data might need only megabytes during its compilation.

(It's not easy to imagine _practical_ circumstances where it would be reversed, with those exact numbers. Some algorithms you might want to use at compile time do explode in memory size, I suppose.)

<comment><USER4> That is getting quite normal nowadays; training a model in machine learning typically takes way more resources than running it.

However, if you need gigabyte to expand your macros, it is likely you need megaseconds, too, and then, it is wise to use 'precompiled headers', and save your 'preprocessor output'.

</comment></comment></comment></comment><comment><USER5> Defmacro is convenient. Debugging when the lack of hygiene leads to weird errors is not.

It happens once ever blue moon, but every time I would kill for a proper syntax-case for CL. Racket's is fine, but I'd be happy with a one like the plain R6RS as well

<comment><USER6> Side effects are no issue if every local variable name in a defmacro is generated with (gensym).

<comment><USER7> And if you're tired of doing that by hand, you can... write a macro that'll do that for you. In fact, those were already written, and are available in many libraries as well as featured in many books.

See e.g. Alexandria[0] for with-gensyms (automatically binding your variables to gensyms) and once-only (similar, but ensures the value will be evaluated only once).

Also note that lack of hygiene is actually a useful feature - it allows macros to capture variables from code passed to it as well as the environment they expand it. Some cool stuff can be done that way (some uncool foot-shooting too, though).

\--

[0] - [https://common- lisp.net/project/alexandria/draft/alexandria....](https://common- lisp.net/project/alexandria/draft/alexandria.html#Macro-Writing)

<comment><USER8> > Also note that lack of hygiene is actually a useful feature - it allows > macros to capture variables from code passed to it as well as the > environment they expand it. Some cool stuff can be done that way (some > uncool foot-shooting too, though).

Doug Hoyte's excellent book _Let Over Lambda_ has a lot of examples.

<comment><USER7> Oh yes. This book is very fun, in the "what on Earth did he just do here" kind of way.

</comment></comment></comment></comment></comment><comment><USER9> I remember trying to explain the power of Lisp macros to a friend who at the time knew C++. I did not even know template-metaprogramming was possible, back then; that probably would have made it a lot easier.</comment>


Ideology Impairs Sound Reasoning - <AUTHOR> https://psyarxiv.com/hspjz <comment><USER2> My take on this is that people need to realize that they are not an exception to this. _Everyone_ has an ideology that overrides logic for many topics.

I think the reason for this is that our brains just generally don't operate on a rational basis because it's not practical for humans. We have to rely on preformed perspectives when it comes to certain broad perspectives. Another reason is that it's almost necessary to adopt your group's perspectives in order to fit in socially. Or at least it's unlikely you will have a different perspective if much of your information comes from one group.

<comment><USER3> I believe the best ways to buck this weakness are:

1\. Invest more energy into trying to falsify your favored beliefs than into confirming them.

2\. Embrace humility, since we're always wrong sometimes. Humility to me means: you can have convictions, but you should never assume that people who disagree with you are stupid or evil.

<comment><USER4> _I believe the best ways to buck this weakness are:

1\. Invest more energy into trying to falsify your favored beliefs than into confirming them.

2\. Embrace humility, since we're always wrong sometimes. Humility to me means: you can have convictions, but you should never assume that people who disagree with you are stupid or evil._

I'd add two other ideas that I try to adhere to, continuing your list.

3\. Try to adopt the perspectives of those you disagree with, especially when you're finding yourself ascribing malice, stupidity, moral failing, or just find yourself baffled by someone. Such feelings are often a sign that you don't understand where someone is coming from, and though you may still disagree with them, you'll have a better platform to discuss matters.

4\. Try to see yourself and your time through the same lens you use to look back on history. We're not special or unique, we're goinf to be seen as primitives eventually, and it can be helpful to imagine in which ways that perception might be levied.

Both of these help to broaden perspective and depend empathy, while also divorcing yourself from a strict "first person view" or tribal view. It's also a couple of concrete steps to gain some distance from your feelings in the present, which makes your steps easier to achieve. You'll also find that the people you end up despising form a much smaller pool than most.

<comment><USER5> Torture yourself. Uncertainty is discomforting. If thinking and deciding is easy for you - you are not doing it. Intellectual honesty is masochistic.

<comment><USER6> We must be very different people. Whenever I realise I've been wrong about something for a long time, I'm fairly excited about it.

And I've been very stubborn in the past. The biggest struggle was being able to accept being wrong in public. It's much easier to have a 'holy shit' moment in private!

</comment></comment></comment></comment></comment><comment><USER7> A few good books I'm reading / have read on the subject

      The Righteous Mind
      The Elephant In The Brain
      In Defense of Troublemakers

The deck is stacked very far against us cognitively. We are a walking, talking political nightmare unto ourselves and others.

The worst part is it's excruciatingly difficult and extremely unlikely for you to find your own blind spots. So you need to hash things out with other people. As others mentioned the best thing you can do is hold defeasibility and corrigibility as some of your highest values and do your best to understand all the pitfalls in our thinking.

<comment><USER8> I'm currently reading _The Righteous Mind_. While I haven't finished it yet, so far a major theme has been that reason's major job is merely to justify what the gut instinct has already decided.

Taking that theory to its conclusion, that means that most people are approaching the question of rationality vs. emotion the wrong way by assuming that appeals to reason and logic are the way to convince the average person. Not so; one must convince their emotions first, and then they will reason together a logical framework to fit their emotion.

It's a bit distressing to think about, but unsurprising when one reflects on the course of history that humanity has taken, and is taking.

<comment><USER7> His experiment in one of the early chapters where they come up with these little stories that are for some reason morally repugnant but on closer inspection don't appear to be hurting anyone and then they press people for their reasons on why they think it's wrong and they wind up inventing justifications that are sometimes pretty far fetched. That was pretty interesting.

There's another great bit of research detailed like that detailed in The Elephant In The Brain.

In the 60s and 70s Roger Sperry and Michael Gazzaniga did some research for which Sperry eventually won a Nobel Prize in 1981 where they showed images to patients who had undergone a corpus callostomy where the two halves of the brain can no longer communicate and asked them questions about what they saw. The results were really striking. They did it in such a way that they show the image to only the right side of the brain but then ask the left side of the brain to describe what they saw verbally. They just invent some kind of fantastical rationalization and they seem to fully believe that's what they think despite the fact that it can't be. I'm explaining it kind of badly but that part was jaw dropping. Seems to fit with Haidts research though.

</comment></comment></comment><comment><USER9> Often it comes down to trust, whether that's rational or not. Take climate change. The topic is too involved for most non-scientists to absorb enough to come to an informed decision on their own. Therefore, unless one invests boatloads of time, they must rely on expert opinion for much of their conclusion.

Therefore, climate-change deniers ask if one should trust scientists over their favorite political pundits or favorite CEO's. There are enough incidents of scientists being biased based on funding source to have some skepticism.

When I reply, "Don't pundits and CEO's have similar financial biases"?

Deniers typically respond something like, "Sure, so I have to rely on my gut, and my gut gives them more credit than it gives to scientists. Most scientists come from liberal-leaning universities."

<comment><USER10> At a way to fully illustrate the OP's point.

<comment><USER9> The title is misleading then. Ultimately complex topics probably require trust regardless, unless one can spend a lot of time on them. I once debated about whether one can clearly determine the Earth is not flat without relying on experts. I found alternative models for just about every home-spun experiment. Maybe with really good weather and carefully crafted survey tools one could rule out the alternative models, but again that's a lot of time (at least for the middle-ages; which is where we set our thought experiment. No Amazon.com back then).

<comment><USER11> > without relying on experts

This does not fly with most complex disciplines where it takes decades to become proficient.

But relying VS not-relying on experts is a false dichotomy. You can choose experts to trust, as rationally as possible.

<comment><USER9> I'll reword it this way: the more you know, the less you have to rely on experts, or at least the degree decreases. But the practical angle of this is that one will still have to heavily rely on experts until they reach a non- trivial point in their education/study of the topic. It's not realistic that the average person master every controversial topic in order to vote fully informed.

</comment></comment></comment></comment></comment><comment><USER12> I would counter that reasoning doesn't stand by itself. Reasoning is a method of getting from A to B, but you need an A (your axioms) to reason from. It's easy to disparage people whose axioms are different from yours (Jehovah is God/Allah is God/There is no god), but sometimes that's all there is to it. Though once emotions get involved (such as by challenging the political/religious framework on which they've built their life), pretty much everyone will also fail to adhere to strict reason.

</comment><comment><USER13> Christopher Tyerman's body of work on the Crusades is really interesting in this regard. One of the key points he keeps pressing home, is that though we think of Medieval people as ignorant and superstitious, they were in fact highly rational. And they were as a culture committed to rational investigation of the world.

But they had axiomatic beliefs that they were building upon. Which meant they were also committed to a rational investigation of the supernatural world. Which we generally view as non-rational.

I'm very much paraphrasing and he would not express it so crudely.

</comment><comment><USER14> I really really like the premise of this study, but I don't buy the results fully.

The logic in the 2nd and 3rd prompts is subtle. In fact, I don't think the 2nd one is in fact a syllogism -- it's unclear if Judge Wilson believes _if_ or _if and only if_. In the former case, the statement is in fact _not_ a syllogism, but in the latter case it is a syllogism. I wouldn't expect your average study participant to pick up on the difference.

I am afraid that the only conclusion here is that, in the absence of a clear logical argument to evaluate, (either due to ambiguity or complexity), people fall back on their beliefs.

<comment><USER15> Number 3 also requires the reader to infer iff.

But it's not an unreasonable requirement because without inferring iff you get "Judge Wilson believes one has the right to end the life all living things" and "Doctor Simmi believes the surgery should proceed no matter what"

Still, I imagine that's enough to throw of an unknown percent of people, alas.

>I am afraid that the only conclusion here is that, in the absence of a clear logical argument to evaluate, (either due to ambiguity or complexity), people fall back on their beliefs.

Still an interesting conclusion though.

</comment></comment><comment><USER16> Practical men, who believe themselves to be quite exempt from any intellectual influences, are usually the slaves of some defunct economist. Madmen in authority, who hear voices in the air, are distilling their frenzy from some academic scribbler of a few years back.

</comment><comment><USER17> This feels like evidence for motivated skepticism: [https://wiki.lesswrong.com/wiki/Motivated_skepticism](https://wiki.lesswrong.com/wiki/Motivated_skepticism)

</comment><comment><USER18> Before this research, did a lot of people assume the null hypothesis that ideology doesn't impair sound reasoning?

Psychology seems to be responding to the replication crisis by studying some really obvious truisms.

<comment><USER19> Before I die, ill be reading an academic article explaining how the sky is in fact, not blue.

</comment></comment><comment><USER20> As far as I can tell from skimming the paper, it fails to establish that ideology impairs reasoning _more_ than any _other_ kind of pre-existing belief.

There is a well-established bias, called _belief bias_ (which the paper mentions), against accepting the logical validity of arguments whose conclusions you disbelieve. The study tested examples of this where the conclusions were political (agreed with liberal or conservative viewpoints), but AFAICT did not use a control test where the conclusions were apolitical, but the participants still agreed or disagreed with them.

A control could have established whether political arguments were _more_ (or less, or equally) susceptible to belief bias. But they didn't use one. So the study only establishes that political arguments are susceptible to belief bias.

</comment><comment><USER21> Sure, ideology impacts formal reasoning, but if you look at the examples given the participants have good reason to reject the conclusions of formal logic that is based on terrible premises.

Despite the result of a simple sequence of sentences divorced from reality, cigarettes really are bad for you and salads are good (depending on their contents).

In study 1) participants might disagree with dangerous drugs being banned, and they disagree that marijuana is dangerous. In 2) premise 1 seems relatively straightforward, then premise 2 is a highly ideological belief (as is the point of the study).

I don't think this is very revealing. When you add 1+2 and get 68445788, you are suprised by the conclusion and check your work. People responding to this aren't dumb, they just aren't playing along with what they regard as faulty reasoning. Basically, they are likely saying I know what the researcher wants me to say, but this is wrong and I won't go along with it.

<comment><USER22> Sometimes I wonder if the general decrease in trust in society affects psychology research:

[http://www.niemanlab.org/2019/01/a-gloomy-vision-for-fake- ne...](http://www.niemanlab.org/2019/01/a-gloomy-vision-for-fake-news- in-2019-low-trust-societies-the-death-of-consensus-and-your-own-lying-eyes/)

The Milgram experiment is the most prominent example which might not be possible today because it depends on participants' willingness to obey scientists. The Milgram _effect_ is still real, but it has become harder to measure.

So in this case, when participants are asked to reason based on premises they don't agree with, they might, as you've suggested, refuse. They might interpret the researchers' intent as nefarious, e.g. "if I agree this syllogism is valid the researcher will report that I support the conclusion". This line of thinking is of course absurd, but it comes close to what I've observed that some people believe about scientists.

<comment><USER21> Is it? Scientists and PR firms get funded by big donors. Professional scientists are typically honest, but which studies get funded are picked by people that aren't necessarily. The public sort of understands that things generally are arrayed against them though they can't necessarily explain why mechanistically.

In this case, it might be even simpler than that. It might be that regardless of what they believe about scientists and the formal logic of their assignment, they just don't like being forced to say things they despise. This could be seen as noble though its not exactly a plus for debating.

</comment></comment></comment><comment><USER23> I have to agree with some of other commentators that I don't think this study is particularly revealing, because there's a lot of nuance in the questions that doesn't directly follow logical thinking. I want to address the first two questions

>All drugs that are dangerous should be illegal. Marijuana is a drug that is dangerous. Therefore, Marijuana should be illegal.

The flaw with this question is that it's divorced completely from the cultural reality we live in. Cigarette smoking is legal, despite being dangerous. The final clause does not actually follow from the rest of the logic, because we have tangible examples of Drug A being Dangerous and Legal. People might think of this, and therefore disregard the conclusion. I don't think that would be the result of ideological impairment, but rather the result of people examining nuance.

>Judge Wilson believes that if a living thing is not a person, then one has the right to end its life. She also believes that a fetus is a person. Therefore, Judge Wilson concludes that no one has the right to end the life of a fetus.

This is just poorly worded. If something is not a person, then Wilson believes you have the right to terminate it. Since a fetus is a person, then no one has the right to terminate it. That logic does not necessarily follow from the initial statement; because the nuance there is that Wilson is expanding her personal logic into the logic of everyone else. Again, there's a bit of nuance in that people may personally not be for abortion, but believe that women still have the right to abortion despite their own personal beliefs.

The logic is also initially biased right from the start, since it implies that Wilson would also believe killing animals, pets etc is OK.

I don't think these two questions really resolve the issue of bias preventing sound reasoning, because it implies that the conclusion of the two questions was logical in the first place. They effectively managed to prove that two highly nuanced questions are, in fact, highly nuanced.

<comment><USER24> The marijuana argument you cited is logically valid. Logical validity isn't about whether the premises are true. It's about whether they entail the conclusion.

<comment><USER23> Is it, though? Like let's go down some similar lines of logic:

> All websites that are dangerous should be banned. Hacker News is a dangerous > website. Therefore Hacker News should be banned.

> Cigarette smoking causes cancer. Things that cause cancer should be illegal. > Therefore, cigarette smoking should be illegal.

> Things that can harm children should be taken away. Phones can harm > children. Therefore, phones should be taken away

All of these function as the exact same logic posited in the study. A is B. B is C. Therefore, A is C. However, this really doesn't apply to the categories above because when you start talking about 'dangerous' or 'causes cancer' or 'harms children' etc there is a wide berth for rational disagreement.

<comment><USER24> > when you start talking about 'dangerous' or 'causes cancer' or 'harms > children' etc there is a wide berth for rational disagreement

That doesn't matter as long as the meaning of words remains the same throughout the argument.

<comment><USER23> The meaning of the word can remain the same, but the way something has the property of said word can vary drastically. As a thought experiment:

Dangerous things should be banned.

Riding your bike without a helmet is dangerous.

Doing cocaine is dangerous.

Driving a car is dangerous.

Ergo, those three items listed above should be banned.

Are all of these actions equally dangerous? The answer almost everyone would give is no. That's where the bias enters into play. The definition of the word hasn't changed at all throughout.

<comment><USER24> Do you understand the concept of "logical validity" [1]? The argument you stated is valid if "dangerous" means _exactly the same thing_ in each and every clause. That doesn't mean the premises (in particular the first one) are true.

[1] [https://en.wikipedia.org/wiki/Validity_(logic)](https://en.wikipedia.org/wiki/Validity_\(logic\))

</comment></comment></comment></comment></comment></comment><comment><USER25> It seems quite concerning then, that most political parties are ideologically driven. I would really like to see a political party focused on evidence based politics.

<comment> barry-cotter Politics isn't mostly about values or beliefs, it's mostly about winning, beating the other side. Insofar as it is about either we have a proposal to make values explicit and to incentivise teaching the goals that serve those values.

[http://mason.gmu.edu/~rhanson/futarchy.html](http://mason.gmu.edu/~rhanson/futarchy.html)

> Futarchy: Vote Values, But Bet Beliefs

> by Robin Hanson

> This short "manifesto" describes a new form of government. In "futarchy," we > would vote on values, but bet on beliefs. Elected representatives would > formally define and manage an after-the-fact measurement of national > welfare, while market speculators would say which policies they expect to > raise national welfare. Democracy seems better than autocracy (i.e., kings > and dictators), but it still has problems. There are today vast differences > in wealth among nations, and we can not attribute most of these differences > to either natural resources or human abilities. Instead, much of the > difference seems to be that the poor nations (many of which are democracies) > are those that more often adopted dumb policies, policies which hurt most > everyone in the nation. And even rich nations frequently adopt such > policies. These policies are not just dumb in retrospect; typically there > were people who understood a lot about such policies and who had good > reasons to disapprove of them beforehand. It seems hard to imagine such > policies being adopted nearly as often if everyone knew what such "experts" > knew about their consequences. Thus familiar forms of government seem to > frequently fail by ignoring the advice of relevant experts (i.e., people who > know relevant things).

<comment><USER25> That's true, which is probably worse than being ideology driven when I think about it.

<comment><USER11> There's a typical moral dilemma involved - the political "trolley problem":

Suppose you are leading a party that has an effective plan to address a lot of preventable deaths.

If you lose, many people won't be saved.

If you bend your values and engage in manipulating public opinion, making empty promises, lying and so on you are much more likely to win.

What would you do?

</comment></comment></comment></comment><comment><USER26> But how do you become ideological in the first place.

Either you're a conspiracy theorist and believe so many weird things that adding another believe won't top the cart.

Or is it that we want to believe explanations that we understand (or think we do) and not believe what we don't understand (science).

</comment><comment><USER27> The only hope for humanity is to find a way to fix this nature mistake in future generations by correcting the genetic code (or anything else important for this process), when it will be completely reverse engineered. All cognitive biases at once.

It might take centuries though...

<comment><USER28> It's a noble program that can achieve meaningful things, but we should be aware that all information processing systems will have biases. The map is not the territory, e.g. the information processing system can never perfectly represent or model reality.

</comment></comment><comment><USER29> Always ask the question: "What evidence would I/you need to change my/your opinion?"

</comment><comment><USER30> I intuitively understand the word ideology as denoting false consciousness, in the marxist sense of the word. So the title reads like a total tautology for me, a la Unsound Reasoning Impairs Sound Reasoning. Guess I'm experiencing ideology.

</comment><comment><USER31> So True!

</comment><comment><USER32> Ideology or religion, don't know what's worse.</comment>