What Is a Framework in Programming and Why Is It Useful?
In Software Development, what is a framework and why is it useful? Let’s talk about that today.
The question again was, “What is a framework in programming terms and why is it useful?” Well, consider building, you probably understand a bit of physical building. It’s got framework and that’s the essential supporting structure of that building. So, in programming terms think of a framework as some software that’s already been developed and is used to help you create your own application. So, it’s basically reusable code that provides specific functionality that a you can use in your program.
Basically, the intention of a framework is to avoid you, needing to reinvent the wheel. Now, an example of a framework in Java is the Java Collections Framework. Well, imagine a scenario were you actually need to a sort some names, you’d got a list of names, and a your running in Java. And you want to figure out how do I actually sort those into alphabetical order. Now, you could do it manually, you’d have to figure out how to write the sorting code, how to you know basically come up with a way to sort alphabetically and a after that you’d a have to find a way to a basically write it in such a way that it was very efficient and a, I mean basically in practical terms it wouldn’t be an efficient use of your time. The reason for that is there’s framework out there, there’s code out there that will already write that or already perform that functionality, in this case sorting for you. So, the Java collections from it which I’ve talked about that provides a sort method, very easy method and it’s basically won a lot of code that you call. Which would sort in this case a list of names, but to whatever is the scenario was it will sort them efficiently. So, that’s a basically allowing you to focusing on in order to focus on your program, and not to worry about the low level stuff.
Now, the other thing to keep in mind is that this code, this framework is probably been, well worked on by a number of different programmers. It’s been tested, it’s been optimised so, its probably gonna do a lot more efficient code wise than you can produce yourself, certainly would probably take you any programmer a long time to a basically come up to the level of the code in some of these frameworks, and the Java Collections Frameworks is an example of that. So, you wouldn’t want to be doing that type of code yourself, you want to be focusing on the high level software at high level functionality of your software, and not worrying about this low level stuff.
Keep in mind that a good programmer, not only knows the basic syntax of a programming language, but they also know one or more frameworks as well. So, in Java terms learning the Java Collections framework would be a great thing to add to your resume, and it also makes you a more productive programmer as well.
I hope that helped. If you got any questions feel free to leave a comment and I’ll get back to you.