16 September 2013

CodeSnip 5 - Proposed Feature Removal

I'm getting on with developing CodeSnip v5 and have been thinking of ditching some features that have struck me as particularly useless. These are all features I haven't used personally since CodeSnip v1.

They are:

  1. The Save Snippet option from the File menu.
  2. The related Copy Snippet option from the View menu.

Before I delete the features I'm looking for some feedback as to whether anyone uses them and can't live without them. If you want to keep them in v5 please get in touch. If I don't hear any howls of protest, the features are going to go!

Let me know what you think either by commenting or sending me a message via my website's contact page.

What follows is a little overview of what the features do.

All these options do is to generate something like the following and either put it on the clipboard or write it to file:

{
 * This code snippet was generated by DelphiDabbler CodeSnip Release 4.8.0 on
 * Mon, 16 Sep 2013 16:53:57 GMT. It is made available on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. The code is used
 * entirely at your own risk.
}

{
  Required unit(s):
    SysUtils
}

function DateQuarterEnd(const D: TDateTime): TDateTime;
  {Gets the date of the last day of the quarter containing a given date.}
var
  Year, Month, Day, Quarter: Word;
begin
  SysUtils.DecodeDate(D, Year, Month, Day);
  Quarter := 4 - ((12 - Month) div 3);
  // get 1st day of following quarter
  Month := 0;
  SysUtils.IncAMonth(Year, Month, Day, Quarter * 3 + 1);
  // required date is day before 1st day of following quarter
  Result := SysUtils.EncodeDate(Year, Month, 1) - 1.0;
end;

There's also the Edit | Copy Source Code option that just put the actual snippet source on the clipboard:

function DateQuarterEnd(const D: TDateTime): TDateTime;
var
  Year, Month, Day, Quarter: Word;
begin
  SysUtils.DecodeDate(D, Year, Month, Day);
  Quarter := 4 - ((12 - Month) div 3);
  // get 1st day of following quarter
  Month := 0;
  SysUtils.IncAMonth(Year, Month, Day, Quarter * 3 + 1);
  // required date is day before 1st day of following quarter
  Result := SysUtils.EncodeDate(Year, Month, 1) - 1.0;
end;

So, all the first option adds is to list the dependencies in comments (which you can get in more details from the program's View | Dependencies menu option) and some disclaimer.

Over to you.

3 comments:

shlomo abuisak said...

In my Opinion if a feature is there
why take it out?
It is no heavy?
See all those "MS word/excel" features who need theme and they are
still there.

BillSTP said...

I have to admit I haven't had the occasion to use the features yet but they do seem like they could be useful at times.

DelphiDabbler said...

OK

I'll leave 'em in. They're not "heavy" but may have to be frozen (i.e. may not be able to relate well to new features).