Please create an account to participate in the Slashdot moderation system

 



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.

Comment Re:It is not necessarily a love of the old smartph (Score 1) 120

So my last new wonderful, top of the line, latest and greatest phone I bought died just before my two year contract was up, so I bought an older model phone (different brand) on Amazon that was supposed to work with my provider. It was supposed to be a temporary replacement until I could buy a new, latest and greatest phone.... but long story short, it's smaller, slower, and everything I actually need in a phone, so I just decided to just keep it.

Comment Re:Free Baggage Checks? (Score 1) 310

I fly several times a year for my company, and I completely disagree. I think it's more perception than reality.

1) This is the most valid point, but unless you're late to the airport it's a moot point, because the plane's not leaving any sooner because you didn't have to check a bag. If you are late, then it's your own damn fault.

2) Nearly every time I've flown the bag is already there by the time I get to the carousel, or within 5 minutes or so. It depends when you get off the plane. If you rush off, pushing and shoving people out of your way so that you can be first, then you will wait longer.

3) Yes... I've even had luggage lost before. But the fact is that it's really quite rare. Last stat I read didn't clearly say how much was lost, but "Mishandled" bags was around 0.6%, I would expect most of that was damage - and while it may be a hassle, airlines are responsible for up to over $3k per lost bag, so they are actually doing quite a bit to stop it from happening. They REALLY do not want to lose your luggage. From this report, airlines are "now 70 percent less likely to lose our bags than they were 10 years ago."

I've flown for quite some time, and I can tell you that when they didn't charge for checked bags, a LOT fewer people used carry-ons.

Comment Re:Back to Front Would Fix Half of It (Score 1) 310

They used to do back to front boarding. I mostly fly Delta now, which uses "zones," but zone 1 doesn't necessarily equate to being in the back, and then they load First Class, "Premiere," "Executives" and whatnot first, then handicapped people and people flying with children... the plane is half full by the time they start boarding zone 1. But even way back when, they'd call "now boarding rows 40 and higher" and everybody would run up to and crowd around the gate anyway.

Slashdot Top Deals

The first sign of maturity is the discovery that the volume knob also turns to the left.

Working...