# A Cautionary Tale on Object-Oriented Programming

**URL:** <https://fortran-lang.discourse.group/t/a-cautionary-tale-on-object-oriented-programming/5674>\
**Category:** Uncategorized\
**Created:** [April 26, 2023, 9:55pm UTC](https://fortran-lang.discourse.group/t/a-cautionary-tale-on-object-oriented-programming/5674 "2023-04-26T21:55:16Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [April 27, 2023, 1:58pm UTC](https://fortran-lang.discourse.group/t/a-cautionary-tale-on-object-oriented-programming/5674/17 "2023-04-27T13:58:30Z")

</div>

> [@ivanpribec](#):
>
> … I revisited the problem, forcing myself to think, what is the shortest way of getting an n-stage drying program into my simulation subroutine …

@ivanpribec , @certik, and anyone who doubts the value of OO,

Please note there needs to be a strong cautionary tale against the cautionary tales around the problems with object-oriented programming (OOP).

As alluded to by @rwmsu , OOP must really be the last stage after considerable attention is devoted to object-oriented analysis (OOA) and object-oriented design (OOD). Often the order is reversed, particularly as someone gets enamored by OO given the influence of Java, C++, .NET, etc. and jumps head first into OOP while overlooking entirely OOA and OOD. That is a recipe for trouble.

Separately, note in the context of Fortran and similar statically typed languages, OOA and OOD can really help with **packaging** modular components that can also facilitate easier **concurrent and parallel** executions. A very simple example of this is given [**here**](https://fortran-lang.discourse.group/t/modern-fortran-sample-code/2019/4).

Additionally the modular design of object components via OOA and OOD can help arrive at codes that over the longer term can be easier to maintain and extend.

Bottom-line: there are parallels with architecture with physical spaces and OO where living or working or leisure experiences and functionality and enjoyability and elegance and long-term viability and productivity are achieved by those who can bring sound analyses and innovative designs.

---

_[View the full topic](https://fortran-lang.discourse.group/t/a-cautionary-tale-on-object-oriented-programming/5674)._
