Tag Info

Hot answers tagged

19

From the perspective of programming language theory I would say neither. A programming language is 3 things A set of rules for constructing programs: the grammar of the language. A set of rules for determining whether a particular program is a valid program without running it: the static semantics of the language* A set of rules for actually evaluating a ...


12

There is a connection, however it is a little loose. In C# the keywords ´in´ and ´out´ as their name suggest stand for input and output. This is very clear in the case of output parameters, but less clean what it have to do with template parameters. Lets take a look at the Liskov substitution principle: ... Liskov's principle imposes some standard ...


7

@Gábor has already explained the connection (contravariance for all that goes "in", covariance for all that goes "out"), but why re-use keywords at all? Well, keywords are very expensive. You cannot use them as identifiers in your programs. But there is only so many words in the English language. So, sometimes you run into conflicts, and you have to ...


5

That definition of "algorithm" is extremely narrow. It applies only to non-interactive deterministic digital small-step algorithms. However, algorithms need not be digital (consisting of discrete steps and operating on discrete values). They can also be continuous (consisting of discrete steps and operating on continuous values) or analog (continuous ...


5

No. It is not. Like a mathematical function, an algoritim transforms elements from a source set of information to a destination set. That works independently from the origins of the source set: Whether it stems from user (keyboard or otherwise) input, from a file containing the information or from punchcards. The input belongs to the preconditions of an ...


4

In .NET, there are two categories of type: references and values (int, double, structs, enums etc). Amongst their differences is the fact that a reference can be null, whereas a value cannot. Thus if you have a value type and want to convey "optional" or "unknown" semantics, you can adorn it with Nullable<>. Note that Nullable<> is constrained by ...


4

It doesn't make sense to talk about the step complexity of an algorithm without defining what a "step" is first. Algorithmic complexity is always relative to a model of computation, whether that be transitions of a Turing Machine, reductions in λ-calculus, instructions of a Random Access Machine or the number of comparisons when talking about ...


3

Functions have two main purposes: aiding code reusability and breaking down a task into smaller logical units. Functions that do not aid code reusability are helper functions; their sole purpose is to "help" a single function by cleaning the code and making the logic clearer. The opposite of a helper function is a library function, which focuses on code ...


2

There is a different connotation, even though they work very similarly. Everyone but Microsoft (insert eye-roll here) uses null and nullable only in the context of references. Options and Maybes are generally understood to refer to both references and values, especially in functional programming languages where referential transparency means there isn't ...


2

Note that the latter definition only talks about the machine language of some computer, not about programming languages in a general sense. I suppose the machine language is a programming language, but when treating programming languages as sets of programs, we can reconcile that with the latter definition by rephrasing it like this: The machine language is ...


2

When defining or talking about algorithmic complexity, you always have an (implicit) target abstract machine in mind (e.g. the RAM machine, the SECD machine, etc). Then the elementary steps are those of that target machine. Bubble sort is O(n2) only with the assumption that compares are constant time. If you imagine sorting bignums it probably is no more ...


2

This is called an eventually consistent system. Databases like Cassandra make good use of this model. To understand why you might want an eventually consistent system, take a look at Brewer's Conjecture and Cap Theorem. It's a trade-off.


1

The commonly used term is "feature", although "functionality" seems clear enough as well, especially at requirements gathering stage (we talk about "functional requirements", not "features"). As for the parts, it depends: If you are talking about the parts of the application from the point of view of a developer, those can be "subsystems" (large) ...


1

They're just terms. In most scenarios, they are interchangeable. In general though, a convinience function is one that just helps you do something you can already do, albeit with less typing. An overload that forwards with the usual defaults for example. A helper often is some new functionality that doesn't really belong somewhere so it's off on its own, ...


1

If the image you saw is like this one, D0-D7 imply bit positions in the status register, called F (for flags) when part of the AF register pair. The Ds are misleading because they imply some (nonexistent) relationship to the D register or the data pins (which are multiplexed with the address lines and are actually called AD0-AD7). Describing bit positions ...


1

Why not just quote wikipedia? Nails it down in my opinion: A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms. Wikipedia - Programming Language


1

To be a pure function, providing the same parameters must give the same result every time. Each time we call Today(), we are providing it the same parameters (none), and yet not necessarily getting the same result (Monday, Tuesday, etc.).



Only top voted, non community-wiki answers of a minimum length are eligible