• Design Pattern (unregistered) in reply to Anonymous
    Anonymous:
    What the hell? I work on flight controllers that process input signals hundreds or even thousands of times every second. I cycle through 100000 calculations in just a couple of minutes of runtime.
    Your flight controllers sanitize telephone number inputs from a (most likely Web) form?

    Your flight controllers are programmed in a dynamically typed language which in it's original implementation was interpreted?

    And even then sanitizing 100000 telephone numbers with a regular expression sounds very possible to be performed in under a minute on todays processors (at least when the regexp is compiled to a state-machine).

  • (cs) in reply to Anonymous
    Anonymous:
    What the hell? I work on flight controllers that process input signals hundreds or even thousands of times every second. I cycle through 100000 calculations in just a couple of minutes of runtime.
    I said it was important to know when to optimize. Obviously you have a reason to be concerned about it in your environment. "What the hell?" you say? I say: Why the hell did you start out ripping on people suggesting regex as a solution for telephone entry validation? Nobody suggested that you use regex in active flight control systems.
    Anonymous:
    OK, so we're obviously coming from seriously different backgrounds here.
    No, we're just arguing about different contexts. Your context is a safety-critical environment where optimization is absolutely necessary, and mine is, you know, relevant to the article and the comments about regex.
    Anonymous:
    Well, my comments are not specifically related to the article code...
    Well, the comments about regex that you were ridiculing were.
    Anonymous:
    No disrepsect boog, but I obviously work in a way more rigorous environment than you.
    Who cares?
  • Anonymous (unregistered) in reply to boog
    boog:
    Anonymous:
    What the hell? I work on flight controllers that process input signals hundreds or even thousands of times every second. I cycle through 100000 calculations in just a couple of minutes of runtime.
    I said it was important to know when to optimize. Obviously you have a reason to be concerned about it in your environment. "What the hell?" you say? I say: Why the hell did you start out ripping on people suggesting regex as a solution for telephone entry validation? Nobody suggested that you use regex in active flight control systems.
    Anonymous:
    OK, so we're obviously coming from seriously different backgrounds here.
    No, we're just arguing about different contexts. Your context is a safety-critical environment where optimization is absolutely necessary, and mine is, you know, relevant to the article and the comments about regex.
    Anonymous:
    Well, my comments are not specifically related to the article code...
    Well, the comments about regex that you were ridiculing were.
    Anonymous:
    No disrepsect boog, but I obviously work in a way more rigorous environment than you.
    Who cares?

    Well it's been fun but we're obviously done here. Good luck in your office job, you clearly enjoy the meagre standards it impresses upon you and I suppose I can respect that. I can't agree with it, but I can respect it.

  • (cs) in reply to Design Pattern
    Design Pattern:
    Anonymous:
    What the hell? I work on flight controllers that process input signals hundreds or even thousands of times every second. I cycle through 100000 calculations in just a couple of minutes of runtime.
    Your flight controllers sanitize telephone number inputs from a (most likely Web) form?

    Your flight controllers are programmed in a dynamically typed language which in it's original implementation was interpreted?

    And even then sanitizing 100000 telephone numbers with a regular expression sounds very possible to be performed in under a minute on todays processors (at least when the regexp is compiled to a state-machine).

    Coming from an instrumentation background, where sampling rates are measured in millions of samples per second, his flight controllers sound quite sluggish. Of course, we separated hardware interface from the software controlling it as much as possible.

  • Anonymous (unregistered) in reply to frits
    frits:
    Design Pattern:
    Anonymous:
    What the hell? I work on flight controllers that process input signals hundreds or even thousands of times every second. I cycle through 100000 calculations in just a couple of minutes of runtime.
    Your flight controllers sanitize telephone number inputs from a (most likely Web) form?

    Your flight controllers are programmed in a dynamically typed language which in it's original implementation was interpreted?

    And even then sanitizing 100000 telephone numbers with a regular expression sounds very possible to be performed in under a minute on todays processors (at least when the regexp is compiled to a state-machine).

    Coming from an instrumentation background, where sampling rates are measured in millions of samples per second, his flight controllers sound quite sluggish. Of course, we separated hardware interface from the software controlling it as much as possible.

    Full disclosure: the controllers I'm currently working on are temperature controllers for cruise missiles, much less rigorous than traditional flight controllers and much lower resolution. But you're right, millions of samples per second is perfectly normal for many of the flight controllers I've worked on. For an in-flight temperature controller you couldn't even measure millions of samples per second, the hardware doesn't come close to supplying that volume of data.

  • (cs) in reply to Anonymous
    Anonymous:
    Well it's been fun but we're obviously done here. Good luck in your office job, you clearly enjoy the meagre standards it impresses upon you and I suppose I can respect that. I can't agree with it, but I can respect it.
    Yes, and I'm sorry that I wasn't able to discuss the matter on your glorified and totally-irrelevant level. It really is a shame that this office job hasn't made me as arrogant and insufferable as you've shown yourself to be. Man, that'll always be the dream.

    Thanks for the well wishes anyhow.

  • Anonymous (unregistered) in reply to boog
    boog:
    Anonymous:
    Well it's been fun but we're obviously done here. Good luck in your office job, you clearly enjoy the meagre standards it impresses upon you and I suppose I can respect that. I can't agree with it, but I can respect it.
    Yes, and I'm sorry that I wasn't able to discuss the matter on your glorified and totally-irrelevant level. It really is a shame that this office job hasn't made me as arrogant and insufferable as you've shown yourself to be. Man, that'll always be the dream.

    Thanks for the well wishes anyhow.

    You're very welcome. For the record, I am insufferable and I am arrogant. You can call it ego, you can call it an appeal to accomplishment, but at the end of the day I do a job that 90% of software engineers couldn't do. It takes an unhealthy level of fastidiousness and that comes from far more than learned good practice - it is an entire mindset. I know I'm unfair on those that don't share that mindset but I also know that I'm a better engineer than them, so I'm not losing any sleep over it. If it's any consolation, you're probably a far more rounded human being than I'll ever be. Poorer, less skilled, but more rounded.

  • (cs) in reply to Anonymous
    Anonymous:
    You're very welcome. For the record, I am insufferable and I am arrogant. You can call it ego, you can call it an appeal to accomplishment, but at the end of the day I do a job that 90% of software engineers couldn't do.
    I'm not calling you arrogant because of your job. In fact, I'd argue that 90% of programming jobs are occupied by people that can't do them; yours just requires that you can (otherwise planes crash and people die).

    I'm calling you arrogant because you assumed that since I'm disagreeing with you on optimizing something that doesn't need it, my standards must be low. My point from the beginning has been about knowing when to optimize. Sometimes it can be a good thing to use a less-optimized (not least-optimized) approach, because it may be cheaper (not just money, but time); it depends on the situation.

    You don't deal with such situations, and that's fine. But you did originally suggest writing more code (than a simple regex) to solve the same problem only slightly-more efficiently when such optimization (and subsequent testing and maintenance) was unnecessary. That doesn't make you a better engineer, in fact quite the opposite.

    Anonymous:
    It takes an unhealthy level of fastidiousness and that comes from far more than learned good practice - it is an entire mindset. I know I'm unfair on those that don't share that mindset but I also know that I'm a better engineer than them, so I'm not losing any sleep over it.
    Blah blah bullshit blah. You're not very convincing; I hear the same crap from contractors. Others don't pursue the same opportunities as you, so you assume it means you're naturally better at it. Sometimes it's not a difference of skill-level; sometimes it's a difference of personal preference (in particular, that of lifestyle and business domain).
  • (cs) in reply to boog
    boog:
    Anonymous:
    It takes an unhealthy level of fastidiousness and that comes from far more than learned good practice - it is an entire mindset. I know I'm unfair on those that don't share that mindset but I also know that I'm a better engineer than them, so I'm not losing any sleep over it.
    Blah blah bullshit blah. You're not very convincing; I hear the same crap from contractors. Others don't pursue the same opportunities as you, so you assume it means you're naturally better at it. Sometimes it's not a difference of skill-level; sometimes it's a difference of personal preference (in particular, that of lifestyle and business domain).

    Let's not even mention the fact that "Anonymous" is single-handedly producing this error-free super code. I'm sure his company must be compensating him well for all the money they're saving on testers and peers to review his code. It's especially lucky for them, because it sounds as though he's peerless.

  • (cs) in reply to Anonymous
    Anonymous:
    boog:
    Anonymous:
    Well it's been fun but we're obviously done here. Good luck in your office job, you clearly enjoy the meagre standards it impresses upon you and I suppose I can respect that. I can't agree with it, but I can respect it.
    Yes, and I'm sorry that I wasn't able to discuss the matter on your glorified and totally-irrelevant level. It really is a shame that this office job hasn't made me as arrogant and insufferable as you've shown yourself to be. Man, that'll always be the dream.

    Thanks for the well wishes anyhow.

    You're very welcome. For the record, I am insufferable and I am arrogant. You can call it ego, you can call it an appeal to accomplishment, but at the end of the day I do a job that 90% of software engineers couldn't do.
    I hate to break it to you dude, but 90% of software engineers couldn't program their way out of a nutsack. I should know: I am one, and I also have to hire these people.

    Unless you're using advanced mathematics in your work, such as solving fluid dynamics problems or some such, you have probably overestimated your exceptionalism.

  • (cs) in reply to hoodaticus
    hoodaticus:
    Anonymous:
    boog:
    Anonymous:
    Well it's been fun but we're obviously done here. Good luck in your office job, you clearly enjoy the meagre standards it impresses upon you and I suppose I can respect that. I can't agree with it, but I can respect it.
    Yes, and I'm sorry that I wasn't able to discuss the matter on your glorified and totally-irrelevant level. It really is a shame that this office job hasn't made me as arrogant and insufferable as you've shown yourself to be. Man, that'll always be the dream.

    Thanks for the well wishes anyhow.

    You're very welcome. For the record, I am insufferable and I am arrogant. You can call it ego, you can call it an appeal to accomplishment, but at the end of the day I do a job that 90% of software engineers couldn't do.
    I hate to break it to you dude, but 90% of software engineers couldn't program their way out of a nutsack. I should know: I am one, and I also have to hire these people.

    Unless you're using advanced mathematics in your work, such as solving fluid dynamics problems or some such, you have probably overestimated your exceptionalism.

    Dunning–Kruger effect anyone?

  • blarg (unregistered) in reply to Anonymous
    Anonymous:
    Full disclosure: the controllers I'm currently working on are temperature controllers for cruise missiles, much less rigorous than traditional flight controllers and much lower resolution. But you're right, millions of samples per second is perfectly normal for many of the flight controllers I've worked on. For an in-flight temperature controller you couldn't even measure millions of samples per second, the hardware doesn't come close to supplying that volume of data.

    Regardless of what you are paid to do, the fact that you cannot grasp such a simple concept as 'different tools for different needs' suggests that perhaps you may not progress much further than mid-level developer.

    I'd suggest that you look around at what other high performance devs are achieving and you'll probably feel somewhat embarrassed with your 100,000/min.

  • JR (unregistered) in reply to The Coward

    Yes, the real WTF is in the requirements.

    Stripping out '+' for instance will completely break some international numbers. I've seen a lot of websites get this wrong.

  • Jeff Grigg (unregistered)

    TRWTF is that it should be a function, for code reuse.

    ...in The Enterprise Library. Required use.

    ;->

  • Maxx (unregistered)

    homephone = homephone.replace(/\D/g,""); //js code

    The comment line does make me wonder if the language isn't javascript or whether the developer is still learning how to properly add comments.

    captcha: validus - Greek hero renowned for form validation

  • quisquis (unregistered) in reply to Anonymous
    Anonymous:
    Mark:
    Dude. Google "regular expressions". I swear it will blow your effing mind.
    I'm worried about the amount of people who are suggesting regular expressions for such a trivial problem. Regular expressions have their place but they are totally the wrong tool for a simple non-numeric replace like this. Fun fact: in the .NET framework the regular expression handling classes have the highest cyclomatic complexity of any classes in the entire framework (last time I checked, circa 3.0). Yes, I know this code isn't .NET but it highlights an inescapable fact about regexes - they are a seriously expensive operation, in any language. Don't abuse them for silly little jobs like this one.

    TRWTF are languages that do not pre-compile regexes - in which the resulting code would just walk the string and check each char for being a digit. Linear complexity results.

  • Irritated (unregistered)

    So totally, TOTALLY, unnecessary. All of those characters could have been removed instantly by a) bungee jumping b) sky diving c) sex d) ride in a jet aircraft e) night at a fair ground f) anything exciting enough to consume that many characters in one go. Why do you sit and scratch your ass instead? Really.

  • Sten (unregistered) in reply to Icould od much better
    Icould od much better:
    Rob:
    This guy was paid by the line, right?
    No. He wouldn't do 3 replaces per line if it was so.

    So he was paid for each function call then :-D

  • Anonymous Guy (unregistered)

    lol

    so what about special characters? :)

Leave a comment on “No Letters Allowed!”

Log In or post as a guest

Replying to comment #342505:

« Return to Article