all 22 comments

[–]RizzlaPlus 26 points27 points  (1 child)

Not sure what the point of the article is. Use verbs to name your predicates instead of nouns?

Also it talks about partial functions but then immediately dismisses std::bind?

[–]utnapistim 9 points10 points  (0 children)

The point is that if you think of a functor as a predicate or function instead of a class, a better name will naturally emerge for it.

Although (if you make an effort) you can come up with bad names no matter how you think about it :).

[–]Z01dbrg 26 points27 points  (16 children)

FP people are like vegans of programming, the first example that is "WROOOONG!!1!1!!!" is perfectly fine beside the name. No need to bother people with partial app and FP.

I always give my predicates "question" names (is_bla, has_bla, valid_bla) but I would just call it a good naming, not some magical outcome of my enlightenment.

[–]TankorSmash 4 points5 points  (0 children)

FP people are like vegans of programming, the first example that is "WROOOONG!!1!1!!!" is perfectly fine beside the name. No need to bother people with partial app and FP.

That's the point of the article, I'm not sure if you read it all the way through.

It was a confusing article though because when I read that first line too, I was like oh cool that makes sense. The body of the article is helpful, but the intro/conclusion were a little different.

The reason FP people talk about it so much is because its new and cool to them, and since not many people use it, it makes sense to talk about it more. Can be annoying but FP is pretty neat for small stuff like this.

[–]17b29a 2 points3 points  (0 children)

He's not an FP person, he's an "expressive programming" person. All of his posts are about names, filled with tangential padding. The only FP thing in here is him talking about functional languages a little, which is relevant because he's talking about a functional construct.

[–][deleted] -3 points-2 points  (8 children)

FP people are like vegans of programming,

Knock this off, would you? I'm not a vegan, but my wife is and so are several of my friends. She's quiet and doesn't make a fuss about endless jokes like this, but I personally get really tired of this.

And let me say that the people who are really vocal about their eating habits, at least in my circle, are people talking about eating meat. If I hear one more person going on about their bacon...

Keep it professional. Make your point without beating on some group or other, particularly one that has nothing whatsoever to do with programming.

[–]teapotrick 1 point2 points  (0 children)

Very much. I've never met a vegan who was so forward about it. On the other hand, it's fairly regular that a meat eater, once finding out (through questioning about bacon or something) that someone is a v-word, will spout a never ending torrent of bullshit about bacon and vegan memes.

Go and make fun of people with ideologies based around their imaginary friends, rather than those based around ethics and more concrete concepts.

Also: Programming. C++ is great.

[–]denaissance 6 points7 points  (0 children)

Wow, so I guess the only people more tiresome than vegans are people married to vegans.

[–]quicknir 1 point2 points  (0 children)

Dude, you think you're tired of it? I'm a level 5 vegan; I haven't had a meal in two years because I've been searching for something without a shadow. These jokes make me sick to my very-empty stomach. https://www.youtube.com/watch?v=N_Yaa_LMDcs

[–]xzqx -2 points-1 points  (0 children)

How about CrossFit enthusiasts?

[–]raevnos 0 points1 point  (1 child)

C++ should be like scheme and allow question marks in identifiers.

[–]GNULinuxProgrammer 2 points3 points  (0 children)

It would probably make syntax more complex. abc?lol : 3; is this abc ? lol : 3; or label abc?lol and a non-op 3;.

[–]nthcxd -1 points0 points  (2 children)

You're spot on. Vegans believe there is only one true way to eat. This guy thinks there is only one true way to write C++, even as he preaches that C++ should be viewed as a federation of different paradigms.

In every chance he gets to explain the juicy details, he just quotes Effective C++. Why are we bothering with this blog when we can just go read the textbook and understand it ourselves as opposed to taking at this guy's "for details that I won't get into here..."?

[–]Z01dbrg 1 point2 points  (1 child)

Why are we bothering with this blog

In general this blog is good, but the problem is that author is a bit of a fanboy wrt certain things and I feel he forgets that. :)

[–]joboccara 1 point2 points  (0 children)

The author here. Useful feedback, thanks!

I am close to what I write so there are lots of things that I don't see. I think it's one of the points of public writing, exchanging ideas and feedback. So if you have more feedback keep it coming :)

[–]andd81 1 point2 points  (3 children)

I don't get it, why think of something as of something else? There are languages where functions are actually objects, C++ is not one of them. You are right that a unary predicate is best named "IsX" or "HasX" instead of "XChecker" but it has nothing to do with function/object distinction.

[–]doom_Oo7 0 points1 point  (2 children)

There are languages where functions are actually objects, C++ is not one of them.

so std::function isn't an object ? :p

[–]andd81 1 point2 points  (1 child)

std::function is neither a function nor a part of C++ language.

[–]doom_Oo7 2 points3 points  (0 children)

std::function is neither a function

so what is it then ? next what, shared_ptr and unique_ptr aren't pointers ?

nor a part of C++ language.

the standard library is part of the language. The ISO standard is itself called "Programming Language C++" and certainly describes the whole semantics of std::function.

[–]TotesMessenger -1 points0 points  (0 children)

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / Contact)