[GSoC-PortA] Interface to specify portfolio object, add constraints, and add objectives

Brian G. Peterson brian at braverock.com
Sun Jun 30 20:07:45 CEST 2013


On 06/30/2013 12:29 PM, Doug Martin wrote:
> I could add a type in the switch statement to specify full_investment,
> active, or dollar_neutral)
>
> add.constraint(portfolio, type="full_investment")
>
> Which way do you think is more intuitive and easier to use?
>
> */[Doug] Option 2 is preferred, as it is simpler and any user will know
> what it means./*
>
> *//*

I agree.  This is more intuitive, at the cost of extra documentation and 
examples.  (min_sum and max_sum will still be available, of course, and 
exact full investment may not happen based on relaxation of constraints 
in any event)

> */P.S. Brian and Guy, I notice that the style “word1_word2” seems to be
> the convention.  I have always preferred “word1.word2” for/*
>
> */easier typing, but have the impression that the use of period instead
> of underscore is frowned upon – e.g., because of difficulties it/*
>
> */causes in some programming languages?/*
>

In R specifically, the period is used for S3 method dispatch.  I also 
prefer periods, but they're frowned upon by most of the R style guides 
unless you're using them as methods for some specific thing.

In practice, I'm not sure it matters.  R's style is so jumbled that 
either works, as long as we're as consistent as we can be.  (file this 
with the preference for camelCase advocated by some, but not all, of the 
R core).

Cheers,

Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock


More information about the GSoC-PortA mailing list