WTF Bites



  • @lb_ Well yeah, if it recovered from one of 0 errors then the error count would roll over to 4294967295.



  • @dkf said in WTF Bites:

    I'll give you a hint: within a filesystem the two operations use the same syscalls…

    But HUMAN BEINGS use computers and to a human being, renaming an item is not the same operation as moving an item. You can move something without renaming it, and you can rename something without moving it.

    It doesn't matter what the fucking syscall is, treating "Move" and "Rename" as the same operation is terrible UX.


  • Discourse touched me in a no-no place

    @blakeyrat Did you understand what people were talking about, or did you just decide to use a prepack rant for shits and giggles?



  • @cvi said in WTF Bites:

    @djls45 Yes, but as mentioned, with the proposal you can (for example) enforce that the interface only contains public virtual methods. And you can inject a virtual destructor by default - which will cut down on people forgetting to do so. You can name it "interface" up-font too, which makes the code more clear and brings a number of guarantees that are actually enforced (rather than promised by documentation or convention only).

    You could also simply create a basic abstract class that has a virtual destructor. Either way, the programmer has to remember that the class he's currently writing has to inherit from the normal virt_dtor class or from something with the "interface" descriptor. Requiring all of the functions in the "interface" to be public and abstract eliminates the ability of the class to have default implementations, which could easily increase the amount of code that needs to be written, since now the base class with the defaults itself has to inherit from an "interface". That's in addition to writing the description for the "interface" itself.

    And it collects all that code in a single place (like shown in the value example). This means that there is a single copy of what essentially amounts to annoying boilerplate.code, instead of having it repeated many times. Not sure why that would make something more complicated. (Yes, you can do similar things by abusing inheritance, but that doesn't exactly make code less complicated.)

    Complex types would still need their own specializations for the assignment, copy, comparison, etc. operators. This does nothing to address that.

    In the end, you will have less code (or more generic code in a library), and you have the possibility of enforcing/checking the things you want to guarantee more than before. Why would this be a bad thing?

    Maybe, but all that just adds more things for the programmer to know in a language that is already incredibly complex. And those enforcements in many cases wouldn't actually be needed or would have to be overridden.


  • ♿ (Parody)

    @dkf said in WTF Bites:

    @blakeyrat Did you understand what people were talking about, or did you just decide to use a prepack rant for shits and giggles?

    Words mean particular things in his head and no other interpretations are possible.



  • @boomzilla said in WTF Bites:

    Words mean particular things in his shoulder alien's head and no other interpretations are possible.

    FTFY





  • @swayde

    As someone with no tech background, I'm really glad that the git hub python server Js apps query is fixed.



  • @Bulb said in WTF Bites:

    @djls45 said in WTF Bites:

    @cvi said in WTF Bites:

    Told you that the dark side was more fun. (Wait till you hear about the meta-classes proposal!)

    I don't see anything there that can't already be implemented normally by using templates, classes, inheritance, namespaces, bitfields, and so on.

    Given that the metaclass generates normal templates, classes, inheritance, namespaces, bitfields, and so on, there can't be. And still, nothing of what they can do is possible with the C++ compiler today. It can be done with a separate code-generator, like the Qt MOC or the Open C++.

    Is there a difference between meta-objects and meta-classes or is one of them named incorrectly?
    Templates, RTTI, and casts seem like they already cover the requirements, though, so I still don't get why meta-classes would be needed.

    @djls45 said in WTF Bites:

    but the code for those still need to be written; they're just in a different place under this proposal

    The point is to generate the code. So in a sense it will still need to be written, but it will be written by machine, not human. And while the human still has to write the machine first, he only needs to do it once, not for each use.

    Right. It could cut down on some things that might be repetitive, but most code has specializations anyways, so there's not much to be saved that doesn't require adding something else elsewhere with a net increase for the programmer to remember and track.
    If it's just code generation, why does it have to become part of the language? Let it remain as separate tools/libraries.


  • Discourse touched me in a no-no place

    @djls45 said in WTF Bites:

    I still don't get why meta-classes would be needed.

    In general (i.e., this is not C++-specific), the main reason for using metaclasses is to let classes take more control over the lifecycle of instances. You can totally do similar things with frameworks and factories and so on, but all that wordy bull gets a lot cleaner when you can use metaclasses to intercept the basic events and take over. (For example, implementing a reuse-pool of objects is quite a bit of work — and rather visible to callers — unless you can intercept construction and destruction.)


  • 🚽 Regular

    @hungrier said in WTF Bites:

    As someone with no tech background, I'm really glad that the git hub python server Js apps query is fixed.

    Oh so you’re a project manager

    I think Mauve has the most RAM.


  • area_can

    @swayde said in WTF Bites:

    Reddit switches to react:

    well, I guess I'll start spending less time on reddit

    e: holy shit, the "new experience" is janky as shit. bummer


  • area_can

    @swayde said in WTF Bites:

    https://www.reddit.com/r/announcements/comments/8830oa/and_now_a_word_from_reddits_engineers/

    But above all, we wanted to use the rewrite as an opportunity to increase "developer velocity," or the amount of time it takes an engineer to ship a fix or new feature. No more "git blame" for decade-old code. Just a giant mass of tendrils, shipping faster than ever.

    :wtf:



  • @djls45 said in WTF Bites:

    You could also simply create a basic abstract class that has a virtual destructor.

    Err... this is about creating that abstract class? Or what exactly is your point here?

    Requiring all of the functions in the "interface" to be public and abstract eliminates the ability of the class to have default implementations, which could easily increase the amount of code that needs to be written, since now the base class with the defaults itself has to inherit from an "interface".

    Whether or not interfaces are a worthwhile thing to have is a different discussion, though. But I'd nevertheless like to point out that anything COM will involve a lot of them, so at least the idea of exposing APIs just through interfaces with only public virtual pure functions is not that far fetched.

    Complex types would still need their own specializations for the assignment, copy, comparison, etc. operators. This does nothing to address that.

    It addresses the case where you have a lot of types with very similar behaviour. But it neatly addresses the problem with very simple types that are mostly just a pile of boiler-plate code.

    For example, have you ever tried to define a BitmaskType with a scoped enum? It's something that's rather common in the standard library (perms, launch, ...), and it's a pain each time. One solution is to use a pile of ugly macros. This would eliminate the need; in fact, with the proposal you could define a bitmask meta-class that allows you to just say bitmask SomeBitmask { one, two, three };, and that would automatically take care of the values too (i.e, set them to 1<<0, 1<<1,...). And as a added bonus, the declaration is rather upfront about what it is.



  • @bb36e I want to figure out who came up with the idea that fast development is the same as good development.



  • @blakeyrat said in WTF Bites:

    @bb36e I want to figure out who came up with the idea that fast development is the same as good development.

    0_1522358245412_f40946f7-5437-4663-a3d5-e9338cc0bb5c-image.png


  • Discourse touched me in a no-no place

    @blakeyrat said in WTF Bites:

    I want to figure out who came up with the idea that fast development is the same as good development.

    You don't need to know who. You just need to know where, as exact GPS coordinates. Drone strikes don't need to know names…



  • @blakeyrat they mention having shitty almost decade old js, somewhat faster might not be the worst they could do.
    I just don't get them, they seem to be pissing users off constantly for little to no benefit.
    The problem might be them still not having monitized the platform sufficiently 😑


  • Garbage Person

    @bb36e said in WTF Bites:

    But above all, we wanted to use the rewrite as an opportunity to increase "developer velocity," or the amount of time it takes an engineer to ship a fix or new feature.

    Most people want to decrease the amount of time it takes to do these things.


  • Considered Harmful

    @dkf said in WTF Bites:

    @pie_flavor said in WTF Bites:

    But renaming is faster than moving.

    I'll give you a hint: within a filesystem the two operations use the same syscalls…

    Ah, but PowerShell does not have to be used within a filesystem. For example, renaming registry keys is a very different operation from moving them.



  • @dkf said in WTF Bites:

    @remi said in WTF Bites:

    forgetting Q_OBJECT leads to basically incomprehensible linker errors

    Dude, it's C++. 99% of all errors are effectively incomprehensible.

    I had to apply this patch to GCC 4.8 (which the message explicitly says isn't affected) in order to make it compile after changing one line of text in a Dockerfile (the first one):



  • @bb36e said in WTF Bites:

    Just a giant mass of tendrilsnoodles, shipping faster than ever.

    FTFS


  • Considered Harmful

    @ben_lubar said in WTF Bites:

    Or open a REAL command line and type mv instead of ren.

    Both work in PowerShell, a REAL command line. But renaming is faster than moving.

    I'll take one fewer keystroke over 0.00001 seconds of execution time savings.

    Of course mv is smart enough to figure out when a simple rename will do.



  • @laoc said in WTF Bites:

    @ben_lubar said in WTF Bites:

    Or open a REAL command line and type mv instead of ren.

    Both work in PowerShell, a REAL command line. But renaming is faster than moving.

    I'll take one fewer keystroke over 0.00001 seconds of execution time savings.

    Of course mv is smart enough to figure out when a simple rename will do.

    mv is a wrapper around the rename syscall.



  • @dkf said in WTF Bites:

    @djls45 said in WTF Bites:

    I still don't get why meta-classes would be needed.

    In general (i.e., this is not C++-specific), the main reason for using metaclasses is to let classes take more control over the lifecycle of instances. You can totally do similar things with frameworks and factories and so on, but all that wordy bull gets a lot cleaner when you can use metaclasses to intercept the basic events and take over. (For example, implementing a reuse-pool of objects is quite a bit of work — and rather visible to callers — unless you can intercept construction and destruction.)

    That is totally off the mark for C++.

    Instances are values in C++, so the user has control of the life-cycle, not the class itself.

    If you want to intercept allocation and deallocation, you do that by defining operator new and operator delete for the class. But reuse pool is normally done using a custom allocator, because if you want to reuse, it's probably something like map elements. And those are not instances of the value class anyway.



  • @ben_lubar said in WTF Bites:

    GCC 4.8

    Why such old version?

    @ben_lubar said in WTF Bites:

    after changing one line of text in a Dockerfile

    It's one small change for Dockerfile, but a huge change for the build environment.

    Debian Jessie has gcc 4.9.2, Ubuntu Bionic Beaver has at least 7.3. Probably they've started generating the error in C++ as well in the meantime.


  • BINNED

    @bb36e said in WTF Bites:

    Just a giant mass of tendrils, shipping faster than ever.

    Take those tendrils and JAM THEM!

    EDIT: Semi-:hanzo: by @HardwareGeek, curse him!


  • Discourse touched me in a no-no place

    @ben_lubar said in WTF Bites:

    mv is a wrapper around the rename syscall.

    When on the same filesystem. When on different filesystems, it does a copy-and-delete (that's the way all operating systems work FWIW). A GUI on top might choose to make rename within a directory and move between directories different visual metaphors, but that's pretty much nothing to do with what the OS is really doing.


  • Discourse touched me in a no-no place

    @bulb said in WTF Bites:

    Why such old version?

    I'm guessing it's using an old base image. I have pretty much the same problem with build chains on Travis and the fix is just to add the compiler version I need. (Also, I need several versions of the compiler and tool chain because of the targets I'm working with, but that's not a common issue…)

    I remember when gcc basically didn't change much for a decade or more. It was just a dependable if rather old part of the system that you just used if you wanted a compiler. Then whatever organisational constipation was responsible for that passed, and compiler versions started advancing again.



  • @dkf, no, no, @ben_lubar is compiling gcc 4.8. If I understand the repository he linked correctly, he's building a cross-compiler for osx target on linux host (and wrapping it in a docker container). And he upgraded the host compiler that builds stage 0, which required applying a fix, because the new host compiler flags some issue that the older one did not.

    And I am wondering why not build a newer cross-compiler instead.

    @dkf said in WTF Bites:

    Then whatever organisational constipation was responsible for that passed, and compiler versions started advancing again.

    It's mostly that the language itself has started evolving faster. C++11 took 13 years, but since then there is an update every 3 years.



  • @dkf said in WTF Bites:

    I remember when gcc basically didn't change much for a decade or more. It was just a dependable if rather old part of the system that you just used if you wanted a compiler.

    Well, you had to choose whether to use the official or the RedHat version (2.96).


  • BINNED

    You know how you sometimes need to convert a proper time representation (be it a standalone type or part of a datetime)? I mean, this seems like a pretty common thing to do, no?

    So, Qt's QDateTime class provides toMSecsSinceEpoch method. So, basically, a fractional Unix timestamp. Cool.

    There's also a QTime class, which is basically just the time component. It's used for timers and such, and I use it for duration of things which I can be sure of won't last longer than 24h. So you'd expect it to have something like toMSecs, or toSecs method, right? HAH! Nope.

    What's the solution?

    int seconds = QTime(0, 0, 0).secsTo(myTime)
    

    Seriously? I mean, it's not the worst thing in the world, true, but how the fuck do you not add a method to simply convert a time to a number of seconds? Yes, you can convert it to a string, yes you can get individual components (and then multiply and add them up if you so wish), but how do you miss a simple method of "just give me how many seconds this is"?



  • @onyx said in WTF Bites:

    toSecs

    :giggity:



  • @dkf said in WTF Bites:

    @ben_lubar said in WTF Bites:

    mv is a wrapper around the rename syscall.

    When on the same filesystem. When on different filesystems, it does a copy-and-delete (that's the way all operating systems work FWIW). A GUI on top might choose to make rename within a directory and move between directories different visual metaphors, but that's pretty much nothing to do with what the OS is really doing.

    Figuring out whether a source and a destination are on the same filesystem can be hard.



  • 0_1522427927652_79550db3-cc43-4395-ad0c-89c931d689db-image.png

    :wtf:



  • @cvi Why not just add interfaces to the language? Metaclasses seem to be a way for the comittee to stop fixing the language and letting libraries do that instead. They should add reflection instead so people stop having to use variadic templates that rely on recursion make everything a mayor PITA.



  • @magnusmaster Basically the proposed metaclasses are reflection. Just a compile-time one.



  • @bulb Yeah but metaclasses seem to be used to add language features, not to make writing template classes or functions easier.



  • 0_1522512375939_9600a81c-1c88-4834-9503-0dd6de9ac074-image.png

    0_1522512394653_8f23ef7f-97bd-408e-8053-d69b86b29b91-image.png

    So Microsoft is telling me to migrate stuff because "their records indicate that I have used Office Mix" (a Microsoft service getting discontinued, shocking). Apparently they couldn't actually look in my "Office Mix" account and see that I have never uploaded anything?


  • area_can

    0_1522523194292_05a4d952-5e52-4d97-a5a6-5b45d32a55b8-image.png



  • @bb36e That makes sense if you consider the commit before test to have no parents.



  • @ben_lubar yeah I've seen that sometimes happen with people who are inexperienced with git and github, mostly in class/group projects. Not sure how people end up creating a parentless commit and merging it with the existing branch, but it happens.


  • Considered Harmful

    @ben_lubar said in WTF Bites:

    @bb36e That makes sense if you consider the commit before test to have no parents.

    The poor thing.



  • @pie_flavor said in WTF Bites:

    @ben_lubar said in WTF Bites:

    @bb36e That makes sense if you consider the commit before test to have no parents.

    The poor thing.

    Most git commits are raised by a single parent 😢



  • @Onyx said in WTF Bites:

    int seconds = QTime(0, 0, 0).secsTo(myTime)
    

    Is QTime::secsTo() a static method?

    Fake edit: No, apparently, it's not.



  • @anonymous234 said in WTF Bites:

    0_1522512375939_9600a81c-1c88-4834-9503-0dd6de9ac074-image.png

    0_1522512394653_8f23ef7f-97bd-408e-8053-d69b86b29b91-image.png

    So Microsoft is telling me to migrate stuff because "their records indicate that I have used Office Mix" (a Microsoft service getting discontinued, shocking). Apparently they couldn't actually look in my "Office Mix" account and see that I have never uploaded anything?

    If they did look in your account to see whether you've uploaded anything, I suspect you'd be complaining about the lack of privacy and "what else might they be saving about me?"
    A general email to anyone who's used their service seems to be the less "intrusive" option.


  • 🚽 Regular

    @djls45 Also if someone currently hasn't uploaded anything, and they didn't get the memo cuz they never uploaded anything, but then did upload before the discontinuation, they'd prolly be a bit upset.



  • @djls45 said in WTF Bites:

    what else might they be saving about me

    What else might Microsoft know about whether I store any data on their service???


  • Discourse touched me in a no-no place

    @bulb said in WTF Bites:

    It's mostly that the language itself has started evolving faster. C++11 took 13 years, but since then there is an update every 3 years.

    Nah; the real cause of the speed up in versioning was egcs. Before that, gcc was astoundingly slow to develop. Not that it mattered very much; C was a pretty static language. It still is and that's not bad as it means that there's really not much question of language version compatibility; stuff that worked a few years ago still works and is likely to continue to work for years to come. There's no culture of rewriting stuff without really good reason.


  • Notification Spam Recipient

    You know it's bad when an internal page is not available...

    0_1522599008797_1522598997027-1992948323.jpg


Log in to reply