Serving the Quantitative Finance Community

  • 1
  • 2
  • 3
  • 4
  • 5
  • 15
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 22nd, 2014, 10:17 am

QuoteAnyway, I'm now trying simple things and test if I can make it work with irreducible and orthogonal concepts. I'm also paying a lot of attention to form and eliminating unnecessary specific choices that cannot be motivated. To me it's a bit like physics, what are the elementary particles, what's noise, what can cause problems? How about concept map, concepts and link?
Last edited by Cuchulainn on May 21st, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 22nd, 2014, 12:03 pm

QuoteOriginally posted by: outrunyes, that's perfect!You're welcome. I alway like to use them to focus my attention areas. It help to separate the focus from the (lower-level) noise.My guess is orthogonal concept ~ trait? Maye the links could be like function objects calls or sumpin'
Last edited by Cuchulainn on May 21st, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 22nd, 2014, 6:50 pm

dubble
Last edited by Cuchulainn on May 21st, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 22nd, 2014, 6:52 pm

QuoteOriginally posted by: outrunRegarding orthogonality, I found this that makes a clear point:QuoteThe meaning of an orthogonal feature is independent of context; the key parameters are symmetry and consistency.An example from IBM Mainframe and VAX highlights this concept. An IBM mainframe has two different instructions for adding the contents of a register to a memory cell (or another register). These statements are shown below:A Reg1, memory_cellAR Reg1, Reg2In the first case, the contents of Reg1 are added to the contents of a memory cell; the result is stored in Reg1. In the second case, the contents of Reg1 are added to the contents of another register (Reg2) and the result is stored in Reg1.In contrast to the above set of statements, VAX has only one statement for addition:ADDL operand1, operand2In this case the two operands (operand1 and operand2) can be registers, memory cells, or a combination of both; the instruction adds the contents of operand1 to the contents of operand2, storing the result in operand1.Ah VAX/VMS. Many memories.Polter,What about orthogonality and multimethods?(BTW orthog not work on VAX quadword).
Last edited by Cuchulainn on May 21st, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 23rd, 2014, 7:17 am

QuoteAnyway, the design could be very similar: we have operands like stochastic processes and financial instrument, and an instruction to compute the price. So, you want to use hardware as a metaphor/basis for software systems?
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 23rd, 2014, 9:55 am

QuoteOne of the OO misunderstandings is that the data and the functions that operate on them should be bundled togetherNot a misunderstanding, encapsulation is a central of OOP.What you probably want to say is that it has negative consequences. Yes, indeed. For example, a circle in 2d geometry has a centre point and radius, so OOP is optimal here. Circles will never change.Quote11's (NonMem): sort(begin(vector), end(vector) );This is functional programming style.Now, they tried this approach in AutoCAD (and Autolisp) but the CAD objects were missing an they went to C++ classes and this was better. Just sayin' _every_ design has it own payoff...
Last edited by Cuchulainn on May 22nd, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 23rd, 2014, 10:04 am

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOne of the OO misunderstandings is that the data and the functions that operate on them should be bundled togetherNot a misunderstanding, encapsulation is a central of OOP.What you probably want to say is that it has negative consequences. Yes, indeed.No, I'm saying1) it has positive consequences (orthogononality, reuse, functional extendibility) 2) bundled data with functions that operate on them is often contra-encapsulation.???Are you referring to OOP? If yes, then 2) is not correct IMO. (maybe a crosspost here). -->QuoteIn programming languages, encapsulation is used to refer to one of two related but distinct notions, and sometimes to the combination[1][2] thereof:A language mechanism for restricting access to some of the object's components.[3][4]A language construct that facilitates the bundling of data with the methods (or other functions) operating on that data.[5][6]Some programming language researchers and academics use the first meaning alone or in combination with the second as a distinguishing feature of object-oriented programming, while other programming languages which provide lexical closures view encapsulation as a feature of the language orthogonal to object orientation.
Last edited by Cuchulainn on May 22nd, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Modern & Effective C++ design ideas

May 23rd, 2014, 10:10 am

QuoteThe OO CAD objects you often refer to .. "Is a square a specialisation of a polygon?" etc. that's a wrong question.VERY WRONG. Too many C++ 90s' books with naffy CAD examples.I would never say this (and never have) since I wrote a production CAD library in C++ and C# starting in 1990. A square is a role, not a class and certainly not ISA. HAS A is better.
Last edited by Cuchulainn on May 22nd, 2014, 10:00 pm, edited 1 time in total.