473,322 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Re: Compressing syntax/code, a testcase

On May 6, 10:22 am, dizzy <di...@roedu.netwrote:
[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.

There is a time when one can program too generically.

Jun 27 '08 #1
1 1447
Christopher wrote:
On May 6, 10:22 am, dizzy <di...@roedu.netwrote:
[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

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
12
by: Paul Moore | last post by:
One of the things I really dislike about Unittest (compared, say, to a number of adhoc testing tricks I've used in the past, and to Perl's "standard" testing framework) is that the...
3
by: Jan Decaluwe | last post by:
I'm working on a unit test for a finite state machine (FSM). The FSM behavior is specified in a dictionary called transitionTable. It has a key per state with a tuple of possible transitions as...
0
by: Yuancai \(Charlie\) Ye | last post by:
Hi, All: I am happy to annouce that we have formally released our latest SocketPro version 4 at www.udaparts.com, an advanced remoting framework written from batching/queue, asynchrony and...
2
by: Johnny Lee | last post by:
Here is the source: #! /bin/python #@brief This is a xunit test framework for python, see TDD for more details class TestCase: def setUp(self): print "setUp in TestCase"
3
by: Bruce Cropley | last post by:
Hi all I'm trying to generate test methods in a unittest TestCase subclass, using decorators. I'd like to be able to say: class MyTestCase(unittest.TestCase): @genTests(, , ) def...
29
by: Gernot Frisch | last post by:
Hi, I have no clue. - I want to align the red, green, blue boxes in one line - red,green,blue must be 45px high - red (center) must be as wide as possible - yellow must start exactly below...
8
by: David N Montgomery | last post by:
class testCase: def __init__(self, tc): if tc == 1:self.testCase1() if tc == 2:self.testCase2() if tc == 3:self.testCase3() if tc == 4:self.testCase4() if tc == 5:self.testCase5() if tc ==...
1
by: dizzy | last post by:
James Kanze wrote: Correct, the char const* uses are very few to worth those versions. Good idea, in my case the code is to be used only on POSIX systems but I'll keep that in mind because...
1
by: Gustavo Narea | last post by:
Hello, everyone. Why do unitest.TestCase grand-grandchildren not work? I've created a unittest.TestCase descendant, which contains the setUp() and tearDown() for testing some components of a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.