Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What programming language paradigm fits which job?

Tags:

paradigms

As far as I know (not much I'll admit), the currently popular programming paradigms are Object Oriented (Java, C#, Ruby) vs functional (F#). As someone who is mostly familiar with the first paradigm, I have several questions:

  • Can a programmer simply stick with one paradigm all of his/her life? Or in other words, can all problems be reduced to nails for one hammer?
  • If not, which tool is suited for which type of task? For instance: web-based vs desktop, creating beautiful and responsive interfaces, able to crunch data quickly, etc.
  • Have people ever needed to learn a new paradigm? For my past two jobs, my workplaces required Java and C#. Are there workplaces that specifically use non-OO languages?

Obviously, there are no "best" languages, but I'm wondering whether it's worth the investment of time and energy to learn a new paradigm. Thanks in advance!

like image 351
echoblaze Avatar asked Oct 09 '08 19:10

echoblaze


People also ask

What kind of programming paradigm would you like to follow?

One of the most popular programming paradigms is object-oriented programming (OOP). The core concept of OOP is to separate concerns into entities which are coded as objects. Each entity will group a given set of information (properties) and actions (methods) that can be performed by the entity.


2 Answers

"Or in other words, can all problems be reduced to nails for one hammer?" Yes. Period. Any programming language you are likely to run into will be as complete as all others. There's actually a formal definition of "completeness" for a programming language.

"Have people ever needed to learn a new paradigm?" Always.

There's actually a trick to following the ups and downs of the "paradigm shifts". Over the last 30 years of my career, I've seen that programming has grown from a relatively simplistic imperative/procedural model to a number of much richer models that include a better balance between process and data.

I've noticed the following...

Part of the driving force is the artificial intelligence community. Many of these "new models" started as AI knowledge representation schemes. They got traction there, then they trickled into more mainstream applications.

The Entity Relationship model was originally for knowledge representation, not business transactions. The Object model, similarly, was for knowledge representation. Then the simulation folks found it. Now the rest of us have it.

Here's my conclusion.

Software is Knowledge Representation.

Your choice of Paradigm or Model or Approach or Style is based on the answer to the following question:

"How Can I Best Represent This Problem?"

If the problem has objects and relationships, OO. If the problem has algorithms and transformations, maps, filters and reduces, Functional. If the problem is dynamic, changing and flexible, Dynamic. If the problem is static and will scale up rapidly, Static.

like image 179
S.Lott Avatar answered Oct 21 '22 22:10

S.Lott


It's worth learning alternate paradigms (OO, functional, procedural, dynamic, etc) because it will help you think about problems in different ways.

For example, think about the difference in solving a tree traversal in a linear fashion (the first way I ever did it) versus using recursion. Or Google's combination of Map and Reduce to help them index the internet.

New ways to think applied to old problems can help break some of the hardest issues.

like image 29
warren Avatar answered Oct 21 '22 23:10

warren