procedural-programming

Struggling with C coming from Object Oriented land? [closed]

霸气de小男生 提交于 2019-11-27 12:47:51
When I am presented with programming problems, I naturally start breaking them up into logical objects in my head. Who has what responsibility, who owns what, who derives from what, etc. I am struggling with C. I just don't get how to do things in a Procedural Language. Can an experienced C programmer help explain how I should think about my programs during design time? For example, I want to write my own Semaphore class. I would naturally need a Queue data structure for my program, which I would like to write myself as well. If I needed to do this in Java or C#, I could simply whip up a quick

What is the difference between declarative and procedural programming paradigms?

泪湿孤枕 提交于 2019-11-27 09:02:18
问题 What is the difference between the declarative and procedural programming paradigms? Could you please provide some examples? What other programming paradigms exist? 回答1: Imperative There are several sub-paradigms of the imperative programming paradigm, such as the procedural or the object-oriented programming paradigms. In the imperative programming paradigm, you describe the algorithm step-by-step, at various degrees of abstraction. Examples of programming languages which support the

Are side effects a good thing?

一曲冷凌霜 提交于 2019-11-27 01:03:59
问题 I feel the term rather pejorative. Hence, I am flabbergasted by the two sentences in Wikipedia: Imperative programming is known for employing side effects to make programs function. Functional programming in turn is known for its minimization of side effects. [1] Since I am somewhat Math-biased, the latter sounds excellent. What are the arguments for side-effects? Do they mean the loss of control or the acceptance of uncertainty? Are they a good thing? 回答1: Every so often I see a question on

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 object oriented PHP with mysqli better than the procedural approach? [closed]

天大地大妈咪最大 提交于 2019-11-26 16:13:24
问题 I have been using the procedural approach with mysql* until recently. Now I want to shift to mysqli and object oriented approach. Many online resources and books state that OOP is better than procedural even in case of PHP. After going through some online tutorials, I have written a small program that connects to the database and selects a value. I want to know why the object oriented approach is better? Plus is this the right way to code an OO php web page? The object oriented approach $host

Struggling with C coming from Object Oriented land? [closed]

微笑、不失礼 提交于 2019-11-26 16:08:02
问题 When I am presented with programming problems, I naturally start breaking them up into logical objects in my head. Who has what responsibility, who owns what, who derives from what, etc. I am struggling with C. I just don't get how to do things in a Procedural Language. Can an experienced C programmer help explain how I should think about my programs during design time? For example, I want to write my own Semaphore class. I would naturally need a Queue data structure for my program, which I

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

simple explanation PHP OOP vs Procedural?

拥有回忆 提交于 2019-11-26 01:03:55
问题 I would like to learn PHP and want to get an Idea about OOP and Procedural. I read some other blogs and tutorials about OOP vs Procedural but I still can\'t understand the approach. OOP vs Procedural Which I should learn? Whats the difference in code? what are the effects? How can a PHP framework help in OOP aproach? (I would like to learn CodeIgniter) Does procedural need a Framework? I really want to know the code difference of the both, my understanding of OOP is you create a class like