• NULLPTR (unregistered)

    time::duration::fromSecs(NULLPTR);

  • P (unregistered)

    Great, next time I should name my variable threeSome when I'm actually having relationships with 59 mates at once. Sounds nothing but fun!

  • Marc (unregistered)

    That's a terrible variable name. A good variable name should say what the variable contains, but what it represents. That is, while the variable might contain "three seconds", it might represent a "network timeout delay" - which in that case would have been a much better name for it.

  • Little Bobby Tables (unregistered)

    I find it's the other way about.

    "Ah this won't take long to fix, about three minutes" ... and then an hour later: "... nearly there."

  • (nodebb) in reply to Little Bobby Tables

    https://xkcd.com/612/

  • bvs23bkv33 (unregistered)

    when estimating time to do some task allways multiply by two and take next larger time unit

  • (nodebb) in reply to Marc

    Yes, but if everyone did that, we wouldn't have nearly so much material for this site.

  • Tobias (unregistered)

    You estimate the time required and then multiply it with Pi...

  • Jaloopa (unregistered) in reply to Marc

    You don't know the code. What if it represents three seconds?

  • Kanitatlan (unregistered)

    Let's be honest, I've seen spectacular examples of this sort of thing in the past. My absolute favourite was a byte constant named THFF (think about it, you'll get it in a minute)

  • Scott (unregistered)

    Victoria's at least got a good approach. Try to get in the previous developer's head to understand what they might've been thinking, so that you can understand the problem. Then, refactor to have a more sensible solution.

    Sometimes, however, the answer to "what were they thinking?" is simply, "they weren't".

  • I dunno LOL ¯\(°_o)/¯ (unregistered)

    s/though/thought/

    (I hope my backslashes will avoid the Markdown WTFery)

  • (nodebb)

    This is why languages with dynamic typing are so bad, is that it breaks features in the IDE. For Java, all you have to do to rename a variable in Eclipse is right-click, Refactor, Rename.

  • Beliar (unregistered) in reply to jinpa

    Am I missing a joke? I fail to see what dynamic typing has to do with the IDE not being able to rename a variable.

  • (nodebb)

    Does Rust not have refactoring capability?

  • Tgape (unregistered)

    I recently encountered something like this. Except there were two cases, each started with a variable named based on the length of the time, and everything else the same.

    This was from someone who had a CS BS. I think this is the sort of thing that comes from professors choosing to grade code by running it through programs. Sure, it gives an objective assessment rather than a subjective one, but it gives a very poor objective assessment. I know, as I intentionally submitted obfuscated code that still got full marks, just to see.

  • (nodebb)

    They should've gone with 7 seconds instead. A) 7 is a lucky number and b) there's a song called "7 seconds" which is pretty decent.

  • (nodebb)

    And I can't skip commenting on yet another programming language. Guys we have enough programming languages. Stop making new ones. Second, what kind of name is Rust? All kinds of nasty expressions involving the word rust come to mind. Just no.

  • Brian Boorman (google) in reply to Mr. TA
    Second, what kind of name is Rust?

    I think it's where the program gets stored.

  • Anonymous') OR 1=1; DROP TABLE wtf; -- (unregistered) in reply to Kanitatlan

    It did in fact take me a minute: Two Hundred Fifty-Five.

    I'm curious, what language was that from? In many languages, bytes are signed, so it's not even a valid byte constant in those.

  • sizer99 (google) in reply to Mr. TA

    Rust is named after a fungus that is robust, distributed, and parallel.

    And I generally agree with the language proliferation problem (there are too many), but Rust fills a need nothing else was filling - which is for a memory safe language which is as fast and as memory-light as C++ without being as terrible to work with. I'm pretty good at C++ (thanks Scott Meyers!) but it's an ancient, bloated, creaking, ugly pain in the ass that's only tolerated because it's fast and has deterministic memory allocation. C# is much nicer for doing GUIs, but sometimes you need the performance and for that Rust is much nicer.

  • (nodebb) in reply to Anonymous') OR 1=1; DROP TABLE wtf; --

    Actually, I was thinking it stood for The Holy FF - that Holy Grail of magic numbers.

  • (nodebb) in reply to sizer99

    C# on .Net Core 3 is not that much slower, and constantly improving. For web it is one of the fastest frameworks around now.

  • (nodebb) in reply to The_Bytemaster

    This. For performance, C# has unsafe context. Even in managed mode, it's come a long way. Once you include the great BCL, fantastic IDE, rich ecosystem, and now cross platform support, I really see no need for any new languages. Maybe Rust (I said it again damn it) is a little faster compared to even unsafe C# (which I doubt), but those performance critical areas can be offloaded into a native DLL of some sort. Yes C++ is all those things you said, but it's good enough if all you're doing in it is high performance routines that are part of a larger managed application.

  • DanK (unregistered) in reply to Mr. TA

    You are clearly not considering embedded applications, where managed environments (especially if GC is involved) are not an option.

  • sizer99 (google) in reply to Mr. TA

    I can use C# for almost everything on a desktop, but Rust stomps Mono for performance and memory use on our little embedded devices. Worse, C#/Mono garbage collection is non-deterministic, meaning you never know when the thing is going to hiccup.

    It fills a niche, which is 'C++ is awful and dangerous, C# isn't cross-platform enough for GUI stuff, and virtual machines are bad for real-time'.

  • Chris (unregistered) in reply to Anonymous') OR 1=1; DROP TABLE wtf; --

    It's a flexible variable, as it can also be used to store 344 if required.

  • (nodebb) in reply to sizer99

    Perhaps you're right about the performance. I'm not doing anything with embedded devices at the moment. My question - now that they're willing to create a whole new language, why not adopt an existing language and give it a new runtime?

  • löchlein deluxe (unregistered)

    Surely, Victoria's problem would have been easily solved by a comment that reads "// this takes about five seconds, so let's take eight to be sure"

  • (nodebb) in reply to Anonymous') OR 1=1; DROP TABLE wtf; --

    Funny: I got there by a different route. T (for whatever naming convention reason) Hex FF.

    Addendum 2019-11-06 01:48: It's a bilingual variable name.

  • (nodebb) in reply to Beliar

    Am I missing a joke? I fail to see what dynamic typing has to do with the IDE not being able to rename a variable.

    If you have a static-typed language like Java, C, C++, .net, you can rename member variables(1), and the IDE's renamer knows for sure that this instance of the name of the member variable actually is (or is not) the same member variable(2). In dynamic-typed languages like Python, JS, etc., the renamer can't be sure.

    (1) That is, in C++ notation, I want to rename ThisClass::m_frobbleCount but not rename ThatClass::m_frobbleCount.

    (2) Apart from some flakiness about templates in C++, where a function or class template might use T::m_frobbleCount, and the question arises about whether the renamer should rename it, especially if the function is instantiated with T = ThisClass in one place and with T = ThatClass in another.

  • (nodebb) in reply to sizer99

    C# isn't cross-platform enough for GUI stuff

    Rust's GUI story isn't great either, at the moment. I've tried gtk-rs which works but looks extremely non-native outside of Linux, and rust-qt is not very usable since you can't subclass Qt widgets and add fields. AFAIK there aren't other mature platform-native or non-native but non-HTML GUI toolkits either. I heard it has usable imgui bindings, and some web-based things. https://areweguiyet.com/

    Rust still has the "virtual machine" advantage over C#.

  • (nodebb)

    Regarding rust: There is a nice article, on why it gets some adoption [1] (Warning: Ad-heavy site...).

    Basically the argument is that systems programming basically REQUIRES a language with deterministic memory management, and compared to C or C++ Rust avoids many classes of bugs by design.

    No amount of testing and linting beats not needing it due to language guarantees.

    [1] https://www.infoworld.com/article/3451296/why-the-rust-language-is-on-the-rise.html

  • Phil (unregistered)

    This could have been a case of attempting to meet impossible customer requirements.

    CUSTOMER: "Your network timeout delay must be three seconds."

    ENGINEER: "...that's just not possible in this system. It has to be sixty. We'd have to refactor the whole system. Also, you wouldn't notice sixty."

    CUSTOMER: "No, it has to be three."

    ENGINEER: "...okay..."

  • (nodebb) in reply to jinpa

    This is why languages with dynamic typing are so bad, is that it breaks features in the IDE. For Java, all you have to do to rename a variable in Eclipse is right-click, Refactor, Rename.

    It's Rust, therefore it is not dynamically typed. All they need to do is change the name of the variable in the let, recompile and fix the new errors.

  • Laharl (unregistered)

    Maybe their programmer used that name because he had a Three Second Memory. Then he got replaced with someone who doesn't have the attention span of a GoldFish.

  • (nodebb) in reply to Andrew Taylor

    https://xkcd.com/612/

    Not the one I was expecting it to be, which was https://xkcd.com/349/

Leave a comment on “Time Dilation”

Log In or post as a guest

Replying to comment #:

« Return to Article