glossary

Functional programming and non-functional programming

依然范特西╮ 提交于 2019-11-26 23:23:09
In my second year of University we were "taught" Haskell, I know almost nothing about it and even less about functional programming. What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in thinking that C is a non-functional programming language? One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values. Functional programming involves writing code that does not change state. The primary reason for

What is the dependency inversion principle and why is it important?

雨燕双飞 提交于 2019-11-26 23:15:04
What is the dependency inversion principle and why is it important? Carl Seleborg Check this document out: The Dependency Inversion Principle . It basically says: High level modules should not depend upon low-level modules. Both should depend upon abstractions. Abstractions should never depend upon details. Details should depend upon abstractions. As to why it is important, in short: changes are risky, and by depending on a concept instead of on an implementation, you reduce the need for change at call sites. Effectively, the DIP reduces coupling between different pieces of code. The idea is

What is the difference between Type and Class?

纵饮孤独 提交于 2019-11-26 21:17:28
What makes a type different from class and vice versa? (In the general language-agnostic sense) yesraaj The following answer is from Gof book ( Design Patterns ) An object's class defines how the object is implemented .The class defines object's internal state and the implementation of its operations. In contrast, an object's type only refers to its interface - a set of requests to which it can respond. An object can have many types, and objects of different classes can have the same type. //example in c++ template<typename T> const T & max(T const & a,T const &b) { return a>b?a:b; //>

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

牧云@^-^@ 提交于 2019-11-26 21:13:33
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? 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 transforming sequential logic into functional logic called continuation passing style .) As a consequence, a purely

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

﹥>﹥吖頭↗ 提交于 2019-11-26 19:47:39
I've heard the term MVC (Model View Controller) tossed about with a ton of Buzz lately, but what really is it? 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 . I like this article by Martin Fowler. You'll see that MVC is actually more or less dead, strictly speaking, in its original domain of rich UI programming. The distinction between View and Controller doesn't apply to most modern UI toolkits. The term seems to have found new life in web programming circles recently. I'm not sure whether that's truly MVC

Database: What is Multiversion Concurrency Control (MVCC) and who supports it? [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-26 19:11:18
问题 Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion Concurrency Control (MVCC) claims to solve this problem. What is it, and what databases support it? updated: these support it (which others?) oracle postgresql 回答1: Oracle has had an excellent multi version control system in place since very long(at least since oracle 8.0) Following should help. User A starts a transaction and is updating 1000 rows with some value At Time T1 User B reads

Java Annotations

和自甴很熟 提交于 2019-11-26 18:47:55
问题 What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the program at run time? What are their typical usages? Are they unique to Java? Is there a C++ equivalent? 回答1: Annotations are primarily used by code that is inspecting other code. They are often used for modifying (i.e. decorating or wrapping) existing classes at run-time to change their behavior. Frameworks such as JUnit and Hibernate use annotations

What is unit testing? [closed]

北城以北 提交于 2019-11-26 11:28:15
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 Rytmis 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 more granular level than point-and-click testing via a GUI Note that if your test code writes to a file, opens a

Functional programming and non-functional programming

浪子不回头ぞ 提交于 2019-11-26 09:14:57
问题 In my second year of University we were \"taught\" Haskell, I know almost nothing about it and even less about functional programming. What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in thinking that C is a non-functional programming language? 回答1: One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return

What is the dependency inversion principle and why is it important?

杀马特。学长 韩版系。学妹 提交于 2019-11-26 08:39:16
问题 What is the dependency inversion principle and why is it important? 回答1: Check this document out: The Dependency Inversion Principle. It basically says: High level modules should not depend upon low-level modules. Both should depend upon abstractions. Abstractions should never depend upon details. Details should depend upon abstractions. As to why it is important, in short: changes are risky, and by depending on a concept instead of on an implementation, you reduce the need for change at call