WTF Bites
-
@topspin even with lambdas they're still painful. It's only with C++20 ranges that they start resembling something ergonomic.
True, they're painful because they don't compose well. Something FP really shines at.
But in C++03 even single calls where insane if you didn't already have the function/functor available. Andbind1st
as poor-man's currying is pretty ugly, too.
-
@Mason_Wheeler said in WTF Bites:
The lambda calculus in [Milner 1978] also looked like a moon language the first few dozen times.
It always does. I've never understood why lambda calculus is taken seriously when so many similar systems are categorized as jokes or estoteric programming languages.
Huh? That's like saying Turing Machines are a joke and nobody should take them seriously.
It's a theoretical tool, not something you program in.
-
@Gąska And that's what I mean. The problem with "simple" is that it has two mutually incompatible meanings. A "simple system" may be one that simplifies the tasks for which people use it, or conversely one that is simplistic in its design.
A simplifying system is actually useful. People love them. But they often contain a massive amount of complexity under the hood. As one of my college professors remarked regarding Larry Wall's famous virtues of a programmer, "being truly lazy is a lot of work!"
A simplistic system, by contrast, is garbage. It looks appealing on the surface, but when you try to use it for non-trivial tasks, nobody actually likes it because it lacks the power and/or the features to do useful things. When your base system is "incredibly simple in the mathematical sense", it makes doing anything with it -- such as subtraction -- incredibly complicated.
-
@Benjamin-Hall said in WTF Bites:
@topspin Yes! This! Someone understood what I was trying to get at.
The concept of a monad isn't so bad. But the explanations of it are horrific and get in the way of understanding the actual issue, which is "how do I do something useful in this language
that explicitlywhere the main selling point forbids any such thing?"
-
-
Status: Distracting myself, I found this channel.
What the fuck am I getting myself into?
-
@Tsaukpaetra said in WTF Bites:
What the fuck am I getting myself into?
Something almost completely different than this?
https://what.thedailywtf.com/topic/17754/the-official-count-as-high-as-we-can-thread
-
I just noticed that all my .pdf files have a weird icon. I clicked on one of them and it opened in . . . . . Microsoft Edge.
What the fucking fuck.
I haven't used Edge since forever and it just randomly hijacks file associations?
-
We're slowly impementing a new domain in the US office, let's call it usa.local
TBH, this is
Using .local domains has been dis-recommended for over 10 years, because of Apple's implementation of multicast DNS. The official recommendation at this point is to use your publicly registered domain name and implement split-brain DNS for external resources (e.g. your www.mywebsite.com address)
-
It's kinda like RAII - non-C++ programmers used to find it unnecessary because they don't need it, then they've got
using
and now they find it unnecessary because they already have it under different name.C++ is the Apple of programming languages, “inventing” stuff “differently” that's been in other places for many years.
E.g.
std::transform
(instead ofmap
like everywhere else – common theme in the standard library). But I don't think that's the case with RAII. For all I can tell RAII was invented in C++.It's basically axiomatic that C++ names things wrong.
map
was already taken for dictionaries, one of the few things that actually aren't horribly named, sostd::transform
had to give. It's not even that bad.
And to be fair, while the STL algorithms have always been advocated for over loops, before lambdas they were just too painfully verbose to use, so better to use map forstd::map
.Yeah, but they didn't have to fuck up std::flat_map. And who the fuck names it unordered_map instead of hash_map?
-
@pie_flavor See first sentence.
-
@pie_flavor said in WTF Bites:
And who the fuck names it unordered_map instead of hash_map?
Committee.
-
Fortune.com has one of the standard cookie opt-in nonsense, except...
-
There are whole tribes of monads travelling in cavarans.
The Haskell tribe is led by their great patriarch, Eddie.
-
and
T& const
error: 'const' qualifiers cannot be applied to 'T&'
Not sure what it would mean. You can't change references after they have been assigned anyway, so?
-
Status: Apparently Ubuntu 18 is no longer supported.
That was fast.
-
Status: I was bored, so I clicked the Ubuntu link in the directory listing...
It eventually stopped letting me do that.
-
and
T& const
error: 'const' qualifiers cannot be applied to 'T&'
Not sure what it would mean. You can't change references after they have been assigned anyway, so?
Yeah, I messed up pointers and references. I haven't coded in C++ for like 3 years.
-
@loopback0 said in WTF Bites:
Fortune.com has one of the standard cookie opt-in nonsense, except...
-
@Tsaukpaetra said in WTF Bites:
Status: I was bored, so I clicked the Ubuntu link in the directory listing...
-
@Tsaukpaetra said in WTF Bites:
Status: I was bored, so I clicked the Ubuntu link in the directory listing...
Start here: http://archive.ubuntu.com/
Then click the ubuntu link until it doesn't appear in the generated page anymore.
-
whole tribes of monads travelling in cavarans
-
To ping everyone in said channel because they have something important to say. Basically
@here
except MS Teams has no@here
.There is marking messages as important, but I am not sure whether it actually works for the purpose.
-
@Tsaukpaetra said in WTF Bites:
Status: Apparently Ubuntu 18 is no longer supported.
Ubuntu 18.04 Bionic Beaver is a LTE and is still supported (usually 5 years + 3 or so more of extended security support). Ubuntu 18.10 is an interim release and is not supported any more as those are only supported 9 months. If you want stability, you have to stick to the <even number>.04 releases.
See also https://wiki.ubuntu.com/Releases
-
@Tsaukpaetra said in WTF Bites:
Status: Apparently Ubuntu 18 is no longer supported.
Ubuntu 18.04 Bionic Beaver is a LTE and is still supported (usually 5 years + 3 or so more of extended security support). Ubuntu 18.10 is an interim release and is not supported any more as those are only supported 9 months. If you want stability, you have to stick to the <even number>.04 releases.
See also https://wiki.ubuntu.com/Releases
I didn't even notice. Usually I click the latest LTS but I guess not this time...
-
<even number>.04 releases
… hm, there might be some joke hidden in making stable releases in April.
-
<even number>.04 releases
… hm, there might be some joke hidden in making stable releases in April.
If you name your release bionic beaver, it already is a joke.
-
@pie_flavor said in WTF Bites:
C doesn't add anything ever so it's understandable it doesn't have it.
C adds things but they tend to be very low level. It's specifically a language that provides you with the tools to make your own library, not one that does everything for you. (For example, C's strings are incredibly primitive, so if you want good string handling you build on top of it.) C is a language that knows exactly what its niche is; I rather like C, especially as it means I don't need to write nearly so much assembly. There are some really surprising bits in C, but you won't care about them much when writing software for desktop computers as then you'll probably be using simple structure layouts and have
double
implemented in hardware.Assembly's really miserable for anything more than a few instructions. Trust me.
-
@pie_flavor said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
Who is doing that? What? What manner of straw man are you shooting at now?!?
Functional people are. That's how Haskell works.
I think that cropped up in ML first; Haskell borrows/steals a lot of ideas from there. It's one of these things that turns up really easily in the semantics once you've got first-class functions, and is a way of doing partial binding of function arguments without a great deal of fussing around. (Imperative languages tend to need an additional explicit operation to do the partial binding.)
For example, here's a trivial function (leaving out types):
fun add(x, y) = x + y
Here's that rewritten to be the other way:fun add x y = x + y
And here's how you might partially bind that second function:let add_one = add 1
Without that, you'd need to do this:def add_one y = add(1, y)
Which looks trivial and it is (ignoring the complexity of the language implementation needed to support this efficiently). Except that with more complex examples (which I'm not writing out here because ) the partial-applicative form works out to use a lot less typing and intermediate declarations and so on.
-
I've seen things like that before with Facebook's rendition of virtual people (maybe MS or Google too) but didn't take a screenshot.
What fresh Picasso hell did these "designers" creep out of to give us these nightmare people? Is this the result of "no child left behind", where 8 year olds with no sense of proportions get hired directly after failing their art class?At least the dog looks normal.
-
Except C++ really was first - at least as far as mainstream languages are concerned.
Scope-limited resource management has been in Lisp for a very long time. It was probably in there well before Stroustroup started writing C++. Lisp isn't really mainstream now (it had its time in the sun and failed for essentially commercial reasons) but it's a language that should be exceptionally well known of by anyone doing language development. Lisp chooses slightly different approaches to C++ for doing this, as it is a language that makes having a subsidiary block of code very easy (Ruby, Perl and Tcl are other languages that are like that, even though they're otherwise very different) and that leads to different natural approaches.
Saying that RAII — which is very much a C++ only concept when used the way they use it — is a C++ innovation is unhelpful. It's also the kind of thing I was referring to. It's an “Apple Innovation” type innovation: not actually innovative (except for the trivial part that it's in C++) yet claimed very loudly to all and sundry as the most amazing thing ever and proof that everyone else sucks because they're Not Innovative. For some reason, such attitudes attract a “well fuck you too then” from the rest of the world.
I mean, what year was
using
added to Java? 2010?Never. That's C#. (Java was absolutely late to the party, and folds the functionality into
try
.)
-
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
Status: I was bored, so I clicked the Ubuntu link in the directory listing...
Start here: http://archive.ubuntu.com/
Then click the ubuntu link until it doesn't appear in the generated page anymore.Yes. I did.
-
Except C++ really was first - at least as far as mainstream languages are concerned.
Scope-limited resource management has been in Lisp for a very long time.
What about RAII? Did Lisp have RAII? How do you define a destructor in Lisp?
Saying that RAII — which is very much a C++ only concept when used the way they use it — is a C++ innovation is unhelpful.
Saying that it's not is also unhelpful. The entire discussion about who was the first is unhelpful. Why did you even start it?
I mean, what year was
using
added to Java? 2010?Never. That's C#.
You're such an annoying asshole, you know?
(Java was absolutely late to the party, and folds the functionality into
try
.)And it happened like in 2010, am I correct about that part? Because that's the only part that matters. You told me that I'm wrong about the part that absolutely doesn't matter whatsoever even one bit (naming), but you said nothing at all about the part that matters. I wish I could turn back time and not have read your post; I'd have been a happier man that way.
-
<even number>.04 releases
… hm, there might be some joke hidden in making stable releases in April.
If you name your release bionic beaver, it already is a joke.
How much do we care about Ubuntu naming? Focal (Fossa).
-
Scope-limited resource management has been in Lisp for a very long time.
RAII is owner resource management though, with scope being a possible kind of owner, but not the only one. As such, languages without concept of owner (including Lisp, the pioneer of garbage-collection) can't have RAII, only scoped resource management.
That said…
Saying that RAII — which is very much a C++ only concept when used the way they use it — is a C++ innovation is unhelpful.
… I am not sure RAII was actually invented/designed into C++ by its designers rather than discovered as a useful use of the available tools. Many useful C++ idioms were discovered like that.
-
You're such an annoying asshole, you know?
Alanis Morissette called... Something about the weather on your wedding day.
-
See that comma separated list? How could that possibly be done stupidly? Glad you asked.
Here's the clue...
Each name is a separate
<span>
(OK so far) with the spacing and comma in the::before
and::after
pseudo-elements.
As a bonus there's no special case for the last entry so there's a trailing comma.<span ng-repeat="productName in vm.appliesTo track by $index" class="c-meta-text display-inline comma-appended ng-binding ng-scope x-hidden-focus" itemprop="about" ng-show="$index < 3 || vm.showMore" aria-hidden="false">SQL Server 2016 Web</span>
.comma-appended::after { content: ","; } .comma-appended::before { content: " "; }
-
RAII is owner resource management though
The key difference is that RAII is using the containing scope, whereas most other languages go with explicit lifetime management. It's less tricky from the perspective of someone reading the code.
-
The key difference is that RAII is using the containing scope
No, the key difference is that besides a code block, the scope can also be another object.
[…] explicit lifetime management. It's less tricky from the perspective of someone reading the code.
It is much more error-prone from the perspective of the person writing the code though, because they have to remember to use it, while RAII is used automatically and rather hard to opt out of by mistake (with perhaps notable exception of shared pointer cycles).
-
It is much more error-prone from the perspective of the person writing the code though
“I'm going to optimise out this unused variable.” (Deletes a
std::lock_guard
…)
-
@dkf and that's why Rust's decision to make the Mutex explicitly wrap around another object and only hand out references to it through the Lock objects is so great. You avoid exactly the scenario you complain about.
-
@Gąska … and why whenever I need to fix some locking in C++ code I introduce a wrapper of mutex + T and use it either similar to Rust or with a
lock
method taking a closure to be executed under the lock. It is not as safe as Rust, but still significant improvement.
-
It is much more error-prone from the perspective of the person writing the code though
“I'm going to optimise out this unused variable.” (Deletes a
std::lock_guard
…)Since locks can only be held over dynamic scopes, they don't benefit from RAII. Using RAII for them is kind of a mistake.
-
I've seen things like that before with Facebook's rendition of virtual people (maybe MS or Google too) but didn't take a screenshot.
What fresh Picasso hell did these "designers" creep out of to give us these nightmare people? Is this the result of "no child left behind", where 8 year olds with no sense of proportions get hired directly after failing their art class?At least the dog looks normal.
And to add insult to injury, the text is in German.
-
@Tsaukpaetra That's as many as four tens, and that's terrible
-
And it happened like in 2010, am I correct about that part? Because that's the only part that matters. You told me that I'm wrong about the part that absolutely doesn't matter whatsoever even one bit (naming), but you said nothing at all about the part that matters. I wish I could turn back time and not have read your post; I'd have been a happier man that way.
Java has had
try
/catch
/finally
for ages, and C# has hadusing
since at least 2004. I don't know how that compares to C++ chronologically
-
@hungrier you're doing that on purpose, don't you.
-
@Gąska I left out the part about how it compares to C++ in any other terms, which is favourably (the way that anything compares to C++)
-
@hungrier you also left out Java's try-with-resources, which was the only thing I asked about. Everything you said was completely irrelevant to what I asked but touched on every subject that was previously discussed. It's like you specifically crafted your post to piss me off as much as possible.
-
It's like you specifically crafted your post to piss me off as much as possible.
YMBHN