glossary

What is the difference between procedural programming and functional programming? [closed]

隐身守侯 提交于 2019-11-26 07:50:28
问题 I\'ve read the Wikipedia articles for both procedural programming and functional programming, but I\'m still slightly confused. Could someone boil it down to the core? 回答1: A functional language (ideally) allows you to write a mathematical function, i.e. a function that takes n arguments and returns a value. If the program is executed, this function is logically evaluated as needed. 1 A procedural language, on the other hand, performs a series of sequential steps. (There's a way of

What is MVC (Model View Controller)? [closed]

爱⌒轻易说出口 提交于 2019-11-26 07:26:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I\'ve heard the term MVC (Model View Controller) tossed about with a ton of Buzz lately, but what really is it? 回答1: You might want to take a look at what Martin Fowler has to say about MVC, MVP and UI architectures in general at Martin Fowlers site. 回答2: I like this article by Martin Fowler. You'll see that MVC

What does the word “literal” mean?

别来无恙 提交于 2019-11-26 06:59:54
问题 What does the word \"literal\" mean when used in context such as literal strings and literal values? What is the difference between a literal value and a value? 回答1: A literal is "any notation for representing a value within source code" (wikipedia) (Contrast this with identifiers , which refer to a value in memory.) Examples: "hey" (a string) false (a boolean) 3.14 (a real number) [1,2,3] (a list of numbers) (x) => x*x (a function) /^1?$|^(11+?)\1+$/ (a regexp) Some things that are not

What is unit testing? [closed]

会有一股神秘感。 提交于 2019-11-26 03:31:35
问题 I saw many questions asking \'how\' to unit test in a specific language, but no question asking \'what\', \'why\', and \'when\'. What is it? What does it do for me? Why should I use it? When should I use it (also when not)? What are some common pitfalls and misconceptions 回答1: Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are: Running the tests becomes automate-able and repeatable You can test at a much

What are MVP and MVC and what is the difference?

怎甘沉沦 提交于 2019-11-26 03:13:20
问题 When looking beyond the RAD (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called Model-View-Controller, Model-View-Presenter and Model-View-ViewModel. My question has three parts to it: What issues do these patterns address? How are they similar? How are they different? 回答1: Model-View-Presenter In MVP , the Presenter contains the UI business logic for the View. All invocations from the View delegate

Difference between binary semaphore and mutex

对着背影说爱祢 提交于 2019-11-26 01:43:30
问题 Is there any difference between a binary semaphore and mutex or are they essentially the same? 回答1: They are NOT the same thing. They are used for different purposes! While both types of semaphores have a full/empty state and use the same API, their usage is very different. Mutual Exclusion Semaphores Mutual Exclusion semaphores are used to protect shared resources (data structure, file, etc..). A Mutex semaphore is "owned" by the task that takes it. If Task B attempts to semGive a mutex

What are attributes in .NET?

烈酒焚心 提交于 2019-11-26 00:39:35
问题 What are attributes in .NET, what are they good for, and how do I create my own attributes? 回答1: Metadata. Data about your objects/methods/properties. For example I might declare an Attribute called: DisplayOrder so I can easily control in what order properties should appear in the UI. I could then append it to a class and write some GUI components that extract the attributes and order the UI elements appropriately. public class DisplayWrapper { private UnderlyingClass underlyingObject;

What are the differences between delegates and events?

与世无争的帅哥 提交于 2019-11-26 00:29:58
问题 What are the differences between delegates and an events? Don\'t both hold references to functions that can be executed? 回答1: An Event declaration adds a layer of abstraction and protection on the delegate instance. This protection prevents clients of the delegate from resetting the delegate and its invocation list and only allows adding or removing targets from the invocation list. 回答2: To understand the differences you can look at this 2 examples Example with Delegates (in this case, an

Abstraction VS Information Hiding VS Encapsulation

烂漫一生 提交于 2019-11-26 00:26:30
问题 Can you tell me what is the difference between abstraction and information hiding in software development? I am confused. Abstraction hides detail implementation and information hiding abstracts whole details of something. Update: I found a good answer for these three concepts. See the separate answer below for several citations taken from there. 回答1: Go to the source! Grady Booch says (in Object Oriented Analysis and Design, page 49, second edition): Abstraction and encapsulation are

What is a 'Closure'?

泄露秘密 提交于 2019-11-25 23:35:36
问题 I asked a question about Currying and closures were mentioned. What is a closure? How does it relate to currying? 回答1: Variable scope When you declare a local variable, that variable has a scope. Generally, local variables exist only within the block or function in which you declare them. function() { var a = 1; console.log(a); // works } console.log(a); // fails If I try to access a local variable, most languages will look for it in the current scope, then up through the parent scopes until