procedural-programming

How do i get out of the habit of procedural programming and into object oriented programming?

Hiya all, I'm hoping to get some tips to kinda help me break out of what i consider after all these years a bad habit of procedural programming. Every time i attempt to do a project in OOP i end up eventually reverting to procedural. I guess i'm not completely convinced with OOP (even though i think i've heard everything good about it...

php file... how to spread my code around

hi, i am writing a web site with a php on the server side. which i have never used before. if i get it right it is procedural programming (which is another thing that i have never done) my question is how to write code: each procedure should be in a different file? to separate it to various files? maybe have one file that receive the...

How to document procedural programming?

In college I learned how to use UML to document OO applications. In the real world I've been tasked with documenting an old procedural program, essentially re-creating the design specification documents that have gone missing. Are there any "standard" documents or methods similar to UML for documenting procedural code? I'm sure there ...

How is code managed before OOP?

The most common issue for non-OOP is: how to prevent conflict of function name when the project becomes extremely huge? For OOP we can simply put the functions into different classes,but what's the approach for procedure programming? ...

OOP vs PP for algorithms

Which paradigm is better for design and analysis of algorithms? Which is faster? Because I have a subject called Design and Analysis of Algorithms in university and have a time limit for programs. Is OOP slower than Procedure programming? Or the time difference is not big? ...

which metric(s) show the difference between object-oriented and procedural code

Which metric(s) could help to indicate that i have procedural code instead of object-oriented code? I would like to have a set of simple metrics, which indicate with a high probability, that the analyzed code contains procedural transaction scripts and an anemic domain model instead of following sound object-oriented design principles. ...

Design Patterns and Encapsulation for Procedural Programming?

I'm working on a fairly large PHP project written in a procedural style (it was written before PHP 5), and I can't help but feel that some of the things I'm doing are a little "hackish." A modification somewhere else can easily break the application. All the design patterns and best practices I've seen seem to only apply to OOP. I cou...

Can someone give me examples of functional programming vs imperative/procedural programming?

Are procedural and imperative the same thing? ...

Unrolling procedural code into SQL

The act of transforming procedural code into SQL has been of interest to me lately. I know that not absolutely everything is expressable in a turing complete procedural language. What if you have a special purpose procedural language though? For instance converting something like this: foreach(var row in Table){ if(row.FirstName=="F...

In non-procedural languages, what specifies how things are to be done?

If you compare C vs SQL, this is the argument: In contrast to procedural languages such as C, which describe how things should be done, SQL is nonprocedural and describes what should be done. So, the how part for languages like SQL is specified by the language itself, is it? What if I want to change the way some query works. ...

Is ORM a problem specific to object oriented programming?

Object-Relational Mapping, ORM is a problem that has to be solved in all applications that is implemented in an object oriented programming language and use a relational database. But isn't the problem the same if you are using structs to map relational databases in C? And tuples/records in a functional programming language? Or am I mis...

oo javascript with properties from server, methods from cache, best practice?

I'm converting procedural JS to OO and would appreciate any help. In a nutshell, what I have is a html-page containing: <script type="text/javascript"> var serverTime='11:32:20'; //time generated by server (php) </script> <script scr="myProcFuncs.js" type="text/javascript"> /* which is containing procedural functions such as fun...

Speed of finite state machines - OO vs procedural

Hey all, I am designing a program that will accept from input a series of tokens and feed them to a finite state machine which I have designed. I have designed a test finite state machine in object-oriented style, with structs for the machine itself and transitions, etc. but the application I am writing is one where speed is very importa...