paradigms

Why is the paradigm of “direct database connection” not welcomed by the Android platform?

一曲冷凌霜 提交于 2019-11-27 21:44:22
When I say "direct database connection", I meant to use a JDBC-alike driver to call and run a remote database query within the context of an activity, just like using an SQLite database to store the local parameters. Until I realized that I could barely find any tutorials or documents on the Internet regarding this way of database connection, I thought, regardless of the unstable Wi-Fi/3G network bore by most if not all Android devices, to connect to a database should be done like so. Even in Android SDK, only local database access (a.k.a android.database.sqlite ) is supported intrinsically.

Mixins vs. Traits

三世轮回 提交于 2019-11-27 10:04:20
What is the difference between Mixins and Traits? According to Wikipedia , Ruby Modules are sort of like traits. How so? Mixins may contain state, (traditional) traits don't. Mixins use "implicit conflict resolution", traits use "explicit conflict resolution" Mixins depends on linearization, traits are flattened. Lecture about traits ad 1. In mixins you can define instance variables. Traits do not allow this. The state must be provided by composing class (=class using the traits) ad 2. There may be the name conflict. Two mixins ( MA and MB ) or traits ( TA and TB ) define method with the same

Do you use AOP (Aspect Oriented Programming) in production software?

一曲冷凌霜 提交于 2019-11-27 09:50:47
问题 AOP is an interesting programming paradigm in my opinion. However, there haven't been discussions about it yet here on stackoverflow (at least I couldn't find them). What do you think about it in general? Do you use AOP in your projects? Or do you think it's rather a niche technology that won't be around for a long time or won't make it into the mainstream (like OOP did, at least in theory ;))? If you do use AOP then please let us know which tools you use as well. Thanks! 回答1: Yes. Orthogonal

Flow Based Programming

若如初见. 提交于 2019-11-27 09:12:52
问题 I have been doing a little reading on Flow Based Programming over the last few days. There is a wiki which provides further detail. And wikipedia has a good overview on it too. My first thought was, "Great another proponent of lego-land pretend programming" - a concept harking back to the late 80's. But, as I read more, I must admit I have become intrigued. Have you used FBP for a real project? What is your opinion of FBP? Does FBP have a future? In some senses, it seems like the holy grail

How do functional programming languages work?

落花浮王杯 提交于 2019-11-27 08:57:55
问题 If functional programming languages cannot save any state, how do they do simple stuff like reading input from a user? How do they "store" the input (or store any data for that matter?) For example: how would this simple C thing translate to a functional programming language like Haskell? #include<stdio.h> int main() { int no; scanf("%d",&no); return 0; } (My question was inspired by this excellent post: "Execution in the Kingdom of Nouns". Reading it gave me some better understanding of what

What is the difference between a Character Array and a String?

为君一笑 提交于 2019-11-27 05:54:58
问题 Spending my time on high level languages it suddenly occurred to me that I did not know the difference between a Character Array and a String. I think they are the same thing but not sure. Is there a difference? Is it just a Character Array with some abstraction? 回答1: a character array is simply an array of characters a string is data structure that uses an array of characters some string representations use a null-terminator (like C), others use a length prefix 回答2: A String is an

Understanding MVC: Whats the concept of “Fat” on models, “Skinny” on controllers?

白昼怎懂夜的黑 提交于 2019-11-27 00:32:02
I'm trying to understand the concept of "Fat" on models vs "skinny" on controllers and from what I've been discussing I have the following example (this is taken from a freenode discussion): Q: On MVC paradigm, its said Fat models, skinny controllers. I'm here thinking, If I have lots of methods (on controller) that uses just a few abstract methods to CRUD (on model), am I creating a fat controller instead of a model ? Or they say, fat model, refearing in what is returned and not typed ? that's something I've never understood =) Any comments are appreciated! Thanks a lot OBS1: I'm not doing

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 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

Why is the paradigm of “direct database connection” not welcomed by the Android platform?

孤街浪徒 提交于 2019-11-26 20:47:39
问题 When I say "direct database connection", I meant to use a JDBC-alike driver to call and run a remote database query within the context of an activity, just like using an SQLite database to store the local parameters. Until I realized that I could barely find any tutorials or documents on the Internet regarding this way of database connection, I thought, regardless of the unstable Wi-Fi/3G network bore by most if not all Android devices, to connect to a database should be done like so. Even in