Why should the principles of object oriented programming in developing application? To be answered from user's perspective [closed] - oop

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I recently was asked this question in an interview and would like to hear the answer from you people.
I discussed about code resuability and security that can be achieved by encapsulation and inheritance but the interviewer did not seem satisfied.
He insisted on how exactly an application user is benefited by using applications developed on the principles of oop.

Depends. Purists (and morons) will apply abstraction to every possible bit of code they generate or come across. This is completely unnecessary in something as simple as a direct, simple MySQL call from within a tiny bit of PHP, to log site accesses, for instance.
However, generally OOP can save you plenty of cycles if applied systematically to big data involving lots of information shuffling, like sorting hundreds of rows of data on every page access. It's a matter of when to use OOP and when to just write procedural code. OOP takes time and effort and is maintainable by experienced programmers, but you need to ask yourself if it is worth all that extra hassle on a tiny snippet of code that does one thing internally.
There are plenty of good articles out there (http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/) that help you to understand WHY OOP is sometimes unnecessary and in fact harmful.

Related

Program overloading? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have this project that has functions to load different chapters of a book. (Ex. loadChapter1)
My thinking was that I will call the functions to load up every chapter when the app launches. But by the time I am done with the program, there would be a huge amount of chapters. It's only loading up lots of NSStrings.
Would that make the program slow to initialize or even crash the program?
My functions are declared in AppDelegate.h using ( -(void)loadChapter1 ). The way I call it in AppDelegate.m is using [self loadChapter1].
If this is not a good way, this there any other way to do this?
You're better off trying something, seeing if it works well, then making changes (and possibly asking questions here) if it doesn't rather than asking a question like this at the outset. For performance questions in particular, the accepted wisdom is that you shouldn't worry too much about performance (memory and CPU usage) while initially writing a program, but rather should do performance optimizations as needed after you've got the program working.
That said, my first approach to this would be to load each chapter as it's requested. So, don't load all the chapters in the book every time the app launches. Rather, load a chapter when the user turns the page to that chapter or selects it in the table of contents (or whatever applies to your app). That way, you don't waste time and memory loading chapters that before they're actually going to be used.

How could we experience the power of object oriented programming in procedural language? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
As we know that the Object oriented programming language has lots of benefit.But in same implementation procedural language like C do not have any alternative like realtime applications. So can we combine the power of two to create a great application?
Can we experience the major pillars of OOPS in procedural language?
Nearly all general-purpose languages are Turing equivalent. This means -- among other thing -- that anything you can dream up in one language, you can implement in another. So yes, it's possible, though it isn't enforced by the compiler as strictly as an OOP zealot might like.
Consider C's FILE type (used by fopen, fread, fwrite, etc). It's not specified what exactly is in there, and you don't need to know or care (read: encapsulation); all you have to know is, you can fopen you a file, fread/fwrite it, and when you're done, you fclose. Thing is, that "file" can be anywhere -- at the root of the FS, in your homedir that's on a whole other drive...in most OSes, it can even be a pipe or a network socket (read: polymorphism).
Basically, the funnest parts of OOP. And we didn't say "class" even once. :)

Are object oriented languages more powerful than declarative programming languages [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Are object oriented languages more powerful than declarative programming languages? By powerful I mean are they able to solve a class of problems that any program written in a declarative programming language can't?
Personally I don't think so. There exists a set of problems for which it is easier to write a program using an object-oriented language, but I think those problems could be solved using declarative languages too (albeit it might be harder to so)
Would like to hear more views on this one.
Go read up on Turing completeness. It basically means any turing complete language can solve any problem a turing machine can.
And most languages are turing complete. (I doubt you'd ever use a non turing complete language).
Alternatively you can think of it as you can solve any problem with Ook! even though it's a very silly language.

Architecture behind large-scale social sites like Twitter - help with a new startup. [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I apologize in advance for this not being a specific programming question, but I believe this is the best place for such an inquiry.
Basically, I have an idea for what I believe to be an interesting social networking site (not just a clone of existing things, but something useful and unique); I have a detailed specification document describing how everything works, but I'm not sure how best to proceed from here. Architecturally, it seems like it would be most similar to something like Twitter, and I have some idea of what technologies are involved in this (SQL database, ajax, mobile integration, etc.). I do not have the time to code everything myself, and honestly some of it is likely beyond me. So, I suppose my pool of questions is something like this:
Assume I am non-programmer with a legitimately good idea for a new and large-scale social networking service, similar (in architecture) to Twitter, and some capital to make it happen:
How do I proceed?
What is the architecture behind a site like Twitter and what technologies does it use? How do I find people with experience building these types of systems for consulting/development purposes?
Are there any initiatives (government or otherwise) that can help me in such a start-up endeavor?
I appreciate any help you can offer. Thanks, and again I apologize for the broadness of this question.
The High Scalability blog ( http://highscalability.com/ ) periodically describes the architecture of major sites. Browse through archives there to get a feel for how they get built.

Why Pex is not massive [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Hi there: I was looking at a few videos, etc and I just cant help but wonder why Pex usage seems to be so low?
Are there any problems that are not obvious, or is it just a licence issue?
It's a very new tool and to work really well you need to use Code Contracts as well. It also catches a lot of issues like possible integer overflows that a lot of developers think they can just ignore. Pex is amazing and will take off eventually but it has a learning curve so it's going to take some time to percolate through the .Net ecosystem.
I've used it on a few new development projects and it has saved me two major bugs (not caught by normal unit tests) that would have taken at least a week to track down and fix normally plus a few smaller issues so I'm a big proponent of Pex. That said it takes a lot of work to get it producing good results on an existing code base of any size so how cost effective it is will need to be determined on a project by project basis.