advantages of object –oriented programming methodologies as compared to the functional programmin?
341242
Encapsulation; polymorphism and inheritance.\n\nEncapsulation lets you contain your data in objects that somewhat mirror 'real' objects.\nCustomer1 = new Customer (you would then populate your customer with public and private fields; perhaps everyone can see the public field that is the name of your customer; but the Customer object could also contain private fields; containing perhaps passwords and what that customer bought.) Encapsulation allows for data hiding; only other classes that have the correct permissions may access appropriate data. For example; another class that sends bills to your customers would also need to see the private data from the customer class. The data and methods that act on that data being enclosed in the methods allow you to change your class with little concern to the other classes that use the class you want to change. As long as you provide the same methods; the other classes will still be able to use the new class. The methods can also be either public or private; perhaps you want any class to be able to change the customer's phone number; but you would want to be more careful perhaps about changing the amount they owe. \n\nPolymorphism allows you to change your classes as required by using different input and output data; different types of data can use the same class. For example, a class could be written to print something; and can act differently if it is passed a string or a number. This allows you to use a class to do similar things with different types of data. It allows for the calling classes to be less concerned about what type of data you have; and more with what you want to do with that data.\n\nInheritance allows you to create new classes from existing classes. You could extend your Customer class by making a new HighSpendingCustomer. This new class would provide the same basic data and methods as your regular customer; but you could also add some new functionality to be more appropriately deal with the high-value customers. The new class would inherit the same functionality. This is often seen called 'is a' relationship. As in HighSpendingCustomer "is a" Customer; meaning that HighSpendingCustomer inherits from Customer.\n\nThe advantages of these are that they typically allow for easier code reuse (your customer class could be moved to a new application with little or no modification); easier to maintain (if you have a problem with a class; you can just change that class rather than dig through a huge program trying to find all occurances of a problem). As well; the classes tend to be smaller bits of code; it makes it easier to read and understand.\n\nThat's the 2 minute intro; hope it provides some value.
1170856
Object oriented language means programming using objects. An object is the instance of a class. Not all languages are object oriented (for example C, Ada, Cobol, Fortran but fortunately there are few people that still use them).\nThe main difference between a OOP and a procedural language is that when working with objects you can control every method for it, restrict acces to it's components, inherit pre-build class components, while in procedural language this is imposible!
159988
If J2EE was as bad as you think it is, why is it so widely used? Answer: it's not.\n\nIt's been a very long time since this technology could be accused of being generally inefficient. JIT and adaptive in-time compilers can actually recompile byte-code into assembley during runtime depending on how it's currently being used. This can produce faster execution in certain cases than C or C++.\n\nMost of the pain comes from starting the runtime, in an enterprise environment this is not an issue.\n\nPS. Remember it's just a specification. If you want to do Java just like C# (ie. compiled and ready to go as a binary), take a look at http://gcc.gnu.org/java/
433146
The difference between "programming" and "scripting" is better defined by usage, or application, as well as scope and purpose. A programming language is used for building standalone projects, or "applications"; a scripting language is used to write "scripts" that interact with other data or systems to perform parts of a task rather than an entire workflow.\n\nAn example might make this clearer. Imagine an accounting application program used in a large corporation. The program would be written in a programming language by a team of developers, probably at some other company, a software house. It would have a long lifecycle, and have many features. One of them might be to generate a series of invoices. This would be one of many tasks done with the program, which runs for extended periods of time. But it might be necessary to separate the invoices, sending some to a printer in the mail room, others to a fax machine, and still others to be sent via email. This task might be accomplished by a local programmer, who writes a simple "script" that sorts through the accounting program's output files and dispatches them appropriately. That little snippet of local, customized programming would be a script, written in a scripting language. The script would be started, perform its one task, and stop.\n\nProgramming languages are used to write programs, which can run for a while and do multiple things.\nScripting languages are used to write scripts, which run for a short duration to perform a single, simple task.\n\nOf course, there are applications programs that have been cobbled together out of collections of scripts, and there are programmers who use a traditional programming language to write a full-blown program to erase a file, but the general sense of the range of usages should now be clear.\n\nSome languagees such as Perl or Visual Basic can be used for both kinds of task, and therefor can be characterized as one or the other.
116814
No, it doesn't improve the method's performance but only substracts a hidden argument from the list. \n'static' is a semantic construct, by which you mean that a certain method belongs to the class, or it doesn't need internal data to deal with.\n\nOn the other side, if you care about 'calling' performance (again, not the performance of the method itself) then consider not using virtual methods unless really necessary. That should decrease calling overhead (virtual calls go through a vtable) a tiny little bit, which makes sense for functions that are called inside loops or the like.
191514
Let's call this practice class-specific import. So say \njava.util.Date;\ninstead of\njava.util.*;\n\nThis is hardly optimization. It is for human reading only. It is not useful, especially if you use a good IDE. Eclipse, for example, can automatically expand imports. It can also collapse imports so they are not in your way. You are very unfortunate if you have to read the import statement to figure out what the code does.\n\nOnce the code is compiled, all classes are resolved and however the imports are organized makes no difference. at runtime, there are only fully qualified classes.
620566
Yes. It is similar. However, OOP has built in support for DE, DA, PM, and so on. You can simulate it in traditional programming methods. You get to see that OOP is supported by OOP languages and tradionational languages can be used to simulate OOP.
7389
There are many, but if I had to pick one, it's the support for generics. That's much like C++ templates (classes or methods that you can customize what types they work with -and other parameters- the moment you need to use them), only they get compiled into intermediate language only once.
98158
OOP languages have extra language features - e.g. encapsulation, polymorphism, and inheritance are object behaviours that don't have a direct procedural equivalent.\n\nFor making setup files, there are commercial solutions like InstallShield, but for free, consider NSIS: http://nsis.sourceforge.net/Main_Page
86041
Well, huh.  \n\nOkay, let's say we're making a dog simulator with OOP.  So we might have various "objects" in the game in order to give structure to our program; in this case, "dog" could be a primary object.  But anything that exists in our program would also be an object -- street, fire hydrant, owner, leash, policeman, etc.\n\nOur dog object will have various properties, methods, and events.  Properties are things that describe the object (possibly uniquely), methods are things the object can actually do, and events are things that can happen to the object that it can respond to.  For example, "color" might be a property, "smell(something)" might be a method, and "owner picks up leash" an event.\n\nA constructor is simply the most basic method for any object that actually creates a new unique object.  In this case anytime we define a new dog object we will call the constructor for that object, in which we might set some default properties (ie set color = "black") and call some methods to establish the object within the program framework.  For example, we might use a constructor to register the new dog object in the list of possible "encounter" events that can happen to other dogs.\n\nObviously this is a very basic introduction. The best way to familiarize yourself with OOP is to design a few very very basic programs -- let's say a program that runs a mouse through a maze.  Imagine all the objects, all the properties for those objects, all the methods those objects will have to do, and all the events the objects will have to respond to, and write them all out.  \n\nThen program something yourself in your favorite programming language and find out all the things you forgot to include  :)
311473
Advantages of ASP.NET over ASP:\n\nCompiled code means applications run faster with more design-time errors trapped at the development stage. \n\nSignificantly improved run-time error handling, making use of exceptions and try-catch blocks. \n\nUser-defined controls allow commonly used templates, such as menus. \n\nSimilar metaphors to Windows applications such as controls and events, which make development of rich user interfaces, previously only found on the desktop, possible. \n\nAn extensive set of controls and class libraries allows the rapid building of applications. \n\nASP.NET leverages the multi-language capabilities of the .NET CLR, allowing web pages to be coded in VB.NET, C#, J#, etc. \n\nAbility to cache the whole page or just parts of it to improve performance. \n\nAbility to use the "code-behind" development model to separate business logic from presentation. \n\nIf an ASP.NET application leaks memory, the ASP.NET runtime unloads the AppDomain hosting the erring application and reloads the application in a new AppDomain. \n\nSession state in ASP.NET can be saved in a SQL Server database or in a separate process running on the same machine as the web server or on a different machine. \n\nThat way session values are not lost when the web server is reset or the ASP.NET worker process is recycled. \n\n\nDisadvantages to other platforms:\n\nThe server framework runs natively on Microsoft IIS 5.0 or higher and Cassini, a web server developed in .NET (shipped with WebMatrix, a free ASP.NET 1.1 development environment, and Visual Studio 2005); however it can run on Linux on any of the alternative frameworks based on the ECMA standard. The most well known one is Mono Project, a free/opensource framework. \n\nPrevious versions of ASP.NET (1.0 and 1.1) were criticized for their lack of standards compliance. The generated HTML and JavaScript sent to the client browser would not always validate against W3C/ECMA standards. In addition, the framework's browser detection feature sometimes incorrectly identified web browsers other than Microsoft's own Internet Explorer as "downlevel" and returned HTML/JavaScript to these clients that was crippled or broken. However, in version 2.0, all controls generate valid HTML 4.0, XHTML 1.0 (the default), or XHTML 1.1 output, depending on the site configuration, detection of standards-compliant web browsers is more robust, and support for Cascading Style Sheets is more extensive. \n\nWhile ASP.NET 2.0 now produces markup that passes validation, it is debatable as to whether it increases accessibility (one of the benefits of a semantic xhtml page + css representation). Several controls (Login controls in particular, but also the new Wizard Server Control) use html tables to layout components which can confuse screen readers. Extensive use is also made of "inline" css rules (e.g. in the Calendar Server Control) which makes it impossible to fully separate content and styling.\n\n\n\nAlso check out:\nhttp://www.asp.net/whitepaper/whyaspnet.aspx?tabindex=0&tabid=1
726598
PHP has been around since 1996, which is longer than, for example, .Net, so if anything is new and untested,  it is in fact .Net.  Ruby on Rails?  Nice toy, but does it work in production?  I am not saying it doesn't, but so far no one tried it. \n\nPHP, with its simplicity and possibility of avoiding object-oriented programming, is ideally suited for software development by a domain expert, rather than a programmer, which is what the future is going to be all about. Programming is quickly becoming a skill, rather than an occupation, very much like driving or typing; a lot of people do it, but for most, it is either not a job at all or just a part of a job.  And this, I believe, is the answer to your question: if you want a secure career, forget programming.  Professional programmers are going the way of professional typists, into oblivion.  There will always be a few niches for professional programmers (someone will have to develop operating systems, development tools, hardware drivers, embedded software, etc.), but application programming, especially on the Web, will eventually be taken over by domain experts...
740133
As a procedural programmer (which I'm only assuming you are; you may already be doing object-oriented programming), you may need to familiarize yourself with the basics of object oriented programming first.   \n\nI would suggest borrowing or buying a book on the object-oriented paradigm (you can find all sorts of OOP books on Amazon)  to familiarize yourself with the concepts.  \n\nThen, go to Sun Microsystems http://www.sun.com and download NetBeans 5.5, which is the Java IDE.  Sun also has plenty of tutorials on its site, and they are hierarchically organized as to skill level so that you can jump in wherever you feel most comfortable. \n\nGood luck!
161388
The idea is to equate a "programming object" to a "real world object."  Using a very simple and probably useless example (don't know how to indent here, code looks a little screwy):\n\nclass apple :\n  color = 'red'\n  def get_color(self) :\n    return self.color\n\nSo you could create an apple object & get its color:\n\na = apple()\nprint a.get_color()\n\nSlightly more useful might be a Person object for an address book, for instance:\n\nclass Person :\n  def get_address(self):\n     ...\n  def get_phone_number(self):\n     ...\n  def get_name(self) :\n     ...\n  def get_age(self) :\n     ...\n\n#blah blah blah\n\nSo, Object Oriented programming is mostly just a way to organize your program so classes (i.e. objects) resemble real objects.  This is very handy for keeping code maintainable.\n\nThere are more advanced Object oriented concepts, such as polymorphism and inheritance, but it's easier you to google them than for me write out examples :)
1011376
Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes the definition of functions, in contrast to imperative programming, which emphasizes changes in state and the execution of sequential commands.\n\nhttp://en.wikipedia.org/wiki/Functional_programming_language\n\n\nIn computer science, imperative programming, as opposed to declarative programming, is a programming paradigm that describes computation in terms of a program state and statements that change the program state. In much the same way as the imperative mood in natural languages expresses commands to take action, imperative programs are a sequence of commands for the computer to perform.\n\nhttp://en.wikipedia.org/wiki/Imperative_programming
418804
I'm a bit rusty with BASIC but both of them look ok (assuming the syntax is good).\n\nThe second one is more efficient because of the FOR loop.\n\nIf you always need to calculate the average for 6 students then you don't need to prompt for the number of students, although it does make the program more useful.
22610
Proponents of OOP claim [...] that OOP approach is often simpler to develop and to maintain, lending itself to more direct analysis, coding, and understanding of complex situations and procedures than other programming methods (Wikipedia)\n\nAs far as I can see OOP not only makes it easier to create abstract domain models, OOP paradigm has lead to understanding that some decisions are more effective and can be videly reused (so-called design and architectual patterns). Being familiar with a wide range of patterns gathered&developed by best practitioners and scientists you won't have to reinvent a bicycle each time.