Forums  > Software  > How to build a software library?  
     
Page 1 of 1
Display using:  

pj


Total Posts: 3305
Joined: Jun 2004
 
Posted: 2016-10-21 16:47
I explain myself.

There exists an internal language which is used for building
structured deals, their pricings, reports and what not.
It does support objects, inheritance and composition.

The goal is to create a reusable library of templates of various
deals.

Have spent some time on googling, I still have a question.

What principles should one obey in order not to step on the
same old rakes?

How the library should be structured?
How deep should the object hierarchy go?
What should be an object?
How to name the things?
etc, etc

It is quite an open ended question, and I am sure, I am missing
some salient points.
But could anybody share some info on that?
Books, examples, etc?


I saw a dead fish on the pavement and thought 'what did you expect? There's no water 'round here stupid, shoulda stayed where it was wet.'

chiral3
Founding Member

Total Posts: 4978
Joined: Mar 2004
 
Posted: 2016-10-21 17:18
Poor planning in these areas have been the bane of my existence at times. I use the adage "measure twice and cut once". You really need to think about the most primitive elements you'll need for building in the future so that code is re-usable, scalable, extensible, etc. Rigorous dev and and a hub-and-spoke prod. Don't forget data. I am a huge fan of centralized, curated data. This reduces costs, eliminates duplication of sourcing, and eliminates people making mistakes learning about new data. As data is curated I'd suggest a wiki or something similar to describe the data, esp if there is stored procedures that transform the data. Separate the math / quant guys that prototype their model development and quant dev who are responsible for producing the best structured code. I've spent thousands of hours over my career planning these things and where I didn't plan well enough I spent twice as much time unfkucing my situation.

Nonius is Satoshi Nakamoto. 物の哀れ

pj


Total Posts: 3305
Joined: Jun 2004
 
Posted: 2016-10-21 17:34
Thank you,
could you supply some references?
> "measure twice and cut once"
The adage is so true...

I saw a dead fish on the pavement and thought 'what did you expect? There's no water 'round here stupid, shoulda stayed where it was wet.'

Maggette


Total Posts: 929
Joined: Jun 2007
 
Posted: 2016-10-21 17:43
Hi,

I asked myself these and other questions 1.5 years ago. And I don't claim that I have found answers that work for myself, let alone others, for all of these questiosn.

A lot of these thing depends in parts on your language and the use case of your API.

I think I have learned a lot from existing libraries. Look at some of the scientific computing/numerical stuff. And some of the more business oriented frameworks (like Apache Camel). It is intetesting hwo different they are organized. This implies to me that there might not be a single truth.


Ich kam hierher und sah dich und deine Leute lächeln, und sagte mir: Maggette, scheiss auf den small talk, lass lieber deine Fäuste sprechen...

EspressoLover


Total Posts: 205
Joined: Jan 2015
 
Posted: 2016-10-21 21:52
I'd recommend picking up a copy of Code Complete, which is pretty much the flagship text on software architecture. If you have time after that I'd read The Pragmatic Programmer and Clean Code.

Finally, a piece of tangential advice. If possible I'd write as much of the library *not* in your firm's internal language. If you can, put as much logic as possible in some major language(s), e.g. python, Java, etc. Then just keep the internal language interfaces as close to a thin wrapper as possible. Finance's strange obsession with internally developed languages is one of the worse cultural pathologies of not-invented-here syndrome. I say this for a number of reasons.

Major languages will have much fewer bugs and better documentation, so it's less of a brainfuck when you're chasing down some bug you can't figure out. They have much better libraries and tooling. If you need to do X, you may just be able to import a python module, rather than building basic functionality in the internal language. Finally major languages are going to have long-term support. Python isn't going anywhere, and updates and patches will be continued to be released until the sun burns out.

katastrofa


Total Posts: 350
Joined: Jul 2008
 
Posted: 2016-10-21 23:50
Python 2.7.x is close to EOL.

pj


Total Posts: 3305
Joined: Jun 2004
 
Posted: 2016-10-22 09:19
EspressoLover,
Thank you for Code Complete.
That looks like precisely what I need in my current state of knowledge.

Thank you, gentlemen (alas, gentlemen only) for your input.
On the Python vs internal language, believe me,
it is a political mine field.

I saw a dead fish on the pavement and thought 'what did you expect? There's no water 'round here stupid, shoulda stayed where it was wet.'

dude


Total Posts: 1
Joined: Mar 2014
 
Posted: 2016-10-22 15:59
Hello,

I think this API design manual written by the people who developed the Qt GUI library is useful.
http://people.mpi-inf.mpg.de/~jblanche/api-design.pdf

It is focused on C++ but has a lot of good general advice.

Quoting the introduction:
• Easy to learn and memorize
• Leads to readable code
• Hard to misuse
• Easy to extend
• Complete

pj


Total Posts: 3305
Joined: Jun 2004
 
Posted: 2016-10-22 17:45
Thank you, dude!
Precisely what I need.

I saw a dead fish on the pavement and thought 'what did you expect? There's no water 'round here stupid, shoulda stayed where it was wet.'

sv507


Total Posts: 165
Joined: Aug 2010
 
Posted: 2016-10-24 12:49
pj

could you clarify what you mean by 'internal language'?

I assumed you meant a 'payoff description language' eg theta payoff description language

this has clearly different requirements to a programming language such as python...


pj


Total Posts: 3305
Joined: Jun 2004
 
Posted: 2016-10-24 13:18
Hi sv507

No, it is not the payoff description
(thank you for the link, by the way!)

It's ... complicated.
For the argument's sake it is more like a variant of (simplified) C#.

I do think that for time being I simply need to digest the
info I was supplied in the thread.


I saw a dead fish on the pavement and thought 'what did you expect? There's no water 'round here stupid, shoulda stayed where it was wet.'

ddrdouble


Total Posts: 45
Joined: Nov 2006
 
Posted: 2016-10-24 18:13
been through the same kind of questions
i have not found many books valuable just some ideas here and there.


Which asset class are you looking at? i can give some feedback on IR less for other classes.


katastrofa


Total Posts: 350
Joined: Jul 2008
 
Posted: 2016-10-25 00:03
Old but still relevant

pj


Total Posts: 3305
Joined: Jun 2004
 
Posted: 2016-10-25 10:14
@drdouble
Absolutely, I would love to hear your thoughts.

I saw a dead fish on the pavement and thought 'what did you expect? There's no water 'round here stupid, shoulda stayed where it was wet.'

pj


Total Posts: 3305
Joined: Jun 2004
 
Posted: 2016-10-25 10:58
The book looks very interesting.
The large scale library would be
an exaggeration though.

I saw a dead fish on the pavement and thought 'what did you expect? There's no water 'round here stupid, shoulda stayed where it was wet.'

katastrofa


Total Posts: 350
Joined: Jul 2008
 
Posted: 2016-10-25 13:51
OK. Whatever you do, don't do another QuantLib.

ddrdouble


Total Posts: 45
Joined: Nov 2006
 
Posted: 2016-10-25 16:11
Ok, if you want to start with some things like naming, interface design, abstract class vs. interfaces, etc. , then take a look at this book:

Framework Design Guidelines by Cwalina, Abrams.

especially useful if you have C# as a programming language or something related.
Although this is only for general programming design.

chiral3
Founding Member

Total Posts: 4978
Joined: Mar 2004
 
Posted: 2016-10-26 13:29
Sorry, pj, didn't see your question. I don't have any references apart from my experience making mistakes while running global operations through the years, keeping what works, and stealing ideas from 3rd party solutions. The books on my shelves are no different any one else's. I will say that I've borrowed quite a bit, ideologically in terms of functionality, from my time working at JPM many moons ago, software including FINCAD, front office systems such as murex, the old sophis, calypso, FO and MO systems such as Charles River, etc.

Nonius is Satoshi Nakamoto. 物の哀れ
Previous Thread :: Next Thread 
Page 1 of 1