Is Pair Programming Worth It? AirPair Interviews Pivotal Labs - <AUTHOR> http://www.airpair.com/pair-programming/

<comment><USER2> I guess I'm just not the pair programming type. I find that the experience is usually frustrating.

1\. Most software development occurs in my head. If you watch me "write" software, you'll see me sitting silently at my desk most of the time. I only actually type once I have a solid picture of the problem and solution (except for the occasional exploratory code to coax out more details from the problem domain). I can't do that with someone talking and changing the existing code structure. It's basically having someone constantly interrupt you. I'm not a multitasker; I can't write code and converse with someone at the same time.

2\. I tend to jump around a lot in an existing codebase to verify behaviors or gain a better understanding of a subsystem. But the person next to me doesn't have the same mental map, and so what I'm doing will appear almost random. I've tried explaining as I go, but it just serves to muddy the waters because the other person will be talking and interrupting as I'm trying to keep the delicate mental structure intact.

I much prefer to work alone, and then bounce ideas off colleagues when I'm stuck.

<comment><USER3> I'm not keen on pairing, but instead of planning things in my head, that's why I do TDD. The tests explore various ideas (as in effect the tests are clients of whatever I'm building, just like the finished app will be) so I get to play around with it before writing any code.

I just don't know how to do that as a pair.

</comment></comment><comment><USER4> They forgot to mention that ( at least in my circles ) they are notoriously known as an 'engineering factory', where most people hate their job, because very few people want to pair program ALL DAY, EVERYDAY.

Pair programming in small doses, works wonders. One to three hours working together on a problem can see serious productivity gains. There's no magic to this however; Any collaborative environment gravitates towards this sort of activity naturally.

As with most things, balance is necessary. Some solitude to think and reflect, some collaboration to explore your ideas and some pairing to smooth out the rough spots.

<comment><USER5> The problem is programmers goof off about 4-5 hours a day but when they assign to pair program the whole day they can't do that. There is no pair goof- offing.

That's why most programmers don't like long period of pair programming. Because you can't program all day. That's all

<comment><USER4> Spoken like someone who either isn't a programmer ( a PM, maybe? ) or is projecting. Programmers don't 'goof off' more than any other group of people.

Programming is generally a solitary activity, largely due to the immense amount of concentration it takes to build a mental model of a system that you're working on. Tracking variables, context, structure, side-effects, out- come scenarios, etc. takes a lot of brain-power. 'Pairing with someone' for long periods of time adds another dimension to that... Communication and synchrony with another person.

</comment></comment></comment><comment><USER6> Seriously, I think very few people get the concept of pair programming or I would say pairing because programming is only one scenario. Pairing is good or bad is like saying gear-5 (in a car, assuming topmost gear) is better than gear-4 or not. Cmon, both are required for different purposes. You got to change gears. You cant just drive in gear-4 or 5 all the time.

Some of the arguments down below read like: I tried driving in gear-4 and I disliked it, so I changed back to gear-5. Funny. Another one: One company forced me to drive in gear-5...again that company was plain stupid (or atleast the management was, for forcing you, in general).

Pair programming is effective when you are coding up while you are building the solution on the go. Its one of those sessions where its not possible to think up everything in your head. Ever had such moments where you didn't know all pieces of the puzzle? You can always say I would think up everything and then discuss in a meeting the whole solution. What if you went ahead and thought up the solution in a pair rather than discussing after you have laid out everything and then realizing you have to change it because you made a wrong initial assumption.

You cannot think up everything in your head (as another comment was there). Many times you do not have all the pieces and sometimes even if you have, you need to consult.

Seriously people, you are not getting the concept of pairing at all. Or I am just nuts.

<comment><USER7> People aren't gearboxes. There's no analogy here.

<comment><USER6> Do you mean to say they are simpler than gearboxes and hence should continue to function using one method always?

If you meant they are more complicated than gearboxes, then I think we are saying the same thing and either you aren't getting it or I am not doing a good job conveying it.

If you are think there is absolutely no analogy, gimme one and I can say the same for that too. If this was the case then, I am sorry but I believe that statement of yours was absolutely unthoughful.

<comment><USER7> I mean that you can't just shove them into this kind of a working mode, then into some other kind, as would say a teenager play around with shifting from 2nd upto 5th the first time he gets to drive his dad's Mazda all by himself.

Which is about the same degree of attachment expressed in the idea that a project manger can "shift" programmers into and out of pair programming mode the way one would work a stickshift.

Working habits are intensely personal, idiosyncratic things.

People -- by which I mean creative, productive, self aware & self-managing people; i.e. the _only_ kind you should ever hire -- almost by definition don't like being pushed into working one way or another. Or being simply _told_ what works best (because X or Y said so).

<comment><USER6> Sersiouly dude, you didnt get it. I said that pushing in general is bad. Not bad, its stupid. I dont know where the hell you got the idea that I meant some manager pushing people to pair program. I didnt say that.

Working habits could be personal but there is something called as team work. You should also make sure the person is capable of collaborating. Collaboration does not always means attending meetings.

</comment></comment></comment></comment></comment><comment><USER8> This reads more like an advertisement than an objective analysis, which in looking more into AirPair, that's exactly what it seems to be. Pair programming might be great (it certainly sounds like something I wish we did some of at my company), but it's disingenuous to pass off a marketing piece as a critical analysis of software engineering methodology.

<comment><USER9> I'd heard of AirPair before, and my first thought reading the title was "Is Pair Programming Worth It? A Company Offering Pair Programming Services Interviews Another Company Offering Pair Programming Services". I wonder what the answer is!

</comment></comment><comment><USER10> Interesting.

I could see pair programming being a good fit where you have say one backed developer, and one front end, and you want both to be able to code both.

Is there anywhere to read more about practices, or is it simply a matter of sitting down side by side? I have done that with less able developers, but it often feels like I am doing the work, and they are watching, whereas I imagine pair programming to be more interactive.

<comment><AUTHOR> Some great resources:

[http://www.pairprogramwith.me/](http://www.pairprogramwith.me/) [http://remotepairprogramming.com/](http://remotepairprogramming.com/)

Best to get into it...

Free communities: [https://plus.google.com/communities/100279740984094902927](https://plus.google.com/communities/100279740984094902927) [http://www.meetup.com/remote-pair-programming/](http://www.meetup.com/remote- pair-programming/)

First Time Paid experiences through AirPair: [http://www.airpair.com/php/troubleshooting-chris- christoff](http://www.airpair.com/php/troubleshooting-chris-christoff) [http://www.airpair.com/angularjs/angularjs-problem- solving-d...](http://www.airpair.com/angularjs/angularjs-problem-solving-dana- de-alasei)

Tons more: [http://www.airpair.com/customers](http://www.airpair.com/customers)

</comment></comment><comment><USER11> It really comes down to being a team player, and being able to accept help from others. A lot of us are the loan wolf type. Just as @kstenerud said. "Most software development occurs in my head". Personally, I find that I can over complicate things especially with a problem I don't have a road map for. However, when I have someone else around to bounce my ideas off of I usually end up with a very scalable simple solution.

AirPair allows you to find someone who is an expert in what you're working on, and instead of hiring that person to be a full time engineer for 120K+ per year you get to pick their brain for an hour or two and see if they can at the very least point you in the right direction. Two heads are always better than one.

So, to answer the question. Is AirPair worth it? 100% worth it IMO.

</comment><comment><USER12> I find pair programming to be an excellent when you are debugging a problem and need two sets of eyes. It's also great for teaching/learning when a junior developer has banged his/her head against the problem before coming over to a more senior person for help. For research projects or deep thinking exercises, it's pretty counter-productive.

<comment><AUTHOR> We have guest posts (and video recordings) from customers that experienced your point :)

[http://www.airpair.com/php/troubleshooting-chris- christoff](http://www.airpair.com/php/troubleshooting-chris-christoff)

[http://www.airpair.com/angularjs/learning-angularjs- morgan-p...](http://www.airpair.com/angularjs/learning-angularjs-morgan- polotan)

</comment></comment><comment><USER13> Pair Programming seems like it would be great if both programmers have similar ways of approaching problems, and can bring their different perspectives to bear on the problem in compatible ways. What happens when two people approach things from very different perspectives?

Coming from a physical science background, I've found that I "think differently" than most computer scientists and engineers I've ever worked with. It's different enough to my mind to be quite incompatible with in situ pair programming; the few times I've done it have been in interviews, and it was uncomfortable to say the least.

It seems like the difference between a kinesthetic and a visual learner. I don't care how often you expose one type of learner to the other kind of learning, there will only be so much improvement; after the improvement plateaus frustration will set in.

</comment><comment><USER14> Anyone with some negative experiences pair programming? Would be interested in hearing about another side of this.

<comment><USER15> I pair almost every day, and my biggest complaint is that pairing isn't useful for boilerplate code. Pair programming's biggest advantage is that you have two people working out solutions and catching bugs. If the solution is boringly obvious and the chance of bugs almost zero, then pairing is a waste.

The success of pairing depends heavily on the skill and personalities of those involved. If the skill disparity is too great, you end up with one person doing all the thinking while also lecturing the newbie. If neither collaborator likes the other, you'll have issues. Even something like preferring different editors can get in the way.

In general, I don't think of pairing as good or bad. I think, "Is pairing a tool I should use in this case?" For me the answer is often yes, but it depends on many factors. I could see others answering no just as often as I answer yes.

Really though, you don't know it 'till you try it. If you want to get started with pairing, make sure you pair with someone who has paired before! If both people are inexperienced, the result is usually chaos and frustration.

<comment><USER16> > The success of pairing depends heavily on the skill and personalities of > those involved. If the skill disparity is too great, you end up with one > person doing all the thinking while also lecturing the newbie. If neither > collaborator likes the other, you'll have issues. Even something like > preferring different editors can get in the way.

Very much agree. I was a client at Pivotal for a few months, and learned a ton from them while pairing. We brought their XP style (slightly tweaked) back to our office once our contract with them was up, and continued pairing about half of the time. We could all get along well enough, and had agreed on using the same editor, so the only pain point I felt was when working with people with a different skillset. Though the different skillset problem made development go slower, but the more experienced people are teaching the less experienced people, hopefully making the tradeoff worth it.

Another advantage to pairing is that it keeps developers honest -- if you're supposed to be doing TDD, then ideally your pair helps you stick to it instead of taking shortcuts you "know" are okay.

Edit: oops, grandparent asked for negative experiences. The only ones I had were frustration when working with people who were already frustrating to work with. (Ideally, while pairintg they'd be learning, and would become less frustrating to work with...) I do agree with parent's point about it being less useful when banging out boilerplate or obvious solutions, but that's not really a horrible experience, just a little wasteful feeling.

</comment></comment></comment><comment><USER17> It's good for about two weeks to a month, and then you are looking at diminishing returns.

The productivity gains come from sharing each others programming tricks. You may learn a different approach to problem solving that you never thought of before. Over time you will learn less and less, to the point where you are just sharing a keyboard.

</comment><comment><USER18> Is pair programming always carried out on a single PC? I was under the impression that the pairs may just sit side by side and help each other throughout the session. Didn't realize that pair programming implied literally taking turns hammering out code on a single PC.

<comment><USER15> It's usually done with a single computer. Sometimes shops will have multiple keyboards hooked up to one computer. But it doesn't have to be that way. There are lots of tools for pairing remotely. Screen/tmux + Vim/Emacs, Screenhero, Google+ hangouts, etc.

I don't want to toot my own horn, but at Floobits (YC S13) we've built some really nice tools for remote pairing. I like Sublime Text. Bjorn likes Vim. I live in SF. Bjorn lives over in the east bay. But we pair using our native editors: [http://abughrai.be/pics/screenshots/Screen%20Shot%202013-12-...](http://abughrai.be/pics/screenshots/Screen%20Shot%202013-12-04%20at%205.46.37%20PM.png)

We're still improving the setup process and documentation, but we've found it to be better than pairing in person. We get to use our favorite editors. We don't have to commute. We can listen to different music while pairing. It's pretty nice.

</comment></comment><comment><USER19> I think pairing is useful _some of the time_ (esp for debugging, code reviews)

in a world trending more and more to flexible hours and remote work, I don't see any way doing it all the time will work.

<comment><USER20> This is where remote pairing comes in - ie: AirPair.

</comment></comment><comment><USER21> Another advantage of pair programming is that two developers can share one desk in a coworking space.

<comment><USER22> I would argue that "advantage" in your scenario only applies to the employer, who doesn't have to provide space for two people. For those who must now share a space, I would consider this a disadvantage.

<comment><USER21> It makes sense for a couple of self-employed startup founders :)

</comment></comment></comment><comment><USER23> I had a great experience with AirPair. It makes me feel like I can really tackle some big issues.

</comment><comment><USER24> Answer: No. [https://help.github.com/articles/using-pull- requests](https://help.github.com/articles/using-pull-requests)</comment>


Portability woes: Endianness and Alignment, Part 2 - <AUTHOR> http://fastcompression.blogspot.com/2014/11/portability-woes-endianess-and.html

<comment><USER2> People should read Rob Pike's "The byte order fallacy," which was already discussed here: [https://news.ycombinator.com/item?id=3796378](https://news.ycombinator.com/item?id=3796378)

[http://commandcenter.blogspot.com/2012/04/byte-order- fallacy...](http://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html)

<comment><USER3> I have a lot of respect for Rob Pike. Doing what he says guarantees correct operation in typical cases, when the memory is cacheable. If CPU arch doesn't support unaligned loads, the compiler must additionally be able to deduce pointer alignment or it's forced to generate separate loads.

However, if performance is important, doing what Pike says doesn't always make sense. The case discussed in the article in question is one those.</comment></comment>


"up to" broadband speeds are bogus - <AUTHOR> http://arstechnica.com/tech-policy/news/2010/08/your-worst-fears-confirmed-real-broadband-speeds-half-of-whats-advertised.ars

<comment><USER2> I knew it! I only ever get 1.5 Mbps and I have the "up to" 10 Mbps connection from Rogers. What a joke.</comment>


Shoppinghook – For indecisive people - <AUTHOR> http://shoppinghook.com

<comment><AUTHOR> The one thing I like about it is that it's anonymous so I can't get annoyed at anyone directly for giving me crap advice. lol</comment>


Matlab to Python: A Migration Guide [pdf] - <AUTHOR> https://www.enthought.com/wp-content/uploads/Enthought-MATLAB-to-Python-White-Paper.pdf <comment><USER2> From personal experiences and reading online, I noticed that quite a few universities dedicate at least one course to teach Matlab (STEM majors excluding CS). Often, upper div labs will require some sort of programming knowledge because large amounts of data needs to be analyzed and manipulated. I found Matlab to be a great introductory language but I've also been learning/using python more recently.

After a brief overview of this pdf, it seems like a solid resource for those who took Matlab courses (like myself) but wish to use python instead. One thing I love about Matlab is how easy the learning curve is to do simple plots and functions. Also not having to deal with whitespace. But, Python seems more practical since you can use it for any type of project. General STEM job requirements also usually list Python and rarely mention Matlab.</comment>


Your idea is worthless - <AUTHOR> http://www.80beans.com/nl/blog/2011/03/23/your-idea-is-worthless

<comment><USER2> While it's probably true, this horse has been beaten to death many times over.

Best part:

Every time you tell someone your idea they will voice their opinion. That's great, because it allows you to keep sharpening your idea based on the opinions of real people instead of the voice in your head.</comment>


CS undergrad looking to combine travel and supporting NGOs this summer - <AUTHOR> http://www.charity-hack.org/

<comment><USER2> Sorry, I don't like to gripe but I have to whine about the site design. I scroll while reading. As a habit I typically keep my focus toward the top of the page. With your page the stuff I'm about to read disappears just before I want to read it. It's _incredibly_ frustrating.

Then when I scroll back up to try to make the text reappear it doesn't unless I either wait for the fade transition to finish before scrolling up or scroll up an additional segment. Except when this happened on the first segment I couldn't scroll up an additional segment so I needed to refresh the page.

You can probably fix this by adding a bunch of whitespace between scroll transitions, or by fixing the animation step to the scroll event rather than using a timeout event (I didn't look at your source, but I assume at some level that's what's happening).

Either way the nontraditional design is superfluous, frustrating, and distracting from your goal. I assume you want people focused on your content and ultimately your goal rather than your design. You might have better luck with a traditional blog layout.

[Edit: I'm on Chrome on a 13" Retina Macbook Pro.]

</comment><comment><USER3> Nice idea! Liked the design until the green & yellow background colours... They're much too bright and contrast with the text makes it very hard to read. Otherwise, good luck!

<comment><USER4> Yes the yellow nearly blinded me. I really like the page though. It has a good flow.

</comment></comment><comment><USER5> Admire the effort, but even if you work from dawn to dusk there's not much you can do in a day.

<comment><USER6> That was my first thought as well -- noble intentions, but NGOs are generally not run with the "You will ship code on your first day" mantra in mind. One day could easily be eaten up by

      * introductions
      * paperwork
      * formulation of problem / explanation of constraints
      * assessing the current situation to figure out what
        solution might be sustainable in the long term (i.e.
        what happens after he leaves)
      * making a rough draft and discovering that there were
        additional constraints that didn't come up at first

Some of the articles that resonate best on HN are those which reiterate the value of doing good work consistently instead of trying to be amazing for a single moment. Unless this guy has a better plan than his pitch makes apparent, I'm not sure it's really a worthwhile proposition.

</comment></comment><comment><USER7> Try this: <http://afritech.com/item?id=2689> (Maybe you could just whip up some python in a day)

</comment><comment><USER8> My eyes hurt after looking at your website.</comment>


Explaining Code Using ASCII Art - <AUTHOR> https://blog.regehr.org/archives/1653 <comment><USER2> A little ASCII art for math from a code snippet of mine:

        //
        // B(m,n)(x) = binomial(m,n) * (1-x)^(m-n) * x^n
        //               __ m-n
        // (1-x)^(m-n) = \      (-1)^i * binomial(m-n,i) * x^i
        //               /_ i=0
        //                           __ m-n
        // B(m,n)(x) = binomial(m,n) \      (-1)^i * binomial(m-n,i) * x^(i+n)
        //                           /_ i=0
        //
        Polynomial Polynomial::bernstein(unsigned m, unsigned n) {
           Polynomial B(m);
           unsigned j = m-n;
           double scale = binomial(m,n);
           for (unsigned i = 0; i <= j; i++)
              if (isEven(i))
                 B[i+n] = scale*binomial(j,i);
               else
                 B[i+n] = -scale*binomial(j,i);
            return B;
          }

<comment><USER3> Maxima[1] can do symbolic computation and display the result in ASCII. I use Maxima notation when I need to do this.

[1] [https://en.wikipedia.org/wiki/Maxima_(software)](https://en.wikipedia.org/wiki/Maxima_\(software\))

</comment></comment><comment><USER4> Screen reader user here. Please don't do this. There are blind developers out there. Don't make their life hell. Often those diagrams are a good excuse not to write a good description of what the system really does. If you absolutely must, please ensure there's a text description that provides exactly as much info as the diagram (or more). If you can, use formats like graphvis and include the text the graphs were generated from, it's at least somewhat readable. The way sourcegraph[0] used to do this was IMO acceptable. They had a graph but if you wanted to, you could sort of figure out what the grah looks like by reading it's text. They also had a good description of what the system does directly below. sadly, They're a bit worse now, though the source is still available if you dig deep enough. [1]

[0] [https://github.com/sourcegraph/sourcegraph/blob/2.13.0/doc/d...](https://github.com/sourcegraph/sourcegraph/blob/2.13.0/doc/dev/architecture.md) [1] [https://github.com/sourcegraph/sourcegraph/blob/master/doc/d...](https://github.com/sourcegraph/sourcegraph/blob/master/doc/dev/img/architecture.mermaid)

<comment><USER5> We're experimenting with Mermaid diagrams <[https://mermaidjs.github.io/>](https://mermaidjs.github.io/>) in our source code. How does that come across?

<comment><USER4> I assume that as a reader of the code, I can get to the code behind those diagrams, not just the images? If yes, I would call it acceptable. Not something I'd prefer personally, but that's a good trade off between actually making an illustration for the sigted and making something accessible to everyone. Accessibility must be taken into consideration, but it shouldn't dominate the software and make the experience worse for users who don't need it. I think you strike the balance here.

</comment></comment></comment><comment><USER6> I haven't created much ASCII art in my own code yet, but I've been VERY grateful to others who included it in a few of the legacy projects I've dealt with in the past.

One project in particular was troubling. It was an industrial spray controller for vinyards and such. As is typical with these older products, the microcontroller that drove it was an 8051 (some SiLab part I think). Normally that wouldn't matter, but this project was written in assembly. Even worse, it was one big file (something like 17k lines).

All of the main variables we're statically allocated for easier ram usage and eeprom saving. There were deliberately few functions in the program (almost everything was in the main loop), due to stack size limitations (it was a 23 byte stack I believe). I don't think a single macro was used in the entire project. Basically this was a very old and very crusty project.

The comments were the only redeeming quality. Timing diagrams, menu layouts, waveforms, LCD illustrations, etc. There were whole PAGES of ASCII art, and it saved my butt. Thank you to whoever made the decision to properly comment that code. I owe you a few beers.

EDIT: That's also around the same time I started using VS Code, which was a huge help. It beats the heck out of whatever 1990s-looking IDE they had me using to debug the project. You don't realize how nice it is to have proper search functionality and the ability to open a file in multiple frames until you don't have it anymore.

</comment><comment><USER7> I have been doing this for years, my favorite tool is Monodraw [1].

It's unfortunate they decided to discontinue its development [2].

[1] [https://monodraw.helftone.com/](https://monodraw.helftone.com/)

[2] [https://blog.helftone.com/monodraw-maintenance- mode/](https://blog.helftone.com/monodraw-maintenance-mode/)

<comment><USER8> That looks amazing. Does anyone have an equivalent for Windows or Ubuntu/Mint?

<comment><USER9> I use DrawIt plugin in Vim... As much as that looks beautiful, why would you open a GUI window to draw plain text? No need(although of course it doesn't look as slick).

A little one I done with it: [https://github.com/salgadobreno/dme/blob/master/README.md](https://github.com/salgadobreno/dme/blob/master/README.md)

Abusing unicode chars, I've done some pretty interesting mock-ups...

</comment></comment></comment><comment><USER10> We sometimes use Monodraw [1] for that in our team and it really made a difference. It's always great to get a top-down perspective on the topology / architecture at the beginning of a complex program.

[1] [https://monodraw.helftone.com](https://monodraw.helftone.com)

Example copied from a program that fetches data from somewhere and prepares it and mounts it as a fuse file system:

        /*
        ┌─────────────────────────────────────┐
        │                      ┌─────────────┐│
        │                      │             ││
        │      ┌──memory───◀───┼───┬──────┐  ││
        │      │main thread│   │   │parser│  ││
        │      └───────────┴───┼───▶──────┘  ││
        │          │ ▲         │     │ ▲     ││
        │          │ │         │     │ │     ││
        │          │ │         │     │ │     ││
        │          ▼─│         │     │ │     ││
        │         ;20s:        │     │ │     ││
        │         :   ;        │     │ │     ││
        │          ╲ ▲         │     ▼─│     ││
        │          │'│         └────;120s────┘│
        │┌─────────┼─┼────────┐ ┌──▶:   ;───┐ │
        ││    ┌────▼─┴────┐   │ │    ╲ ╱    │ │
        ││    │fast memory│   │ │     '     │ │
        ││    │main thread│   │ │     Λ     │ │
        ││    └─┬───────▲─┘   │ │    ╱ ╲    │ │
        ││      │       │     │ │   ╱   ╲   │ │
        ││    ┌─▼─fuse──┴─┐   │ └──     ◀─┘ │
        ││    │controller │   │    beacon     │
        ││    └─┬───────▲─┘   │      ╲ ╱      │
        ││      │       │     │       V       │
        │└──────┼───────┼─────┘               │
        │┌──────▼───────┴─────┐               │
        ││   fuse <> kernel   │               │
        │└────────────────────┘               │
        └─────────────────────────────────────┘
        */

(screenshot of comment without the HN formatting issues: [https://i.imgur.com/YOaysWn.png](https://i.imgur.com/YOaysWn.png))

<comment><USER11> It is unfortunate that almost virtually all box drawing characters and geometric shapes are ambiguous in the Unicode East Asian Width standard [1], so they can't be reliably used even in the preformatted text. I tend to default to ASCII art for this reason.

[1] [https://www.unicode.org/reports/tr11/#Ambiguous](https://www.unicode.org/reports/tr11/#Ambiguous)

</comment></comment><comment><USER12> There's some irony in presenting these pieces of ASCII Art (i.e. text) as PNG/JPG images.

</comment><comment><USER13> btw [http://asciiflow.com/](http://asciiflow.com/) is great for doing ascii diagrams like these.

</comment><comment><USER14> Markdown Literary programming that don't break the syntax of any programming language

[https://github.com/linpengcheng/PurefunctionPipelineDataflow...](https://github.com/linpengcheng/PurefunctionPipelineDataflow/blob/master/doc/markdown_literary_programming.md)

advantages:

\- It don't break the syntax of any programming language, you can compile directly. comment area markup method can be applied to any programming language and any markup (including Org,rst, asciidoc, etc.), which is the greatest advantage.

\- you only need a single line of regular replacement preprocessing, then you can use any Markdown parse or converter.

\- Support any code editor that supports Markdwon Live preview, allowing the source code of any programming language to become rich text in real time. In the code's comment area, You can use the markdown to draw flowcharts, tables, task lists, and display images on the live preview panel, enhance the readability of your code.

\- If you extend the Markdwon tag, you can implement the eval code, print result, display data visualization and other instruction tags, to achieve live programming, live test.

the main purpose of the Code comment area markup method is to live Preview directly in the Code Editor Preview panel without exporting or any preprocessing.

I think:

\- Literary Programming, Programming was the first, Literary was the second.

\- The entire file is compliant with the programming language syntax and can be compiled directly.

\- When writing (reading or refactoring) code files, I can modify and live preview directly in the editor without exporting or any preprocessing.

\- Do not interfere with people who do not understand the markup language to read the code.

</comment><comment><USER9> I even had in mind writing a post about this... Diagrams in code have so much potential to explain things better, and taking this kind of thing OUT of the code always ruin it(I much prefer code w/ TODOs & comments all around than code that is just code with zero human context), maintaining a little explanatory diagram is so much easier than trying to have drawings elsewhere where they'll get outdated, I think it should be encouraged. As I mentioned in some replies here, as a Vim user is quite seamless to do this with DrawIt plugin, this is one I've done just for the hell of it:

edit.: No way I can make it keep format here lol [https://github.com/salgadobreno/dme/blob/master/README.md](https://github.com/salgadobreno/dme/blob/master/README.md)

</comment><comment><USER15> Love ASCII art! I even use it on my blog [0]. I write all my posts in Markdown and it's pretty sweet to be able to see and edit diagrams in-line with the rest of the post.

I'm still looking for an ASCII art editor to make it more pleasant to draw though. So far, I like the default styles in Asciio [1] the best.

[0] [https://preetam.io/post/s3-static-hosting- https/](https://preetam.io/post/s3-static-hosting-https/)

[1] [https://metacpan.org/pod/distribution/App- Asciio/lib/App/Asc...](https://metacpan.org/pod/distribution/App- Asciio/lib/App/Asciio.pm)

<comment><USER16> asciio is great, I use it a lot to document architecture of systems.

</comment></comment><comment><USER17> Since some of these examples seemed to be part of a documentation system such as Javadoc, Sphinx or Doxygen, I wonder wether the more complicated examples would not be better made as proper drawings. It may be nerdy to draw huge diagrams in the text editor, but they are error prone (sometimes due to bad visualization). Instead, with a proper UML diagram editor or with Inkscape, such diagrams are quickly exported to SVG/PDF standard and rendered as a nice picture within the given documentation system. Drawback: They are no more part of the source code.

<comment><USER18> There is plantUML. Then diagrams can live alongside source code and be under version control.

<comment><USER19> Found this which looks pretty neat [https://github.com/jbn/IPlantUML](https://github.com/jbn/IPlantUML)

</comment></comment></comment><comment><USER20> I find this useful and wish it was used more, but I have to say that I've seen it discouraged in coding guidelines. Another thing is that ASCII drawings can be easily destroyed by the auto formatter.

I think ASCII drawings should be used as an aid but not as a replacement for a textual description. If you use ASCII art on a website W3C recommends providing a text alternative [1].

[1] [https://www.w3.org/TR/WCAG20-TECHS/F72.html](https://www.w3.org/TR/WCAG20-TECHS/F72.html)

<comment><USER21> Why do you obey coding guidelines or autoformatters which stop you writing good, well documented code? If a tool makes your work worse, fix it or stop using it.

<comment><USER22> If a tool is 90% good and 10% bad, it still makes my work better despite the presence of the bad

<comment><USER23> Especially if those 10% can be ignored (document ahead when its useful but respect the guidelines in other aspects )

</comment></comment></comment></comment><comment><USER24> Users of Emacs can use artist-mode to do this in their code at any time.

<comment><USER9> And DrawIt for Vim

</comment></comment><comment><USER25> I always find a good ASCII art in code comments heartwarming because it shows that they're serious about explaining the code to its readers. In other words, they care about you.

</comment><comment><USER26> I generate dot files (graphviz) based on code. It's an amazing tool, both for understanding how the code behaves and as a communication tool others.

The clear advantage is that the documentation is always up to date. Spend time once to develop your tool, generate your doc at any time you want with almost zero cost.

For a simple state machine sed/grep/awk magic is sufficient to generate a dot file.

For a more complex data processing graph, I use boost graph.

</comment><comment><USER27> It's even more fun (better?) to encode 1-bin images directly into source code using the Unicode block character set! You can get 4 pixels per character, and do "lossless" representation of simple binary images:

(UGH! HN doesn't seem to support unicode in comments!)

[https://pastebin.com/raw/Bg5L9ZJV](https://pastebin.com/raw/Bg5L9ZJV)

<comment><USER28> HN supports _some_ unicode in comments: いただきます

I'm not sure if it's a whitelist or a blacklist, but either way it's a deliberately curated subset.

</comment></comment><comment><USER29> Some of those are not technically _ASCII_ art so probably won't be so readable in some editors/fonts, but diagrams are certainly useful in source code --- as long as they are accurate. Otherwise the effort required to update it may mean it becomes inaccurate quickly. Many of the examples show something that is unlikely to change often if at all, which fits the use-case well.

</comment><comment><USER30> They can be really useful, but it's worth bearing in mind that these are all inherently inaccessible to people browsing your source code using a screen reader of some other non-visual presentation mechanism. By all means include them if you want, but it's also good to use them as an enhancement to your textual representation rather than the only source.

</comment><comment><USER31> I've actually used that dBASE diagram to write my own parser,

[http://www.dbfree.org/webdocs/1-documentation/0018-developer...](http://www.dbfree.org/webdocs/1-documentation/0018-developers_stuff_\(advanced\)/os_related_stuff/xbase_file_format.htm)

blast from the past!

</comment><comment><USER32> In my opinion ASCII art can make things look unnecessarily complex. Daunting.

</comment><comment><USER33> I've used asciidraw.com [1] in the past for diagrams like these. I like its simplicity.

Then for fun, if you have to email the diagram, use the shaky tool [2] to convert it to an image.

[1] [http://www.asciidraw.com/#Draw](http://www.asciidraw.com/#Draw) [2] [http://shaky.github.bushong.net/](http://shaky.github.bushong.net/)

</comment><comment><USER34> This is why I use TempleOS. Graphics inline in my Holy C.

</comment><comment><USER35> These examples were nicely curated. Thank you.

</comment><comment><USER36> I'd really like some c/c++ code that nicely prints trees in ascii... never found a good one

</comment><comment><USER37> Not that easy to keep these kind of "docstrings" up to date though.

</comment><comment><USER38> I do this with Monodraw all the time mainly so I can add to markdown files</comment>


Peter G. Neumann and the Hacking Culture of the '50s - <AUTHOR> http://www.nytimes.com/2012/10/30/science/peter-g-neumann-and-the-hacking-culture-of-the-50s.html?src=recg <comment><USER2> This appears to be a followup to the longer story that appeared in the NYT Science section on Tuesday, also posted on HN to almost no comment:

<http://news.ycombinator.com/item?id=4714328> <http://news.ycombinator.com/item?id=4716240> <http://news.ycombinator.com/item?id=4720637>

That story discussed Neumann's work on the DARPA-funded Clean Slate project to "build something new from the bottom up" to respond to security problems.

Neumann is beginning this 5-year project at age 80 -- an interesting response to the "do you still want to be doing this at age 55" thread.

<comment><USER3> I initially skipped the linked story because the (original, NYT-provided) title came across as excessively hokey, leading me to suspect some hyperbolic content.

This is a case where I would have appreciated a bracketed qualification in the HN title.

</comment></comment><comment><USER4> This is an outstanding article profiling Peter G. Neumann. Highly recommended.

<comment><USER3> I take it you mean in particular the related article that jonjacky links in another comment here.

The OP article is pretty brief and superficial. The related article is a good newspaper article with some significant biographical background.</comment></comment>


Memo: Foxconn cost to Wisconsin nearing $4.5B - <AUTHOR> http://host.madison.com/wsj/news/local/govt-and-politics/memo-foxconn-cost-to-public-nearing-billion/article_83a3ab6e-6c7e-553e-ba97-976c9c32fe76.html/ <comment><USER2> In my opinion, environmental regulation exemptions are the real cost to the state[1]. Not to mention its kind of weird to give out an exemption, if the standards are being lowered why is it just for this one entity?

[1] [https://www.wpr.org/wisconsin-foxconn-deal-waives- environmen...](https://www.wpr.org/wisconsin-foxconn-deal-waives- environmental-regulations)

<comment><USER3> I've never heard of anything like this. Is this common?

 _(1) Let Foxconn discharge dredged materials or fill wetlands without a permit. The provision would apply not only to wetlands Foxconn fills when it 's constructing its 1.6 square mile complex, but also to wetlands it fills once its new facility is fully operational. (2) Exempt the company from another state law that requires businesses to create new wetlands when they get permits to fill existing ones. (3) Allow Foxconn to change the course of a stream, or straighten a stream without a permit. (4) Let Foxconn build on a lake or stream bed without a permit. (5) Sidestep a state law that requires environmental impact statements before businesses can begin construction. (6)Let public utility projects begin for the Foxconn complex without approval by the Public Service Commission._

Also, Foxconn gets "refundable tax credits" \-- does this mean state could end up paying FoxConn cash (not merely a break on taxes)? is this also common? I wish every small business could be _paid_ to create jobs.

<comment><USER4> > I wish every small business could be paid to create jobs.

I always thought tax credits for businesses were more related to numbers rackets than to actual economic gain.

Here's a thought experiment:

I take one person from my company, fire him, and split the job into two people. Both get paid less than half of the original guy I fired. Yet one of the keeps the old title. Did I create a job? Yes. Did I grow the economy? Doubtful.

While splitting one job into two seems far fetched, it's not that far fetched to split 8 jobs into 10, say.

<comment><USER5> Actually, you arguably shrank it if the new lower salaries both render the receivers eligible for a greater share of public benefits while subjecting them to lower marginal tax rates.

<comment><USER4> Yeah that's a good point, but that also means there's more rent being paid, more food being bought. So it's probably at best a wash.

</comment></comment></comment></comment></comment><comment><USER6> It is worth noting though that some of these costs are simply tax credits for revenue that wouldn't be collected if the factory isn't build. So they are comparing the "cost" to a basis that assumes the factory gets built and pays normal taxes. Items in that group are:

* State tax credits, $2.85 billion * Local government incentives, $764 million[1] * State sales tax exemption, $139 million

When you add back the revenue that would be generated from 13,000 jobs the state will come out well ahead.

Note, I am not in favor of the government picking corporate winners, but I think it is fair to clarify that the state of WI is not paying FoxConn or pulling money from other places (at least in a large portion of the line items).

[1] I don't know what this actually is, but I would assume it means tax credits based on various metrics (i.e. jobs created).

<comment><USER7> 4.5bn / 15 / 13,000 = $23k cost per job created, give or take, plus the chance for a boosting of local manufacturing. That seems perfectly reasonable.

<comment><USER8> $23k tax collected / job created with a 7.65% state tax rate, roughly means a $300k salary per job for 15 years. Sure sales tax and real estate taxes will help some, so let's be generous and say you only need $200k in average salary for 13k workers over 15 years. That still sounds completely unreasonable to me.

I feel like governments would come out ahead if they refused to negotiate. I guess with multinationals the nash equilibrium leads to governments all ratting out each other... Isn't there something game theory can do to save us here?

<comment><USER9> The prisoners dilemma ultimately proves that in the short term, while you win more if everyone works together, you ultimately risk losing less if you don't work together.

Or rather, if you think another govt might blink and screw you, blink first and screw them to avoid being screwed more by them.

</comment></comment></comment></comment><comment><USER10> I think this kind of subsidy is only slightly better than sports stadiums. They both are shades of the bad parts of capitalism.

If only all states could agree to not give preferential treatment via tax subsidies. It'd be nicer for companies to pick their location based on geography and work force along with tax reasons.

<comment><USER11> >If only all states could agree to not give preferential treatment via tax subsidies.

Any reason a Federal law couldn't do that? Most states agreeing might be good enough.

<comment><USER12> States have latitude on how they tax. I'm thinking it would be a debate as to how much latitude and who could restrict them.

</comment></comment></comment><comment><USER13> Tax credits are not costs. If Foxconn didn't come to Wisconsin none of that money wouldn't be realized. On the other hand, there is very little info in the article on how having a Faxconn facility there will help with the direct benefits which job creation brings.

Relatively speaking, the LA Rams stadium actually cost the LA county $2.6B and there are few direct revenue benefits of it. Otoh, having a city NFL, one can argue increases citizen happiness, which is why this might be worth the investment.

<comment><USER14> There's the third option of Foxconn building the factory in WI despite there not being tax credits offered.

Very few would make the argument that the EITC doesn't cost money because without it people wouldn't have kids. There's likely a correlation, but it's far from an "all or none" situation.

The "simplest" thing to do is to recognize tax credits as expenditures, because it balances things out pretty well and is probably closer to reality. The reality where companies build factories because they need them, and tax credits help but aren't the main reason.

(Thought experiment: we outlaw tax credits for building factories worldwide. Do factories stop getting built entirely?)

<comment><USER15> Your thought experiment already alludes to this: states can compete. If anything, the only thing that was "really" lost, practically, is the difference between WI and the second best offer.

There is no way a company with choice would ever go for a state which unilaterally put its foot down. You need an authority to say: no more credits. Or to otherwise put a quota on credits. That would balance things out. But until they do, it's a tragi-economic race to the bottom. Nash equilibrium and all that :(

<comment><USER9> See the prisoner's dilemma. In the short term, the most likely way to win is to ensure everyone loses.

</comment></comment></comment></comment><comment><USER16> Getting Foxconn to Wisconsin is going to end up being a ridiculous boondoggle. They'll reap the rewards of massive tax cuts and Wisconsin will never see any upside.

<comment><USER17> Jobs are not an upside?

<comment><USER18> Nearly everything creates jobs. An uptick in car crashes or a catastrophic flood would create crisis management jobs and all the insurance and construction infrastructure jobs that go with it.

Exxon Valdez was the most job creating oil tanker to ever sail. Think of the thousands of jobs that have been created to clean that up.

"creating jobs" is a placeholder for "economic activity" with the benefit of always making it appear positive.

It's a euphemism that's used when nothing more legitimate can be found.

In the business context it's insidious in yet another way. Deals and contracts that will make certain privileged people gobs of money is presented as "job creating" because people are needed to execute the deal or do the dirty work. In this case, the Wisconsin tax payer is paying $1,500,000 to foxconn for each job.

The focus is removed from the cost to society, who benefits the most, or the structure and merits of a particular event. They get papered over with the economic equivalent of rainbows and puppies: "job creators".

<comment><USER17> Spoken like someone who has a job.

There are hundreds of thousands of people in this country who could use the work. Why limit their opportunities?

<comment><USER18> It's presented as "This is a non-zero net job thing!" without questioning it. This is a problem. Are the taxpayers squandering say $20 million for creating a minimum wage part-time, 2 week gig? Well let's not limit the opportunity here! Let's waste those 20 million dollars! We're just losing 99.9985% of our principle. What a great investment!

A bad policy fundamentally limits the number of jobs in the long run because by then you've already spent the money poorly, in a way that didn't lead to many jobs at all.

If you could "create X jobs" one way and that would lead to "X*3" jobs later on, wouldn't you want that instead of something that creates "X/4 jobs" in a temporary environment and leads to "create 0 jobs" later on?

If that's the only thing you care about; not the environment, type of job, structure of the work, sustainability of the practice, actual pay, health, culture, well-being of society, if it's only the total quantity of jobs, then it's still a wasteful squandering of resources because you can get "more created jobs" for less money many other ways.

We have to do better than just saying "ok" to every bad deal that comes along.

</comment></comment></comment></comment></comment><comment><USER19> The concept that America is not substantially a crony capitalist economy is at present untenable. There are too many examples otherwise. And if people don't see this development as a primary threat against every principle the US was founded on they are either not paying attention or deluding themselves.

<comment><USER20> At the risk of sounding pedantic: how do you prevent a capitalist economy, an inherent cumulative system that in practice can not be separated from the meta-system that regulates it, from turning into cronyism?

<comment><USER19> I suspect you're looking for some sort of iron clad algorithmic solution that is good for all cases, that's not how it works. The answer is the same as always: eternal vigilance. An educated and engaged electorate. A functional media. And the ability of the government to course correct as necessary. Institutions that feel they are accountable to the will of the electorate. There are, of course, many examples of this not working, but there are examples of it working as well (trust busting around the turn of the 20th century, the breakup of ma-bell, etc.)

</comment></comment></comment><comment><USER21> Predictably, $3 billion is simply a negotiated discount on fees in return for Foxconn choosing Wisconsin over a state not willing to discount fees.

<comment><USER22> I understand what you're saying, but I think you're wrong, for two reasons.

1\. There's a reason that foxconn wants to manufacture in the USA, and there's a reason they're courting states in the great lakes region. Resolving the Prisoner's dilemma becomes much easier when there are ~3 states with viable sites as opposed to 50.

2\. See guelo's comment.

Your point is well-taken in general, but in this particular case, IMO, it really is a stupid giveaway.

</comment></comment><comment><USER23> Would make more sense to just hand the money to the people that would get those 'jobs' and be done with it?

<comment><USER24> Or giving $4.5 Bn tax credits to SMBs across the whole state, instead of just one business in one town in the furthest corner of the state.

</comment></comment><comment><USER25> $4.5B + the long term liability of maintaining all the new infrastructure

Wisconsin is already far behind on the infrastructure maintenance front.

</comment><comment><USER26> I don't disagree with giving out tax credits, I jut disagree with giving them to unreliable companies like Foxconn without a more firm contract. I also potentially disagree with how big the breaks are.

Tesla received a $1.3B incentive from Nevada and a bunch of other perks. At the time, I believed it was a clear net positive for Nevada and I haven't had the chance to look in depth about this deal, but I hope it's the same here.

This isn't a Republican or democrat thing by the way. Both sides do this about equally. Just like Amazon bidding for their campus.

</comment><comment><USER27> I assume the 13,000 supposed jobs require skilled workers being found to want to live in Wisconsin in a time of full employment. I also assume Foxconn wants to pay them wages similar to the ones in China. Good luck with that.

</comment><comment><USER28> In addition to what the others pointed out:

* Worker training, $20 million

* Utility costs, $140 million

Does the state pay for that?

* U.S. Interstate 94 North-South project, $408 million

* Road improvements, $134 million

How is improving the infrastructure a bad thing? FoxConn is a great excuse but they should be doing that anyway, no?

</comment><comment><USER29> So, when employees want a raise from their employer, they generally have to work at the higher level for a while before they get the raise. Essentially working at a discount for a while, until the employer has decided to give the raise.

Why don't we require the same of companies asking for tax breaks? We'll give you the tax break AFTER you've been around for a bit, and you've proven that you're worth it, and that you'll actually do the things you promised you'd do.

<comment><USER30> The best time to negotiate is before you start.

<comment><USER31> I thought it was after you got them to sign the contract?

</comment></comment></comment><comment><USER32> Still amused that the jobs Trump promised will end up to be Foxconn jobs. Not really the jobs people wanted and certainly not the jobs that will rebuild the nation. And ofcourse those jobs will be automated in 20 years max anyway.

The Chinese are not stupid, they're actually moving away from light industry. Decreasing state subsidies.

</comment><comment><USER33> And Steve Jobs told Barack Obama those jobs weren't coming back!

<comment><USER34> 13,000 jobs is essentially indistinguishable from zero if you're looking at a national scale.

</comment></comment><comment><USER35> Note it's a cost not a loss. There's a difference.

I hope there's a good return on investment in a reasonable amount of time.

<comment><USER36> I hope it's better than giving $100,000 in credits to 30,000 small businesses in the greater Milwaukee area.

<comment><USER35> This is an attempt to set a precedent of successful investment on American manufacturing.

Is this idea in particular viable? Probably not.

<comment><USER37> This doesn't make sense, Foxconn already publicized their intention to create these jobs. The incentives just made it more economically feasible for them to do it in this state. Race to the bottom is a phrase that comes to mind.

<comment><USER35> Many countries give short-term incentives to attract long-term foreign investment.

Some countries go as far as providing guarantees for investors in their constitution.

<comment><USER24> Developing countries, sure, and they run a huge risk of propping up an unsustainable economy. Especially when those incentives run out.

Just look at how Argentina's incentives for Blackberry panned out: [https://www.npr.org/2017/02/23/516895101/when-argentina- elec...](https://www.npr.org/2017/02/23/516895101/when-argentina-elected-a- populist-president-some-companies-left-the-country)

<comment><USER35> All investments have associated risks. e.g: Microsoft invested in Nokia and turned out bad, except for the acquisition of a substantial IP portfolio.

</comment></comment></comment></comment></comment></comment></comment><comment><USER38> Will Racine get the suicide nets up-front, or will that have to wait until... later?

[http://www.telegraph.co.uk/news/worldnews/asia/china/9006988...](http://www.telegraph.co.uk/news/worldnews/asia/china/9006988/Mass- suicide-protest-at-Apple-manufacturer-Foxconn-factory.html)

</comment><comment><USER39> I am a Wisconsinite, and I voted for Republicans that are pushing this into place. This whole thing stinks and I'm upset about it. I voted for job creation through lower taxes, not job creation through direct corporate handouts and bribery.

Outside of principled arguments against this sort of thing, one blatant issue is that Wisconsin taxpayers are paying for something that bolsters job creation in the _Chicago_ Metropolitan Statistical Area. Racine is not Milwaukee, Racine is Chicago. The jobs being created and the local economy stimulus are going to spread to Elgin and Waukegan before it makes its way to West Bend and Janesville.

edit: also, why is this on HN?

<comment> 549362-30499 At the risk of taking this wildly off-topic, how you reconcile the massive failure of low taxes = jobs = more revenue in Kansas state politics over the last few years? Is there something about Kansas that makes that lesson not apply here?

<comment><USER39> Any kind of response I would give here would just be regurgitation of junk articles I've read, sorry.

</comment></comment></comment><comment><USER40> On the bright side, it's pocket change compared to the F-35.

Https://politico.com/story/2014/02/f-35-fighter-plane-costs-103579

</comment><comment><USER17> The title is misleading; Foxconn's plant is not costing Wisconsin anywhere near $4.5 billion, according to the article itself. In reality, the state is outlaying very little money to bring in this company, probably about $20 million total. Even the interstate improvements are cited as previously planned and not a special accommodation to Foxconn, except that it was moved up in priority.

Tax exemptions and credits are a common method of enticing businesses to set up shop. The notion that this somehow "costs" the state is mere rhetoric with no factual basis. The money the state is supposedly losing by not taxing the plant never existed. If Foxconn never moved there, there's zero potential of tax revenue. The fact that Foxconn made a deal with the state for a package of tax incentives merely means the state won't collect theoretical corporate and property taxes from this entity. The state is not paying money out of the treasury to Foxconn.

What the state does get from Foxconn is _jobs_. Three thousand jobs is significant, even in a moderately populous state that's already doing well. The employees pay state income tax (ranging from roughly 4% to 7%), they'll spend their paychecks on food, cars, homes, and consumer goods, and the ripple effects will be quite beneficial. The initial construction will employ lots of people as well--builders, inspectors, security, suppliers, utilities, etc.

It's interesting that the Asian countries have long recognized the benefits of plants and factories, whereas in the U.S. people have come to regard these efforts as a bad thing, polluting and greedy and tax evaders. Singapore one time offered HP ten years tax free in return for setting up a laptop factory there; they understood implicitly that technology employment is beneficial to the local economy.

I frankly can't understand why people (aside from NIMBY neighbors who don't want the increased traffic and activity) would characterize this excellent development as a net negative.

<comment><USER41> _> aside from NIMBY neighbors who don't want the increased traffic and activity_

This made me laugh. Let me try to explain why. Kenosha/Racine are about as far from SF Bay / crowded metropolis as you can get. They're bedroom communities of Chicago and Milwaukee with one or two major local employers.

So, trust me, none of the locals care about the traffic/activity. If anything, they welcome it.

However, locals _do_ care about the environmental impacts. Tourism, growth of bedroom communities, and other economic activity related to the location's environmental appeal helped the local economy sustain the hit from auto factory closures. A dirty, polluted lake would rob this region of a somewhat unique/defining natural resource. And the locals know all too well that factories come and go.

So, far from NIMBYism, there's a very intelligent and hyper-rational, purely economic concern about the economic impact of degrading the local ecosystem.

<comment><USER17> The assumption is that a Foxconn plant will destroy the local ecosystem. Any evidence, or just plain anti-business nimby-ism at work here?

</comment></comment></comment><comment><USER42> This is all based on the premise that the $2.85b in tax revenue _automatically_ belongs to the state in the first place.

I understand that most people agree with the above view, and they have what they believe are good reasons to think that. (And no doubt many will reply with these reasons...)

But I don't agree. I don't think that any such forcible takings are justified. If people want (as I do) a government to protect them from a Hobbesian nightmare, let them choose to pay for it voluntarily. Such a government could publish lists of people who have paid, and how much they chose to pay, and maybe with a brief description or statement outlining why. People could then choose for themselves whether or not to have dealings on people on the basis of what they find in that list.

One benefit of this is that you could say, "not a dime from me because you're invading Iraq," or "none of my money may be used to fund executions, drug prosecutions..."

<comment><USER43> One of the useful things science fiction taught me was to look for where the magic comes in to a fictional world. E.g., travel at sub-light speeds makes it inconvenient to write about interstellar empires, so the author creates a magic FTL drive covered over with science doubletalk.

The magic in your fantasy is infinite cognitive capacity. As if each person could carefully look at the list of hundreds of millions of taxpayers across federal, state, county, and city jurisdictions, extract all the information they needed, fairly contextualize it in the total economic and social environment, and then respond appropriately when they meet somebody new over dinner. All the while managing to live their lives, do their work, raise their kids, etc, etc. And that's not even counting the labor of figuring out the correct amount to pay for each function of government, which on its own is an impossible task for a single individual.

In practice, with human cognitive limitations, what we'd have is chaos, parasitic behavior, and a race to the bottom. Which is why we have a system where the free rider problem is instead solved by having a variety of locales one can move to so that individuals can choose the sort of public investment approach they'd like to live under. If you would like to live in 19th-century conditions, you can buy a chunk of land in the middle of nowhere for approximately nothing.

<comment><USER44> "The magic in your fantasy" is a very good check for evaluating the mechanism effects of a new product or service. Thanks for this!</comment></comment></comment>


Working from Home Part 2: Now about how it doesn't suck - <AUTHOR> http://geeksinboston.com/2009/02/04/working-from-home-part-2-why-its-great/?

<comment><USER2> I can definitely relate to the time aspect mentioned here. I find that for very complex design or architecture issues it can sometimes take an hour just to "load" the problem into my memory, such that I can then start thinking around creative solutions to it. I just couldn't do that in the typical open plan office.

<comment><USER3> This is absolutely true for me as well - since working from home in Nov, I've noticed the _quality_ of my work has gone up even more than the quantity because I can concentrate on just the output rather than being self-conscious about looking like I'm working during the runup to the output.

As a designer, for example, I've hit stumbling blocks with certain layouts and now that I think about how I've often solved the problem, I'd probably get tossed to the curb as a weirdo from even the trendiest of open plan offices - I'll list all the UI elements on a sheet of paper, then go lie on the couch for an hour or so and mull them over in my head to let it marinate, maybe go to the corner coffeeshop to read the paper to get my mind off of the gig but with index cards and sharpies by my side in case an idea occurs. I can't isolate when or why, but sometimes that's way more productive than just staring at an empty screen or trolling through CSS gallery sites.

</comment></comment><comment><USER4> I am glad that the author(s) revisited this topic, and acknowledged a few of the benefits.

The earlier "Working from home: Why it sucks" link and discussion (including many benefits) is here:

<http://news.ycombinator.com/item?id=450408>

<comment><USER5> Duplicate of: <http://news.ycombinator.com/item?id=466704> ... honestly I liked both the first article and this second one, but I don't get it why shimon posted it twice on HN -- so I flagged this one.

<comment><USER6> Maybe he forgot that he'd already posted it. Easy to do.

<comment><USER7> But it was yesterday--only ~15 hours earlier. Plus, he added a ? on the end to force the system to accept the duplicate.

</comment></comment></comment></comment><comment><USER8> We are different and a lot of "these" matters are subjective. E.g. some use Vim while others use Emacs and some people prefer to work from home while others prefer to work from an office. What's better is not that objective and people should do what they feel best with.

<comment><USER9> What can be very frustrating in a corporate environment is the unrelenting "one size fits all" attitude. Your workspace. Your toolset (not just what language to use, where I can understand a need to standardize, but what editor and utilities and such). Your flexibility is limited to what pictures you put on your desk.

For me, the distraction in an open space environment kills my productivity. I don't want to be disconnected from my coworkers, but I can't take the constant noise and immediate presence. I get along much worse in such a situation. Give me a little separation, and I'm much more relaxed and focused in face to face meetings, on the phone, in email and IM.

When things are like this, I do quite well. Then something will change and the work environment will suck again. I'll tell my management exactly what has happened and why my productivity has declined. But there is nothing they can do. "But we all work in cubes" is one response I received.

One size fits all. If we do it for you, everyone will want it. We must treat everyone "equally". In the name of "fairness", they force department management to turn a blind eye to individual variances and differing needs.

At least working from home seems to provide some disconnect, in the company's mind. The home environment is not their jurisdiction, and your performance is measured more in terms of results rather than conformity.

One suggestion I have with regard to open space: If you insist on it for your employees, then let them self segregate to some extent. There is always a subset that wants a quieter work environment, but they are spread throughout the organization. Let them colocate in a designated quiet area, akin to the "quiet floor / quiet hall" arrangement at some colleges and universities.

I suppose this would be viewed as overly burdensome in terms of management. Further, I've observed a continued strong drive to physically colocate team members whenever they are at the same facility. But it would take no more physical space, and it would make that portion of the population much happier and more productive.

Next step, let them use decent tools. Don't force them to do finger gymnastics because you keep them on the 5-releases-past version of some commercial editor that has been "blessed". But now I'm just dreaming...

</comment></comment><comment><USER10> Speaking about the "concentration span" I can't but notice that sometimes it's very easy to get lost when you are overly concentrated. That's why it is extremely important to discuss new ideas, algorithms or implementations within the team.

You physically reduce possible sources of distraction when working from home, but you still need to work hard to improve your concentration skills.

That's why I think that a good office ( the one with some private and quiet space for developer) + good discipline ( reserve some time for hanging around and talking, be concentrated all the other time) will work way better than working from home.</comment>


Tell HN: Company returned 3X, but I (investor) may lose money - <AUTHOR> [US Tax Payer here]
I invested X into the company, with a post-money valuation of Y (a minor investor). The company was bought for 3Y. Sounds good, right?
However, the deal was structured such that 1Y was paid in cash, and 2Y was paid in stock of the buying company. (1X and 2X is my respective share of the deal)
So, I got my cash back; the 2X is considered immediate ordinary income, taxed at 35% federal + 13% NYC. So, I'm 48% down on the 2X already.
Enter SEC rule 144 - I'm not allowed to sell these in the first 6 months. That might have been ok, if the buying company didn't go down some 40% since then.
So, I'm still more than break even, but not a lot more. If the company goes down (in total) more than 52% in those 6 months, I'm going to be losing money on a successful investment.
Thanks to US security and tax laws. <comment> ldd- Sounds like you're in the same boat as everyone else in your round, right? It's simply a function of the timing of the deal (less than a year since you invested, apparently) and the deal structure (cash vs. stock).

Stock inherently requires the acquired company to share the risk of the deal.

If the stock goes down further, you should be able to claim the loss on your taxes when you sell, which should mean you would need more than a 52% total decline to go in the red on the deal.

Are you an accredited investor? If not, you may have some legal outs to demand your money back, but you'd need to chat with a lawyer. If you were to pursue that route, though, you'd likely ruin any credibility to make future investments in other companies.

Kinda stinks that there's the gap between tax law and SEC regs timing, though. Good luck with the investment!

<comment><AUTHOR> > Sounds like you're in the same boat as everyone else in your round, right?

5% of the investment is accounted for by US tax payers. The rest are not, so I'm not in the same boat.

> If the stock goes down further, you should be able to claim the loss on your > taxes when you sell, which should mean you would need more than a 52% total > decline to go in the red on the deal.

No. The tax event is on the grant, not a capital gain (therefore capital loss does not cancel). Furthermore, if I fall under AMT (very likely), I can't deduct anything.

> Are you an accredited investor?

Yes.

<comment> ldd- >No. The tax event is on the grant, not capital gain (therefore capital loss does not cancel). Furthermore, if I fall under AMT (very likely), I can't deduct anything.

Ooph . . . sorry. However, just so I understand, if your shares were to rise above the transaction price, would you not be subject to capital gains tax on the gain? It would seem a bit misaligned if you could be taxed on gains but not benefit from losses (however, I wouldn't put that past the codes and that still wouldn't account for AMT issues).

Good luck with it!

<comment><AUTHOR> > if your shares were to rise above the transaction price, would you not be > subject to capital gains tax on the gain?

Yes. The way the IRS views it, I was given a an ordinary income bonus which consisted of new shares, and which was valued at $Z during the grant (and taxed as such, at that second). From now on, I own shares, so capital treatment goes into the future. If the stocks drop, I will have capital loss when I sell them -- but I need some other capital gain to net against.

</comment></comment></comment></comment><comment><USER2> Sorry you're going through this, but it is a great example of how certain tax and security laws create unhealthy barriers to the free market. Personally, I've never understood the logic of paying tax on stock that you receive before you dispose of it. Seems that tax policies like this do nothing but keep small investors out.

<comment><USER3> And the sadder part is that richer investors know their way around those taxes better than new comers because they have access to accountant professionals who can advise to pay less tax.

<comment><USER4> I'm not a tax expert so this assumption may be wrong, but if the 2X is being taxed as ordinary income at 35% wouldn't that imply that beagle3 is making at least $379,150 + 2X this year? I would consider someone with that kind of income to be rich.

Also, if the stock has gone down 40% can't you claim that as a loss when you sell and lessen your overall tax burden?

<comment><USER5> > wouldn't that imply that beagle3 is making at least $379,150 + 2X this year? > I would consider someone with that kind of income to be rich.

So what?

Seriously - do you think that the US govt or NYC is likely to do better with that money than he would have? Based on what?

<comment><USER4> In my comment I did not state whether I agree or disagree with the current US tax laws and that was not the point. I was responding to the post above mine which I think made some incorrect assumptions concerning beagle3's income level and ability to afford professional accountants.

</comment></comment></comment></comment></comment><comment><USER6> It's obvious, but this fact escapes so many people today: we do not have capitalism in the US.

What does a free market mean, anyway? Free of what? It means freedom from your neighbors, no matter if it's just one of them breaking into your house at night, or a whole bunch of them voting for laws to take what's rightfully yours by day. To put it another way, in a free market, others can't control when you buy or sell, nor can they take your money by force or fraud, even if they call it "taxes."

<comment><USER7> Capitalism doesn't require a free market, and the definition of a free market allows for tax collection by the government.

Your definition of both is simply wrong.

<comment><USER6> I don't agree.

Here's the most definitive definition of capitalism (written by what many today acknowledge as its greatest champion): <http://aynrandlexicon.com/lexicon/capitalism.html>

From the link: _Capitalism is a social system based on the recognition of individual rights, including property rights, in which all property is privately owned._

Today, we don't come close to this ideal. One example of this is that the government is the largest single landowner in the country: [http://strangemaps.files.wordpress.com/2008/06/map- owns_the_...](http://strangemaps.files.wordpress.com/2008/06/map- owns_the_west.jpg) Need I mention Fannie Mae and Freddie Mac, the alphabet soup of regulatory agencies, the Federal Reserve, the giant social programs that redistribute forcibly? None of these things existed a century ago when this country was on the rise.

 _When I say "capitalism," I mean a full, pure, uncontrolled, unregulated laissez-faire capitalism—with a separation of state and economics, in the same way and for the same reasons as the separation of state and church._

This is something we've never had, even in the 19th century. When we do, the human flourishing unleashed will make the lives for those who live it more vibrant and fulfilling than anything seen before on Earth.

<comment><USER8> > From the link: Capitalism is a social system based on the recognition of > individual rights, including property rights, in which all property is > privately owned.

The real definition, from wikipedia: "Capitalism is an economic system structured upon the accumulation of capital in which the means of production are privately owned and operated for profit, usually in competitive markets." Ayn Rand's definition looks more like libertarianism ("a political philosophy that upholds individual liberty, especially freedom of expression and action ... minimization of the state and sharing the goal of maximizing individual liberty and freedom.").

</comment></comment></comment></comment><comment><USER9> Why didn't you invest the money via a loan to an offshore company that then invested the money? That way you'd only pay tax when you paid yourself out of that company.

</comment><comment><USER5> Why wasn't some of the cash treated as tax-free return of capital?

If all of your investment was treated that way, you'd just be hosed on the profit that you made on the deal. Yes, that ignores the time value of money, but ....

</comment><comment><USER10> I always thought these deals were typically done as stock swaps so it doesn't affect your capital gains?

<comment><AUTHOR> Only if done in very specific way (google "triangular merger", there are several variations).

This deal wasn't, and I wasn't in the driver seat to make it that way.

<comment><USER10> That's what I thought. How do they offer cash in that type of deal? As a fixed price purchase agreement that hits after the holding period?

(I'm still learning how all of this works..)

<comment><AUTHOR> No, there can be a cash at the beginning, no larger than 20% or 50% of the deal (depending on whether it is reverse or forward merger. Get a tax specialist if these details matter to you and you are in the driver seat)

<comment><USER10> With any luck perhaps some day I'll be in the driver's seat. For now I'm just taking advantage of whenever I see an opportunity to pick up some knowledge. :)

</comment></comment></comment></comment></comment><comment><USER11> Couldn't you have written 6-month PUT options?

<comment><AUTHOR> I probably could. The stock went down during the week I was trying to get clearance from my lawyer :( It used to be illegal to hedge against SEC rule 144; Apparently, it is now legal (but check with your lawyer before you hedge -- don't trust an anonymous person on the internet)

<comment><USER11> Sorry, I should have mentioned IANAL and not even a US citizen. It'd probably be seen as trying to circumvent laws wouldn't it? That'd be bad.

On the other hand, the major investors would lose out even more wouldn't they? Didn't they build any protection into their sale clauses?

</comment></comment></comment><comment><USER12> Do SEC rules prohibit you from hedging?

<comment><AUTHOR> They used to explicitly prohibit you.

As far as I can tell, they don't explicitly prohibit you but they say something like "we'll look at it badly if you do" in their publications. Make of that what you will.

<comment><USER13> Why would they care? I really can't think of a rationale for that stance.

OTOH why would I presume one should exist?

<comment><AUTHOR> Well, it's basically a protection against intricate pump-and-dump schemes that include mergers and acquisitions - the rule basically says shares allocated (rather than _bought_ or invested into) need to be held for 6 months. (It is sometimes known as "lockup period", and versions of it exist in many countries).

However, the entire allocated stock in this deal is ~1% of the buying company; so this protects no one. Even if all of the allocated shares were sold on day 1, the stock would not have moved more than ~5% as a result. However, the market conditions has caused it to move 40% in a week.

</comment></comment></comment></comment><comment><USER14> Ouch. Now you know what it feels like to work for a startup.</comment>


How and why CPUs do "branch prediction" (2017) - <AUTHOR> https://danluu.com/branch-prediction/ <comment><USER2> One fun thing to note is that the author doesn't really talk a lot about anything from this decade, which makes sense considering how much complexity was being added for the tiny improvements towards the end. Modern branch predictors are quite complicated so they can eke out improvements in accuracy by fractions of a percent.

<comment><USER3> Improving CPUs since ~2003 has just been incredibly hard. My favorite satire- history account remains The Slow Winter: [https://scholar.harvard.edu/files/mickens/files/theslowwinte...](https://scholar.harvard.edu/files/mickens/files/theslowwinter.pdf)

> "I wonder if we can make branch predictors even more accurate," and the next > day you'd start XOR'ing the branch's PC address with a shift register > containing the branch's recent branching history, because in those days, you > could XOR anything with anything and get something useful, and you test the > new branch predictor, and now you're up to 96% accuracy, ...

> When you retire in 2003, your face is wrinkled from all of the smiles, and > even though you've been sued by several pedestrians who suddenly acquired > rare paintings as hats, you go out on top, the master of your domain. You > look at your son John, who just joined Intel, and you rest well at night, > knowing that he can look forward to a pliant universe and an easy life. > Unfortunately for John, the branches made a pact with Satan and quantum > mechanics during a midnight screening of "Weekend at Bernie's II."

</comment></comment><comment><USER4> Discussed at the time: [https://news.ycombinator.com/item?id=15078574](https://news.ycombinator.com/item?id=15078574)

</comment><comment><USER5> In some/many cases there is code before the branch that does not influence the branch condition. In that case, would it be possible to architect the cpu such that it could execute the branch 'early'? I'm thinking of a special asm instruction like 'execute the next 4 instructions, and only then do the conditional jump'.

E.g. instead of:

      i=0
      StartLoop:
      i+=1
      do_stuff_0
      do_stuff_1
      do_stuff_2
      do_stuff_3
      if i<N goto StartLoop

we would have:

      i=0
      StartLoop:
      i+=1
      do_stuff_0
      do_stuff_1
      if i<N goto StartLoop in 2 instructions
      do_stuff_2
      do_stuff_3

<comment><USER6> Yes, that was made explicit in the MIPS instruction set with branch (and load) delay slots, and it's implicit in out-of-order processors. As I understand it the branch delay slot paradigm did not pan out as well as was hoped and it has not found its way into many other architectures.

<comment><USER7> The issue with the branch delay slot is that it assumes there is exactly one clock cycle (I.e. one stage) between fetch and execute. This was true on some of the early 5 stage in order riscs, but hasn't been true for a while. In an high frequency in order design there are maybe a dozen stages/clock cycles which would be hard to fill with delay slots. OoO is even more complicated.

</comment></comment></comment><comment><USER8> really great article. love it, super clear and consise. This kind of mechanisms are super interesting to learn more about. I'm curious to the new AMD cpus which use neural network to predict branches, how that fits into the performance and what kind of accuracy it peaks at.

<comment><USER9> A brief introduction can be found in this post here:

[https://chasethedevil.github.io/post/the_neural_network_in_y...](https://chasethedevil.github.io/post/the_neural_network_in_your_cpu/)

It talks about "Dynamic Branch Prediction with Perceptrons" (Jimenez 2001) which sparked the whole thing.

The AMD engineers read this paper (and probably many more!), put together a development program, and shipped it.

</comment></comment><comment><USER10> reading these make me feel like i don't know much about programming :D

<comment><USER11> Ha, ha.:-) A lot of us are in the same boat except that few are willing to acknowledge it openly. That said; i can suggest the following for further reading (from simple to advanced);

a) Eben Upton's write-up on "Raspberry Pi and Spectre/Meltdown" gives a very nice overview of the main features of modern processors - [https://www.raspberrypi.org/blog/why-raspberry-pi-isnt- vulne...](https://www.raspberrypi.org/blog/why-raspberry-pi-isnt-vulnerable- to-spectre-or-meltdown/)

b) Inside the Machine: An Illustrated Introduction to Microprocessors and Computer Architecture by Jon Stokes.

c) Computer Systems: A Programmer's Perspective by Bryant and O'Hallaron.

d) Modern Processor Design: Fundamentals of Superscalar Processors by Shen and Lipasti

</comment></comment><comment><USER12> Regarding fixed precision neural networks, it looks like Intel had some fairly mature work on this at ISCA -- fast inference, but have to train elsewhere in the machine:

[https://arxiv.org/abs/1906.09889](https://arxiv.org/abs/1906.09889)

</comment><comment><USER13> This is a good primer for understanding the Spectre[0] issue. In a nutshell, Spectre is caused by the CPU keeping the branches in an unencrypted cache that is accessible from programs other than the one that generated the branch.

Their fix was to add an extra kernel check for unauthorized access, which is why it causes a huge performance hit. The real fix will be in the next generation of chips, which will either encrypt or at the least protect the branch cache from unauthorized access from other programs.

[0] [https://en.wikipedia.org/wiki/Spectre_(security_vulnerabilit...](https://en.wikipedia.org/wiki/Spectre_\(security_vulnerability\))

<comment><USER2> > In a nutshell, Spectre is caused by the CPU keeping the branches in an > unencrypted cache that is accessible from programs other than the one that > generated the branch.

I would instead say that the branch prediction has observable side effects even when it's thrown away; say, for example, the branch performs a memory access: it may leave things in the cache even if the processor doesn't take the branch and hence it may be possible to recover information by running a timing attack on how long it takes to access certain things.

</comment></comment><comment><USER14> I feel like fixed precision neural nets are probably the future of branch prediction. Both 'hardcoding' a neural net on a large amount of software and then designing the weights into the CPU in a ROM, but also dynamic approaches to deciding which prediction strategy to use for a specific branch based on state recorded by another neural net.

Approaches like this have been used as a fun exercise, but now I think we're reaching the point where single thread performance is so important, and mispredicts are getting more expensive, so it's worth taking quite a big power and area hit to get a few more percentage points of performance...

<comment><USER15> > but now I think we're reaching the point where single thread performance is > so important

Ever since Denard scaling stopped, the biggest boosts to performance have been in increasing the parallelization opportunity, both at the SIMD level and at the multi-core level. Admittedly, working in HPC gives me a biased view, but everyone I see has resigned themselves to processors ceasing to give meaningful boosts to single-threaded performance.

Moreover, the ceiling you could get in boosting single-threaded performance with a perfect branch predictor (for conditional branches) over current state- of-the-art is around 4%. There's just not a lot of upside to be had, and even just using the extra space for another core looks preferable at that low ceilings. Extra area for the branch predictor is likely to go to better indirect branch prediction (including virtual function calls), which are increasingly important in modern workloads, and where there is a much larger headroom for performance improvement.

I'll also add that the effectiveness of neural nets in modern machine learning contexts has come from making them big and deep, and deep means adding latency to the branch predictor, which is not what you want (especially because you want to know ASAP if you need to prefetch a different I-cache line).

<comment><USER7> Thing is not everything is amenable to simd or multithreaded optimization. As you said yourself, a lot of HPC code tend to parallelize more easily than average. For a lot of code out of order execution is the only way to extract some amount of parallelism, and one of the biggest limiting factors to increasing the reorder window is branch prediction rate. Even an improvement of 0.1% in the prediction rate can lead to non trivial improvements in performance.

<comment><USER16> > For a lot of code out of order execution is the only way to extract some > amount of parallelism

But that's the thing. A CPU is simply a parallel machine forced to accelerate "sequential" code.

A "truly sequential" code sequence, like linkedList->head->next->next->next cannot be parallelized on a modern CPU. The only stuff that can be parallelized are if-statements / loops (aka: branch prediction: try to do the future speculatively), and anything Tomasulo's algorithm happens to pick up.

Even then: the modern CPU will attempt to parallelize that linked-list access because of Cache prefetching. That's actually why Arrays work so well in today's architectures: because the L1, L2, L3, and DRAM components are working in parallel through Cache Prefetchers (and Arrays are so simple that speculation will certainly be correct).

In effect: people are writing parallel programs. They are just leaving it to the CPU to figure out the parallelism details.

X = Y + Z; A = B + C can be made parallel (independent variables).

X = Y + Z; X = D + E. Also parallel: Write-after-write hazard, so X=D+E can execute first, and just throw away X=Y+Z entirely. Etc. etc.

CPUs simply find these patterns in your code and execute them in parallel.

AMD Zen has 4-integer pipelines + 4-vector pipelines + 2 load/store units per core.

Intel has 8-pipelines of varying capabilities per core. 0, 1, 5 are vector units, but 0 is also the division pipeline. Its a bit more complicated, but its still 8x parallelism that is being fed by the front-end (and reordered into the correct order by the backend).

\</comment></comment></comment></comment><comment></comment><comment>--

Basically: the parallelism does exist in the code that was written. The programmer just hasn't explicitly acknowledged it yet.

But with every "speculative" branch taken, the CPU does work, and then (maybe) throws it away. The GPU-basis of coding is to not do any speculative work at all. Instead, GPUs throw 10-threads per shader (kinda like a core) and SMT the heck out of them.

If thread#0 accesses memory, it will be stuck doing that for 300+ cycles. So thread#1 will take over the core. When thread#1 waits on memory, thread#2 takes over. Etc. etc. By the time thread#9 and #10 roll around, thread#1 probably has its memory ready.

Instead of speculatively executing thread#0, the GPU is provided with alternative work it can do. In any HPC context, there's probably "more work to do" somewhere, so the GPU can remain saturated with work to do. Its naturally a more power-efficient methodology: there's less wasted work.

It just requires the programmer to figure out a lot of tasks that the GPU can do to remain saturated. While a CPU will dedicate more and more resources, all the way towards speculative execution, to accelerate the same task. Even if its highly wasteful.

</comment><comment><USER17> What's the state of the art of indirect jump prediction?

<comment><USER18> [https://hal.inria.fr/hal-00639041/document](https://hal.inria.fr/hal-00639041/document)

Might be of interest

<comment><USER17> Thank you!

<comment><USER18> If you want to see other fun uses of (IT)TAGE I'd recommend reading Arthur Persis & Seznec's work on value prediction [https://www.google.com/url?sa=t&source=web&rct=j&url=https:/...](https://www.google.com/url?sa=t&source=web&rct=j&url=https://hal.inria.fr/hal-01193175&ved=2ahUKEwjR2sqp1JbjAhW0VBUIHeviAtIQFjAKegQIBRAC&usg=AOvVaw2TpKm23-KjxyAj6jxnlCIR)</comment></comment></comment></comment>


Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controversy - <AUTHOR> http://www.rubyinside.com/rails-3-1-adopts-coffeescript-jquery-sass-and-controversy-4669.html <comment><USER2> Well, bad news guys:

<http://doihavetousecoffeescriptinrails.com/>

</comment><comment><USER3> I don't see why this should be controversial, it's so easy to switch to Haml, Sass or jQuery when you need/want to. The defaults are there to get the uninitiated off the ground as quickly as possible, and is in keeping with the 'rails way'.

I, on the other hand, have my 'own way', and rails doesn't in any way prevent me from implementing that when I start a new rails project.

</comment><comment><USER4> How will this be integrated? Does this just mean when I generate a rails project, I'll see:

      gem 'haml'
      gem 'coffee'

in my Gemfile? That's cool, I just hope this stuff isn't vendored.

<comment><USER5> Yes, that's about it. In fact, that's what the diff shows if you follow the link.. :)

(no haml though). This is purely about adding a line saying

gem 'coffee-script'

That's it. Lots of 'nerdrage' in the comments though, feels like reading 4chan. Considering that more and more people like to point to Github as a reference for their future employers I do wonder what the motivations are for some of these comments.

</comment></comment><comment><USER6> While I don't agree with this change, I have to hand it to DHH -- he brings "opinionated" to breathtaking heights :)

And he's right -- these kind of changes may be controversial, but Rails was never about being mainstream / safe / conservative. Rails was always about being productive, and in that context taking risks is good -- which is the reason for the dozens of Rails-clones written in dozens of languages.

<comment><USER2> It amazes me how many developers (even ones who like coffeescript) feel compelled to rage on behalf some hypothetical developer who is capable of learning all of the other stuff in Rails but whose head will explode the moment he touches a .coffee file.

Not to mention the people who "left Ruby a while ago" but are somehow super passionate about this commit.

<comment><USER6> If you're referring to my disagreement, I disagree simply because IMHO, the price paid for Coffeescript is not worth it. But heck, whatever.

<comment><USER2> Haha, I wouldn't really consider your post "raging" (if it was intended to be, it needs way more hyperbole), it was a response to your comment about the controversial nature.

</comment></comment></comment></comment><comment><USER7> Why not haml? Was there a discussion about this?

<comment><USER8> DHH finds it to be a "splinter in [his] brain": <https://twitter.com/#!/dhh/status/58289541068492800>

Can't say I disagree with him. Sass extends CSS with extra functionality. CoffeeScript allows complicated things to be expressed easily. But Haml is essentially an aesthetic thing for coders who merely don't like HTML, IMHO. (But luckily it's _so easy_ to add in and if you use the "haml" extension on your views, it should mostly Just Work™ so it's all cool!)

<comment><USER9> _CoffeeScript allows complicated things to be expressed easily. But Haml is essentially an aesthetic thing for coders who merely don't like HTML, IMHO._

Haml and CoffeeScript serve practically the same type of role (the greater complexity of JS notwithstanding).

"It's just an aesthetic thing" can be used to dismiss practically anything, even the differences between, say, Ruby and Java.

If you're writing a lot of HTML, turning

            qux

into

      .foo
        #bar
          %span.baz qux

is a big win. It reduces the noise in a template substantially and is a perfect impedance match with the CSS3/JQuery selector syntax.

For what it's worth, I hated Haml until my third time playing with it. :)

<comment><USER10> HAML is a DSL for doing HTML markup & templating, Coffeescript is a "language extension" to JavaScript. How are they playing the same role???

<comment><USER11> "Is a rose by any other name still not a rose?"

I write HAML, the plugin generates HTML.

I write Coffeescript, the plugin generates Javascript.

Surely you can see how these two are similar. Yes, there are more precise definitions for each, but pragmatically, they play a similar role.

<comment><USER8> Except that a proficient Haml developer will still need to "think in HTML" and Haml is just another way to express it.

CoffeeScript goes so far and introduces enough new concepts that you can "think in CoffeeScript" and not worry about JavaScript _too much_.

You're right that the translation idea is similar but I can't agree that the mental model for using both is similar.

</comment></comment></comment></comment></comment></comment><comment><USER12> Who cares? How much longer is this going to drag on? It doesn't force you to use CoffeeScript, you can easily continue to write JavaScript or Sass with no detrimental effects. If I understand correctly, it only changes the templates created.

<comment><USER13> It doesn't even change templates. I literally is one line of code in a configuration file (the Gemfile) which most people populate with their own settings anyway.

Without it being explicitly talked about, a Rails developer wouldn't see the difference beyond "Hmm, I wonder what CoffeeScript is?"</comment></comment>


Printing Wikipedia Would Take 1 Million Pages, But That's Sort Of The Point - <AUTHOR> http://www.npr.org/blogs/alltechconsidered/2014/03/27/295262783/printing-wikipedia-would-take-1-million-pages-but-thats-sort-of-the-point <comment><USER2> [http://web.archive.org/web/20010406105746/http://www.wikiped...](http://web.archive.org/web/20010406105746/http://www.wikipedia.com/wiki/Wikipedia)</comment>


Who Becomes an Inventor in America? [pdf] - <AUTHOR> http://www.equality-of-opportunity.org/assets/documents/inventors_paper.pdf <comment><USER2> TL;DR -

1) Children from high-income (top 1%) families are ten times as likely to become inventors

2) Exposure to innovation during childhood has significant causal effects on children's propensities to become inventors

3) The financial returns to inventions are extremely skewed and highly correlated with their scientific impact (Which basically means your product gotta sell good)

</comment><comment><USER3> amazing paper. Thanks for sharing.</comment>