Eval()?


  • kills Dumbledore

    @accalia said:

    heaven is bland

    AIUI, according to standard Christian dogma, there is no desire in Heaven, hence why people there aren't worried about their heathen friends being eternally punished. So I conclude Heaven is basically like having a frontal lobotomy.



  • An interesting variation of the few occasions I use eval(), which is basically because there are times when the expression you need to execute next can only be "constructed" as a string or be the product of a billion conditional tests (where the first one the User needs, you didn't think of).

    IRONY: This is post 101.

    Nobody has yet posted the automatic eval is evil and walked away from the issue, although there have been "hints", Some appear to be "afraid" to admit they use it for reasons, I suspect, are on the variation of fear of being ridiculed and ostracised. A few have indicated, what I consider, to be a healthy approach i.e "eval() is a powerful tool, and with power comes responsibility". It can be abused; it is a "short cut" but there are times when it is the "best" tool available at the time.

    I use the question to help "evaluate" my fellow Devs - I don't really care what they think of me for asking the question. But it indicates (to me) a level of (at best) conservatism that could be "difficult".

    I will say this: "There are two types of developer. Those that use code written by others and those that write code that will be used by others". The former may have difficulty "solving" new problems, the latter won't. Going back to iInesat, my (sub)Team Leader (call him Arse Hole) was 2 years out of university and apparently had high scores. He was in that role by virtue of being there "first". I spent most of my time during his "review" of my code explaining various techniques. If he did not understand or recognise the principle he would want to "bin" my code. If I did not, he would "complain" to the actual Team Leader (who was based in the US). He was a good, experienced guy and we got on very well but he had "made in America" written all the way through him and did not like conflict and all "difficult" decisions were escalated. This I did not mind, but Arse Hole would often subsequently complain to Golden Rod.

    Dammit @Jaloopa :) I knew I should have saved to ensure my 101 slot.


  • kills Dumbledore

    @loose said:

    IRONY: This is post 101.

    :hanzo:


  • Discourse touched me in a no-no place

    @loose said:

    Nobody has yet posted the automatic eval is evil and walked away from the issue

    Oh, but it is evil! You're assuming that we're not😈



  • It's early in the morning, but:

    The Antichrist is evil, but that don't stop him being a tool. :rofl:



  • Oh yeah. A bit of context: Arse Hole was so ultra conservative he did not want there to be any chance of there being the slightest hint of an "off white" smudge against "his" (meaning his sub-teams) code that could ruin his "perfect record". Which I was given to understand was a single Project that consisted (UI wise) of a Report selection / generation tool that used auto complete on a consecutive series of HTML Selects.

    P.s. The role I had was at a salary 50% above market and a very healthy 20% bonus (50/50 productivity / personal development. The former paid monthly the latter annually).

    iInesat advertised for PHP Developers. They explained during the interview that they needed Perl Developers but could not get any suitable candidate and they were of the opinion that PHP devs to be easily "retrained" as Perl devs. This was the opinion of the guy who became my Technical Manager. He programmed in Perl, and had used PHP for pet projects until he "discovered" Python. For completion's sake: The Dev (Linux servers [we all had our own VM] - Red Hat Enterprise) were "littered" with Python "auto-magical" "helper" scripts.


  • area_pol

    eval is the most important program ever made - it represents the core concept that program is part of the data and not part of the hardware.
    Every CPU and interpreter is eval, so you use it all the time, just do not call it by the name.

    The form of eval function in scripting languages is the least interesting form.


  • Discourse touched me in a no-no place

    @Adynathos said:

    The form of eval function in scripting languages is the least interesting form.

    http://data.whicdn.com/images/6381559/large.jpg


  • FoxDev

    @Jaloopa said:

    So I conclude Heaven is basically like having a frontal lobotomy.

    so it's even worse than i thought.

    good to know.



  • Only time I used eval on JS was for some calculator I made for FirefoxOS when I got a free device and played around with it.

    Man, the divisions that you get from eval are really crazy.


  • Discourse touched me in a no-no place

    @dkf said:

    Look for “BSD M&Ms”…

    [spoiler][/spoiler]



  • I think we need a range of "like" type buttons: Sad, Sick, Wicked, Fail, Epic etc

    Hmmm, perhaps they could have mutators / modifiers like: Almost, Massive, Extreme etc

    ???


  • BINNED

    @loose said:

    I think we need a range of "like" type buttons: Sad, Sick, Wicked, Fail, Epic etc

    If you want slashdot you know where to find it.



  • Well, it's a matter of perspective, but I can see Adynathos' point, sort of. Conceptually, the language translator - whether a compiler or an interpreter - can be viewed as a virtual machine of sorts, with an eval/apply loop at its core (in a compiler, evaluation is temporally separated from operator application, but both are still there). This viewpoint is pretty explicit in Lisp, and some of the strict FP languages, but it is present in all programming languages, though hidden.

    From that point of view, the eval() function provided by most dynamic languages is just an introspection into the language evaluator, hence the comment about it being the least interesting aspect of eval itself. At least, I think that's what Adynathos had in mind.



  • Nah, let people assign an arbitrary tag to a post. Otherwise it's too restrictive.



  • @Jaloopa said:

    AIUI, according to standard Christian dogma, there is no desire in Heaven, hence why people there aren't worried about their heathen friends being eternally punished. So I conclude Heaven is basically like having a frontal lobotomy.

    That's not at all the way I understand it. There are passages in the Bible (I don't remember where off-hand, and I CBA to search at the moment; if you're interested, ask, and I'll look them up) that indicate people will be given work to do. The Bible gives no information about the sort of work (mostly; there are a couple of specific things mentioned), but the general teaching I've heard is that, whatever it is, it will be chosen based on one's individual inclinations and talents. Imagine a day at work where you're working on a project that is interesting and exciting, and you go home feeling like you accomplished something significant; that's the Christian view of Heaven that I've heard.



  • For what it's worth, in a Q&A session at a catholic retreat, a group of priests confirmed that there is glorious fornication in heaven



  • You don't understand, for people who don't pay attention, anything some random Catholic said once is standard Christian dogma. Most people don't even know why the devil is a red guy with horns and a pitchfork, or know that most Christians don't think that.



  • @mrguyorama said:

    there is glorious fornication in heaven

    I have heard it said that there will be sex in Heaven, based on the hypothesis that "God doesn't make something good, then throw it away." However, it is clearly stated that "they neither marry nor are given in marriage" (Matthew 22:30). I don't know how to reconcile these, but I'm fairly certain it's not "glorious fornication." The words translated into English as "fornication" (Greek πορνεία, porneia; Hebrew זָנָה, zanah) include a much broader range of forbidden sexual behavior than the modern usage. However, even the narrow meaning of "consensual sex between unmarried persons" is forbidden, and ISTM unlikely that what was considered immoral on Earth would be considered moral in Heaven.

    Also, I would take the teachings of Catholic priests in matters of sexuality with a few grains of salt.



  • Doesn't matter to me. There won't be much sex in my casket six feet under!




  • Java Dev

    @HardwareGeek said:

    However, it is clearly stated that "they neither marry nor are given in marriage" (Matthew 22:30).

    From memory, Jesus was asked about situations in which a single woman had had multiple husbands (a distinct possibility under Jewish law), and who she would be with in heaven. Jesus called the asker small of mind.



  • @PleegWat said:

    From memory, Jesus was asked about situations in which a single woman had had multiple husbands (a distinct possibility under Jewish law), and who she would be with in heaven.

    Yes, that is the context. (Specifically, if a man died without an heir, his brother was to marry his widow, and their first child would be considered the dead brother's child. More specifically, the question was about seven hypothetical brothers, all of whom married a hypothetical woman according to this law, and all of whom died without children, i.e., none of them had a stronger claim to her than any of the other brothers.)

    @PleegWat said:

    Jesus called the asker small of mind.
    I don't remember that specific response off-hand, but "You're asking the wrong question" was a common theme to Jesus's answers when asked trick questions.

    (Yay, more server cooties.)



  • eval()'s not the only way to get dynamic Javascript:

    <script> there's also these things but whatever </script>
    return new Function("return new Function(\"return new Function(\\\"return new Function(\\\\\\\"return 0\\\\\\\")\\\")\")")
    

  • FoxDev

    @riking said:

    eval()'s not the only way to get dynamic Javascript:

    <script> there's also these things but whatever </script>
    return new Function("return new Function(\"return new Function(\\\"return new Function(\\\\\\\"return 0\\\\\\\")\\\")\")")
    ```</blockquote>
    
    That..... 
    
    oh goddess...... i think i'm going to be sick!
    
    <img src="/uploads/default/original/3X/d/c/dc1a2f0694c32e7b797d7bd2616cfc5f8137cd66.jpg" width="500" height="500">


  • Oh come on! There are plenty of perfectly good official images of the Squidgirl! This one is awful!


  • FoxDev

    are there any that show the appropriate reaction to @rikings abomination?



  • Almost certainly! Her puking ink is an important plot point! They use it to sell lots of noodles!


  • FoxDev

    provide an image apropriate to the ocasion and i shall edit my post as apropriate.

    /me sits back with a book to wait



  • I found three:

    There are probably images that better portray disgust, but you'd need to screencap those, or use the manga.


  • kills Dumbledore

    @mrguyorama said:

    There won't be much sex in my casket six feet under!

    Not with that attitude



  • @Magus said:

    Her puking ink is an important plot point!

    ...aaaand that's another thing I need to cross off my "things I never thought I'd hear in a conversation" list. THANKS JAPAN!



  • Racist! Squid people are people too!



  • @Magus said:

    Squid people are people too!

    This seems like a tautology.



  • @tar said:

    This seems like a tautology.

    Now I wonder whether

    Non-people are people too

    sounds like a tautology, too, or not.

    Maybe like a tautology, threa?



  • We use eval in the platform I look after to handle dynamic parsing of variables into emails.



  • @Arantor said:

    We use eval in the platform I look after to handle dynamic parsing of variables into emails.

    You are Doing It Right™. This enables you to dynamically extend the semantics of these variables by putting "eval()" into them too, so you can have an Inner Platform® in your Inner Platform®.



  • Read it as "dynamic parsing of variables from emails" and had this utterly terrifying vision of RPC over email.


  • Discourse touched me in a no-no place

    @Maciejasjmj said:

    Read it as "dynamic parsing of variables from emails" and had this utterly terrifying vision of RPC over email.

    This has been done. God help me, this has been deliberately done.



  • @dkf said:

    @Maciejasjmj said:
    Read it as "dynamic parsing of variables from emails" and had this utterly terrifying vision of RPC over email.

    This has been done. God help me, this has been deliberately done.



  • Come on! Which better system to transmit data on almost fail proof, distributed, async way?

    LPT: don't read about SMTP; it's boring!


  • Discourse touched me in a no-no place

    @Eldelshell said:

    almost fail proof

    This is “almost ‘fail proof’ but just missing that second word” I'd guess.

    It's possible to bring it all back to the realm of being a mere Bad Idea if you can implement a sandboxing technology. Various forms of white-listing (probably using digital signatures) might also help taming the beast. At that point, you're almost getting to the point of it being a weird, rather inferior and over-complicated message bus solution.

    It still gives me the heebie-jeebies.



  • Because running an eval is so much harder than setting up an array for str_replace because PHP, eval, email, is practically an unholy trifecta.



  • @Arantor said:

    trifecta

    And there was me thinking PHP is always a "cert" as it is always a "one horse race" under any conditions.

    i.e it is always going to win (be the best).

    Note: This statement is insupport of PHP, and an endorsement of it's superiority over all others.

    However, I can understand the sarcasm used here, as associating these three words (unholy trinity)

    @Arantor said:

    PHP, eval, email,

    Is liable to cause extremely high blood pressure in some quarters



  • Have you seen The Thread yet? In the lounge, "coming up for air"



  • No



  • I have (sort of) now.

    There is a lot of bad PHP out there. not because PHP is a bad language, but because PHP was made available to the masses in a way that other "free" languages weren't. Also, at the time there was little else available. A poor analogy:

    • People want to take advantage of the brand new, and improving, road
      infrastructure.
    • Government says everybody should have access to a car
    • Car providers (buy or hire) make any model freely available with minimum fuss
    • Petrol is only available at a few locations, you have to complete endless application forms and meet stringent requirements to even be considered to be allowed access. And you need a repayment plan not unlike that of a mortgage.

    Government is happy. Car manufactures, retailer etc are happy - especially after diverging into petrol supply. Petrol suppliers are happy

    People are unhappy - Govement has done what they requested but in such a way as to make the problem worse.

    Then a new supplier of petrol hits town. They have distributors on every corner. The petrol is not very good quality, but it will get you from A to B at no cost. Distributors know of the short comings, and do their best to improve it.

    Hey, I just realised (perhaps it was my subconscious mind). This actually works for petrol, if you think of the effect of supermarkets on the market.

    @Arantor I hear you my friend. I will never really be out of work (although, by definition, I will be one day) There are many small business whose business is their business and has nothing to do with understanding the mantra and ritual of IT. Who need help to automate their entire IT infrastructure (or at least reduce to a simple set of procedures) that is not only bullet proof, but nuke proof.


  • Discourse touched me in a no-no place

    @loose said:

    Who need help to automate their entire IT infrastructure (or at least reduce to a simple set of procedures) that is not only bullet proof, but nuke proof.

    But all they're willing to pay for is bullet proof.



  • @loose said:

    . not because PHP is a bad language, but because

    It is a horrible platform. There are lots of examples of the many woes PHP is riddle with and most of them are there because of intelligent design.



  • Actually PHP is legitimately getting better, with 5.5/5.6 and the changes coming in 7 where scalar type hinting (and enforcing) on function inputs and outputs will finally be a thing.


Log in to reply