Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror

Comment Re:real world (Score 2) 186

Ah, gotcha. A slashdot post is not really sufficient to introduce the topic. Typically you use immutable data structures, which are often built over a mechanism called a "path copy". Basically, your app state is stored in a data structure, and when state is updated, you create a new data structure representing the new state, using purely functional code. People often think this is slow, but it's very fast, often faster than mutable code, except in very hot loops. The bit where you update the reference to the current state (change the reference from the old state to the new state) is a side effect, and is handled in different languages/frameworks in different ways. In some languages your code returns data that represents the state change (e.g. state monad) and the runtime handles the side effects, so you have no direct handle on the side effects. In other languages, there are stateful abstractions, like an "atom", that effectively separate the concept of a "value" from the concept of an "identity" (like the current state).

More generally, you separate side effects (including state) from the purely functional parts of the code. E.g. instead of writing a routine that prunes log files by date, you write a routine that reads dates (this is a side effect), one that reads the current time (also a side effect), and one that deletes files (also a side effect). Then you write a purely functional routine that takes a list of dates and returns a list of files to delete.

The overall goal is to get all your business logic into purely functional routines like this, because it hugely simplifies development, and reasoning about code. E.g. it's very easy write tests, because you don't have to mock anything. The code with side effects becomes extremely simple, so testing those becomes easier, too.

It's a huge topic, and I highly recommend looking for more info on youtube, and elsewhere.

Comment Re:real world (Score 1) 186

Not sure what your concern is, but there are very many real-world examples to choose from. Look into any functional programming language for web server and database examples. A few specific ones that might be worth a look are the datomic database, the clojurescript "om" framework, the react "redux" state management framework, and more generally the notion of "single atom state".

Comment Re:Right. (Score 5, Interesting) 290

Ok, so you've proven you don't know what the terms "institutionalized racism" and "affirmative action" mean. There is a wide body of literature about race in the US which will describe these terms, what they mean, and how they are measured. You can look them up and read them, so that the next time you comment on an article about race your ignorance will be less comprehensive.

But regarding your twenty years in Oklahoma and Texas, I grew up in that part of the country. There are a few possibilities. If you're a transplant, they may not use the n-word around you because in their minds you're still an outsider, even after twenty years. Or, maybe you're a person of color yourself, so you're an outsider. Or, in those twenty years you never left your house. Or, it's so normalized you no longer hear it. Or, you're lying.

In any case, while you can't avoid people who use the n-word in those parts of the country, they aren't a majority. That doesn't mean racism isn't common. For example, a multi-racial couple that I knew made the mistake of attending an all-white church, and their car was keyed during the service. Most of the congregation would never use the n-word, but they quietly looked away when this sort of thing happened, and they *certainly* didn't see anything, if asked. This is the predominant cultural attitude in large portions of the US, which you are willfully misrepresenting.

Submission + - WebKit introduces new tracking prevention policy (webkit.org)

AmiMoJo writes: WebKit, the open source HTML engine used by Apple's Safari browser and a number of others, has created a new policy on tracking prevention. The short version is that many forms of tracking will now be treated the same way as security flaws, being blocked or mitigated with no exceptions.

While on-site tracking will still be allowed (and is practically impossible to prevent anyway), all forms of cross-site tracking and covert tracking will be actively and aggressively blocked.

Education

Is Believing In Meritocracy Bad For You? (fastcompany.com) 480

An anonymous reader quotes Fast Company: Although widely held, the belief that merit rather than luck determines success or failure in the world is demonstrably false. This is not least because merit itself is, in large part, the result of luck. Talent and the capacity for determined effort, sometimes called "grit," depend a great deal on one's genetic endowments and upbringing.

This is to say nothing of the fortuitous circumstances that figure into every success story. In his book Success and Luck, the U.S. economist Robert Frank recounts the long-shots and coincidences that led to Bill Gates's stellar rise as Microsoft's founder, as well as to Frank's own success as an academic. Luck intervenes by granting people merit, and again by furnishing circumstances in which merit can translate into success. This is not to deny the industry and talent of successful people. However, it does demonstrate that the link between merit and outcome is tenuous and indirect at best. According to Frank, this is especially true where the success in question is great, and where the context in which it is achieved is competitive. There are certainly programmers nearly as skilful as Gates who nonetheless failed to become the richest person on Earth. In competitive contexts, many have merit, but few succeed. What separates the two is luck.

In addition to being false, a growing body of research in psychology and neuroscience suggests that believing in meritocracy makes people more selfish, less self-critical, and even more prone to acting in discriminatory ways.

The article cites a pair of researchers who "found that, ironically, attempts to implement meritocracy leads to just the kinds of inequalities that it aims to eliminate.

"They suggest that this 'paradox of meritocracy' occurs because explicitly adopting meritocracy as a value convinces subjects of their own moral bona fides."

Submission + - AmigaOS 3.1.4 released for classic Amiga (hyperion-entertainment.com)

Mike Bouma writes:

The new, cleaned-up, polished Amiga operating system for your 68K machine fixes all the small annoyances that have piled up over the years. Originally intended as a bug-fix release, it also modernizes many system components previously upgraded in OS 3.9.

Contrary to its modest revision number, AmigaOS 3.1.4 is arguably as large an upgrade as OS 3.9 was, and surpasses it in stability and robustness. Over 320K of release notes cover almost every aspect of your favourite classic AmigaOS — from bootmenu to datatypes.


Comment thinking testing and UI are easier (Score 2, Interesting) 341

There's a widespread belief in IT that test code and UI are easier than other coding tasks.

It's completely false. Both are harder than other coding tasks. Your senior devs tell you to assign these projects to junior devs because they don't want to do them. They don't want to do them because they're much harder than other coding tasks.

It's win-win for the senior devs: they get easier work, and when the junior devs struggle, it makes the senior devs look even better. "oh, man, they can't even write a test suite. Well, I guess I should get the big bonus this year."

Put your best devs on test and UI. Put your junior devs on the simple stuff: backend work.

Comment Re:As a non-US resident... (Score 3, Insightful) 140

It's freaking horrible for US residents, as well. I just want to buy a service, I don't want to try to work through the calculus of how well the driver performed, how much I value it, how much the driver deserves, and how much social aggression I'll face if the driver thinks they've been shorted. I just need a ride. I don't need a passive-aggressive douche pressuring me to tip well on my way to the airport.

Slashdot Top Deals

A sine curve goes off to infinity, or at least the end of the blackboard. -- Prof. Steiner

Working...