Re: Compressing syntax/code, a testcase
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Compressing syntax/code, a testcase         

Group: comp.lang.c++ · Group Profile
Author: dizzy
Date: May 7, 2008 00:48

Christopher wrote:
> On May 6, 10:22 am, dizzy roedu.net> wrote:
> [snip]
>> How do you people solve similar issues?
>
> Coding standards per project.
> i.e
> All code in this project will use exceptions for error handling.
> All text parameters will be in the form of const char * ( a string can
> always call c_str() )
>
> Design decisions
> i.e
> Permissions are a parameter or they aren't.
> If a directory exists, no operation is performed.
>
>
> Trying to cover every combination is a wasted and bloated effort IMO.
> You cannot cater to everyone, but you can be consistent.
> Spending too much time and providing that many options for something
> as simple as making a directory would get me fired.

But mkdir(2) is a low level, common need that for sure will be needed for
almost any other project and I intend to reuse as much code as possible
(not have to rewrite mkdir for every different project because it has other
coding style or design decisions). For mkdir needs I would have used
boost::filesystem::create_directory if that supported privileges on
creation (to avoid an addition chmod system call).
> There is a time when one can program too generically.

I might have reached such a time but the code I write I intend to reuse in
any possible project that would need something like mkdir so I need alot of
flexibility from it and (as any library code) to achieve the "do not pay
for what you don't need" design principle.

--
Dizzy
no comments
diggit! del.icio.us! reddit!