Questions tagged [evaluation]

Evaluation of expressions in a program.

Filter by
Sorted by
Tagged with
2 votes
1 answer
181 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, ...
Yeldar Kurmangaliyev's user avatar
0 votes
1 answer
54 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 = ...
Daniel Donnelly's user avatar
2 votes
2 answers
675 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 ...
user6245072's user avatar
0 votes
2 answers
4k 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)...
Jayn's user avatar
  • 3
51 votes
13 answers
12k 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 (...
Luis Masuelli's user avatar
-1 votes
3 answers
361 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 ...
user106313's user avatar
3 votes
4 answers
8k 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.
Vegan Sv's user avatar
  • 217
3 votes
2 answers
188 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 ...
Dennis's user avatar
  • 8,217
6 votes
4 answers
752 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) ...
tigrou's user avatar
  • 269
4 votes
2 answers
424 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 ...
joecritch's user avatar
  • 143
1 vote
4 answers
394 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 ...
Matt S's user avatar
  • 31
4 votes
5 answers
593 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; ...
user34295's user avatar
  • 143
9 votes
3 answers
2k 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 ...
scravy's user avatar
  • 387
23 votes
11 answers
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 ...
Korvin Szanto's user avatar
10 votes
2 answers
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 ...
Deckard's user avatar
  • 3,427
50 votes
17 answers
5k 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, ...
7 votes
3 answers
469 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 ...
Berin Loritsch's user avatar
301 votes
38 answers
99k 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 ...