Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maths behind Programming Languages

 
Padmarag Lokhande
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have tried googling but could not find an answer to this question.

Relational Databases are based on Relational Algebra.
Do programming languages have any such Mathematical concepts behind them? I know about the formal languages but besides that-
e.g.,Does OOP have any mathematical basis?
[ July 09, 2008: Message edited by: Padmarag Lokhande ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, there is no such basis for OOP.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you could stretch a bit and say that set theory is relevant, especially in a language with multiple inheritance.
 
K. Tsang
Bartender
Posts: 3348
12
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is like asking why does Computer Science undergraduates "must" study discrete math and maybe calculus to balance things out?

Set theory stuff is indeed part of discrete math, along with graph theory, logic etc. Even the a for loop require math especially outputting complex stuff with collections say, which sometime does make me loose count of the index.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the point is that there is no mathematical model for how OO languages work in principle - that is, there is no mathematical model behind the principles of inheritance, polymorphism etc. As a consequence, you can't really apply mathematical theorems to reason about the correctness of your OO code.

This is quite different for other programming languages such as Prolog and many functional programming languages, which have a very strong mathematical foundation.
 
Eric Nielsen
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well most of the formal studies of type systems (which form the basis for inheritance systems) do get to the level of formal proofs. The LSP for instance came out of this kind of analysis...
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does OOP have any mathematical basis?


OOP = object-oriented programming.

"object-oriented" is an adjective that is used to describe the "style" of the programming. It is a design concept. There can be good designs, bad designs, and very bad designs. There are no mathematical principles that can verify if a design is good or better or worse.

Is red a "better" color than orange?
 
Rakesh Chaudhary
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it does ...

Because if you try to design oops examples using UML than it brings on the mathematical concept of flow charting....

Tell me if I am right...
thanks
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me, flow charts are a device to visualize something. I don't know that it's got much to do with maths, or that there is a theory behind them.
 
K. Tsang
Bartender
Posts: 3348
12
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UML or flow charts don't have any math involved. But it does require logic of how the intended program should work (or flow), which is common sense for the person who designs the program.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic