How to get bias into a Wikipedia article - <AUTHOR> http://en.wikipedia.org/wiki/User:Ravpapa/Tilt <comment><USER3> My favorite example of bias introduced to Wikipedia is by some obviously religious fanatics that managed to add the big section of "Religious views" to biographies of most of famous people of science, and then misinterpret their quotes to support the view that all were religious, in a sense of "supporting/believing in the existing religions."

The best example, Einstein:

[http://en.wikipedia.org/wiki/Albert_Einstein's_religious_vie...](http://en.wikipedia.org/wiki/Albert_Einstein's_religious_views)

"Albert Einstein's religious views have been studied extensively. He said he believed in the "pantheistic" God of Baruch Spinoza, but not in a personal god, a belief he criticized." And there's no citation re "pantheistic." That is, as stated the claim appears to support the view that there were Einstein's words that mention the "pantheistic" as the most important thing of "Spinoza's" God.

If fact, the only quote, of course not cited in Wikipedia, where Einstein explicitly mentions "pantheism" is apparently:

[http://www.einsteinandreligion.com/spinoza.html](http://www.einsteinandreligion.com/spinoza.html)

"I'm not an atheist and I don't think I can call myself a pantheist."

The only fair description would be "he was an agnostic" and that's all. Instead, the "pantheism" is effectively promoted before, making "agnosticism" his second choice, which it wasn't. Specifically, he quotes Spinoza in order to point to the previous thinker that rejected the belief that the soul exists separately from the body. That's why he mentions him (as seen in the full quote linked above).

He was frequently quoted to declare himself agnostic, whereas he mentions Spinoza's God only in one mail.

Still, try to remove obviously lying "pantheistic" pseudo quote/promotion from Wikipedia's texts about Einstein.

And the same thing is repeated for a lot of other scientists!

<comment><USER4> I find Neil deGrasse Tyson's case is particularly amusing, where he himself corrected it multiple times only to find it changed back to "atheist" (from "agnostic").

[http://www.youtube.com/watch?v=CzSMC5rWvos](http://www.youtube.com/watch?v=CzSMC5rWvos) around 1:31.

<comment><USER5> I find the labeling of people very frustrating.

People often have very good reasons to pick the labels they do, but those reasons are often fairly nuanced. The only way to respect that nuance is to honor the label. And you don't even have to be Neil deGrasse Tyson to run into relabelling.

Whether that relabeling is done by a Pew poll that labels you as a religious person because you attended a single religious service one year because you were curious about an unknown slice of culture, or by a friend trying to soften your image by labeling you as something they think is less offensive, it's infuriating.

I can't imagine how frustrating this has to be for someone who actually has the burden of having a voice that people are interested in hearing; when someone reduces a careful and intimate response to a fairly personal question to not only a single word, but the wrong word.

It makes me sick.

<comment><USER6> The general thrust of Wikipedia policy is that on religion, sexuality and other similar issues, self-identity trumps all.

We've had all sorts of problems with this: there was an actor a few years ago who gave an interview to a British gay magazine talking about how he was out as gay. But then the prospect of him becoming big in Hollywood came along and his agent wanted to erase this, or sort of have it fade away into ambiguity. What do you do in those kinds of circumstances?

The flip side of that is I've cleaned up horrible biographies written by people who absolutely loathe particular people without even a faint hint of neutrality.

<comment><USER3> Why can't the people be simply exactly and fully quoted instead of having something else put in their mouth?

Why can't we see Einsteins quote from 1954 in the main article about him

"The word God is for me nothing more than the expression and product of human weaknesses, the Bible a collection of honourable, but still primitive legends. No interpretation no matter how subtle can (for me) change this. These subtilised interpretations are highly manifold according to their nature and have almost nothing to do with the original text"

instead of referring to "pantheistic" "Spinoza's God" out of his letter 1929 to interpretations of which he referred also in 1954:

"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it."

Even where the quotes exist (the separate article) they are intentionally shuffled to appear that he at the end it's important that he believed in "Spinoza's God" (by placing that quote after the later ones and hiding the context).

The answer is: those that win edit wars are religious, and they try to obscure his words "The word God is for me nothing more than the expression and product of human weaknesses." If the "smartest man" says that, and they do believe in God, they feel "stupid," and they simply can't accept that, facts be damned.

</comment></comment></comment></comment></comment><comment><USER7> What's also interesting is the bias that appears when the same topic is covered in different languages. Take the English and Spanish articles about the Battle of Vitoria:

[http://en.wikipedia.org/wiki/Battle_of_Vitoria](http://en.wikipedia.org/wiki/Battle_of_Vitoria)

[http://es.wikipedia.org/wiki/Batalla_de_Vitoria](http://es.wikipedia.org/wiki/Batalla_de_Vitoria)

You don't need to be able to speak Spanish - just check out the list of the battle commanders. (And if you do speak Spanish, you can see how the description of the battle differs quite radically too...)

I'm not sure what the solution to this and the main article's problem is, though, other than vigilance.

<comment><USER8> > I'm not sure what the solution to this and the main article's problem is, > though, other than vigilance.

Generally, it helps to not rely on a single point of information. The more sources and viewpoins you consider, the more accurate the picture becomes. Even reading very biased sources can help you get a clearer picture when you intersect their information with a source from the "other" side. Also, as long as you speak only one language, you will miss out a lot as the media copy from each other and there often is bias in the language itself. For example, consider how different the meaning of "liberal" has become in English and German, even though it meant the same originally. Or consider the fact that Germans tend to use faecal terms to curse while in English, sexual terms are more common. This can subtly influence the way we think about things. Generally, the easier it is to express a viewpoint in a language, the more prevalent that viewpoint becomes. For example, before the term "political correctness" was added to the English language, it was much harder to comlain about it.

I diverted a little from the original point. Considering multiple sources in multiple languages helps a lot.

<comment><USER7> > Or consider the fact that Germans tend to use faecal terms to curse while in > English, sexual terms are more common.

Bullshit.

:)

(But I fully agree with the rest of what you say).

<comment><USER9> > tend.

"Bullshit" is vulgar slang, not cursing. You don't yell "Bullshit" when you stub your toe.

<comment><USER10> "Shit" isn't uncommon, though. It seems to me that English-language cursing is pretty broad-spectrum. For the toe-stubbing situation, for instance, you have the scatological ("Shit!"), the religious ("Christ!", "Damn!"), the sexual ("Fuck!"), the anatomical ("Arse!", at least in the UK; I don't think "ass" is used that way in the US), the weird-hybrid-between-sexual-and-religious-and- ethnic-minority-abuse ("Bugger!"; look its etymology up some time).

Personally, I usually just say "ow".

<comment><USER7> And let's not forget a personal favourite: "You fucking piece of shit!", which nicely spans the faecal/sexual linguistic divide.

</comment></comment></comment></comment></comment></comment><comment><USER11> this is at best a sub-point of the main article, but it's one that I find particularly chilling: if you want people to believe something, the easiest way to accomplish that is to lie to them. From the article:

""" It is important to know, though, that in the battle over reliable sources anything goes - lying, trickery, the basest chicanery. Jaakobou complained that Peace Now - a group devoted to researching the expansion of Jewish settlements in the West Bank - had made up a citation from a government report on the West Bank settlement of Mitzpe Ha'ai that appeared on the group's website. "I went ahead and checked their claim that an official report requested by the Prime Minister stated something on Mitzpe Ha'ai. The Mitzpe was not mentioned in the original," he wrote in the discussion on the Reliable sources noticeboard. When someone pointed out the section and page where the settlement was mentioned, he claimed that the mention did not include the specific information that was included in the article. When the original passage was quoted in its entirety, he still didn't give up; he claimed that the addition of a satellite photo of the settlement on the web page made the citation unreliable ("citing the content to Peace Now is problematic, since they add their own words and images to wiki-reliable information").

The point is: never give up. If you don't win this time, maybe you will win next time. """

<comment><USER12> It does seem familiar. Almost as though the news recently may have featured a government somewhere somehow lying being called on the lie and then repeating this cycle a few times. </sarcasm>

I hope that these types of tricks start getting taught in schools so that young people learn to recognise them at an earlier age. More important than analysing Moby Dick.

<comment><USER13> I think similar types of tricks are taught in many U.S. school systems, but only as they apply to commercials. It would be great if critical thinking skills, in general, were taught. Schools would have to walk a fine line, though. Just as others pointed out bias in this article, parents and other "interested parties" would point out bias in the school's teaching - <USER2> chosen for critical analysis, results of the analysis, the teacher's (perceived) bias. These battles are constantly fought at the textbook level: historical interpetation, too much/not enough multi-culturalism, evolution vs. creationism. ..

Besides, what you describe can't really be tested on a standardized, fill-in- the-bubble test. And to the extent that it can, there would be endless arguments about the correct answer.

Great suggestion, but hard to implement pragmatically.

</comment></comment></comment><comment><USER14> Somehow I can't shake off the feeling that this article itself has bias. So meta.

<comment><USER15> It certainly does and it never claims otherwise. However, even though it shows examples that are biased mostly to one side it points out and describes the techniques used to create the bias, so you're free to use the knowledge gained to help yourself recognize the other sides attempts at creating a bias.

<comment><USER14> What I meant is that it points out biased articles in a way that itself is biased. To be more specific, it seems to have a pretty strong pro-Israeli bias.

<comment><USER16> Most of the article seemed to be defending Gideon Levy ([http://en.wikipedia.org/wiki/Gideon_Levy](http://en.wikipedia.org/wiki/Gideon_Levy)), so I don't think it has a pro-Israeli bias.

<comment><USER17> It looks pro-Israel to me.

<comment><USER18> That is a pretty useless^H^H^H^H^H^H^H subjective statement. The author is clearly trying to alternate between examples for pro Israeli and pro Palestinian bias.

<comment><USER19> Well the user's name is Rav Papa, who is a well known Jewish roman-era scholar, which is one tactic he doesn't mention, press all your advantages, usernames are a great way to show fain to be one side but really be the other.

<comment><USER18> Well, I wasn't aware. Now that we know about his evil ethnicity, we can stop talking about his article and finally condemn the filthy Jew.

<comment><USER19> Lol, I wish you had looked at my comment history before you had said that. ( I too have been outed as a JUDEENRAT).

Personally I think he was attempting to be impartial though towards the end it became apparent that he was more pro-BDS than peace (now you know how I feel about this).

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER5> I ran into my first experience with this sort of thing while looking into Mormon initiation rites on wikipedia. I certainly understand why Mormons may be interested in keeping initiation secrets off of wikipedia, but wikipedia has no interest in censoring that information. And yet, at least the last time I checked, I had a very hard time finding that in part because of the mess of articles I ran across and the reshuffling of articles.

Is there an easy way to search for deleted articles and read the discussion history for them?

</comment><comment><USER20> Sometimes I feel that I don't spend my time on earth in an optimal way. Then I read about people living their life by doing editing wars over a salad(!). Life is not that bad actually when I think about it.

</comment><comment><USER21> Step 1, add a talk page about "How to add bias into Wikipedia" discussing bias from a very pro-Israeli point of view.

Seed distrust, misinformation and be obvious that this article is biased, make no attempt to hide it, this blatant display will despite the reader knowing about it, build trust in the article and writer. Its magnificent. Use this trust to point out the negative sides of the Arabs in the Arab-Israeli conflict. Step back and watch as the readers take your/the Israeli side, as the trust built from exposing bias is still valid as previously mentioned. Go Israel. There is no Israel lobby in USA, but there is an Arab one. Its called an Israeli salad not Arab salad. And so on...

<comment><USER22> In the OP, the first example he used was of 'pro-palestinian propagandists', which made me think like you, but as I read more, most of his examples are actually of misdeeds by 'pro-Israel' propagandists.

I suspect he's actually partial to the Palestinian side, actually, although he tried to use examples from both partisan sides to paint a general picture of propaganda on wikipedia.

(Disclosure: I personally believe that Israeli policies and practices toward Palestinians constitute apartheid.)

<comment><USER23> Thanks, this might be a perfect example.

GP is not the only one in this thread to have this opinion.

Now that this has been brought to light, can everyone who was about to comment please take your own biases up for review?

Being on the "right" side doesn't mean you can skip careful reading and critical thought, does it?

<comment><USER22> Well, um, of course not, especially since you need that careful reading and critical thought to identify the propaganda the 'other' side is trying to embed in wikipedia. Naturally.

</comment></comment></comment></comment><comment><USER24> Politics on Wikipedia is terrible. IMHO there are certainly organized covert groups (commercial and military) who are editing it on behalf of governments (and corporations) already. Basically it's a war of attrition, and those with resources win. It's very sad, looking at the spirit that Wikipedia emerged from.

In short, as Einstein said: _Nationalism is an infantile disease; the measles of mankind._ IMHO the OP needs to grow up and broaden their perspective. By distributing such rants (s)he is attracting interest in the deliberate abuse of Wikipedia for partisan goals, which is not in its spirit. It's not something to be proud of.

<comment><USER25> > IMHO there are certainly organized covert groups (commercial and military) > who are editing it on behalf of governments (and corporations) already.

Yep. Though in your list of groups/causes you forgot "environmental". For example, there's the saga of William M. Connolley, described in part here:

[http://blogs.telegraph.co.uk/news/jamesdelingpole/100020515/...](http://blogs.telegraph.co.uk/news/jamesdelingpole/100020515/climategate- the-corruption-of-wikipedia/)

</comment></comment><comment><USER26> In a way it's quite terrifying to consider the possibilities of bias in Wikipedia. After all, if you're not an expert on a particular subject, how are you to know that even an article which seems neutral in content and tone isn't subtly selecting for and emphasising a certain portrayal of its subject? Tricky stuff.

<comment><USER9> s/wikipedia/any media/

<comment><USER27> And this is why trying to keep to some mythical "Neutral Point of View" is impossible.

</comment></comment></comment><comment><USER28> politics, Middle East, and environment, are three areas I only go to Wikipedia for dates of occurrence and names of those involved. All the rest related I assume is biased.

Need to look up a song and artist, anime character, or what years a car was available, I am pretty much going to trust what I read there, not so with much else anymore.

<comment><USER29> That is a bit too harsh. But at a minimum -- check the references on those subjects.

<comment><USER25> You also need to look at the discussion page to (a) see what points of view are being deliberately excluded by the biased editors, (b) find references to data on the other side.

(At least you need to do that on climate/environment - I've never looked into middle east)

</comment></comment></comment><comment><USER30> Are these biases made on both side of the edit war? Some of these articles seem to have pro-Israel bias and others anti-Israel.

<comment><USER31> I think it is irrelevant which side is making a bias into Wikipedia (everyone has a bias and the author of the essay is no exception). What is important is that such bias is made into Wikipedia and we need to be aware of, or careful about them. I guess proponents of alternatives to Wikipedia have something to say about them.

<comment><USER32> What are the alternatives to Wikipedia?

<comment><USER33> The best alternative to Wikipedia is Wikipedia plus a dose of healthy distrust for the content therein. Look up the edit history, check page discussions, verify the references. Do the homework and you should be safe.

<comment><USER34> I think that depends on the subject.

If I look up, say, resistor colour codes, a car or TV show, the the info Im looking of is as good as fact. The colour codes are correct, the car specs should be pretty much correct, and the general TV info is correct.

If I know Im delving in to something opinion based, for example, political or general history, I treat it as a starting point.

Problem comes when the subject falls in tot he middle, for example looking up a person. Some of I I assume to be correct like date of birth, home town, etc. Or at least its probably as correct as anywhere else. But often trivial type thing turn out to be little more than folk lore. But, if that matters, its very wise to look for something the person's own pages, if they exist. Or at least google the claim to see if its likely to have weight.

So, I think its fair to think some subject are likely to be acceptable as fact, other not so much.

Part of me thinks there should be a separation between things that can be seen as fact, and things that are likely to contain some sort of bias. No idea how that can reasonably be achieved though.

</comment></comment></comment></comment></comment><comment> vezzy-fnord Honestly, the whole "neutral point of view", despite being a universal Wikipedia rule, is most prominent in the English one.

If you go read some of the Balkan Wikipedias, you'll have blatant nationalist propaganda and completely contradictory viewpoints. What one wiki will decry as chauvinism, another calls national identity. Most blatant is the propaganda in the Macedonian Wikipedia.

</comment><comment><USER35> [http://cryptome.org/2012/07/gent-forum- spies.htm](http://cryptome.org/2012/07/gent-forum-spies.htm)

</comment><comment><USER36> This is great. I'm honestly going to go over this with my 11 year old to complement the section of her Language Arts class on the media and advertising. Lots of great things to learn to watch out for in the news and general media, not just in Wikipedia.

</comment><comment><USER37> For a long while now I've thought that some articles should simply stop trying to be perfectly neutral.

Just have two sections in the article: Each clearly biased in a different direction (maybe use colors and do it per paragraph).

Historically newspapers used to do that, each paper was clearly biased a certain way and you knew that when reading it.

Insist on accuracy of course, but the slant in the way something is written can matter a lot even if completely accurate.

<comment><USER12> Yeah but each side will still try to edit the opposing sides point of view to ruin it.

<comment><USER38> Or they'll try and one-up each other, creating exaggeration.

</comment></comment></comment><comment> V-2 Hasbara strikes again? :)

<comment><USER29> Not Pallywood, then? :-)

</comment></comment><comment><USER39> Don't feed the trolls.

<comment><USER34> At the risk of doing so.....

Are you suggesting that having a different opinion is trolling?

<comment><USER40> Climate change denialists or homeopaths or intelligent design proponents are not trolls, but the effect is pretty much the same.

You can generate megabytes of meta discussion by sticking to a fringe viewpoint and exploiting the weird wiki culture. At that point it doesn't matter if you sincerely believe the nonsense or if you're just doing it for shits and giggles.</comment></comment></comment>


Arduino DUE (32 bit) Now Available - <AUTHOR> http://store.arduino.cc/eu/index.php?main_page=product_info&cPath=11&products_id=243 <comment><USER2> You might also consider a STM32F4DISCOVERY board:

<http://www.st.com/internet/evalboard/product/252419.jsp>

This is also a ARM Cortex board but it's $15 and in stock everywhere. (I think it's more powerful and has more features than the Due, but I haven't checked in detail. At $15, though, it can't be beat. And there are less powerful boards in the series that are even cheaper!)

<comment><USER3> I've been looking at several uCs, in particular the Cypress Semi PSoC5 system for the system-on-chip functionality and the great toolchain, but also the very cheap TI Stellaris series. But there are so many highly capable products out there these days, it's hard to know which one is the best; I feel like a first-time computer buyer trying to choose between Mac and Windows without really knowing much about either.

Are there any resources you'd recommend for people trying to choose their development platform? I have specific reasons for liking the cypress system- on-chips (massive i/o, extensive software config capabilities, toolchain support for my intended application of audio/MIDI), but it's hard to size up all the different options.

<comment><USER2> I'd just say: try them. I learned microcontrollers with Basic stamps (many years ago), bought a Teensy a few years ago and learned AVR (avoiding Arduino for various reasons), and am now learning the STM ARM stuff.

My biggest takeaway is that teaching hardware people about unit tests would make humanity as a whole about 93% more productive :)

</comment></comment></comment><comment><USER4> I am new to Arduino but very interested in starting. So far I have read that the Uno R3 is the best for beginners but now that the new Due is out will this be preferable for a beginner?

From what I've read, the Due is faster and able to handle more things. But is it easier to use compared to the Uno?

<comment><USER5> Start with the Uno. You'll cut your teeth on all the same conceptual ground you'll encounter with the Due, but you'll have a simpler platform under you with a great deal of supporting information available on the Internet.

When you grow out of the Uno, the Due will be there waiting for you.

Personally, I'm going to avoid getting a Due until I need the extra horsepower. The simplicity of the AT family of microcontrollers is very appealing. Once you have a prototype working on the Uno, creating the deployable version using an ATTiny85 or whatever is not that difficult.

Compare hooking up an 8 pin ATTiny85 and a few supporting components vs the soldering wire-wrapping nightmare of using a AT91SAM3X8E or some near equivalent.

<comment><USER4> Thank you all for the answers. Yes I suspect that I was a bit quick to jump on the appeal of the faster microcontroller on the Due while I wont really need it at all, especially in the beginning.

</comment></comment></comment><comment><USER6> €60 for shipping to US seems a little much for shipping 60 grams taking a week.

Sadly none of the distributors seem to have it yet. Seems like we'll have to wait a little while longer still.

<comment><AUTHOR> I'm sure SparkFun or some other American based company will import in bulk so you can get it cheaper from them.

<comment><USER7> Ture. I'll probably wait a few months and buy it from Amazon...

</comment></comment></comment><comment><USER8> This is really exciting- the Arduino DUE is the board used in the Android ADK2012[1]. I can't wait to start building hardware to talk to my android devices.

[1]: <http://arduino.cc/blog/2012/06/28/android-adk2012-is-here/>

</comment><comment><USER9> Which version of ARM does this use?

<comment><AUTHOR> Atmel SAM3X8E ARM Cortex-M3 CPU

Datasheet: <http://www.atmel.com/Images/doc11057.pdf>

<comment><USER10> Seeing that the SAM3X has on-board Ethernet, but the Due doesn't have a port, I hope someone either builds a clone that does, or builds a simple (compared to current Ethernet shields) shield that adds the port.

This should really help lower the entry cost of using Ethernet in DIY devices, which I think is cool.

<comment><USER2> The Ethernet PHY is actually rather expensive, around $20. That's why the cheap dev boards don't have it.

<comment><USER10> That's true, of course. So, all I can hope for is that something like this ([http://www.seeedstudio.com/depot/ethernet- shield-p-518.html?...](http://www.seeedstudio.com/depot/ethernet- shield-p-518.html?cPath=132)) drops in price by $5 then (the price of their on-board Ethernet controller). :)

</comment></comment></comment></comment></comment><comment><USER9> So... can I run Linux on it?

<comment><AUTHOR> Linux requires more resources, but if it's a small board you want to roll Linux checkout the Raspberry Pi!

<http://www.raspberrypi.org/></comment></comment>


As IPOs hit 30-year low, VCs hit tough times - <AUTHOR> http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2008/09/30/BU101387M9.DTL <comment><USER2> Every single silicon valley old timer I've spoken to, says the same thing.

There was an almost magical time when the valley was almost nothing but computer geeks having fun, creating new stuff, and starting small businesses that relied on profits from sales.

This dream like reality is long gone, but I wonder if it may return some day.

</comment><comment><USER3> Here's a question for anyone that does angel investment: How much does this decrease in availability of VC capital and exit options affect your decision to invest in fledgling startups?</comment>


The Pentium F00F Bug (1998) - <AUTHOR> http://www.rcollins.org/ddj/May98/F00FBug.html <comment><USER2> This was, in part, responsible for why Intel CPUs now have upgradeable microcode. Functions like these can be implemented in a software layer that has the ability to correct shipment defects. F00F is far from Intel's last bug; their last _two_ generations featured transactional memory that had to be disabled from the microcode because it simply didn't work properly.

</comment><comment><USER3> On a slightly related note: here's a paper on the math behind the FDIV bug: [https://pdfs.semanticscholar.org/dd0f/ea9121741873fa46eed581...](https://pdfs.semanticscholar.org/dd0f/ea9121741873fa46eed58190a011a1b1522a.pdf)

</comment><comment><USER4> Chemists know to stay far away from FOOF. It's so reactive it will burn water.

</comment><comment><USER5> Foof is also British slang, which in this case is almost appropriate.

<comment><USER6> [https://en.wiktionary.org/wiki/foof](https://en.wiktionary.org/wiki/foof)

<comment><USER7> Why am i even surprised...

</comment></comment></comment><comment><USER8> In case someone is wondering (like me): F00F != 2018</comment>


Interview With Digg's Kevin Rose: The State of The Union - <AUTHOR> http://www.techcrunch.com/2009/04/20/interview-with-diggs-kevin-rose-the-state-of-the-union/?awesm=tcrn.ch_RJ&utm_medium=awesm-twitter&utm_content=techcrunch-autopost&utm_campaign=techcrunch&utm_source=direct-awesm

<comment><USER2> Even though Kevin Rose was pretty tight-lipped with respect to product, I think it will be interesting to see Digg move in a different direction later this year, with him hinting at an emphasis on real-time search. Whether or not this is the future though, despite everyone swooning over Twitter, remains to be seen. It makes me wonder whether the supposed importance of real-time search will be a self-fulfilling prophecy (with these large companies jumping on the bandwagon, and pushing it to mainstream importance) or if it will reach that state in its own right.

On another note, I don't think Arrington's reference to Hacker News as a competitor to Digg is particularly accurate, as they clearly have separate goals. HN is trying to maintain what Digg wasn't able to - namely a civil, intelligent community. Oddly enough, he preceded that topic by first commenting that Digg has done a good job with trolling, and asking how they'll combat it as they continue to grow. Seriously? Has he checked out the comments on Digg lately?</comment>


Dear Web Developers: EFF Needs Your Help - <AUTHOR> https://www.eff.org/deeplinks/2014/04/tech-volunteers-eff-needs-your-help <comment><USER2> Full instructions on how to take part are at this link: [http://theunitedstates.io/contact- congress/](http://theunitedstates.io/contact-congress/)

And here is the Github repo: [https://github.com/unitedstates/contact- congress/](https://github.com/unitedstates/contact-congress/)

<comment><USER2> 100 people, 760 commits, 43k lines added to the YAML files in 13 hours. Thanks all those taking part - we were expecting this to take a month and it looks like it'll get done in a day :).

Still plenty more to do if anyone else is interested in dropping by and helping close up issues.

<comment><USER3> Well I hope I'm not late. Just home from work but this looks too awesome to resist jumping into

</comment></comment></comment><comment><USER4> In the UK we have a decent website for contacting one's MP:

[https://www.writetothem.com/about-us](https://www.writetothem.com/about-us)

And it works!

For petitions to Number 10 we also have:

[http://epetitions.direct.gov.uk/](http://epetitions.direct.gov.uk/)

...and it works, as in you can sign something that will be totally ignored (eyes roll)!

So in every country we are duplicating effort. Hence I think the EFF need to think beyond the shores of that renegade British colony known as the USA. Maybe it is time for some open source system that can be rolled out to everywhere from The Hill to Burkina Faso.

Let's also be honest about those people in congress - do the current batch of revolving door military/corporate oldies that sit there really deserve to be taken seriously? Does anyone believe they understand concepts such as reasoned argument, being fair, the common good, progress, listening instead of speaking, telling the truth instead of lying? Even if they do appear genuinely for the good it can be just an act, as per that person you Americans have for 'President'.

So, to invite participation from the rest of the world and get some enthusiastic input from those that think that the current batch of congressmen are deserved of being Guantanamo-ed, the EFF should think bigger. They should link up with groups that have made progress internationally and work towards a tool for democracy that can work everywhere.

<comment><USER5> Write To Them is open source and is already being used in multiple countries:

[https://github.com/mysociety/writetothem](https://github.com/mysociety/writetothem)

</comment></comment><comment><USER6> I know this is all in good spirit and you just want to show some appreciation for the help. But rewarding programmers by number of commits is a bit perverse. Nowadays everyone generally agrees that paying programmers per line of code is a bad idea. I think rewarding based on number of commits creates very similar unwanted incentives and should probably be avoided completely.

<comment><USER7> Needs backlog with priority value, progress state... basically paper trail.

Also, I like the idea of this project, but I hate the pitch. I don't know why. Maybe it is because programmers already go above and beyond, taking care of the stuff that no-one else thinks over. I would actually suggest investing time in looking to fund better development. Just my 2 cents - great idea, best of luck!

<comment><USER8> Thanks for the feedback!

The tech team at EFF is pretty overloaded all of the time; we've hired outside contractors before but this is a project where it seems more efficient (and potentially more fun per person) to crowdsource. The same goes for HTTPS Everywhere ([https://www.eff.org/https-everywhere](https://www.eff.org/https- everywhere)), a browser extension that I maintain where almost all of the 10,000+ XML (ugh!) http-to-https upgrade rules are contributed by volunteers.

I think EFF is in a rare position to experiment with crowdsourced programming tasks, because (most of) our contributors don't have any incentive to game the system and deliberately submit low-quality work, which decreases the usefulness of results you get from money-driven crowdsourcing platforms like Amazon Mechanical Turk. This particular experiment was far more successful than I predicted, which brings up the question of whether there is a systematic way to make crowdsourced web development effective.

</comment></comment></comment><comment><USER9> The US House of Reps is almost done with development for an API (that was spearheaded by outside organizations like CMF) for 'campaign' communications (communications where the majority of the messages are 'similar') from third party advocacy organizations. After this occurs, the hope is that only messages sent via web forms are completely unique messages sent from constituents without the assistance of a third party. The project has been slow (10 years in the making?) but its near completion. Achieving 100% adoption amongst the 440 member offices is a different question though, although 100% adoption has been mandated.

<comment><USER10> As far as I understand, the Sergeant at Arms can enforce IT mandates upon the various offices, no?

</comment></comment><comment><USER11> I think it's really great that the EFF is reaching out to the community like this. I reached out to donate time and I encourage you to do the same.

<comment><USER10> I'll also point out that Sina (sinak) has been spearheading this effort, and while he has a job title at EFF, he's primarily independently coordinating the volunteer efforts of folks like us through [https://taskforce.is](https://taskforce.is)

</comment></comment><comment><USER12> > Secure Connection Failed

> An error occurred during a connection to www.eff.org. The OCSP server has no > status for the certificate. (Error code: sec_error_ocsp_unknown_cert)

Anybody else getting this?

<comment><USER13> Got it briefly. Tried again and it worked.

</comment></comment><comment><USER14> Here is a very effective german platform for not only contacting, but also making the answers to questions visible:

the site - [http://www.abgeordnetenwatch.de/](http://www.abgeordnetenwatch.de/) the code - [https://github.com/parliamentwatch/parliamentwatch](https://github.com/parliamentwatch/parliamentwatch)

the site is in german, but you might guess the content with a little help from an online translator. It is very popular and linked to from the biggest german online media. It might be an indicator for it's success that several conservative politicians tried to fight this site with all kinds of tricks, but they still did not succeed :)

Unfortunately the code is drupal, it certainly would be much better to convert this to some more flexible framework like pyramid or django, but it works.

It might be a much better alternative to make questions to congressmen publicly visible than just sending stuff into spam-folders of people that do not have interest at all in being contacted by "the people".

</comment><comment><USER15> I'm really impressed with the project. It's a great idea - both the concept and the execution are brilliant.

The bookmarklet for generating the yaml file could be used for all sorts of things - I've never seen this idea before. Even better, it's being used to crowdsource the data for the tool.

I'm really impressed with this. Kudos to all involved.

<comment><USER16> What does the bookmarklet do exactly?

<comment><USER17> You fire up the bookmarklet on the MOC's site, point it at a form, and it extracts the input fields and marries them to the parameters for email, zip etc, or lets you marry them. produces YAML for their cucumber'esque system etc. Quite a cool tool/idea.

</comment></comment></comment><comment><USER18> They really need some copy editing done on _everything_ for this project.

<comment><USER2> If you have suggestions on fixes, please feel free to submit a pull request. theunitedstates.io/contact-congress is on the gh-pages branch [1]. I wrote the instructions page and realize there are a few grammatical errors, any help fixing them would be really appreciated.

[https://github.com/unitedstates/contact-congress/tree/gh- pag...](https://github.com/unitedstates/contact-congress/tree/gh-pages)

</comment></comment><comment><USER19> Have been completely engrossed in this most of the day. Hope it's done soon or I'll have to go cold turkey.

</comment><comment><USER20> "How technical do I need to be?" \- not very.

Sorry, what?

<comment><USER21> "You should be comfortable using Github, having basic programming proficiency in at least one language and have a reasonable grasp of HTML and Javascript. Experience collaborating via IRC is handy, but not critical."

So... very technical?

<comment><USER22> Is that called "very technical" nowadays?

Basic proficiency in a random programming language and some grasp of HTML is something that's taught in a high school computer class or any introductory course for a tangentially related college program such as statistics or physics - this level of proficiency is something that a random student (of not-computer subjects) is somewhat likely to have.

I mean, it definitely is _technical_ and does require some background, but it's appropriate to say "a bit technical, but you don't need to be an expert".

<comment><USER23> They don't teach HTML in physics or stats. Most people also don't take an intro to computer programming course.

<comment><USER24> They may not teach HTML, but my alma mater taught python to freshman physics students. By senior year, you would have at least learned two additional languages. That's just from the physics courses - if you decided to take an intro to cs course (which most did), you would have learned a fourth (but probably not a FORTH).

While they wouldn't specifically know HTML or Javascript, they'd know enough to how to read the language documentation and gain basic proficiency in a week. They wouldn't be a Douglas Crockford, but they could help out an open source project.

Of course, this was at a state school. Things might be different elsewhere.

</comment></comment></comment></comment></comment><comment><USER25> Disclosure: Only bother if you are American.

Next time you ask, make sure you specify who you are serving. Congress does not serve me as a foreigner (then again, does it serve everyday Americans either?).

New title:

"Dear US Web Developers: EFF Needs Your Help"

<comment><USER26> 1\. US laws can have a huge impact on foreigners, especially if they are Internet-related

2\. you can help a good cause without directly profiting from it

</comment></comment><comment><USER20> An organization that I had hope in, posts something like this for captcha breaking and subtle bullshit. Really? Is this HN or ODesk?

<comment><USER2> Just to clarify, we're not trying to break any captchas - any system that implements the open data format in contact-congress would need to return captchas to users for them to fill out. We're simply making it possible for third parties to create simpler, unified interfaces for sending emails to someone's member of congress.

</comment></comment><comment><USER27> I was pretty surprised to see the EFF's naive take on the Tea Party [1] in "recent deeplinks" underneath the linked article, which seems not to recognize it as pretty much an astroturf instrument of the neo-bircher Kochs [2], [3].

Of course co-opting TP sympathizers around a common goal of opposing overweening government surveillance to unknown purpose is a Good Thing, but unless the EFF, an org I've respected for ages, is unaware of the spurious "grassroots" provenance of the Tea Party, which seems very unlikely, I'd expect a less nakedly revisionist approach from them.

[1] [https://www.eff.org/deeplinks/2014/04/tea-party-taxes-and- wh...](https://www.eff.org/deeplinks/2014/04/tea-party-taxes-and-why-patriots- wouldve-revolted-against-surveillance-state)

[2] [http://www.nytimes.com/2010/08/29/opinion/29rich.html?_r=0](http://www.nytimes.com/2010/08/29/opinion/29rich.html?_r=0)

[3] [http://www.astroturfwars.com](http://www.astroturfwars.com)

<comment><USER28> If you're trying to get self-identified Tea Partyers on board, a great start is not alienating them. Appealing to the aspects of their ideology we can all agree on is a great idea to garner allies. The Tea Party's "grassroots" origin may be spurious, but the sense of injustice that fueled its adoption by ordinary folk is real enough. As I understand it, a lot of basically normal, non-frothing people now believe that the Tea Party basically stands against government overreach, and as such are sympathetic to it. Might as well channel that. We might even see an evolution of what the Tea Party means.

<comment><USER10> This. We don't have to agree with them on everything. We do have to respect them enough to use their language (think ./English/politics/Tea Party/ in contrast to ./English/tech/ _._ ) when communicating our shared ideas to them.

I found the piece to be a very (actually surprisingly so) savvy bit of strategic outreach from EFF, even if it was quite blunt in its tactical approach.

See also: [http://www.sfgate.com/politics/article/Republican-Rand- Paul-...](http://www.sfgate.com/politics/article/Republican-Rand-Paul-fires- up-a-Berkeley-crowd-5332740.php)</comment></comment></comment>


Ask HN: Resources for gameplay design? - <AUTHOR> Does anybody know of articles or methodologies for designing the rules of games?  My son has what I think is a pretty good idea for a battle card type game, but I know that playability of rule sets is a pretty complex thing.  I think maybe we can design by analogy from things like Yu-Gi-Oh and Pokemon, but it would be even better if somebody had already put some thought into this and published the results. <comment><USER2> Might be a bit advanced or too academic, but The Art of Game Design by Jesse Schell is a great resource that really goes into the art and science of designing "fun" experiences.

<comment><AUTHOR> Thanks - that's more or less exactly the kind of thing I'm looking for!

</comment></comment><comment><USER3> I can't recommend more "A Theory of Fun" by Raph Koster.

<comment><AUTHOR> His site [<http://www.theoryoffun.com/>] includes the slides from a presentation on game grammar [<http://www.theoryoffun.com/gdc2005.shtml>] that lists boatloads of academic work, which is really what I was looking for - thanks!</comment></comment>


Show HN: New D3.js Tutorial: D3.js Axes - <AUTHOR> http://www.dashingd3js.com/d3js-axes

<comment><AUTHOR> Just added a new section to my D3.js tutorial website. This one covers the D3.js Axes and how they are used within D3.js.</comment>


20% of Android apps use private data - <AUTHOR> http://www.readwriteweb.com/archives/android_opens_blinds_on_20_of_app_data.php

<comment><USER2> It's a whitepaper by a security firm. Using my HouseAbsolute behavior-based detection methodology, I have used various heuristics to detect that this study is possibly BS. Some key factors in this detection, with exclamation points showing how concerning an individual flaw is (! is the least, !!! is the most. Note that all these points are regarding the researchers' whitepaper itself.):

!!! The article makes a big deal out of a specific spyware application. This wouldn't be very much of a problem if the application weren't openly described by its authors as one whose sole purpose is spying on the phone's user. So why make a big deal out of it!?

!! The article makes a big deal of the fact that some applications have requested the same set of permission that some spyware apps have. I can think of no conceivable specific combination of permissions that alone would give much information at all about whether or not an app is spyware. It also makes a big deal of how nine applications can brick the phone without going into any detail about the nominal purpose of these apps (i.e. does it make sense that such an app behaving as described in the market entry for this app should need to brick the phone).

! This article seems to imply that one would need any of these permissions to harm the user. From my understanding of Android development, I believe that any application can raise an intent to open a webpage in the browser, and the url of that page could easily be used to transmit sensitive information even with no permission at all. (I could be wrong on this one.)

!!! Any app that requests two of the permissions they label as sensitive is marked as suspicious. This means that any app wanting to both access the internet and do any of the following is considered suspicious according to this study:

\- Access coarse location.

\- Write to the external storage.

\- Send an SMS.

! The company behind this paper is trying to sell something that you would be more likely to buy if you believed its results.

</comment><comment><USER3> I enjoy RWR, but it's a bit sensationalist to use "seize" in that headline when what they really mean is "access" and by access they mean "access after explicit permission has been granted."

I do think there are issues to be addressed, and the article mentions apps which can send premium text messages, an exploit vector which is more concerning.

<comment><USER4> Not to mention that in a lot of situations this is exactly the point. Twitter can access contact data so it can add a person's twitter account into their contact information. You might use a solution to synchronize your contacts with a CRM so that you can follow up on potential leads. That's "seizing" you're data, but that exactly what you want it to do in that case. This is pure sensationalism and is exactly why journalism shouldn't be the pratice of copying press releases for the sake of some hits.

<comment><USER5> The constant chasing after traffic is not a good thing for the new media ecosystem, it leads to sites that glory in lots of low quality attention, and a boring sameness to the novelties on parade. We need to find a way to compensate creators based on the quality of their audience, rather than mere quantity.

The only functional forces pushing in that direction at present are patronage amd pride. Patronage from the audience and pride from the performers.

</comment></comment></comment><comment><USER6> This seems to be a PR piece written by SMobile Systems ("enabling Secure mobility") promoting their "new behavior-based detection methodology", leveraging "heuristic-style technology".

One of their conclusions appears to be that "one must look at the permissions it has requested to determine what the application's true capabilities might be". Very heuristic.

Quotes from [http://threatcenter.smobilesystems.com/wp- content/uploads/20...](http://threatcenter.smobilesystems.com/wp- content/uploads/2010/06/Android-Market-Threat-Analysis-6-22-10-v1.pdf) (PDF)

</comment><comment><USER7> Ugh, sensationalist fluff. Android's permissions system is very clear and very easy for the end user to understand. "This app might cost you money" on install is pretty darned clear!

<comment><USER8> PEBKAC, sir. That's the problem.

</comment></comment><comment><USER8> The way this article has been titled, it screams "SENSATIONAL!!11 READ ME!!!". Comes across as applications lock all your photos and messages and charge a dollar a peek.

</comment><comment><USER9> I thought you have to explicitly allow applications to access any data outside their own directory?

<comment><USER10> You need permission to access any user data (SMS, calendar, etc).

It is almost impossible to get data from another app if the author doesn't expose it somehow (place it on SD Card, expose Content Providers).

<comment><USER11> >>Finally, 3% of all of the Market submissions that have been analyzed could allow an application to send unknown premium SMS messages without the user's interaction or authorization.<<

Could an independent Android developer comment on whether this is in fact true?

<comment><USER12> I'm not privy to any statistics on the matter, but simply as an Android user I can tell you that Android applications can't dial numbers, send SMS, etc., unless you explicitly grant them permission to do so -- and Android will tell you, plain as day, that the application wants privilege to access "Services that can cost you money".</comment></comment></comment></comment>


Clojure for the Brave and True – Functional Programming - <AUTHOR> http://www.braveclojure.com/functional-programming/ <comment><USER2> Has there been any exploration into an idea where the problem with side effects is not that they make functions impure, but they are often against the metaphor of the instructions being given? That is, if the metaphor that one is trying to model is traditional mathematics, then of course side effects are terrible.

However, consider a program where the main metaphor is controlling something. Logo, for example. Few people argue, I would think, that the traditional imperative styling there hurts and confuses things.

More extreme, consider stack based languages. These are strictly based on the current state of the program, yet my understanding is if you can fit your mind to that metaphor, it works very very well.

Or, my favorite category, cookbooks. Look at traditional baking directions: "Begin heating oven to XXX, mix dry ingredients in bowl, add butter, whip, ..." Doesn't get any more imperative than that, and yet people around the world often have great success replicating the desired results. (Granted, I often think that the difference in programming and teaching is that humans make an effort to understand what you were communicating, computers typically don't.)

Does this make sense?

<comment><USER3> (serve (fry (add-pan kale (fry (add-pan (dice onions)))))

<comment><USER4> Better is

        (->> onions
          dice add-pan fry (add-pan kale) fry serve))

<comment><USER5> Amazing. What's the ->> operator called?

<comment><USER6> A monad ;-)

No, but seriously, you can think of (->> foo bar baz quux)

As a way of saying:

        Within the context of computing one thing and passing
        that result to the next thing with a common carrier
        object of "foo", do bar, then baz, then quux within
        that context, each operating on foo.

In VB you could do:

        with someFile
            readIt()
            processIt()
            writeIt()

See the similarity?

By the way, monads are a way to abstract this even further so that not only can you model the context of "do something to a thing then do the next thing then do the next", but almost every other kind of context you could think of.

EDIT: as has been pointed out, this isn't really a monad, but it's an example of something monad-like that helps me grasp the larger concept better. Also, fixed the syntax.

<comment><USER7> (->>) is not really a monad, though. It's a concatenation of endomorphisms, which sort of has the smell of a monad, but is simpler.

<comment><USER8> Not necessarily _endo_ morphisms, though, is it?

<comment><USER7> True, and then it's a category.

<comment><USER8> Well, hmm, I don't think that's quite right either. There is a category where the objects are clojure types and the arrows are clojure functions, but I don't see how the threading operator _embodies_ it. There could totally be some perspective I'm missing, though.

<comment><USER7> No, I think I'm just playing more fast and loose than I should. I don't think it fits into any particular semantic mould because it's really a syntactic thing—it is a list processing function that's applied to source code represented as lists. The basic usage pretty much traces out a path in the Clj category, so perhaps if you built Paths(Clj) then (->>) is a forgetful functor from Paths(Clj) -> Clj. In which case it's almost a monad, since if you play with Paths and (->>) you can turn them into a forgetful/free adjunction pair and make a monad.

<comment><USER8> Hmm, I think that's right. Heh.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> Rich Hickey has a great description of how to think about working with immutable values - what we usually want when we change a variable is simply the next value and so long as we are getting the value we expected, there's no need to name it.

In other words if our current position in an array is 2, what we need to access the next position is the value 3. Creating a variable _int i=2;_ and then mutating it _i++;_ introduces the possibility of side effects. This not to say that at an abstraction layer below our programming language a register won't get incremented, only that our brains don't need to worry about the mechanisms most of the time if we use a functional language.

<comment><USER8> Or a language with a foreach construct...

<comment><USER9> Exactly.

There's nothing magical about functional programming - it is no more than syntactic sugar to help programmers control the state of computing devices.

Foreach is a higher level abstraction that makes reasoning about our code easier. The bits still change.

<comment><USER10> > There's nothing magical about functional programming - it is no more than > syntactic sugar to help programmers control the state of computing devices.

In the same way that objects in Java are just syntactic sugar for encapsulating state. In the same way that a compiler is just the machine that takes a language of the syntactic sugar of language A to the actual language A.

> Foreach is a higher level abstraction that makes reasoning about our code > easier. The bits still change.

So how do you write a Foreach loop from a regular for-loop in your typical imperative language? How do you compose that Foreach loop to make even higher level abstractions like map, filter and fold/reduce?

<comment><USER11> > So how do you write a Foreach loop from a regular for-loop in your typical > imperative language?

By walking through the collection in the update step of the for loop (for languages with less-general version of for than C and friends, this may actually require a while loop rather than a for loop.)

> How do you compose that Foreach loop to make even higher level abstractions > like map, filter and fold/reduce?

By abstracting it behind a function call that takes a function (or function reference/pointer, or in particularly limited languages a location to jump the current instruction pointer to) as an argument.

Yes, languages that focus on the functional paradigm (or which have been influenced by it even if it isn't their central paradigm) have syntax which makes this more straightforward than it might be in some other languages,

<comment><USER8> In the case of foreach, it's simple to be sure, and I'm pretty fine with calling foreach "syntactic sugar". Even something as simple as function composition breaks down a bit in C. You can manage it, but you're either not really using C anymore (writing out machine code in memory and treating it as a function, which is going to be tremendously compiler and architecture specific) or you're not really dealing with C functions anymore (passing around a structure that stores the things to compose, "calling" that function with a separate "apply" function).

Yes, you can ultimately write all of Haskell in C and code at the higher level, exceedingly verbosely, but to say that's "just syntactic sugar" would be absurd - "fundamentally all these languages are Turing equivalent" already encapsulates that observation, there's nothing new the notion of "just syntactic sugar" is adding.

Typically I restrict "just syntactic sugar" for things that are simple transformations that can be done locally. The archetypical example being array syntax in C, which can be described more precisely by a syntactic transformation than a semantic operation:

Given:

        char *c = "abcd";
        int i = 2;

It turns out that:

        a[i] = *(a + i)

but that's equivalent, by commutativity of +, to:

        *(i + a)

and so, counter-intuitively if you're thinking of [] as a semantic "array indexing" operation, you get the same results with:

        i[a]

<comment><USER11> > In the case of foreach, it's simple to be sure, and I'm pretty fine with > calling foreach "syntactic sugar".

Yeah, I was responding specifically to the "foreach" and specific things layered on top of foreach, which are fairly straightforward in most popular non-FP languages.

> Even something as simple as function composition breaks down a bit in C.

Quite. No argument there. At least with standard C. (I think Clang and GNU C both have extensions -- but not the same ones -- that make this reasonably straightforward in simple cases, but still much less elegant than, say, Haskell.)

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> As someone who still doesn't get functional programming, I would like to see a real-world example of how to deal with side effects. Eg: write something into a file or a DB. Because _of course_ methods/functions with no side effects are easier to deal with, it sounds good, but I don't think it would be easy nor convenient to separate every side effect in a real-world program (as opposed to academic programs, where you just write a Fibonacci or whatever). Even in good OOP, you can have lots of side effects in a method.

Halp!

<comment><USER13> Using side effects in Haskell is easy. The only thing is that they need to be explicit and you aren't allowed to hide them inside pure functions.

For a database example, here is the chapter from Real World Haskell about databases (a bit old but still relevant):

[http://book.realworldhaskell.org/read/using- databases.html](http://book.realworldhaskell.org/read/using-databases.html)

And here is some example code:

        do
          conn <- connectSqlite3 "test1.db"
          stmt <- prepare conn "INSERT INTO test VALUES (?, ?)"
          execute stmt [toSql 1, toSql "one"]
          execute stmt [toSql 2, toSql "two"]
          execute stmt [toSql 3, toSql "three"]
          execute stmt [toSql 4, SqlNull]
          commit conn
          disconnect conn

As you can see, it looks very similar to how you would write it in a regular imperative language. The main difference is that since they database operations are IO operations then they need to be in the special do-notation block and cannot be mixed with regular code.

As for the question of wanting to mix pure and impure code that much I don't think it actually comes up that much. First of all, I find that I don't often find myself with an impure function that I want to add a side effect in the middle seamlessly - firstly, side-effecting stuff tend to be side-effecting from the beggining and secondly if I do want to turn a pure function into an impure one then forcing me to change the interface helps make sure that I am not breaking any code that used to work because it assumed it was working with pure code. Additionally, Haskell is really good at abstracting code so its not that hard to take a big chunk of logic and split it into a pure and an impure part. Finally, converting code from pure to impure is not that bad - sure, you need to change the syntax a bit but the type checker helps you find all the places that need to change and also helps you check all the code that calles the method you changed so you can be sure that you aren't breaking those.

side effecting operations in the IO monad so you can't run them in the middle of any function and instead must run them inside a special "do-notation block" like I did.

You can have impure code call both other impure code and pure functions and all you can't do is call impure functions from inside pure functions. Sure, its a bit annoying if you ever have to convert a pure function to an impure one (you need to change some of the syntax and all the places that call tha tfunction need to start treating it as impure) but its not that bad: first of all the type checker tells you all the spots where you need to update your code and secondly, Haskell is super good at abstracting code so its not hard to take a big chunk of code with some side effects in the middle and split it into a pure and an impure part.

> to academic program

Its a little pet peeve of mine but it seems that nowadays "academic" doesn't have a real meaning and just tends to refer to whatever people don't like. :)

<comment><USER8> "do" is just syntax. You could write the above as:

        connectSqlite3 "test1.db" >>= \ conn ->
            prepare conn "INSERT INTO test VALUES (?, ?)" >>= \ stmt ->
              >> execute stmt [toSql 1, toSql "one"]
              >> execute stmt [toSql 2, toSql "two"]
              >> execute stmt [toSql 3, toSql "three"]
              >> execute stmt [toSql 4, SqlNull]
              >> commit conn
              >> disconnect conn

and it's "just" a bunch of nested lambdas with no "do" in sight. What's different from "regular" code is that those lambdas 1) return IO actions, and 2) are strung together with monadic bind (>>=) to build one big IO action.

To be sure, in this case the do version is much easier to read (that's why "do notation" exists). It can be used with any monad, though - nothing ties it particularly to IO.

<comment><USER13> Maybe I should have been clearer but the basic point is that monadic code has a different interface

        bar (foo x) --pure Haskell

vs

        foo x >>= bar --monadic Haskell

vs

        bar(foo(x)) -- in C you write both cases like this.

<comment><USER8> You're close, but it's not really so clear cut.

foo x ++ bar -- "pure" or "monadic"?

foo x >>= baz -- "pure" or "monadic"?

What if (foo x) is a list in both cases?

(>>=) is just an operator. The values that it operates on are anything with a Monad instance, just like the values that (+) operates on are anything with a Num instance. There is nothing voodoo about monads or about bind (>>=); such voodoo as there is lies solely in IO, which is interacted with the _same_ way as other values (though certainly what you can do with (IO a) is more limited than what you can do with (Maybe a)).

<comment><USER10> I used to think that Monad was some alternative realm in Haskell, a realm where purity didn't exist and everything was written in an alternative, built- in language (do-notation). That's because people tend to refer to using Monads as "working in the X-Monad", as if it is some... _place_. But then it turned out... Oh, so it's basically just a signature/interface/type class.

<comment><USER13> True! But one neat thing is that, if you have a black-box abstract data type then you can force people to use the provided Monad interface if they want to do stuff with it. The IO monad does exactly this to create its "alternative realm"; there is no way to get "out" of IO once you get in , the only way to run an IO computation is to have it be directly or indirectly called by "main" and the only primitive way to compose IO computations is with the monadic combinators.

</comment></comment></comment></comment></comment></comment></comment><comment><USER14> I want to take a leap and talk about 2 core concepts that I got after spending last week learning Clojure. I'd love some comments about them.

I've been writing javascript for years but functional programming didn't make sense until I realized:

1) It's essentially inverted callbacks. You can read and reason about your code by working from the inside out. The results of a function are passed up to the outside.

2) When you stop modifying variables and just pass them around, it becomes a lot easier to think about code in abstract ways. There are of course some situations where modifying a variable is needed, but it really feels icky and you think twice about doing it.

The problem I found trying to learn this stuff is that once you learn to think functional its hard to think like someone who doesn't get it. That makes it hard to translate concepts in ways that non-functional people can get easier. I'm keeping mental tabs on ideas as I understand them to hopefully help with this problem.

Also, macros. Clojure people love talking about them. They aren't explained well most of the time though.

Simplest explanation is that you can write a bunch of your own functions, even ones that will override native functions, i.e macros. Since clojure is a compiled language, at compile time all the source code gets read in and pre- processed. When the compiler reaches some code that was defined in a macro, it keeps rewriting that code until all the macros are processed and the code has been re-written. Then everything is compiled to bytecode for the jvm.

<comment><USER15> Your use of the language "passed up to the outside" is interesting... Up and outside imply some sort of intrinsic directionality. Considering that functional programming seems to capture the mathematically inclined, can anyone speak to the concept of topology applied to code structure or interpretation? For instance, does a closure imply some sort of filtration structure on the "code space?" (by filtration here, I mean the concept from algebraic topology)

<comment><USER14> Oh man, you lost me. I'm definitely not one of the mathematically inclined. My analogies are rough and largely wrong and the only thing I'm trying to relate is the particular way of thinking that at a critical moment helped me understand a little more. I wouldn't put too much credence on the veracity of "up to the outside". If it does hit on some underlying important point, it's entirely by accident, I swear.

</comment></comment></comment><comment><USER16> I found LightTable* as a great way to grok functional programming - you can actually see how data moves around. Really brilliant.

*Lighttable IDE: [http://www.chris-granger.com/lighttable/](http://www.chris-granger.com/lighttable/)

</comment><comment><USER17> Just watched this decent intro released yesterday... (OSCON 2013: "Functional Thinking" \- Neal Ford) [http://www.youtube.com/watch?v=7aYS9PcAITQ](http://www.youtube.com/watch?v=7aYS9PcAITQ)

</comment><comment><USER18> > It always returns the same result given the same arguments. This is call > "referential transparency" and you can add it to your list of five-dollar > programming terms.

> It doesn't cause any side effects, e.g. it doesn't "change the external > world" by changing external mutable objects or outputting to i/o.

These have little to do with one another. "sort :: [a] -> [a]" sorts a list, perhaps using quicksort. If you want to randomize the pivots, it's "sort :: [a] -> IO [a]", and everything in your program that sorts things has a different type, even though it produces the same value.

</comment><comment><USER19> I have been tempted by functional programming, and it is interesting, but I'm not sure how would be the result for highly complex code.

<comment><USER20> It is especially suited to highly complex tasks. (Your code should stay as simple as possible.)

</comment></comment><comment><USER21> Another great post, Daniel... keep 'em coming!

<comment><AUTHOR> Thanks!

</comment></comment><comment><USER22> The third example has an error: ((rand) > 0.5) should say (> (rand) 0.5)

<comment><AUTHOR> Thanks, fixed!

<comment><USER23> I like your post, and think we need more people like you doing this. One critique: I think you need to do a much better job explaining your first part on recursion.

You need to walk through exactly what you are doing in your sum function, because it is not at all clear to the uninitiated where in the hell the "acc" variable comes from. Instead of explaining any of this part, which is perhaps the most difficult part for a non-FP person to grasp, you jumped straight to "by the way, use loop when there's a lot of numbers."

My coworker's comments when I sent him the link:

"Ok, I get it...... what's going on with the sum?..... whaaat?"

Thanks for doing what you're doing. I look forward to reading more of your work.

<comment><AUTHOR> OK - I've updated that section. I hope it helps!

<comment><USER23> Yes, that is a fantastic explanation. My coworker immediately got it, and was simultaneously blown away by the concept of "arity."

Please keep it up.

One area you may be interested in: I've recently been playing around with Incanter (a library for data analysis, similar to R or Python Pandas).

There is a distinct lack of tutorials for using it, and the documentation isn't exactly friendly....

The reason I mention it is because I think data analysis is a place where Clojure absolutely shines, and someone with your expertise could probably work it into useful examples.

<comment><AUTHOR> Thanks for the suggestion! I know next to nothing about data analysis so I might not ever get around to using or writing about Incanter, but I've seen it in action and it looks super cool. Thanks again :)</comment></comment></comment></comment></comment></comment>