2,420 karma · joined Apr 9, 2012 (14y ago) · 1,199 submissions
comment 14y ago · link · parent
No they aren't. You are assuming every language is as shitty as Java. This is not the case. There is nothing special about Bool, it is a normal ADT:
Bool = True | False
>How would you handle a real complex type like Customer or Order or Window or Button?Defining a type for it, just like anything else? I don't understand what is confusing you here. Do you normally just keep your Customers or Orders as a hash table of string:string or something? Even in OO languages, you create a type for them, it just happens that the only way you can create types in most OO languages is making classes.
>Yes, it does. It's effectively the DRY principle -- you can't repeat the data manipulation code throughout the codebase
Yes you can, there is absolutely nothing stopping you from making a dozen different doThingToCustomer functions/methods scattered across a dozen different classes. I am amazed that you are seriously suggesting that the problem OOP solves is people accidentally writing the same function multiple times, when that was never a problem, and OOP doesn't do anything to address it. And how on earth does this bizarre notion address the class of errors you were complaining about, which are type errors?
comment 14y ago · link · parent
comment 14y ago · link · parent
I create a type for it? Why do you think RGB being bytes makes it special? Bools aren't bytes, but I can't pass anything other than True and False for a Bool.
>OOP combines opaque data structures with the operations performed on them.
That does nothing to prevent errors. Having the operations require the correct types does prevent errors on the other hand, regardless of whether or not the operations and data are put into an "object" together or not.
comment 14y ago · link · parent
Had you just suggested that beating eggs is a side effect, and thus not purely functional you would have gotten a response. But when you go so far off the rails that the only reasonable explanations are that you are trolling or insane you shouldn't expect people to take you seriously enough to bother responding.
Yes, beating an egg changes the state of the egg from unbeaten to beaten. Yes, this is a difference, however it is not a difficult to understand difference. I explain it all the time, that's why I used it as an example. "With functional programming, instead of the egg_beater function changing the egg, it takes in the unbeaten egg, and returns to you a beaten egg. If you gave the unbeaten egg a name, you can still use it.". That is easy to understand, which is why people respond with "oh, ok" instead of confusion. This concept has to be understood when teaching OOP too, as generally methods that just change state return "this" so you can chain method calls: egg->beat()->fry(). So proposing that it is some unfathomable difficulty with learning FP is ridiculous.
comment 14y ago · link · parent
No? How would you get to that interpretation when I didn't even say anything about this theoretical person, but rather about you?
>For what I do, I cannot afford to work with a PhD student who does not know more than one programming paradigm!
Unless you are doing programming language research, yes you can. Almost everyone already does, it is just that the only paradigm in question is imperative, rather than functional. That's not a significant barrier for the vast majority of roles, especially not PhD students.
>People don't talk in terms of transformations, they talk in terms of instructions,
That's the same thing. People think "beat the egg". Beating is a transformation, egg is a thing. People do not think "send the egg a message requesting it to change itself to the beaten state", which is why the OOP metaphor fails so badly. Functional programming directly maps to the normal way people think, as does traditional imperative programming. OOP does not.
comment 14y ago · link · parent
Ironically, it actually indicates a severe ideological bias on your part, not theirs.
The rest of your post seems like it is entirely platitudes intended to say nothing. No, people don't think in terms of objects, that is why the leaky metaphor used to teach OOP traditionally causes so much confusion, and makes OOP harder to learn than FP. Thinking in terms of FP is not thinking in terms of "formulas", and it appears you are basing all the rest of your assumptions on top of that one faulty assumption. People intuitively understand "I make a thing that transforms other things" much easier than they understand "I make my things know how to transform themselves, or maybe other things, or maybe both, but sometimes neither and I make different things to do the transforming instead, but those things are wrapped inside an "object" that doesn't represent anything for no discernable reason".
comment 14y ago · link · parent
comment 14y ago · link · parent
I'm living proof that you are mistaken.
>Actually, many companies put Haskell (or even Scala) down as a requirement just to filter out the low end programmers
If by "many" you mean "a couple", then it depends what you mean by "low end programmers". Asking for haskell is decent at weeding out people who have no interest in learning new things and improving themselves. It isn't particularly useful for filtering out people who aren't "really smart".
>OO is accessible because it is much more naturalistic than FP
It is interesting that you pre-suppose that is the case. My experience with teaching people programming with no prior experience is that OOP is not accessible at all, and FP comes quite naturally.
comment 14y ago · link · parent
comment 14y ago · link · parent
You are doing the equivalent of saying gnome developers should just delete gnome and start working on KDE instead. The gnome developers aren't interested in KDE. If they were, they would be KDE developers, not gnome developers. This is the same with the BSD lineage operating systems. NetBSD developers aren't going to become FreeBSD developers just because you think it would make them do better in a popularity contest they didn't enter. If they wanted to develop FreeBSD, they would be doing so.
comment 14y ago · link · parent
comment 14y ago · link · parent
comment 14y ago · link · parent
comment 14y ago · link · parent
The current strategy of charging backwards at full speed doesn't seem like a great plan though. We're not getting closer to linux on the desktop being plausible, we're getting further and further away. Making a typical linux desktop system even more complex, brittle, and fragile than windows is not a good way to compete with windows.
comment 14y ago · link · parent
Yes it does. This weird misconception that all the developers of different BSD lineage OSes would all be working together one a single system otherwise is ridiculous. There are 4 because the people working on them wanted 4. If netbsd disappeared, those developers wouldn't just switch to an OS they don't care for, and aren't interested in. Having 4 OSes means there are more developers in total, and given the licences, code is shared between the 4 systems. It is entirely a gain for all 4 of them to have the other 3 exist.
comment 14y ago · link · parent
comment 14y ago · link · parent
comment 14y ago · link · parent
I realize lots of people run wordpress. That doesn't support the claim that it easily scales to the traffic demands of a top 10 site.
comment 14y ago · link · parent
I agree that using caching is normal, but the difference is the total reliance on caching. I wouldn't be impressed with google's scalability either if it were 99.9999% static pages being served up.
comment 14y ago · link · parent
That is a function of popularity, not language. If some blogging app had a userbase the size of wordpress's, it wouldn't matter if it were written in PHP or brainfuck, shared hosting providers will set it up. This is why appealing to techies makes sense. They will be the ones setting it up in the initial "its not popular yet" phase, and if they don't use it, it will never get off the ground. Once they start setting it up for their friends/family/etc, a few companies start offering it as an option for their hosting. Then a few more, and it snowballs as the app gets more and more popular. Trying to start from "use PHP so end users will use it" doesn't work, because installing a PHP app is just as hard for them as installing anything else.
comment 14y ago · link · parent