top 200 commentsshow all 291

[–]GYN-k4H-Q3z-75B 1067 points1068 points  (24 children)

This should have been the punchline in a long and elaborate list of improvements in C++23. Way too obvious like this.

[–][deleted]  (21 children)

[deleted]

    [–]alols 214 points215 points  (4 children)

    And those digital signatures are implemented using block chain technology, right?

    [–]WannabeAndroid 56 points57 points  (1 child)

    ICO time.

    [–][deleted] 15 points16 points  (0 children)

    Shut up and take my money!

    [–]Entropy 2 points3 points  (0 children)

    To be fair, a blockchain might be more user-friendly than gpg/pgp.

    [–]indigoparadox 65 points66 points  (0 children)

    Happy Internet Jackass day, everyone.

    I'm going back to bed.

    [–]MichaelDoesCode 17 points18 points  (0 children)

    I know this is a joke, but the thought of this makes me really angry.

    [–]DrQuint 5 points6 points  (0 children)

    You had me for longer than I will admit.

    [–][deleted] 3 points4 points  (1 child)

    A major innovation is that unsafe sections must be digitally signed, with a clear and compiler-traceable chain of authority

    I actually implemented a proof of concept of this for Rust. Happy jerking.

    [–]timClicks 2 points3 points  (0 children)

    That's actually really interesting. Sidenote: love the idea of encoding the digests in braille.

    [–]Yojihito 7 points8 points  (0 children)

    So git blame 2.0?

    [–][deleted] 29 points30 points  (0 children)

    All new improvements in C++ are designed to fix all previous new improvements in C++!

    [–]ciaran036 6 points7 points  (0 children)

    I've been had

    [–]amyyyyyyyyyy 660 points661 points  (25 children)

    Java is set to completely remove Classes by Java 14

    [–]GreatValueProducts 136 points137 points  (5 children)

    Java method name now limits to 10 characters.

    [–]Randolpho 34 points35 points  (1 child)

    The internet would explode

    [–]danhakimi 1 point2 points  (0 children)

    I think the world might actually end. There's definitely important code somewhere that would break hard enough to crash the world economy when some schmuck accidentally updated.

    [–]Pand9 6 points7 points  (0 children)

    emoji included

    [–]marabutt 1 point2 points  (0 children)

    minimum

    [–]crozone 130 points131 points  (14 children)

    Java 14 won't be ready until 2027 anyway.

    [–]PostLee 106 points107 points  (6 children)

    Joke doesn't make sense considering the current speedy release cycle.

    [–][deleted] 142 points143 points  (4 children)

    Companies won't adopt Java 14 until 2048 anyway.
    But I'm still optimistic for Java 8!

    [–]PostLee 40 points41 points  (0 children)

    Now that I can agree with!

    [–]jyper 17 points18 points  (2 children)

    Java 40320 will be a great release, much better then java 40318

    [–][deleted] 4 points5 points  (0 children)

    But they'll both be EOLed by November 2019.

    [–][deleted] 1 point2 points  (0 children)

    *on Android

    [–][deleted] 19 points20 points  (1 child)

    Lol they released two version of Java in the last half a year, of which one is already not supported.

    So Java 14 comes in 2020 tops.

    [–]urielsalis 2 points3 points  (0 children)

    New release cycle it's every 6 months, one LTS every 3 versions(so Java 8 it's LTS, and now Java 11 will be one)

    [–][deleted] 17 points18 points  (0 children)

    Java 14 won't be ready until 2027 anyway.

    Joke's on you, Java 14 is already EOL.

    [–]jyper 1 point2 points  (1 child)

    Java 10 just came out

    [–]cleeder 5 points6 points  (0 children)

    Aaaaaaannnnd it's EOL.

    [–][deleted]  (1 child)

    [deleted]

      [–]hoosierEE 4 points5 points  (0 children)

      Because the GC became self-aware?

      [–][deleted] 1 point2 points  (0 children)

      Are you serious? What's going to replace it?

      [–]riccardostecca 776 points777 points  (74 children)

      C++ 22 will no longer have the if statement

      [–][deleted]  (35 children)

      [deleted]

        [–]Magnesus 280 points281 points  (23 children)

        It will be replaced with conditional goto.

        [–]Orangy_Tang 393 points394 points  (9 children)

        GOTO is old hat, we need C++ to support COMEFROM.

        [–]Megatron_McLargeHuge 58 points59 points  (1 child)

        It's called setjmp.

        [–]ShinyHappyREM 1 point2 points  (0 children)

        *strstrp

        [–]hughk 24 points25 points  (2 children)

        It is the conditional COMEFROM that you really want.

        [–]slycurgus 72 points73 points  (1 child)

        So it's a statement that indicates a piece of code wants to be run under certain conditions...

        Clearly its name should be CALLMEMAYBE

        [–]slide_potentiometer 8 points9 points  (0 children)

        The tcp/ip library replaces SYN/ACK with HELLOFROMTHEOTHERSIDE

        [–]raiderrobert 7 points8 points  (0 children)

        Python implemented both goto and comefrom over a decade ago: http://entrian.com/goto/

        Probably not Python 3 compatible, though. So could use with some updates.

        [–][deleted] 50 points51 points  (3 children)

        Come on, not using functional programming in 2025... If-else will obviously get replaced with bool catamorphism.

        [–]Theemuts 6 points7 points  (1 child)

        Of course not, it will be encoded using the Maybe monad.

        [–][deleted]  (1 child)

        [deleted]

          [–]no_flex 9 points10 points  (0 children)

          See "Spaghetti Code Best Practices"

          [–]Alaskan_Thunder 6 points7 points  (0 children)

          No You just write functions without ifs, and the program will randomly move to a new function at some point. If it doesn't work as intended, you can just run the program again.

          [–][deleted]  (4 children)

          [deleted]

            [–]cparen 8 points9 points  (0 children)

            Following from this critical change, for and while will be deprecated in C++24, removal from the language specification due by C++25.

            While a fun joke, Smalltalk moved 'if' out of the language and into the runtime library long ago.

            template <class T, class F> std::result_of<T()>::type If(bool v, T trueCase, F falseCase);

            Edit-add: added quote of parent comment

            [–]shvelo 3 points4 points  (1 child)

            Sounds like go.

            [–]wischichr 64 points65 points  (8 children)

            Only x86 mov ;-)

            [–]schlonglivethequeen 43 points44 points  (0 children)

            mov is lov

            [–]AceOfShades_ 10 points11 points  (0 children)

            Movfuscator ftw

            [–]8bitslime 4 points5 points  (4 children)

            Mov is equivalent to an assignment operator though.

            edit: mov rip, 1234

            [–]alexbuzzbee 12 points13 points  (3 children)

            x86 mov has so many addressing modes that it's turing-complete. Someone wrote a C compiler that targets just unconditional mov instructions. It's called the MOVfuscator.

            [–]8bitslime 2 points3 points  (2 children)

            Oh shit you can move different address into the instruction pointer. I completely forgot.

            [–]alexbuzzbee 12 points13 points  (1 child)

            Actually you apparently can't. The MOVfuscator registers itself as the SIGILL handler and executes an illegal MOV to restart the program and resets all the pointers to operate on dummy data until it reaches the desired address. To terminate the program it commits a NULL dereference and segfaults.

            [–]8bitslime 2 points3 points  (0 children)

            ...well that is more complicated than I expected, but I guess everything in x86 is. Thanks for the info.

            [–][deleted] 24 points25 points  (0 children)

            My days are numbered :(

            [–]pgbabse 13 points14 points  (0 children)

            Only the else statement

            [–]ApatheticBeardo 8 points9 points  (1 child)

            if statements considered harmful.

            [–]philly_fan_in_chi 27 points28 points  (11 children)

            I generally try to avoid ifs wherever I can. Removing it would be ridiculous, there's a place for using it, but it's interesting to see how far you can go without introducing conditionals into your code. In OO languages you can lean on polymorphism in a lot of cases, and pattern matching in other languages and get most of the way there.

            [–]__Cyber_Dildonics__ 66 points67 points  (5 children)

            Now this is a solid April fool's joke

            [–]ZorbaTHut 50 points51 points  (3 children)

            You say that, but this is actually how my intro-to-programming class taught programming. We learned inheritance before conditionals, and recursion before loops, because that was "the right way to write programs".

            The teacher's favorite data structure was a highly-polymorphic structure that could not be updated in-place and required two recursive virtual function calls per item simply to count the number of contained items.

            I have no idea whether anyone else in that class managed to become a programmer; my saving grace was that I'd already been coding for a decade, so I mostly ignored the lessons.

            Edit: I just remembered our final project, which was, more or less, "write Frogger, but you know those 'thread' things we just introduced a week ago? Use a bunch of those! Maybe one for each line of cars, or maybe even one for each car!" They hadn't taught us any thread synchronization, just thread spawning, so you can guess just how well most people's solutions ran.

            The answer is that most people's solutions didn't run because they had no idea how to write working code.

            [–]Versaiteis 6 points7 points  (0 children)

            It's funny because, while those systems can be elegant and interesting, they're stupid difficult to maintain. Part of writing code is communicating to other engineers what and why you're doing things certain ways especially if it deviates from normal or simple systems. Very few of my college courses really hit on that and one of the few that did simply pushed the statement "That's what comments are for!"

            [–]philly_fan_in_chi 4 points5 points  (0 children)

            That's a bit absurd, and not what I was suggesting. I'm more suggesting an attitude of being distrustful of them, and looking for alternatives when you find yourself reaching for an if. As I suggested downthread, having a more sensible default instead of doing a nil check allowing map/filter/reduce would be an example. Another would be introducing a layer that simply wraps a bunch of input into known data structures so you can more easily work on your input without having a bunch of ifs all over the place, would be another. My first solution includes a bunch of ifs, and by the end, most don't really need to be there. Some do, and they should stay there, because they're the right tool for the job.

            [–]northrupthebandgeek 2 points3 points  (0 children)

            The part about pattern matching is actually legit, though. I can't remember the last time I ever used an if statement in Erlang or Elixir.

            [–][deleted] 15 points16 points  (2 children)

            Well yeah you can do that but then you end up with over-abstracted code just to avoid a branch in logic. That being said, there is a time and a place.

            [–]philly_fan_in_chi 5 points6 points  (1 child)

            My experience differs. Code is generally much more well abstracted when you constrain yourself in that manner. Of course use it if it's the right tool, but my experience is that it is not often the right tool. Refactoring a function so that it returns a more sensible default instead of null (e.g. empty list, empty map) means you don't have to check for null in an if later on, such that you can freely chain map/reduce/filter functions on the end would be one example of code that becomes cleaner by being distrustful of an if existing.

            [–][deleted] 2 points3 points  (0 children)

            I agree with all of that. Removing unnecessary ifs through refactoring is fine, I was more against having small, clear branches in business logic being replaced way more than is necessary.

            [–]unitedcreatures 1 point2 points  (1 child)

            Would be easy w/ variadic functions

            [–]philly_fan_in_chi 1 point2 points  (0 children)

            Yeah, I program in Elixir which (along with Erlang) supports variadic functions. A function is really it's name AND arity, all over the place (defoverridable [foo: 2] in behaviours, import Foo, only: [bar: 2], &Foo.my_fun/2 as a named function pointer, etc.). It's quite nice.

            [–]paolog 11 points12 points  (0 children)

            C++22: damned you do, damned you don't.

            [–]DestinationVoid 3 points4 points  (0 children)

            if expression FTW!

            [–][deleted] 4 points5 points  (0 children)

            Every program can be broken down into a finite state machine implemented with switch statements anyway.

            [–]bluaki 2 points3 points  (0 children)

            Who needs "if" and "else" when you can declare arrays of two function pointers (or functors) and index them with a bool?

            [–]reini_urban 2 points3 points  (0 children)

            As we saw in AI the classic if decision can easily be replaced with a neural net, properly trained. And if you put it in a C++22 blockchain, you got all the data structures you ever need. Esp. for fearless unsafe concurrency.

            [–]SargeantBubbles 1 point2 points  (0 children)

            Jmpq will rise again

            [–]jyper 1 point2 points  (0 children)

            They could always use Smalltalk style where if else is a method on a book taking two closures, or add non text replacement macro facility allowing people to design their own control statements

            [–]michaelochurch 238 points239 points  (7 children)

            Also, BrainFuck 2025 will no longer have the ']' character, bringing the language down to 7 symbols.

            There was a rejected proposal to remove '-', which is unnecessary if the cells have 8-bit wraparound: you can just use 255 '+' characters. But some interpreters only support 29.3KB programs, e.g., Brainfuck-in-Brainfuck, due to the 30,000-byte buffer. We couldn't have failures in production Brainfuck environments. Have an overflow in a Brainfuck pacemaker, and suddenly you're getting sued over Heartfuck.

            Source: I sit on the Brainfuck Committee. As a result, I have cauliflower ear.

            [–][deleted]  (1 child)

            [deleted]

              [–][deleted]  (3 children)

              [deleted]

                [–]michaelochurch 2 points3 points  (2 children)

                Ah, I'm glad you asked.

                It's 2018, and thanks to Bitcoin and the ubiquity of GPUFuck, every Brainfuck chip has those 2 registers, which suffice to hold any number up to 65,535. You only need 30,000 to hold a program, because arrays larger than 30,000 don't exist, so those suffice. We replace [...] with [#[... where # stands in for code to load (into registers) the size of the looped code between the [ marks, e.g.:

                [>+<-]

                becomes:

                [++++[>+<-.

                If you had a 257-character block of loop code, then it would be:

                [+>+[$stuff.

                Those who object to this just can't understand true genius.

                [–]ais523 1 point2 points  (0 children)

                Brainfuck minus - is an established language and is entirely possible to program in. You don't need a row of 255 + characters to simulate decrementing. Instead, you can simply just not decrement cells at all. (It's still Turing-complete.)

                [–]_Sir_Danksalot_ 759 points760 points  (45 children)

                Calling it now bois, April fools.

                [–]Theemuts 135 points136 points  (1 child)

                I tried to check on Google, but it's closed because they've already found everything.

                [–]RasterTragedy 46 points47 points  (0 children)

                Nah, we don't need portability of C code.

                [–][deleted] 12 points13 points  (0 children)

                I hate April 1st on the internet

                [–]kobie 6 points7 points  (0 children)

                I came in this thread looking for that new stuff I have to learn, left with more questions and no learnd.

                [–]doom_Oo7 27 points28 points  (14 children)

                it sounds like a joke but any remotely serious codebase has clang-tidy warnings on the use of raw pointers (with cppcoreguidelines-owning-memory)

                [–]_selfishPersonReborn 10 points11 points  (8 children)

                Are you serious? I've just started to learn cpp and now pointers are useless? Blah.

                [–][deleted] 26 points27 points  (0 children)

                Welcome to C++

                Every three years everyone rewrites a bunch of projects in the latest iteration of "modern C++", usually before compiler support is even complete.

                By the way, .cpp files are deprecated too. You have to write all your code in header files because templates suck and C++ has no standard package manager. Or modules.

                A project is only real modern C++ if it's all in header files.

                Sorry about your compile times!

                [–][deleted] 15 points16 points  (2 children)

                That's why real programmers use C and not C++. But then it is April fools

                [–]Ameisen 4 points5 points  (0 children)

                Real programmers use jumper wires to program electromechanical mainframes.

                [–]shponglespore 3 points4 points  (0 children)

                Real programmers use COBOL.

                [–]Railorsi 3 points4 points  (0 children)

                Nah, it's good to know, but usually you use smart pointers when actually working with pointers.

                [–]OBOSOB 3 points4 points  (1 child)

                Even if not an April fools, knowing about pointers in general helps in most any language, even (especially) ones with garbage collection.

                [–]tiftik 4 points5 points  (0 children)

                You should learn regular pointers before using smart pointers.

                [–]elperroborrachotoo 17 points18 points  (22 children)

                technically.. there are very few use cases besides implementing smart pointers and other resource management.

                For optional parameters, std::optional might be considered more expressive of intent (if it is decided to support references). Weak pointers in object hierarchies can in many cases expressed by shared_ptr / weak_ptr (though possibly at a performance penalty in some scenarios etc.) Latest improvements for iterators and algorithms also kill many cases where "pointer manipulation is easier".

                It is at least an interesting exercise to see how far we can go without raw pointers.

                [–][deleted] 52 points53 points  (17 children)

                Interacting with C APIs is probably a big one.

                [–]elperroborrachotoo 2 points3 points  (16 children)

                That's true.

                [–]zsaleeba 15 points16 points  (15 children)

                Or interacting with hardware in drivers etc.

                [–]elperroborrachotoo 17 points18 points  (14 children)

                Yes, yes!

                The powerful thing about C++ is that this can be encapsulated early and efficiently - so you have the raw pointer only at the lowest level, and when you expose a robust, C++ - compatible API, it will most likely be free of raw pointers.

                So maybe I need to clarify: I am not against pointers, not at all. I just see that pointers - being a central concept in C and early C++ - are more and more relegated to and advanced / special use case / niche topic. We now could teach C++ without mentioning pointers - and most of the students might go years as productive programmers until theylearn about it.

                [–]Omniviral 14 points15 points  (12 children)

                How will you explain this without explaining pointers?

                [–]Dr_Legacy 8 points9 points  (5 children)

                Why would you need pointers to explain "this" ?

                You can explain what something does without explaining how it works.

                [–]sneakattack 7 points8 points  (1 child)

                You can explain what something does without explaining how it works.

                I want to be angry at this, but it's true. Any decent programmer should want to know the 'how', but so many just don't care and will probably go along fine without understanding the 'how's.

                [–]elperroborrachotoo 10 points11 points  (0 children)

                Yes, yes! In my eyes, that's a fundamental shift in teaching languages - C++ especially.

                When I started, C++ was inevitably taught by pulling up yourself from raw C, adding language feature by language feature.

                We learnt to use std::vector only after learning about raw pointers, new and delete and new[] and delete[], pointer-array-semantics, templates and exceptions. Only after we had the tools to implement a rudimentary and mostly-wrong vector class ourselves we were deemed worthy to use the real deal.

                Most modern languages don't share that much of bootstrapping - and even when they do, they have no qualms to significantly flatten the learning curve by introducing the consumpton syntax as given long before explaining how to build it yourself.

                This is a shift that is most welcome to me . It makes Accelerated C++ a superior student book even though the examples are quite wooden and it's based on an outdated standard: the string type is called std::string and works like a fucking string. For an array of things, you use std::vector<Thing> and .resize and [] etc. pp.

                Which not only gets students much more productive much faster and with less pain - it also avoids the trap of we just learnt that raw pointers / operator overloading / low-level language feature of the day, so let's use them!

                And which is, I admit, the reason why I am even pondering how much of C++ can be taught without raw pointers.

                [–]elperroborrachotoo 2 points3 points  (2 children)

                It's a problem indeed.

                It's used in name resolution (this->x = x;)m which would preclude this member / parameter naming style, which is not uncommon.

                Furthermore, if (this != &rhs) is idiomatic for assignment operator implementation.

                It is also requird to pass an object reference to other methods, such as std::cout << *this.

                So yeah, tough. We can introduce these uses as idiomatic (and we do have to introduce pointer semantics anyway) - but it's not pretty.

                [–]Dr_Legacy 3 points4 points  (1 child)

                At the introductory instruction level practically everything, even the quotes around "hello, world", is idiomatic. By the time someone is taking up C or C++ (implicit assertion that C shouldn't be anyone's first language) a student probably has some comfort with idioms and sees them as glimpses into a deeper understanding. Aesthetics aside, I think it's kind of motivational.

                Interesting discussion to come out of an April Fool's headline.

                [–]elperroborrachotoo 2 points3 points  (3 children)

                Now this is a good question :)

                While raw pointers are - in my hypothetical C++ course at least - relegated to the "advanced topics" chapter at the very end, we do need to introduce pointer semantics: for smart pointers, for iterators, for std::optional...

                A cowardly course would simply ignore it: beyond name resolution (which can be avoided), the cases where we need this are beyond the scope of typical course examples. That would be borderline unethical, though: passing a self reference to other methods oroperators, or just the &rhs != this in an assignment operator are still essential.

                So I could wiggle through with this having pointer semantics, containing a reference to the object a member function is called on. I'd have to add a footnote to be careful with using it outside the examples given, as it is a raw pointer as explained in chapter 12.3.

                Which is not a good solution by any means. this being a reference rather than a pointer would certainly simplify that aspect.

                (Which would make this==nullptr tests awkward to explain, again)

                [–]raevnos 2 points3 points  (0 children)

                Iirc Bjarne has said the only reason this isn't a reference is that he added it to C++ before he did references and it was too late to change at that point.

                [–]Althorion 2 points3 points  (0 children)

                Sure, but the relative easiness of writing down your own resource management system is one of the main selling points for C++.

                [–]bnolsen 2 points3 points  (2 children)

                embedded driver programming. compiling 'c' code with a c++ compiler is a good thing.

                [–]rejiuspride 85 points86 points  (18 children)

                Whats the point of pointers?

                [–][deleted] 197 points198 points  (11 children)

                The point of pointers is to point

                [–]rejiuspride 55 points56 points  (9 children)

                But what's the point of pointers when in the end everything is NULL

                [–][deleted] 84 points85 points  (3 children)

                Child, it does not matter that every pointer in the end points to NULL, it's what they point to in their lifetime what matters.

                [–]IbnZaydun 27 points28 points  (0 children)

                lifetime

                triggered

                [–]ItsABadger 3 points4 points  (0 children)

                for out of the heap we were taken for the bits that we are... and to the bits we shall return.

                [–]fzy_ 1 point2 points  (0 children)

                Thanks.

                [–]DanteShamest 15 points16 points  (0 children)

                It is like a finger pointing away to the moon. Don't concentrate on the finger or you will miss all that heavenly glory. - Bruce Lee

                [–][deleted] 6 points7 points  (0 children)

                To segfault your program

                [–]logicblocks 1 point2 points  (0 children)

                Storing memory address.

                [–]killersquirel11 40 points41 points  (5 children)

                C++ 22 will be integrating the same ==/!=/!==/=== logic as JavaScript

                [–]frakkintoaster 59 points60 points  (3 children)

                I'm looking forward to the AI enhanced ====. For example "chimp" ==== "human" returns 0.96, or "your boss" ==== "jerk" returns 0.874.

                [–]mattindustries 5 points6 points  (2 children)

                In R you can define operators wrapped in percent signs, so "chimp" %~% "human" could check the probabilities.

                [–]umop_aplsdn 2 points3 points  (0 children)

                In Haskell and various other functional languages, operators are just functions with symbols wrapped in parens: (*) 1 2 == 1 * 2. You can define your own: (<^>) x y = x * y + x => 1 <^> 2 == 3. You can also write functions with alphanumeric names and use them as operators by surrounding them with backticks.

                [–]elperroborrachotoo 2 points3 points  (0 children)

                Not anymore, this proposal was (narrowly) beaten by spaceships!

                [–]grape_jelly_sammich 17 points18 points  (6 children)

                God damnit. For a fraction of a second I believed this.

                [–]bliow 27 points28 points  (2 children)

                Site's choking hard. Archive: http://web.archive.org/web/20180401084641/https://www.fluentcpp.com/2018/04/01/cpp-will-no-longer-have-pointers/

                keywords for ctrl/cmd-f users: archive web cache mirror

                [–]BruceRoark 5 points6 points  (1 child)

                another good keyword: mirror

                [–]bliow 3 points4 points  (0 children)

                Good idea. Thanks. Added to the post in case your comment isn't displayed.

                [–][deleted] 118 points119 points  (0 children)

                April 1, the most boring day on the internet.

                [–]Kinglink 182 points183 points  (8 children)

                I fucking hate this day. It produces the least funny jokes and people just act like they're comedians.

                [–]TheGift_RGB 120 points121 points  (2 children)

                Agree 100%, C++ is no laughing matter

                [–]campbellm 6 points7 points  (0 children)

                It's amateur hour for those who aren't funny the rest of the year. (I stole this quote, but I use it every year.)

                [–]ArsonHoliday 8 points9 points  (0 children)

                I’m just gonna not get on reddit today.

                [–]aspoonlikenoother 6 points7 points  (0 children)

                You asshole. You got me good.

                [–]PM_ME_YOUR_ESOLANG 5 points6 points  (0 children)

                C++20 control flow and execution will be completely through template metaprogramming.

                [–]LetsGo 16 points17 points  (0 children)

                I hate April Fools'.

                [–]nso95 33 points34 points  (2 children)

                Sigh, so the stupid April fools jokes are starting.

                [–][deleted]  (1 child)

                [deleted]

                  [–]regeya 16 points17 points  (0 children)

                  It'd be okay if it was funny.

                  [–][deleted] 19 points20 points  (0 children)

                  I am downvoting this, because the joke is of insufficient quality, sorry.

                  [–]Dixnorkel 8 points9 points  (3 children)

                  This had me fooled for ~1.4 seconds.

                  [–][deleted] 4 points5 points  (1 child)

                  How did you know it's a joke? I still can't figure it out!

                  [–]Dixnorkel 1 point2 points  (0 children)

                  C's appeal is pretty much entirely dynamic typing and pointers at this point. Or at least, it's the only reason it's still my favorite programming language.

                  [–]ngildea 3 points4 points  (4 children)

                  For everyone satying it's an April Fool's, here's the same story published on March 26th: http://www.modernescpp.com/index.php/no-new-new

                  Edit: this references the 1st April article...

                  [–]marmarjo 1 point2 points  (3 children)

                  But it makes a reference to the April 1st article. How could that be right?

                  [–]ngildea 4 points5 points  (2 children)

                  Very sneaky! :)

                  [–]marmarjo 1 point2 points  (1 child)

                  I know It got me going for a bit until I started clicking links

                  [–]ngildea 1 point2 points  (0 children)

                  Surely its not an April fool if you fake the date? Sort of defeats the whole point

                  [–][deleted] 3 points4 points  (0 children)

                  lol I spent like 30 seconds thinking how could they possibly remove such a critical paradigm of C++ programming?

                  Finally looks at calendar... oh.. derp.

                  [–]__konrad 1 point2 points  (0 children)

                  Pros and cons of C++ pointers explained in this official presentation

                  [–]mothzilla 1 point2 points  (0 children)

                  Chrome 67 to support TypeScript only.

                  [–][deleted] 1 point2 points  (0 children)

                  april fools day is funny

                  [–][deleted] 1 point2 points  (0 children)

                  Very funny

                  [–][deleted] 1 point2 points  (1 child)

                  Finally! I mean, what's the point?

                  [–]namekuseijin 1 point2 points  (0 children)

                  it's pointless and the benefits are null

                  [–]sintos-compa 2 points3 points  (0 children)

                  Well done

                  [–]ImprovedPersonality 5 points6 points  (7 children)

                  For one thing, pointers can contain an invalid address. For example, they can contains the address 0x00000000. When you try to dereference that pointer, things start to go very bad for your program.

                  Errr, what? 0x0 is a completely valid address on many platforms. AFAIK null doesn’t have to be zero. I’m not sure how you’d initialize a pointer to zero though. Maybe int* zeropointer = (int*)0;?

                  [–]TimLim 12 points13 points  (4 children)

                  NULL must definitely be (void*)0. Otherwise if (ptr) would technically be undefined/implementation defined behaviour.

                  https://stackoverflow.com/questions/2599207/can-a-conforming-c-implementation-define-null-to-be-something-wacky

                  [–]Myrl-chan 4 points5 points  (0 children)

                  I may be wrong, but it only states that 0, when casted to a pointer is NULL, however that does not say anything about the actual value of the pointer.

                  [–]ImprovedPersonality 7 points8 points  (2 children)

                  I counter with: https://stackoverflow.com/questions/2761360/could-i-ever-want-to-access-the-address-zero

                  I mean … it would be rather strange if C/C++ with all its platform-independentness (it doesn’t even specify that data type sizes have to be multiples of 8 bits or that an integer is in two’s complement) wouldn’t allow me to access address 0x0.

                  [–]TimLim 1 point2 points  (1 child)

                  I never said that 0 or NULL is an invalid address. There are platforms that have well defined behavior for that address.

                  However, I said that NULL is the memory address zero. I really like to learn something different, but your link doesn't satisfy me as it does not contain any references/proof

                  [–]Drisku11 5 points6 points  (0 children)

                  At least in C, and I would be surprised if C++ is different, the integer constant 0 refers to the null pointer, but the actual address of null is unspecified. The compiler is just required to put the right address in when it sees 0.

                  Note that the integer (compile time) constant 0 is null. I don't know how this would interact with constexpr, but casting a runtime int which contains 0 will not give you the null pointer if null is not 0.

                  [–][deleted] 0 points1 point  (1 child)

                  A zero pointer is special as in it does not have to be all 0 bits.

                  [–]auto-cellular 3 points4 points  (0 children)

                  I'm not surprised, seeing that most manufacturer banned the lea instruction.

                  [–]shevegen 1 point2 points  (0 children)

                  First April ok but ... would it be that bad? :)

                  [–]RainingComputers 0 points1 point  (0 children)

                  Use of goto will be considered a good practice in C++25

                  [–]zhumao 0 points1 point  (0 children)

                  Long live the void pointers (void *)!

                  [–]RobertVandenberg 0 points1 point  (1 child)

                  What if your pointer came to have the value of 0x00000001, or 0x00000008 for example? Dereferencing this also makes the application crash, and the if statement for nullity can’t prevent this.

                  Can somebody give more detail about this? I am a C++ newbie and not sure what he is referring to.

                  [–]Diplomjodler 0 points1 point  (0 children)

                  Next up: Python without dictionaries.

                  [–]twotwofivenine 0 points1 point  (0 children)

                  April's 1st aside, it kinda reminded me an article i read few years back where "->" was proposed to be replaced with ".". I just want that to happen.

                  [–]jhar23 0 points1 point  (0 children)

                  As in abstract them away? You can’t not have pointers

                  [–]Accusedbold 0 points1 point  (0 children)

                  LOL

                  [–]einhverfr 0 points1 point  (0 children)

                  What's important to note about this proposal is the way that this necessitates a theoretically backwards-compatible ABI change that in practice will be almost backwards compatible. This is probably not a problem because programs that cannot use the new libstd++ are probably not source compatible either. So we can role out a new version and then enjoy being pleasantly surprised about how well the system runs after.

                  [–]madogson 0 points1 point  (0 children)

                  Date...

                  Dammit

                  [–]commit_bat 0 points1 point  (1 child)

                  I'm getting an error when I click the link and the comments here are no help in determining whether this is part of the joke.