Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7397831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:47:50+00:00 2026-05-29T03:47:50+00:00

Many programmers say it is a bad practice to use the eval() function: When

  • 0

Many programmers say it is a bad practice to use the eval() function:

When is JavaScript's eval() not evil?

I’d like to take a moment to address the premise of your question – that eval() is “evil”…

Is this eval() dangerous?

Buggy evaled code can violate security properties just as easily as buggy source code…

Why not eval() JSON?

There are a number of ways that your security may be compromised…

Is there ever a good reason to use eval()?

Yes – when there is no other way to accomplish the given task with a reasonable level of clarity… This eliminates 99% of cases where eval is used…

Why is eval unsafe in javascript?

The danger of eval only rears its ugly head when you are serving a script written by alice to user bob for bob’s browser to eval…

So why does it exist in the first place?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:47:51+00:00Added an answer on May 29, 2026 at 3:47 am

    Because sometimes there is a need. All the same reasons for/against using eval in JavaScript can likely be shared with the use of reflection in Java, for example.

    However, I agree with everything you quoted in your question. Many reasons for using it are ill-advised, and best done differently – but sometimes, there is still a need, or it is simply the “best choice” over other available alternatives. (I’d focus on the answers to Is there ever a good reason to use eval()? for additional reasons.)

    +1 to your question for good research.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not really a programming question, but relevant to many programmers... Let's say I have
Like many programmers, I'm prone to periodic fits of inspiration wherein I will suddenly
Many beginning programmers write code like this: sub copy_file ($$) { my $from =
I, like so many programmers before me, am tearing my hair out writing the
Why many programmers use: if ($_GET['var'] or $this->error) instead of if (isset($_GET['var']) or isset($this->error)
Recently, many programmers and that includes me, have taken the X out of AJAX,
What is a magic number? Why do many programmers advise that they be avoided?
I'm working with websites written in PHP, along with many other programmers, and sometimes
There are many things that all programmers should know, but I am particularly interested
It seems like a lot of people here and on many programmer wikis/blogs/ect. elsewhere

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.