Questions tagged [evaluation]

Evaluation of expressions in a program.

Filter by
Sorted by
Tagged with
-2
votes
0answers
37 views

How to evaluate multiple expressions in Java [duplicate]

We have a scenario where a business expression can result in true|false. Example quantity > 2 . Users can create such business expressions and also define the overall validation among the rules. All ...
2
votes
1answer
82 views

Best practices for dynamically-evaluated dates in system?

Let me introduce you into a minimalistic and made-up case with real-case chronological order, updates and problems. User with ID only I had a system, and it had User entity with ID column only. So, ...
0
votes
1answer
50 views

When should an expression tree hold pointers and when should it hold values of subexpressions?

I was thinking it should hold pointers: struct Expr { string sym; Expr*[] sub; this(self, string sym) { this.sym = sym; } @property auto dup() const { auto e = ...
2
votes
2answers
441 views

Concerns on lazy evaluation and infinite data structures

I am trying to learn how lazy evaluation works because I'm going to implement try to implement it in the programming language I'm developing (I know it isn't the best thing to do (to try to implement ...
0
votes
2answers
2k views

Lambda calculus: Call by value / Call by name (lazy)

Having difficulties deciding which rules to apply on by value / by name evaulation. Say I have: (λz.zz)(λb.b) And I want to evaluate according to call by valute, will the next step be (λz.z)(λb.b)...
51
votes
13answers
10k views

Why are eval-like features considered evil, in contrast to other possibly harmful features?

Most modern languages (which are somehow interpreted) have some kind of eval function. Such a function executes arbitrary language code, most of the time passed as the main argument as a string (...
-1
votes
3answers
270 views

How are expressions evaluated in Turbo C++?

I was reading about casts in c++ and got confused about how are the expressions actually evaluated. Consider the following code in which var is of type int and after the expression var = (var*10)/10 ...
1
vote
4answers
5k views

Why do negative numbers evaluate to true in PHP? [closed]

function haha($lol) { if($lol) { echo "plus"; } else { echo "minus"; } } haha(-1) echoes plus. Is it because PHP uses twos complement? Google search wasn't really helpful.
3
votes
2answers
176 views

How to accomplish a task of evaluating editable variables and formulas, using PHP?

Task as defined: User needs to be able to define their own variables and formulas to operate on those variables, to get output based on their inputs. Since formulas and variables and their inputs ...
6
votes
4answers
602 views

How to convert the following node evaluation procedure to a non recursive solution?

I have the following recursive method. It evaluates a node (that represent a logical expression), using deep first search traversal : EvaluateNode(Node node) { bool result; switch(node.Type) ...
4
votes
2answers
348 views

Evaluation order of expressions in Clojure?

I'm currently learning Clojure (my first functional programming language), and I'm curious as to its order of evaluation. Here is an example: (take 10 (cycle [1 2 3])) If the cycle expression was ...
1
vote
4answers
373 views

Efficient way of evaluating an array of strings then add to an array in Ruby

I am looking for an efficient way of evaluating an array of strings against a series of rules and then adding them to another array. For example I have an array of strings: something a 1234 #gohere ...
4
votes
5answers
584 views

What's the effect of this assignment (whatever the language)?

I think my book (Programming Languages: Principles and Paradigms) is wrong. a is a vector, assume a C-like language: b = 0; a[f(3)] = a[f(3)] + 1; int f(int n) { if(b == 0) { b = 1; ...
9
votes
3answers
1k views

Is there a general method to evaluate the optimality of an optimization algorithm?

is there a general method to evaluate the optimality of an optimization algorithm, for example an algorithm solving an otherwise NP-hard or NP-complete problem? The only method I came up so far is ...
22
votes
11answers
2k views

How is fundamental mathematics efficiently evaluated by programming languages?

As I get more and more involved with the theory behind programming, I find myself fascinated and dumbfounded by seemingly simple things.. I realize that my understanding of the majority of fundamental ...
9
votes
2answers
3k views

What is a good method to do lightweight architecture evaluation?

I'm familiar with architecture evaluation methods such as the technical Architecture Tradeoff Analysis Method (ATAM) and more business-oriented Cost Benefit Analysis Method (CBAM). However, these ...
49
votes
17answers
4k views

How do managers know if a person is a good or a bad programmer?

In most companies that do programming teams and divisions consist of programmers who design and write code and managers who... well, do the management stuff. Aside from just not writing code, ...
8
votes
3answers
446 views

What's the best way to do a Proof of Concept shootout?

In preparation for a new release of software our company maintains, I've been working on what I believe to be a really good approach to solving our scalability issues. I have every intention of ...
301
votes
38answers
84k views

How Can I Know Whether I Am a Good Programmer?

Like most people, I think of myself as being a bit above average in my field. I get paid well, I've gotten promotions, and I've never had a real problem getting good references or getting a job. But ...