Achievement Unlocked: Become a terrible coder



  • @PJH said:

    @bridget99 said:
    Is it appropriate to throw natural language preconditions on their use, e.g. "the ResizeWindowpane() function accepts two 64-bit integers and returns a single 64-bit integer, but you must not use it on windowpanes where b_ComplicatedFeature is true"? I suppose such things are inevitable, but I certainly would not consider them design positives.
    How else are you supposed to create the 'contract?' A real-life example of what you describe there is in C or C++ where the parameter passed to free() must either be 0 or have come from a previous *alloc() function (as opposed to, say new[] in C++, or just making it up as you go along in C). Or memcpy() which states that the two buffers concerned should not overlap.

    I admitted that such things were inevitable. But they should be minimized. The API should respond gracefully to the inputs supplied to it, unless they are in clear error. Keeping tabs on my client program to see (basically) how big its callback functions are is not an example of graceful behavior. It's the opposite, in fact. It's the metaphorical equivalent of dumping out a cocktail on my head because I was playing too slow that time at golf... not that I suck at golf or every had anyone do that to me.



  • @blakeyrat said:

    The "magic number" in XP is (IIRC) 15 seconds. If you haven't replied to a message in 15 seconds, you're locked-up, no question about it.

    Oh, OK. So there is a magic number, you admit it, you knew about it, and yet you still have the nerve to advocate for this crap design. If I put a big, fat, hard-coded 15000 into my code, you'd call it crap, and rightly so. All I ask is that you hold Microsoft to the same standards.

    @blakeyrat said:

    That doesn't work. Plus I wager it's actually more difficult than handling the situation properly in the first place

    How does it not work? The user cannot see or do anything other than my banner while it's up. And no, it's not difficult to do. I was expecting you to call it lazy, and it is lazy, but it is anything but difficult.

    @blakeyrat said:

    @bridget99 said:
    Incidentally, did the versions of MacOS with a Win16-style multitasking model have anything like "Not Responding", or did they just lock up quietly?

    Hard-to-say, since during the entire lifetime of Classic Mac, the OS was actually responding to the same messages as applications were-- so it's not like the Classic Mac message-passing system was ever ported onto an NT-like kernel which could enforce such things as "hey you didn't respond to a message in 15 seconds."

    It's not hard to say, you said it. They didn't have such a message, nor could they have, and when they finally moved to an OS that could have such a message, they broke backward compatibility. So they never had such a message, nor would Apple do that sort of thing to its developers and customers.

    @blakeyrat said:

    BTW it's good to hear that a programmer who's been around long enough to have written Win16 apps is so knowledgeable about the industry. You didn't already know how Classic Mac worked? Aren't you in the IT industry? Do you just not give a shit? Ding ding ding I think we found the answer.

    Uh, yeah... sorry if I'm a bit rusty on my MacOS history. As for being old enough to write Win16 apps, Microsoft was still selling Win16 well after 2000. They weren't selling it to the chiropractor's offices and adult bookstores that you probably work for, but cool people like me still used it until very recently.



    As for "not giving a shit", you are 100% correct that I do not, at least not about what other programmers think. I will deliver what you would call crap code, but I will do it on time and under budget and the result will behave predictably. Guess what my bosses think about me compared to the guys who do it "right"?



  • @bridget99 said:

    Oh, OK. So there is a magic number, you admit it, you knew about it, and yet you still have the nerve to advocate for this crap design. If I put a big, fat, hard-coded 15000 into my code, you'd call it crap, and rightly so.

    Why would I call it crap again?

    You're doing this "thing" where we're all just supposed to assume that having a "magic number" (which, hell, is probably a setting in the Registry anyway) is this horrible bad awful thing and... uh... it's not.

    @bridget99 said:

    How does it not work? The user cannot see or do anything other than my banner while it's up.

    And now the user chooses "Shut Down"... what happens?

    @bridget99 said:

    It's not hard to say, you said it. They didn't have such a message, nor could they have, and when they finally moved to an OS that could have such a message, they broke backward compatibility.

    Which is a "no, but..." not a "no."

    @bridget99 said:

    So they never had such a message, nor would Apple do that sort of thing to its developers and customers.

    They never had such a message because it was technically impossible to implement one. Not because they consciously made a decision to not label non-responding programs in some way.

    In an alternate universe where Classic Mac gained a pre-emptive multitasking kernel before being EOL'd, would they have added the message? We'll never know.

    @bridget99 said:

    I will deliver what you would call crap code, but I will do it on time and under budget and the result will behave predictably.

    Until the user tries to log out while your program is running.



  • @blakeyrat said:

    @bridget99 said:
    Oh, OK. So there is a magic number, you admit it, you knew about it, and yet you still have the nerve to advocate for this crap design. If I put a big, fat, hard-coded 15000 into my code, you'd call it crap, and rightly so.
    Why would I call it crap again?

    You're doing this "thing" where we're all just supposed to assume that having a "magic number" (which, hell, is probably a setting in the Registry anyway) is this horrible bad awful thing and... uh... it's not.

    Obv blakey is a bad coder because he uses NUMBERS in his programs. 


  • @Sutherlands said:

    Obv blakey is a bad coder because he uses NUMBERS in his programs. 
     

    I only use strings like "5" and "39".



  • @dhromed said:

    @Sutherlands said:

    Obv blakey is a bad coder because he uses NUMBERS in his programs. 
     

    I only use strings like "5" and "39".

    Clearly you need to rearrange your keyboard so "5", "3" and "9" are on the home row.



  •  But how will I type asdfjkl quickly when I'm distrought?



  • @dhromed said:

     But how will I type asdfjkl quickly when I'm distrought?

    Strings reduce readability. All strings should be converted to base-3, using only the characters 5, 3 and 9. Implement immediately.


Log in to reply