Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning Perl or Java for Object Oriented Programming (OOP) [closed]

Tags:

java

oop

perl

My programming teacher is giving us a decision to make, learn in Perl or Java for object oriented programming, which should we choose and why?

Thanks.


1 Answers

I think you are putting the cart before the horse. The first questions to consider are if you already know a programming language and if you can program well. If the answers are affirmative, you might already be applying some object oriented concepts without being aware of it.

So, your first task is to understand what object oriented programming is about, reading up on encapsulation, polymorphism, inheritance versus composition etc. Once you are comfortable with those concepts, you can adapt to whatever paradigm is facilitated by your language of choice.

Just because Java forces you to treat pretty much everything as an object does not mean all Java programs are automatically good examples of object oriented programming.

Similarly, just because Perl allows you to do crazy things, it does not mean you cannot apply principles of object oriented programming.

For Perl, Moose provides a lot of power. Once you have a grasp of the basics, you should read Moose::Manual::Unsweetened to get a brief overview of both object oriented programming in plain Perl and the sugar Moose provides.

like image 135
Sinan Ünür Avatar answered Aug 24 '26 23:08

Sinan Ünür