4

Haskell falls in Functional Programming Paradigm

C in Procedural Programming

C++ in Object-Oriented Programming

Which paradigm does Bash fall in?

  • 3
    See my comment here. It's not really a programming language; it's a utility orchestrator. You may want to investigate another question: why is it that PyShell never really caught on, despite the popularity of Python as a programming language? Answer is, because Python may be a good programming language, but it's a poor utility orchestrator. (Or at least it requires a lot more verbosity for common tasks than Bash does.) – Wildcard Mar 17 '18 at 00:07
  • 3
    Since it has simple functions but no objects, bash is closer to procedural programming than it is to object oriented programming. – John1024 Mar 17 '18 at 00:30
  • Since "Bourne Again Shell" is fundamentally "Bourne shell". From https://en.wikipedia.org/wiki/Bourne_shell "Although it is used as an interactive command interpreter, it was also intended as a scripting language and contains most of the features that are commonly considered to produce structured programs." – ankit Feb 18 '21 at 03:53
  • Also from https://en.wikipedia.org/wiki/Bourne_shell "Stephen Bourne's coding style was influenced by his experience with the ALGOL 68C compiler that he had been working on at Cambridge University. In addition to the style in which the program was written, Bourne reused portions of ALGOL 68's if ~ then ~ elif ~ then ~ else ~ fi, case ~ in ~ esac and for/while ~ do ~ od (using done instead of od) clauses in the common Unix Bourne shell syntax. Moreover, – although the v7 shell is written in C – Bourne took advantage of some macros to give the C source code an ALGOL 68 flavor." – ankit Feb 18 '21 at 03:57

1 Answers1

5

Based on this list it is:

  • imperative rather than functional because it allows side effects,
  • not declarative because it does specify the order in which operations execute (It's not always trivially sequential. Compare < file program and program < file, which do the same thing.),
  • not object oriented because code and data are not grouped,
  • procedural because you can group together code into functions,
  • not logic because it has very little to do with formal logic, and
  • not symbolic because it program manipulation is unheard of in reasonable production code.
l0b0
  • 51,350