答:
Use #4,

```<code>IsMyFileDeleted := DeleteFile(MyFilePath);
</code>```

Or possibly, since this is Delphi,

```<code>IsMyFileDeleted := false;
try
   IsMyFileDeleted := DeleteFile(MyFilePath);
except
   ...
end;
</code>```

If you want to be properly paranoid about it, if you are concerned an exception might be thrown.  I dont think you are achieving anything in the other options other than making simple code unnecessarily complicated.

Title: Functions with side-effects in Delphi/Pascal

Body:
What is the proper approach to functions that have side-effects in Delphi/Pascal?

For example, I could have a boolean function DeleteFile that returns True if the file was deleted and False otherwise. How do I collect the return value?

1) The very explicit form would be:

```<code>if DeleteFile(MyFilePath) then
begin
  IsMyFileDeleted := True;
end;
else
begin
  IsMyFileDeleted := False;
end;
</code>```

2) Less bulky would be:

```<code>IsMyFileDeleted := False;
if DeleteFile(MyFilePath) then
begin
  IsMyFileDeleted := True;
end;
</code>```

3) Or even shorter, but discouraged by JEDI - perhaps it is acceptable just to collect return values:

```<code>IsMyFileDeleted := False;
if DeleteFile(MyFilePath) then IsMyFileDeleted := True;
</code>```

My problem with 2 and 3 is that I explicitly state something (X := False) that I may not know for sure.

4) I would rather not set the variable beforehand and have its value completely determined by the function:

```<code>IsMyFileDeleted := DeleteFile(MyFilePath);
</code>```

Here the issue is that it is a bit misleading, because assigning a value to a boolean has a pretty serious side-effect. I'm not sure if this usage is desirable.

Some argue that functions should never have side-effects, but I think some of Pascals internal functions violate that.

5) The alternative would be making it procedures with a result variable to be filled by the procedure:

```<code>DeleteFile(MyFilePath, IsMyFileDeleted);
</code>```

That might go against the trend to keep parameter use to a minimum (Clean Code).

4 and 5 would be the only ways to collect a return value other than boolean, I suppose? Does that mean anything for boolean functions?

Yes, there are many ways to do the same thing and maybe I'm just worried about nothing really, but I'm trying to develop a good style and I wonder if there are any best practices. For a beginner, many principles seem to be in conflict all the time.

Body:
Use #4,

IsMyFileDeleted := DeleteFile(MyFilePath);

Or possibly, since this is Delphi,

IsMyFileDeleted := false;
try
   IsMyFileDeleted := DeleteFile(MyFilePath);
except
   ...
end;

If you want to be properly paranoid about it, if you are concerned an exception might be thrown.  I dont think you are achieving anything in the other options other than making simple code unnecessarily complicated.


问:
Functions with side-effects in Delphi/Pascal
What is the proper approach to functions that have side-effects in Delphi/Pascal?

For example, I could have a boolean function DeleteFile that returns True if the file was deleted and False otherwise. How do I collect the return value?

1) The very explicit form would be:

```<code>if DeleteFile(MyFilePath) then
begin
  IsMyFileDeleted := True;
end;
else
begin
  IsMyFileDeleted := False;
end;
</code>```

2) Less bulky would be:

```<code>IsMyFileDeleted := False;
if DeleteFile(MyFilePath) then
begin
  IsMyFileDeleted := True;
end;
</code>```

3) Or even shorter, but discouraged by JEDI - perhaps it is acceptable just to collect return values:

```<code>IsMyFileDeleted := False;
if DeleteFile(MyFilePath) then IsMyFileDeleted := True;
</code>```

My problem with 2 and 3 is that I explicitly state something (X := False) that I may not know for sure.

4) I would rather not set the variable beforehand and have its value completely determined by the function:

```<code>IsMyFileDeleted := DeleteFile(MyFilePath);
</code>```

Here the issue is that it is a bit misleading, because assigning a value to a boolean has a pretty serious side-effect. I'm not sure if this usage is desirable.

Some argue that functions should never have side-effects, but I think some of Pascals internal functions violate that.

5) The alternative would be making it procedures with a result variable to be filled by the procedure:

```<code>DeleteFile(MyFilePath, IsMyFileDeleted);
</code>```

That might go against the trend to keep parameter use to a minimum (Clean Code).

4 and 5 would be the only ways to collect a return value other than boolean, I suppose? Does that mean anything for boolean functions?

Yes, there are many ways to do the same thing and maybe I'm just worried about nothing really, but I'm trying to develop a good style and I wonder if there are any best practices. For a beginner, many principles seem to be in conflict all the time.

答:
I think you are making things way too hard for yourself.

There are many functions in the VCL and the Windows API that are only functions because they return success or failure and only functions can return anything. To all intents and purposes though these functions are procedures in what they do.

If they didn't return their success or failure as a function result, you would have to jump through hoops to check whether they were successful, or would have to rely on them throwing exceptions if they just weren't able to do what they are meant to do but didn't encounter any real problems:

```<code>try
  DeleteFile(MyFilePath);
  IsMyFileDeleted := True;
except
  IsMyFileDeleted := False;
end;
</code>```

You really don't want to litter your code with constructs like that. Plus, especially on win32, exceptions are expensive. And, using exceptions for flow control is not good practice anyway.

So, use #4

```<code>IsMyFileDeleted := DeleteFile(MyFilePath);
</code>```

It does exactly what you need and it is pretty obvious that you are just capturing the success or failure of the DeleteFile.

And if you have a "function that really is a procedure reporting success or failure" through error codes, you could also do something like:

IsThisSuccessful := (ProcedureAsFunction = S_OK);

ContentLicense: CC BY-SA 3.0

Body:
I think you are making things way too hard for yourself.

There are many functions in the VCL and the Windows API that are only functions because they return success or failure and only functions can return anything. To all intents and purposes though these functions are procedures in what they do.

If they didn't return their success or failure as a function result, you would have to jump through hoops to check whether they were successful, or would have to rely on them throwing exceptions if they just weren't able to do what they are meant to do but didn't encounter any real problems:

try
  DeleteFile(MyFilePath);
  IsMyFileDeleted := True;
except
  IsMyFileDeleted := False;
end;

You really don't want to litter your code with constructs like that. Plus, especially on win32, exceptions are expensive. And, using exceptions for flow control is not good practice anyway.

So, use #4

IsMyFileDeleted := DeleteFile(MyFilePath);

It does exactly what you need and it is pretty obvious that you are just capturing the success or failure of the DeleteFile.

And if you have a "function that really is a procedure reporting success or failure" through error codes, you could also do something like:

IsThisSuccessful := (ProcedureAsFunction = S_OK);


问:
How important is multithreading in the current software industry?
I have close to 3 years experience writing web applications in Java using MVC frameworks (like struts). I have never written multithreaded code till now though I have written code for major retail chains.

I get a few questions on multithreading during interviews and I answer them usually (mostly simple questions). This left me wondering how important is Multithreading in the current industry scenario ?

答: Concurrent and parallel programming is what is becoming important. Threads are just one programming model of doing multiple things at the same time (and not in pseudo-parallel like it used to be before the rise of multi-core processors). Multi-threading is (IMHO fairly) criticized for being complex and dangerous since threads share many resources and the programmer is responsible for making them cooperate. Otherwise you end up with deadlocks which are hard to debug.</p>


问:
Should organizations penalize developers for the amount of defect reports filed against code they worked on?
Should organizations penalize developers for defect reports filed against their work products?

I was having a discussion with my friend where he asks if a manager taking the number of defects filed against a developer is justified. My take is no, because developers can introduce defects, but by holding those against him can cause unnecessary negative feelings in the developer's mind.

What are the problems with penalizing developers based on defects that they inject? Does your organization penalize developers for creating defects in work products?

答:
I'm not opposed to this idea - but ONLY if there is consensus about the defects: a designated group of senior technicians that rules on them. Users, BA's and managers often are not qualified to decide on what is a code defect - and it's always dangerous to put something like this under the control of one (or any) individual.

But I don't think it's really necessary - when a developer is consistently writing bad code, if his seniors and peers are doing their job, it won't be a secret for long and the developer will suffer the consequences with a formal system of 'demerits'.


答:
Option #4 is fine, really. Delphi isn't a functional programming language and doesn't really try to be one, so talking about "side effects" in this context is kind of silly.

Deleting the file isn't "a side effect" of calling DeleteFile, it's simply the effect of calling it.  You don't call it to get a boolean, you call it to delete a file.  If anything, the "side effect" is returning a result at all.


问:
When do you rebuild an application or keep on fixing the existing one

Possible Duplicates:

  When is a BIG Rewrite the answer?

  Have you ever been involved in a BIG Rewrite?

I am at a customer where I have been tasked to fix a number of issues they have in their existing systems. These systems are all quite old and was built in older technologies to really low development standards.

All of this makes it quite difficult and frustrating to properly maintain these systems, because of the two thoughts that often come to mind while working on this:

A. It would have been so much easier / quicker to do this in one of the newer technologies.

B. I would not have coded this feature like this. There are many better ways to design this application to make it more maintainable and better performing. (examples are bad OO design, code is often repeated, settings are hard coded, etc.. the list is long).

So under the circumstances I try to make the best of it and fix everything to the best of my ability without complaining too much, but my question is now:

How do you decide when it is time to rebuild a system with newer technology, versus keeping on plugging holes in an old one? And how do you make a case for rebuilding? How can you persuade the powers-that-be it is necessary to rebuild the system?

答:
The proper, and safest approach is to isolate your changes.

First, determine where the new fix needs to be made.  Write tests around this functionality.  Break that functionality out into a new application in the newer language/framework.

Yes, you have a split system.  But, you've fixed the system, cleaned up a small portion.  Modularized your system.  And added tests to ensure the fix is correct.

Any future bug fixes/features get handled the same way.  In the end, the original app is gone.  Leaving a nice clean new system, full of tests.


问:
Are database schema migrations a problem in production environments?
In discussions about NoSQL vs SQL databases, I sometimes hear that companies prefer to use schemaless NoSQL databases because it is problematic to migrate the schema to a new version. But is that really a big problem when doing upgrades? Are relational databases bad for such operations?

I read this blog post on the MongoDB blog: Why Schemaless?

答:
Just because your NoSql database doesn't have a schema in a traditional sense doesn't mean there isn't a logical schema you need to deal with as it changes. In the case of a typical app using MongoDb, most likely your code expects certain fields of the json object to behave in certain ways. If you change the behavior, it follows you might want to update the already existing data in the database. Now, with traditional RDBMS this was a largely solved problem -- you just had to ALTER the underlying tables. But with these newfangled NoSQL databases, you have a decision -- do you write a script to munge and update all your objects? Or do you add code to convert between versions on the fly? If so, how long do you support v1 objects? Forever? Until v3?

I'll add that the example used in the MongoDb blog post is a bit simplistic and a very easy case to handle if you've got a decent update process no matter what the RDBMS is; adding a field rarely hurts. It is when you decide to split your Name field into FirstName and LastName that things get exciting.

ContentLicense: CC BY-SA 4.0


答:
In delphi, one of the primary differences between procedures and functions is that a function always has a return value, and for each input, you will get one and only one return value out, no matter how many times you run the function on the same input.

So, for your code, #4 is fine, so long as it returns the same value on every run of the same input. So if you run the delete function on a file and return true, then rerun the function on the same file, it should return true again. Even though the file is already gone! The current runtime state should have no impact on your return values in delphi functions. Unless this is implied by the function use states and/or documentation. For a good example, see John's comment below.

If the current state is important, then you should be using a procedure which mutates an input boolean variable, or better, a record that can return more information, such as whether the file exists, and if we have permission to delete.

Or, you should add inputs to your function, to allow for more variation. A good one would be what to do if the file doesn't exist. Finally, if you just want to include current state implicitly, make sure you document that fact.


问:
What is the best way to provide open and closed source versions side-by-side safely?
My company is looking to develop and release an open source software project along with a proprietary enhanced version, similar to pre-4.0 VirtualBox.

What is the best way to maintain the two code bases such that changes to the open source version can easily be incorporated into the commercial version with minimal risk of accidentally pushing proprietary code to the open source product?

答:
Source Control & Branching

The root would be the code common to the both distributions. You would also (presumably) create two branches from your root:

Open Source

Closed Source

Open Source would probably mirror your root in this scenario. On a regular basis, you would merge Open Source and Closed Source by hand (Closed Source would likely not get as many updates).

This way, you can keep the enhancements in your Closed Source branch, and pull in new changes from the Open Source version.


问:
When a team size gets over 10, can you still do release planning together?
When deciding what to work on for the next release, and estimating timings for each user story (and sub tasks for a given story), do you guys do this in a group or just managers?

For a team size of 10, is this practical?

How long does it take?

答:
This task is more efficiently done by a manager. In small teams, the roles tend to get mixed up. Everybody is involved in everything. But as your team grows, this becomes unmanageable and roles need to be clearly defined.

As much as I do get the desire to be involve in everything, it's just not productive.


问:
Should you document everything or just most?
It seems a bit of a controversial subject to document everything, including the "JavaBean" syntax of getters and setters for fields: People say its needlessly long and repetitive breaking DRY (don't repeat yourself), that the naming convention should explain everything, and it clutters code/documentation. Sometimes those arguments work. But other times, you end up with this:

Above is common to open source projects that do boldly follow those principles. You're left with entirely useless documentation. That doesn't explain anything about what's going on underneath, the possible effects, or even what the expected value is (could it be null or never null? I don't know; the Javadoc doesn't tell me).

So when should I document? Do I document everything even if it occasionally clutters code? Or do I document nothing since in my eyes it's "obvious"?

答:
Personally I go with the approach of consider documenting everything. I.e. while coding I consider at every point whether documentation would add value. Most of the time the answer is yes for exactly the kinds of constraints and domain knowledge mentioned in the original question. E.g. null-ability, unique constraints, interpretation of the field in the wider domain.

To avoid duplication I tend to heavily document the main API classes with this kind of information. Then only document implementations and internals where there is non-obvious or inconsistent behavior. I find this works well as it's the users of the API which need the most help and documentation, it's generally safe to assume people modifying the implementation know the API so have this knowledge.

I also tend to document just the getters. I don't duplicate documentation onto setters, field definitions and constructor parameters. I only document non-obvious behavior such as defaults in these places. Any behavior that can be inferred from the getter documentation isn't documented. For example, if the getter is documented as never-returning null, I generally don't document that you can't pass null to the setter, unless there is a default.

Some people like to mark this act of "considering documentation" by adding empty comments where they have considered documentation but found it unnecessary. I don't like this practice as it just clutters up the code and gets in the way.

ContentLicense: CC BY-SA 2.5


答:
I'm actually part of multiple projects (and multiple teams) as a lead, and there a few that are 10+. On almost all the projects I work on, the release planning is done by the leads and the business analysts. However, in our situation the BAs are not the managers, so the managers don't really participate in the release planning.

Estimation is done by the implementation team, though, and although both parts are separate, they are very much related.

Estimation is how much time a task takes to get done, whereas the release planning is when those tasks get scheduled to be worked on.

Planning should be done according to business concerns, while estimation should be done according to technical concerns. Hence the break up of estimation and planning.

Title: When a team size gets over 10, can you still do release planning together?

Body:
When deciding what to work on for the next release, and estimating timings for each user story (and sub tasks for a given story), do you guys do this in a group or just managers?

For a team size of 10, is this practical?

How long does it take?


问:
Is it possible to evaluate the efficiency of a testable algorithm against alternative solutions that aren't already built?
An e-commerce application I used to work on used a decision tree and a rules engine for each node in order to determine if a customer qualified for certain discounts.

The problem was that every promotion tree had to be evaluated, so the more promotions the client had the slower the evaluation became.

This was a big problem that was often solved by throwing more hardware at it.

There were alternatives to consider, but the promotions engine was a considerable undertaking.

I always wondered if there was a way to consider an alternative without developing it (or developing it entirely)?

答:
I always wondered if there was a way to consider an alternative without developing it (or developing it entirely)?

Yes.  There is.

It's called "design".

You build a model (ideally a mathematical model) of each different algorithm.

You do some analysis on that model to get the "Big-O" time complexity of the algorithms.

The algorithms with less time complexity will usually tend to be faster.


答:
I would create 2 projects.

OSS Project which can run standalone.

Proprietary code which depends on the OSS project code.

You can have the dependency be a build time or run time dependency.  If you want each package to be standalone, then you can have proprietary package pull in the OSS files it needs during build/package creation.  If your fine with a run time dependency, you can just package up the proprietary code alone, and have it depend on the OSS package at run time.

Benefits:

Frees you from duplicating code.

Get bug fixes in both for the cost of getting it in one.

Clear delineation between OSS and Proprietary.

Title: What is the best way to provide open and closed source versions side-by-side safely?

Body:
My company is looking to develop and release an open source software project along with a proprietary enhanced version, similar to pre-4.0 VirtualBox.

What is the best way to maintain the two code bases such that changes to the open source version can easily be incorporated into the commercial version with minimal risk of accidentally pushing proprietary code to the open source product?


答:
Prioritisation should be done by a single product owner with input from the various stakeholders, including a senior developer who is a stakeholder for the code and as responsible for non-functional requirements as a business stakeholder is for the functional requirements.

Estimation should absolutely be done by the people who will do the work, never by a manager who is under pressure to deliver, however your instinct is correct that more than a half-dozen people will spend hours arguing over this. In an ideal world, you really should break the team down such that there are no less than 4 and no more than 7 on a single team -- 5 is ideal, IMHO.

If this is absolutely not possible, for some reason - and you need to apply 5 whys to that reason before accepting that it is impossible - then a team of 4-5 people should be selected by the team to do estimations on their behalf.


答:
You can try to make an approximation with a few techniques:

Compare existent and already implemented algorithms which work in a similar way or are parts of the algorithm you want to evaluate,

Build a mathematical model of each algorithm and evaluate the models (see the answer by S.Lott),

Build the most essential, performance-wise, parts of each algorithm and profile them.

This being said, you'll obtain just an idea. It may work perfectly well in some cases. It may completely fail in others, because you omitted compiler optimization, or how processor work, or some weird thing in a language or a runtime, etc.

That's why when you see on Programmes.SE questions "Is A faster than B", "If I change this and that, will it become faster?", the only answer they receive is inviting the author of the question to profile the application.

Title: Is it possible to evaluate the efficiency of a testable algorithm against alternative solutions that aren't already built?

Body:
An e-commerce application I used to work on used a decision tree and a rules engine for each node in order to determine if a customer qualified for certain discounts.

The problem was that every promotion tree had to be evaluated, so the more promotions the client had the slower the evaluation became.

This was a big problem that was often solved by throwing more hardware at it.

There were alternatives to consider, but the promotions engine was a considerable undertaking.

I always wondered if there was a way to consider an alternative without developing it (or developing it entirely)?


问:
Unit testing newbie team needs to unit test
I'm working with a new team that has historically not done ANY unit testing.  My goal is for the team to eventually employ TDD (Test Driven Development) as their natural process.  But since TDD is such a radical mind shift for a non-unit testing team I thought I would just start off with writing unit tests after coding.

Has anyone been in a similar situation?  What's an effective way to get a team to be comfortable with TDD when they've not done any unit testing?  Does it make sense to do this in a couple of steps?  Or should we dive right in and face all the growing pains at once??

EDIT

Just for clarification, there is no one on the team (other than myself) who has ANY unit testing exposure/experience.  And we are planning on using the unit testing functionality built into Visual Studio.

答:
One way to get comfortable with TDD is to write integration tests first.  Introduce test seams and true unit tests later.

The problem with writing unit-tests after coding is that the code may not necessarily be well-designed to be testable.  You may need to do some refactoring or maybe re-design to introduce the test seams.  But how can you refactor or re-design safely if you have no test coverage of any kind?

Integration tests can give you that coverage initially.  Every time you have a regression or a production issue, fix it in the code and cover that code with a test.  Once you have enough of a safety net provided by such tests, you can introduce unit tests of more finely-grained, isolated components and/or classes of your system.


答:
As S.Lott suggested, the standard way of doing it is by abstraction to the Big-O notation. It has shown that for algorithms, this asymptotical consideration is a good predictor on the real performance.

But sometimes, it's too rough (e.g. you cannot tell which O(n^2) implementation is faster) and sometimes it's misleading (there can be an O(n) implementation that is slower for the usual input sets than an O(n^2) implementation). That's why there is a lot of research about performance predictability at our University, with a methodology and tool called Palladio. If you are interested, take a look at it and see that such predictions are far from being trivial. If you are even more interested, try it!


问:
Should we adopt an agile methodology when rewriting an existing application from scratch?
I work for a small product based company. We are about to re-write our existing product from scratch. We are planing to adopt Agile methodology for our development. Now my question is as we have all the requirements even before start of project (as we are re-writing the existing product), is it worth to dive into Agile world? Isn't agile more useful when you don't have all the requirement upfront and you get your requirement in phases?

Secondly, let's say if we jump into Agile, whats the best practice to design database? Let's say in our first iteration we just create a login system (user can login, logout etc). Do we just need to create Users table without worrying about other tables? And other tables would be evolved as our product would progress?

答:
The most important is that the scrum process will be usefull to you. I mean if your work will be better, just take it. But you will never know unless you try it.

Another point is that there is no need to take scrum process by the book. Just take things that will work for you. Our team for example does not have a scrum board. Because we do not need it.

As for design , you should try to design in such manner that future changes will not take a lot of time. Your system must be robust.

OwnerDisplayName: TK Lee

OwnerDisplayName: Gregory Nozik


答:
Agile is applicable for any development project, and not specifically for complete greenfield projects that do not yet have any requirements specified. Agile project management makes your project self-learning, and self-improving by taking small steps, reviewing your steps often and improving your next steps. There are a lot of blogs on Agile around. Google is your friend ...

Regarding your specific question on Agile database development, you are sort of on the right track. You can develop user management without caring about the rest at first. That will probably end up in some rework when you get further in the project, but that can be considered a cost of doing small focussed iteration. Some middle-of-the-road approach would investigate your database model a bit more upfront and make some design that could work a few sprints ahead. That way, you'll have less rework.

Title: Should we adopt an agile methodology when rewriting an existing application from scratch?

Body:
I work for a small product based company. We are about to re-write our existing product from scratch. We are planing to adopt Agile methodology for our development. Now my question is as we have all the requirements even before start of project (as we are re-writing the existing product), is it worth to dive into Agile world? Isn't agile more useful when you don't have all the requirement upfront and you get your requirement in phases?

Secondly, let's say if we jump into Agile, whats the best practice to design database? Let's say in our first iteration we just create a login system (user can login, logout etc). Do we just need to create Users table without worrying about other tables? And other tables would be evolved as our product would progress?

OwnerDisplayName: kroonwijk


答:
is it worth to dive into Agile world?

Yes.

Isn't agile more useful when you don't have all the requirement upfront and you get your requirement in phases??

False.

When you don't have all the requirements it's the only way to make progress.  Anything else requires fanciful assumptions that will eventually be proven false.  Agile simply makes fewer fanciful assumptions.

When you have all the requirements, you must still follow all the Agile principles.

Read this before proceeding any further: http://agilemanifesto.org/

All of these points are true no matter how much you know of the requirements.

You still benefit from using an Agile method like Scrum, because you'll have more realistic expectations.

whats the best practice to design database? Let's say in our first iteration we just create a login system (user can login, logout etc).

What a terrible first iteration.

Do we just need to create Users table without worrying about other tables? And other tables would be evolved as our product would progress?

Yes.  You create the database incrementally.

You do everything incrementally.

You prioritize based on what creates the most value to users.  Not fanciful (and silly) technical considerations.


答:
In my opinion, you should NOT do release planning as a team of 10 people.  Most likely you will end up with a giant meeting where in any given discussion 6-8 people will feel completely disconnected and bored.  Add to that the exhaustion of 3-4 hours being locked in a room together. And consider that if 10 people talk, you have way too much conversation.  If they don't talk, you may not get valuable input.

We did something very similar to Joseph's company.  Previous release we had 8 engineers and release planning took 2 solid weeks. And it was absolutely brutal. Few hours into each day, I think all of us start trying to speak as little as possible so that the meeting would be over sooner.

This release our team size more than doubled. So we broke up into smaller teams that would take permanent ownership of an area of a product.  Each of the smaller teams had a lead.  Then we did high-level release planning with just the leads, which went by way faster and more efficiently because now we only had 4 developers in a room.  During this time, we identified which team would do what stories and how the product will be divided. Also this gave leads the larger picture of the entire product.

Then each lead went back to his own team and went over the portion of the release that only that team was responsible for.  During this time, we filled in some details and assigned story point values.

Lastly, everything was put together and we did one final walkthrough (more of a presentation than discussion) so that everyone on the team knows what's going on with the entire team.

Although we didn't have a full successful release with this method, I do think that release planning overall went by way smoother than before and we got much more out of it.  The key was that we never had more than 3-4 developers in any given meeting and everyone's voice was still heard.

If possible I'd recommend you split your 10 developers into 3 groups. If you can't divide your overall release into 3 mostly-non-overlapping areas, then even 2 groups would be better than one large team.


问:
Should I include a selfdestruct-method to my applications?
I recently had a negative experience, where client bailed from the bill, but my middle-man already uploaded our software and design to the clients server. Client turned out be a known criminal, and of course he changed all possible passwords of the server.

However, I can still access the admin-panel of the CMS. Sadly it turns out, that my software is very secure.. Tried to SQL-injection, fake the image-upload etc etc. However, I cannot hack my own software.. Anyways, I preparing to sue this person, so that is not the problem.. I'm just thinking now, that maybe there should be some backend selfdestruct-method. So, if similar case occur, I have the option to kill the software.

My own idea is to hide some function in the core files. Encode it with base64, so it wouldn't be obvious. So something like this:

```<code>eval(base64_decode('ZWNobyAnSGVsbG8gd29ybGQhJzs=')); // echo 'Hello world!';
</code>```

And basically make a small script, that takes all the software's files, chmod's them to be sure and then deletes them.

My newer versions of the CMS, all have filemanagers that I could use for easier hacking. But what if the access to the admin-panel is limited.

To be very clear, this is meant only for the development-stage software's, in my personal server or the clients server (last part being the ethically questionable.) So if my client should steal my software.. This wont be included inside a commercial-software.

And to be even more clear, we are talking about those rare freelance jobs. I think its fairly logical, that contract-work doesn't need such methods. So we are talking about those jumprisk-clients, only in development mode -- when the project is ready, then obviously this would be a very very unethical backdoor to have inside your software.

Ethically is this a good idea? (Keeping in mind, that obviously I will remove it, when project has been 100% and everything is paid for)

Have you guys ever had to hack your own software, because of similar issues with the client(s)?

Any recommendations on this idea, code and method wise?

What may be the possible drawbacks or repercussions of selfdestruct-scripts?

My conclusion on this

Is a little bit sad, that all answers were targeted on the contracted cases. It was my fault really, that I didn't make it more clear in my question.. just thought, that it is fairly clear, that there is no point in the kill-switch.. when you are protected by the contract.

However, if you are doing a contract work.. then this should be stated in the contract -- this makes it legal, even inside the clients own server. However, having kill-switches inside my own personal server is really nobodies business (this is what I really wanted to know.)

I decided to make the kill-switch script for my CMS. Mainly, because it seems an interesting challenge. But also, that I could use this for my non-contracted works where the client is a friend of a friend of a friend.. I probably wont use this on the clients server, but..for the cases, where the client or some middlemen have access to my server .. And my software gets stolen, or "moved without my knowledge", then I don't get paid and they cut the access to the software.

I have read trough alot of topics here, where they recommend to send a warning and then take down the page. Well, I saw a problem in it, as when Im dealing with a person.. who will just copy it to somewhere else (maybe re-brand it and sell it) and tells me, that it has been taken down. And also, I wouldn't "turn the site off", but delete it. Though, I guess its still illegal to access my clients server and to delete it. Or at-least, access it trough backend and not from the FTP. For this I thank all of you, who answered.

答: On a practical note, surely the client would check their logs, find the kill request, restore the code from a backup, remove the kill switch and re-deploy.</p>


答:
A secret self-destruct feature is a horrendous idea.  Yes, you'll be clever and may have the opportunity to stick it to an awful client in the future, but its way more trouble than its worth.

You still won't get paid for work you've done.  Yes the other person won't use your code; but you'll still suffer lack of payment.  You think some criminal will decide to pay the person who's already brought down their site once remotely?  They'll find some new chump to make their site for free.

Utilizing the self-destruct sequence, makes you liable for your own legal problems.  Depending on jurisdictions, you could easily be seen as hacking/destroying their data (when they were about to pay and had plenty of extenuating circumstances for why they didn't pay earlier).  Even if you aren't convicted/successfully sued, you still may mount hefty legal fees and have much more trouble than its worth.

What if some good paying client browses your code later (or has a CS friend who just browsed it to do a minor tweak), sees the function with weird base64 part, is like what's this, tries executing it, and accidentally deletes the web app (and does it while you're on vacation so it takes a while to fix)?  Or posts a bunch of public reviews about you everywhere stating you are unethical and leave backdoors in your work?  Sure you may remove it from the finished product after they pay, but with VCS they may browse older source or not want you on their server after they paid (and that would be an awkward conversation; yes I need an account again, cause I haven't removed the secret self-destruct backdoor).

What if the criminal backups their data?  You delete their webserver with a secret backdoor, the site is offline for a day or two while they (or a friend) finds the offending function backdoor function and its back online.

In the future, get people to sign a simple contract, pay you in stages, and don't let code leave the development server and computer that only you control until you've been paid.  (If they need it to be live before all the work is finished; make sure they've at roughly paid for the fraction of code that's becoming live).  If they want to see the work as its under development, have them give you a few IP addresses which you'll open your firewall for your develolopment server (and maybe with a clever CNAME to the effect of unpaid_work_in_development.example.com).  Give no guarantees of uptime of your dev server, and if you are getting way more traffic than you should be (e.g., you find they are redirect lots of people to your site) just close off the firewall until they pay.  If they need to contribute content to your webserver, make them either email you with the content suggestions, or create an dropbox shared folder for them that only has permissions to write to the small subset of files (under VCS control outside of dropbox) that they can meaningfully contribute to (e.g., html templates).

Title: Should I include a selfdestruct-method to my applications?

Body:
I recently had a negative experience, where client bailed from the bill, but my middle-man already uploaded our software and design to the clients server. Client turned out be a known criminal, and of course he changed all possible passwords of the server.

However, I can still access the admin-panel of the CMS. Sadly it turns out, that my software is very secure.. Tried to SQL-injection, fake the image-upload etc etc. However, I cannot hack my own software.. Anyways, I preparing to sue this person, so that is not the problem.. I'm just thinking now, that maybe there should be some backend selfdestruct-method. So, if similar case occur, I have the option to kill the software.

My own idea is to hide some function in the core files. Encode it with base64, so it wouldn't be obvious. So something like this:

```<code>eval(base64_decode('ZWNobyAnSGVsbG8gd29ybGQhJzs=')); // echo 'Hello world!';
</code>```

And basically make a small script, that takes all the software's files, chmod's them to be sure and then deletes them.

My newer versions of the CMS, all have filemanagers that I could use for easier hacking. But what if the access to the admin-panel is limited.

To be very clear, this is meant only for the development-stage software's, in my personal server or the clients server (last part being the ethically questionable.) So if my client should steal my software.. This wont be included inside a commercial-software.

And to be even more clear, we are talking about those rare freelance jobs. I think its fairly logical, that contract-work doesn't need such methods. So we are talking about those jumprisk-clients, only in development mode -- when the project is ready, then obviously this would be a very very unethical backdoor to have inside your software.

Ethically is this a good idea? (Keeping in mind, that obviously I will remove it, when project has been 100% and everything is paid for)

Have you guys ever had to hack your own software, because of similar issues with the client(s)?

Any recommendations on this idea, code and method wise?

What may be the possible drawbacks or repercussions of selfdestruct-scripts?

My conclusion on this

Is a little bit sad, that all answers were targeted on the contracted cases. It was my fault really, that I didn't make it more clear in my question.. just thought, that it is fairly clear, that there is no point in the kill-switch.. when you are protected by the contract.

However, if you are doing a contract work.. then this should be stated in the contract -- this makes it legal, even inside the clients own server. However, having kill-switches inside my own personal server is really nobodies business (this is what I really wanted to know.)

I decided to make the kill-switch script for my CMS. Mainly, because it seems an interesting challenge. But also, that I could use this for my non-contracted works where the client is a friend of a friend of a friend.. I probably wont use this on the clients server, but..for the cases, where the client or some middlemen have access to my server .. And my software gets stolen, or "moved without my knowledge", then I don't get paid and they cut the access to the software.

I have read trough alot of topics here, where they recommend to send a warning and then take down the page. Well, I saw a problem in it, as when Im dealing with a person.. who will just copy it to somewhere else (maybe re-brand it and sell it) and tells me, that it has been taken down. And also, I wouldn't "turn the site off", but delete it. Though, I guess its still illegal to access my clients server and to delete it. Or at-least, access it trough backend and not from the FTP. For this I thank all of you, who answered.


答:
Now my question is as we have all the requirements even before start
  of project (as we are re-writing the existing product), is it worth to
  dive into Agile world?

Yes, though I'd imagine there are likely more than a few possible changes to how the application is currently designed as this would be the time to clean up various technical debt in having a cleaner design given the information known now.

Isn't agile more useful when you don't have all the requirement
  upfront and you get your requirement in phases??

How confident are you that those requirements will not change as you build the application again?  Are you sure that the design being taken will never be refactored?

Secondly, let's say if we jump into Agile, whats the best practice to
  design database? Let's say in our first iteration we just create a
  login system (user can login, logout etc). Do we just need to create
  Users table without worrying about other tables? And other tables
  would be evolved as our product would progress?

There are plenty of different options here.  Do just enough to make it work.  If the Users table is all that is needed, great.  If there are a few other tables someone wants to have so the DB is in a more normalized form, then that may make it better to do that.  You won't be perfect the first time and Agile is all about a try and fix kind of methodology as once you show what you have the user will often have feedback that is what keeps Agile going and going... (Also where the new requirements will come as people may then start asking for stuff too)


问:
Best book, articles and literature on unit testing
In my battle to introduce unit testing in my workgroup, I find a lot of people that have little to none knowledge of the concept. Can you suggest:

best articles or tutorials for quickly introducing people on the topic

best comprehensive book(s) for learning unit testing in depth

academic works and studies that prove the effectiveness of unit testing

答:
G. Meszaros' xUnit Test Patterns: Refactoring Test Code is a kind of encyclopedia, the "Design Patterns" of unit-testing.

R. Osherove's The Art of Unit Testing: With Examples in .Net is a more practical guide to getting started with unit-testing and understanding the key concepts.

L. Koskela's Test Driven: TDD and Acceptance TDD for Java Developers appears to be the Art of Unit Testing for Java developers.


答:
In concept you are right. Your execution is all wrong.

You need to provide him trial licences that expires. Upon full payment give him the Final "forever" licence. All upfront and honest.


问:
Where could SPMD parallel programming be used in a Compiler?
I have little knowledge about the subjects of compiler construction and parallel programming, so please bear with me. This is a course about compiler construction, and we are asked to learn CUDA while taking the course because the professor would like us to write a compiler for a simplified language. That compiler is supposed to be doing the work in parallel at some specific stages. My understanding was that the scanner, parser, semantic analyzer, code generator and the optimizer are inherently sequential. I have written some parsers for very simple tasks before, so my understanding is based on little bit of theory and little bit of experience. I would understand how to incorporate shared state at some point in the construction of the compiler to do multiprocessing, but not SPMD.

What components of a compiler can be parallelized(e.g. using CUDA as in my case, SPMD model in general)?

SPMD: Single Program Multiple Data

答:
There are all sorts of opportunities for handling the work in parallel. Individual lines in a source-code files can be scanned and tokenized independently of each other, for example. Blocks of code can typically be parsed independently of each other and can be target for parallelism there.

Some optimization techniques lend themselves to being parallelized. Intermediate structures containing information about register allocation, can, for example, be generated independently from different blocks of code, and then stitched together in one long pass at the end. Much intermediate work and some code generation work can be done in parallel - it's possible to have a complete intermediate representation where code generation can occur in parallel, starting at multiple starting points at the same time.

Of course, this all sounds rather strange. It's unusual to try to write a compiler which uses CUDA (compilers nowadays are mostly more than fast enough for most purposes they're used for, without parallelization). It's much more common to try and write a compiler which compiles CUDA code, and which attempts to introduce parallel processing power into code originally written to run linearly.


问:
Do you prefer conciseness or readability in your code?
Language shortcuts can often be used to make code more concise.

For example, ternary and null coalescing operators can reduce the amount of code, but arguably to the detriment of readability:

In C#:

```<code>Person newGuy = new Person();
if (boss == null) {
    newGuy.Boss = GetDefaultBoss();
} else {
    newGuy.Boss = boss;
}
</code>```

is functionally equivalent to:

```<code>Person newGuy = new Person();
newGuy.Boss = boss ?? GetDefaultBoss();
</code>```

but obviously a lot more verbose.

Where do you draw the line when it comes to conciseness vs readability?

答:
While both are good goals, I'll always side with Readability when forced to choose one.

I would argue that your example improves both readability and brevity.  Consider, however:

```<code>if( a > b )
{
    foo = bar
}
else
{
    if( c.isThing() ){
        foo = somethingElse;
    }
    else{
        foo = someFurtherThing.GetFoo();
    }
}
</code>```

as opposed to

```<code>foo = a > b ? bar ?? whatever.something : c.isThing() ? somethingElse : someFurtherThing.GetFoo();
</code>```

The latter is concise, but is difficult to read through.  The former is verbose, but the flow of logic is clear.

Ultimately, brevity doesn't serve much of a purpose, other than the ability to fit more on the screen.  Readability makes it easier to debug, and so should generally be preferred.

Body:
While both are good goals, I'll always side with Readability when forced to choose one.

I would argue that your example improves both readability and brevity.  Consider, however:

if( a > b )
{
    foo = bar
}
else
{
    if( c.isThing() ){
        foo = somethingElse;
    }
    else{
        foo = someFurtherThing.GetFoo();
    }
}

as opposed to

foo = a > b ? bar ?? whatever.something : c.isThing() ? somethingElse : someFurtherThing.GetFoo();

The latter is concise, but is difficult to read through.  The former is verbose, but the flow of logic is clear.

Ultimately, brevity doesn't serve much of a purpose, other than the ability to fit more on the screen.  Readability makes it easier to debug, and so should generally be preferred.


问:
How can I advocate unit testing on private code?
I'm trying to advocate unit testing in my workgroup, but an objection I often get is that it should be used only for externally exported API (which is only a minimal and non critical part of our system), and not on internal and private code (which now has only functional testing).

While I think that unit test can and should be applied to all the code, how can I persuade my coworkers?

答:
There are two kinds of private code: private code that gets called by public code (or private code that gets called by private code that gets called by public code (or ...)) and private code that does not eventually get called by public code.

The former already gets tested through the tests for the public code. The latter cannot be called at all and thus should be deleted, not tested.

Note that when you do TDD it is impossible for untested private code to exist.


问:
Scrum, is there a Critical Path for release planning?
Mike Cohn in Agile Estimating and Planning, page 154, defines a "natural order" for implementing user stories - this, according to him, is a intuitive sequence that makes sense to both developers and the team. I understand and endorse this idea.

Though, I am having trouble letting go the concept of "critical path"; I see the value of ordering stories based on their dependencies. Even if the backlog is an always evolving tool, we could derive the "critical path" of the current backlog to prioritize and derive for 3-6 months worth of releases. It just does not sound right considering all I know about Agile.

How do you apply the concept of critical path in Scrum?

Your personal opinion would be much appreciated!

答: If you're doing Agile there shouldn't be any dependencies because you can test without having completed the part(s) you are "dependent" on.  And the rare exception shouldn't be enough to make a critical path analysis worth while.


答:
There is no longer a critical path.

At the end of every sprint you have a deliverable product. You show this to the customer in the sprint demo. If the customer likes what they see you can deliver what you have, if not then you do another sprint.

You repeat the processes. Every time the customer seems that have gained a significant amount of functionality (stories) they can take delivery of the next version.

Having a fixed deadline (every 3-6 months) and a fixed feature set is what you are trying to avoid. How can you plan for something that is 6 months away with the little knowledge you have and expect to hit both targets.

You can provide estimates but every sprint you must re-evaluate what you can achieve.

If you have a fixed feature set the end point will move at the end of every sprint.

If you have a fixed end point then the feature set will move at the end of every sprint.

The third leg is quality and in scrum this is the leg that should not be moved. You still need to provide unit tests and verification each sprint.

Best to have neither and let the customer accept incremental upgrades as features become available.

Title: Scrum, is there a Critical Path for release planning?

Body:
Mike Cohn in Agile Estimating and Planning, page 154, defines a "natural order" for implementing user stories - this, according to him, is a intuitive sequence that makes sense to both developers and the team. I understand and endorse this idea.

Though, I am having trouble letting go the concept of "critical path"; I see the value of ordering stories based on their dependencies. Even if the backlog is an always evolving tool, we could derive the "critical path" of the current backlog to prioritize and derive for 3-6 months worth of releases. It just does not sound right considering all I know about Agile.

How do you apply the concept of critical path in Scrum?

Your personal opinion would be much appreciated!


答:
First and foremost you have to compare the asymptotic complexity of the algorithms (the Big-O notation that people have mentioned here).  This gives you a way to quickly gauge which algorithm will be faster.  Even though O(n^2) might be faster than O(n) for a small input size, the fact that you are worried about performance tells me that your input size is not that small.

If the alternative algorithm passes the complexity analysis, but you are still not sure if it is a better choice, then there must be some benchmark data for it.  Whoever came up with the algorithm must have written a paper about it, and must have done some sort of evaluation.  You may be able get some idea of the performance from the paper. Sometimes the authors publish the data they used for evaluation, so you may be able to benchmark your algorithm on the same data.  And, of course, you can always contact the authors and ask.


问:
What it is a data structure of a certain type called?
I'll try to keep this as much language agnostic as I can but I'll give the examples in C# since I now know how to solve it that language.

The question came to mind when I was thinking of how could I instantiate many objects of the same type.

Lets say I wanted to create one rectangle, I would do:

Rectangle rect1 = new Rectangle()

Now, if I wanted to create 2 I would do.

```<code>Rectangle rect1 = new Rectangle()
Rectangle rect2 = new Rectangle()
</code>```

This of course is not efficient when you need to create many rectangles.

The problem is, I couldn't use loops just like that to create a many rectangles:

```<code>for (int i = 0; i < 100; i++){
    Rectangle rect1 = new Rectangle()
}
</code>```

This obviously doesn't achieve what I am after since I would just create 100 rect1's.

I was pointed out that you could do something like this: Thanks mootinator

```<code>var rectangles = new Rectangle[100];
for (int i = 0; i < 100; i++){
  rectangles[i] = new Rectangle();
}
</code>```

For what I understood, the code creates a data structure (Array? ArrayList?) of they type Rectangle inside you actually "store" Rectangles.

The hardest thing for me was putting a question for this.

So the questions are:

What is this called?

Is this standard / "common" in most OOP based languages? The question actually came up in ActionsScript 3, but is is useful /necessary in any language it might seem.

Is this the best way for doing this considering that I would the like to, for example, loop this Array and apply a method .Move().

Are there? and what are the other options to do this.

答:
You are creating an array, which is something built in to the language, in the case of C#.  If you want a nice collection object you can create the collection you want, say an ArrayList, or better, ArrayList< Rectangle > and call the Add() method in a loop, adding a New Rectangle each time.

The specifics do vary from language to language, but nothing makes you write rectangle1,rectangle2,...rectangle100000, since that wouldn't be practical.  In general you would call "a bunch of objects that don't each need to have a unique name" a collection.  Array is sometimes a special built-in language concept, while other collections are often implemented on top of them, but sometimes other kinds of collections (dictionary, list) are the built-in basis for other collections.


答:
It's an Array of objects. Other implementations might be a linked list or a tree that mimics an array but allows for expansion/deletion: The infamous ArrayList. I'd recommend a book on Data Structures as the more you know, the better off you are. As to what you store in the Data Structure itself? It doesn't matter, objects are a code construct in that respect. Assuming first-class objects, you can then pass them to and fro to any data structure.

Well sort of. Technically you're passing a message to that data structure to create a new object inside itself that corresponds to the object "passed" as an argument. To use the car example that I always do, the message tells the data structure to "store this car" and the data structure builds a car and stores it.

Title: What it is a data structure of a certain type called?

Body:
I'll try to keep this as much language agnostic as I can but I'll give the examples in C# since I now know how to solve it that language.

The question came to mind when I was thinking of how could I instantiate many objects of the same type.

Lets say I wanted to create one rectangle, I would do:

Rectangle rect1 = new Rectangle()

Now, if I wanted to create 2 I would do.

```<code>Rectangle rect1 = new Rectangle()
Rectangle rect2 = new Rectangle()
</code>```

This of course is not efficient when you need to create many rectangles.

The problem is, I couldn't use loops just like that to create a many rectangles:

```<code>for (int i = 0; i < 100; i++){
    Rectangle rect1 = new Rectangle()
}
</code>```

This obviously doesn't achieve what I am after since I would just create 100 rect1's.

I was pointed out that you could do something like this: Thanks mootinator

```<code>var rectangles = new Rectangle[100];
for (int i = 0; i < 100; i++){
  rectangles[i] = new Rectangle();
}
</code>```

For what I understood, the code creates a data structure (Array? ArrayList?) of they type Rectangle inside you actually "store" Rectangles.

The hardest thing for me was putting a question for this.

So the questions are:

What is this called?

Is this standard / "common" in most OOP based languages? The question actually came up in ActionsScript 3, but is is useful /necessary in any language it might seem.

Is this the best way for doing this considering that I would the like to, for example, loop this Array and apply a method .Move().

Are there? and what are the other options to do this.


答:
Critical path thinking comes from trying to predict the future and guess where/how bottlenecks may occur or where risks are likely to eventuate and cause us problems and then organising the rest of the development activities around those bottlenecks/risks so that the important features can be "guaranteed" for delivery.

In some respects this is an aspect of lean thinking and trying to optimise flow though the development process, unfortunately it usually doesn't get borne out that way because it's treated as an up front waterfall style exercise and never reviewed as development progresses. The reality is we have bottlenecks and risks all over the place and they tend to change over time as the team works through development.  It's how we adapt to those that is important.

In Scrum we avoid the useless effort of predicting the future by doing small batches of work and then inspecting our progress and adapting planned activities for the next small batch based on the results of our previous work, on the risks that have actually eventuated and the most valuable features we need next.

It doesn't mean we can't do some initial thinking about risks and delivery order for features.  In scrum we do this by working with the product owner so that they order the product backlog with the high risk/high value items coming first.  Additionally we manage bottlenecks by monitoring our velocity and ensuring that we think about where we're going slow and how to improve that during each and every spring retrospective.

So whilst Scrum doesn't have any critical path planning component to it, the process itself embeds this thinking in it directly. We deliver the "critical" items early on and deal with any risks that we think may occur so that we have time to make any adjustments for our future plans based on what eventuates, whilst still ensuring the customer gets what they need the most as soon as possible.


答:
Your coworkers may be confusing true unit tests with integration tests.  If your product is (or has) an API, the integration tests can be programmed as NUnit test cases.  Some people mistakenly believe that those are unit tests.

You can try to convince your coworkers with the following (I'm sure you already know this stuff, all I'm saying is that pointing it out to your co-workers might help):

Test coverage.  Measure the actual test coverage percentage of those integration tests.  This is a reality check for those who have never run test coverage.  Because it is difficult to exercise all logical paths when the input is several layers away, the test coverage tops out at somewhere between 20% and 50%.  To get more coverage, your co-workers need to write real, isolated unit-tests.

Configuration.  Deploy the same software under test and perhaps you can demonstrate to your co-workers how difficult it is to run their tests in a different environment.  Paths to various files, DB connection strings, URLs of remote services, etc. -- it all adds up.

Execution time.  Unless the tests are true unit tests and can run in memory, they will take a lot of time to run.

Title: How can I advocate unit testing on private code?

Body:
I'm trying to advocate unit testing in my workgroup, but an objection I often get is that it should be used only for externally exported API (which is only a minimal and non critical part of our system), and not on internal and private code (which now has only functional testing).

While I think that unit test can and should be applied to all the code, how can I persuade my coworkers?


问:
Do LAMP/Java-based software development teams have SOE's?
As a developer on the Windows/.NET stack, it's pretty normal for the company-supplied machine to come with Windows (usually an ancient, archaic version like Windows XP) and a stack of software pre-installed as part of a Standard Operating Environment.

In companies building software on the Java/Ruby/PHP/C stack using Linux/Unix/BSD as a primary OS, in your experience:

Does everyone tend to use the same OS/version?

How do you ensure everyone is using the same version of libraries/dependencies/tools (do you?)

How do you create an SOE to pre-configure a machine (do you?)

答:
Does everyone tend to use the same OS/version?

No.

We specifically write software that runs on a variety of Linuxes (Lini? Linen?).  A same OS or same version isn't particularly helpful.

Unless one is writing kernel-oriented software, exact Linux versions don't matter the way exact Windows versions seem to matter.  Why?  Linux conforms to a standard (POSIX); for most "ordinary" application development, the version only needs to be reasonably close.  Standards compliance assures that things really work.

How do you ensure everyone is using the same version of libraries/dependencies/tools (do you?)

A list of RPM's (or whatever's appropriate) to download and install.

How do you create an SOE to pre-configure a machine (do you?)

Sometimes a sys admin will bundle a collection of RPM's for us.


答:
You've asked the wrong question.  The thing to work on and improve is not to add some sort of remote kill switch (adding a vulnerability that you or someone else can use), but to fix your real problem, which was a poor way of arranging for payment and delivery.  Sounds like you needed a better escrow system (or whatever such a concept is called where you live).

Don't waste your time on a kill-switch, figure out where you screwed up in the business deal part of it.


问:
What are the differences between throwaway and evolutionary prototypes?
I have notes about various methods of prototyping, and I found several definitions on the Internet, but I would like to confirm what I learned.

I understand that throwaway prototyping is developed from an outline of a specification, an various prototypes are delivered and modified until the client is satisfied with its functionality.

On the other and, evolutionary prototypes are built from basic requirements gathered from end-users. An initial prototype is presented to the users and evaluated. The prototype is modified based on the feedback until the client is satisfied.

Is this correct? Are there better definitions of throwaway and evolutionary prototyping?

答:
Both methods of prototyping are used when there's some aspect of the system that you don't entirely understand. However, the key difference is the lifecycle methodology that you use. With evolutionary prototyping, you typically understand some aspects of the system and aren't sure about others. In throwaway prototyping, you have a general lack of understanding that you need to complete before you can build a production-ready system.

Note that there are lots of kinds of throwaway prototyping, and neither are limited to the entire system. For example, using paper or whiteboard sketches of a user interface can be considered throwaway prototyping. Yes, you might go through several iterations and throw away a previous design, but you also won't use the final prototype in the system (it's not physically possible, for one).

If you're interested in general software engineering topics and the breadth of SE, I'd highly suggest picking up the Sommerville book that I quote. It's really good for covering the breadth of topics. If you're more interested in process models and methodologies and how you can apply them to various projects, I'd recommend the McConnell book - it has an entire chapter devoted to evolutionary prototyping and another chapter devoted to throwaway prototyping.

I also took a quick glance at the Wikipedia article on software prototyping. Some parts of it are a little weird (at least on my quick read), but there doesn't appear to be anything that I downright disagree with. Some of it is a little focused on one particular aspect, but it's not factually wrong that I see. I prefer the definitions below, but it might be an interesting read on various types of prototyping.

Evolutionary Prototyping

Exploratory development where the objective of the process is to work
  with the customer to explore their requirements and deliver a final
  system. The development starts with the parts of the system that are
  understood. The system evolves by adding new features proposed by the
  customer. (Sommerville: Software Engineering, 8th Edition)

Evolutionary Prototyping is a lifecycle model in which the system is
  developed in increments so that it can readily be modified in response
  to end-user and customer feedback. Most evolutionary-prototyping
  efforts begin by prototyping the user interface and then evolving the
  completed system from that, but prototyping can start with any
  high-risk area. Evolutionary Prototyping is not the same as Throwaway
  Prototyping, and making the right choice about whether to develop an
  evolutionary prototype or a throwaway prototype is one key to success.
  Other keys to success include using experienced developers, managing
  schedule and budget expectations, and managing the prototyping
  activity itself. (McConnell: Rapid Development: Taming Wild Software Schedules)

Throwaway Prototyping:

Throwaway prototyping is where the objective of the evolutionary
  development process is to understand the customer's requirements and
  hence develop a better requirements definition for the system. The
  prototype concentrates on experimenting with the customer requirements
  that are poorly understood. (Sommerville: Software Engineering, 8th
  Edition)

With Throwaway Prototyping, code is developed to explore factors
  critical to the system's success, and then that code is thrown away.
  The prototyping implementation uses programming languages or
  development practices or both that are much faster than the target
  language and practices. The user interface is prototyped far more
  commonly than any other part of the system, but other parts of some
  systems can also benefit from being prototyped. When used as a
  requirementsspecification aid, the Throwaway Prototyping practice can
  accelerate projects based on traditional lifecycle models, such as DoD
  projects. It can be initiated at either a management or technical
  level. (McConnell: Rapid Development: Taming Wild Software Schedules)

OwnerDisplayName: Mifas


问:
Randomly Accessing Data Packets in a Compressed File
In my line of work I deal with very large files, hundreds of Gigabytes in size.  The nature of the data in these files is such that compression would greatly reduce their size.  The problem is, the records/data packets within the file must be individually accessible.

Is there a way to apply some home-grown techniques to these records to individually compress them and, once compressed, place them in a data stream such that the byte offset locations of each compressed packet is still known?

Would this kind of fragmentation of the packet data substantially affect the efficiency of the compression/decompression cycle?  Are zip algorithms suitable for this, or are there better methods of compression that are designed specifically for this?

答:
If you are dealing with well-defined packets, then the answer has to be that yes this is all possible.

I'd suggest:
- the file contains 2 types of information: an index, and a data record
- data records are compressed
- indexes point to data records, or a new index

The indexes need to be extensible so that as you grow a file by adding more records you can create and add a new index if it is required.

This could all be wrapped up in a fairly nice API.

If you wanted to compress the data records, I'd suggest you look at 7-zip, it seems to have a COM interface or similar, and it compresses better than plain zip.

Something to bear in mind is that when dealing with large files, you may find that you get far better compression of the whole file, when compared to compressing the records individually. This is because most of these compression algorithm rely on detection of repeated patterns in a file, and if there is repeated information across records this will crunch down very well. An individual record might not have much repeated information and so may not compress as well.


答:
Depends on the open source license which isn't stated in the question.  GPL gives the most problems in this regard and any static link or runtime link is suspect.

Read the FAQ for best results; don't trust other answers.  Using plugins is not truly legit.  Many commercial products violate the GPL in different ways & basically look the other way.

http://www.gnu.org/licenses/gpl-faq.html

If a program released under the GPL uses plug-ins, what are the
  requirements for the licenses of a plug-in? It depends on how the
  program invokes its plug-ins. If the program uses fork and exec to
  invoke plug-ins, then the plug-ins are separate programs, so the
  license for the main program makes no requirements for them.

If the program dynamically links plug-ins, and they make function
  calls to each other and share data structures, we believe they form a
  single program, which must be treated as an extension of both the main
  program and the plug-ins. This means the plug-ins must be released
  under the GPL or a GPL-compatible free software license, and that the
  terms of the GPL must be followed when those plug-ins are distributed.

If the program dynamically links plug-ins, but the communication
  between them is limited to invoking the ‘main’ function of the plug-in
  with some options and waiting for it to return, that is a borderline
  case.


问:
How to Properly Google for C
The problem with trying to use Google to find tutorials or answers for the C programming language is that C is not an expressive enough name to narrow down the searches. Even coupled with keywords like "Programming" and/or "Language" yields results mostly for C++, C#, and Objective-C.

Is there a way to more effectively search for specific C resources using Google?

答: My solution barring just going to Stack Overflow and searching by tag there, is to look up what I want to do, then put it in quotes before I search. So "C Programming Tutorial" would probably get what you wanted. Something I looked up a while back, "Matrix multiplication in C" would be similar. Also learning to use Google's advanced search has really become a right of passage of sorts for programmers. I know of people on this and other SE sites who have scripts and settings for their browsers to do a lot of that stuff automatically.</p>

Title: How to Properly Google for C


答:
If you're searching for a specific programming concept, just put 'C' at the beginning of the search.  In my experience, early terms have a higher weight - and C is common enough that just about any programming term reveals actual programming information for the language.

Unfortunately, Google sometimes likes to be smart and include/exclude punctuation as it sees fit, so you may match things like C++, C#, and so on for a while.

However, Google can be trained, if you're logged in.  I search for programming-related items so often, Google often assumes that's what I mean without needing more clarification. (For example, a search for 'tree' gives me the wikipedia article on the data structure in the results before the type that grow outside - although most of the remaining results are that type of tree).  Eventually Google should learn that you mean C, not C++, C#, or the generic letter of the alphabet.

Title: How to Properly Google for C

Body:
The problem with trying to use Google to find tutorials or answers for the C programming language is that C is not an expressive enough name to narrow down the searches. Even coupled with keywords like "Programming" and/or "Language" yields results mostly for C++, C#, and Objective-C.

Is there a way to more effectively search for specific C resources using Google?


问:
Can we replace XML with JSON entirely?
I'm sure lots of developers are familiar with XML and JSON, and they've used both of them. Thus no point in explaining what they are, and what is their purpose, even in brief.

If we try to map their concepts, we can say (correct me if I'm wrong):

XML tags are equivalent to JSON {}

XML attributes are equivalent to JSON properties

XML tag collection is equivalent to JSON []

The only thing I can think of, which doesn't exist in JSON, is XML Namespaces.

The question is, considering this mapping, and considering that JSON is highly lighter in this mapping, can we see a world in future (or at least theoretically think of a world) without XML, but with JSON doing everything XML does? Can we use JSON everywhere XML is used?

PS: Please note that I've seen this question. It's something entirely different from what I'm asking here. Thus please don't mention duplicate.

答: I don't know if such a facility exists for JSON, but in .NET at least you can validate XML against a given schema. That's a valuable advantage of XML in my eyes.</p>

Title: Can we replace XML with JSON entirely?


答:
The LZ-based compression schemes are based on finding and eliminating repeated strings of characters. As they compress a stream, they build up a dictionary of strings that have been encountered, so when the same string is encountered again, they transmit the location of that string in the dictionary instead of re-transmitting the entire string.

In a typical case, the first few kilobytes of data actually expand a little, because the dictionary starts out (essentially1) empty. Only after a few kilobytes have been scanned and strings added to the dictionary do you start to get much compression.

To get such an algorithm to work decently on record-oriented data, you probably want to group your records into blocks of, say, something like 64K apiece. Reading a record will be a two-step process. First you'll find the block that contains the record, read it into memory, and de-compress the whole block. Then you'll find the record you care about in that decompressed data.

The block size you select is a compromise between compression efficiency and random access efficiency. A larger block generally improves compression, but (obviously enough) requires you to read more data to get to the records in a block. A smaller block size reduces the extra data you need to read to get to a particular record, but also reduces compression.

If you're willing to hand-roll your compression, you can do things rather differently. The general idea would be to scan through a large quantity of data to build a (roughly LZ-like) dictionary of repeated strings, but not do on-the-fly compression like LZ does. Instead, store the dictionary (separately from the data). After you've scanned through all the data, use the full dictionary to compress the data. This requires you to store the dictionary (which uses some space) but allows you to have it pre-built when you decompress the data. This reduces the penalty for compressing each record separately, so when you read data you'll only need to read one record (plus associated parts of the dictionary -- but when it's in use, you'll probably have most of the dictionary in RAM most of the time).

1 In quite a few implementations, the dictionary starts out initialized with entries for the 256 possible byte values, but this still results in expansion -- each of those one-character strings is represented in the bit-stream with a (minimum of a) 9-bit code. In other cases, those dictionary entries are "virtual" -- each is treated as being present at the proper position in the dictionary, but never actually stored.

Title: Randomly Accessing Data Packets in a Compressed File

Body:
In my line of work I deal with very large files, hundreds of Gigabytes in size.  The nature of the data in these files is such that compression would greatly reduce their size.  The problem is, the records/data packets within the file must be individually accessible.

Is there a way to apply some home-grown techniques to these records to individually compress them and, once compressed, place them in a data stream such that the byte offset locations of each compressed packet is still known?

Would this kind of fragmentation of the packet data substantially affect the efficiency of the compression/decompression cycle?  Are zip algorithms suitable for this, or are there better methods of compression that are designed specifically for this?


答:
You can use the + or - signs to add or remove weight for a search term.

However the best place to search really isn't google at all, it's StackOverflow

A few google examples anyway:

+C for articles where the letter C stands alone

+C -C++ for C articles where there are no references to C++

+"C Sharp" for articles with weight added to a grouped term

Title: How to Properly Google for C


问:
What are the best strategies for selling Android apps?
I'm a young developer hoping to sell my apps I made for Android soon. My applications are basically 99% finished so I'm investigating what would be the best marketing strategy to use to sell my apps. I'm sure the brilliant minds here can give me some great advice.

I'm particularly interested in your thoughts on the following points (especially from experienced Android developers):

Is it more profitable to sell an app for free with ads or to sell an app without ads for a price? Perhaps a combination of a free ad version and a paid ad-free version?

If you give away an app for free with ads on it is it ethical to decline bending over backwards to support it?

How much does piracy actually affect potential sales? Should any effort be put towards preventing it?

Can you still make a profit off your application if you make it open source? Could you perhaps make more of a profit from the attention you would get by doing so?

Is Google's Android Marketplace really the best place to release Android apps?

It is worthwhile enough to maintain a developer blog or website to keep users updated on your development progress and software releases?

Any other suggestions you could give me to maximize profit meanwhile keeping users happy and coming back for more would also be greatly appreciated. While I appreciate general tips and tricks, I'd like to ask that if possible you please go the extra step and show how they specifically apply to selling Android apps. Marketing statistics, developer retrospect, and any additional experience you can share from your time selling Android apps is what I would love to see most.

Thank you very much in advance for your time. I truly appreciate all the responses I receive.

答:
I've developer some popular Android apps, such as "Car Locator", so I'll try to answer your question using my personal experience.

Is it more profitable to sell an app for free with ads or to sell an app without ads for a price? Perhaps a combination of a free ad version and a paid ad-free version?

I've tried both methods, and have found that it is much more profitable to sell your app without ads for a price. In my experience, Android users are willing to pay good money (upto $5) for a good quality app that fits their needs.

If you have a free version of your app, make sure to include an ad or link somewhere in that links to your paid version. The point of your free version should be to get your user to ultimately buy the full version of the app. You might want to checkout www.marketandroidapps.com for some more discussions on paid/free app strategies.

If you give away an app for free with ads on it is it ethical to decline bending over backwards to support it?

I personally believe that you should support anything you release. This is especially true for any bugs that you may have in the app. Of course, if your user is being very unreasonable without having paid for the app, you shouldn't spend too much time supporting that person. I have users who pirate my apps, and then ask for support over email, and I'll still support them sometimes!

How much does piracy actually affect potential sales? Should any effort be put towards preventing it?

Adding some licensing solution to your app in order to prevent piracy is really quick and can stop a lot of piracy. Android's LVL or AndroidLicenser.com are a good starting points.

Can you still make a profit off your application if you make it open source? Could you perhaps make more of a profit from the attention you would get by doing so?

I don't have any experience in this, so I won't answer.

Is Google's Android Marketplace really the best place to release Android apps?

Yes. Google's Android Marketplace accounts for about 95% of my revenue, so it is still by far the best place to release your Android apps. I have my apps released through Android, Amazon, Verizon, Motorola, and AndroidLicenser.com

It is worthwhile enough to maintain a developer blog or website to keep users updated on your development progress and software releases?

Most certainly! It does not take very much time and it can only help you!


问:
What are questions to test a programmers knowledge of SQL?
What are questions to test a programmers knowledge of SQL? What is the answer to the question? And what would a lack of an correct answer mean in terms of time likely to understand the concept(s) related to the question?

GOOGLED: sql challenge

答:
It depends on how difficult you want it to be. Also, I'm a little wary of giving you the answer because most SQL problems have multiple acceptable ways to do things and there are also ways of solving SQL problems in sloppy ways that will cause other issues. The person "grading" the answer definitely needs to be able to solve it on their own.

That said, here are a few I came up with off the top of my head.

Extremely Easy Level:

Given an employees table with the columns EmpID, FirstName, Lastname, HireDate, and TerminationDate:

Write a query to return all employees still working for the company with last names starting with "Smith" sorted by last name then first name.

Easy Level

Given the Employee table above, plus a new table "AnnualReviews" with the columns EmpID, and ReviewDate:

Write a query to return all employees who have never had a review sorted by HireDate.

Medium Level
Given the employee table above, write a query to calculate the difference (in days) between the most and least tenured employee still working for the company?

Hard Level

Given the employee table above, write a query to calculate the longest period (in days) that the company has gone without a hiring or firing anyone.

Harder Level

Again using the same tables, write a query that returns each employee and for each row/employee include the greatest number of employees that worked for the company at any time during their tenure and the first date that maximum was reached. Extra points for not using cursors.


答:
Personally I've always googled "C programming", and then whatever topic regarding the language that I'm curious about... That is...

Until I found out about stack overflow. Now I just use the already existing language tags there, and search within them. If noone has answered any question on the subject of matter (quite rare but it happens every now and then) I ask the question myself. :)

Title: How to Properly Google for C


问:
Fast algorithm to search a sorted array of floats to find the pair of floats bracketing an input value
I have an array of floats, sorted from smallest to largest, and need to be able to pick out the nearest float greater than or less than a passed input value.  This input value is not necessarily present as a value in the array.

A naive approach would be to do a simple linear search through the array.  That might look like this:

```<code>void FindClosestFloatsInArray( float input, std::vector<float> array,
                               float *min_out, float *max_out )
{
    assert( input >= array[0] && input < array[ array.size()-1 ] );
    for( int i = 1; i < array.size(); i++ )
    {
        if ( array[i] >= input )
        {
            *min = array[i-1];
            *max = array[i];
        }
    }
}
</code>```

But obviously as the array gets larger, this will become slower and slower.

Does anyone have an idea about an algorithm that would let me find this data more optimally?  I've already switched to a binary search, which has improved matters somewhat, but it's still a lot slower than I'd like, and since I'm not actually looking for a specific value that exists in the array, it can never terminate early.

More information:  The floating point values in the array are not necessarily distributed evenly (that is, the array could consist of the values "1.f, 2.f, 3.f, 4.f, 100.f, 1200.f, 1203.f, 1400.f".

I'm doing this operation hundreds of thousands of times, but I can do any amount of pre-processing on the array of floats, if it'll improve the lookup time.  I absolutely can change to use something other than a vector to store them, if that'll help.

答: The obvious answer is to store the floats in a tree. Supporting 'previous' and 'next' operations are trivial in a tree. So just do a 'next' on your value, and then do a 'previous' on the value you find in the first step.</p>


问:
Why do programmers use one-based indexing for line numbers in source code?

Possible Duplicate:

  Why isn't the line count in Visual Studio zero-based?

Why isn't the top line in a source code file labelled line number 0?

i.e. in a source file which was 10 lines long, I would expect line numbers would be 0-9, but they're not!  Now grep, awk, sed etc all seem to number from 1, so I'm assuming it's an established convention for a good reason.

It occurred to me recently that, for almost every other structure a programmer has to deal with in their day to day work, the convention is to count from 0 - and a source file is as much like a list of lines as a line is like a list of chars (afaik list of chars is invariably 0-indexed). I had to actually open up my text editor and sanity check that the top line of a file was labelled line number 1!

I was just wondering if there is a good reason for this or if it's just an unfortunate historical convention.

答:
I have programmed in Basic. There the numbers would typically be 10, 20, 30. You could add extra lines like 15 and then use "renum" to make 10, 20, 30, 40. And these numbers were important as you used "goto 15".

So lines haven't always been numbered as 1,2,3


答:
0-based indexing is for computers not humans

line numbers are for humans not computers

all humans are not programmers

1-based line numbers ease readability a tiny bit -- otherwise every time you saw an error message with a line number, you'd have to remember to decrement it by one to get to the actual line that caused the error -- and that impedes readability.

Also line 1 reads better than line 0 -- because others (people who may be non-technical) may have to read your code.

Title: Why do programmers use one-based indexing for line numbers in source code?

Body:
Possible Duplicate:

  Why isn't the line count in Visual Studio zero-based?

Why isn't the top line in a source code file labelled line number 0?

i.e. in a source file which was 10 lines long, I would expect line numbers would be 0-9, but they're not!  Now grep, awk, sed etc all seem to number from 1, so I'm assuming it's an established convention for a good reason.

It occurred to me recently that, for almost every other structure a programmer has to deal with in their day to day work, the convention is to count from 0 - and a source file is as much like a list of lines as a line is like a list of chars (afaik list of chars is invariably 0-indexed). I had to actually open up my text editor and sanity check that the top line of a file was labelled line number 1!

I was just wondering if there is a good reason for this or if it's just an unfortunate historical convention.


答:
for almost every other structure a programmer has to deal with in their day to day work, the convention is to count from 0

This is language specific, and AFAIK it is only prevalent in C and its successors. AFAIR indexing is 1-based at least in the Pascal / Modula and BASIC family, and possibly in functional languages too (which don't use indexing much anyway, rather iterators or foreach etc.).

In C, it made array/pointer arithmetic convenient. However, I don't think anyone can call it intuitive - I believe it took some time for all of us to get used to it. It is, as @greengit pointed out, a hardware-level concept, or rather an implementation detail. Only (C et al) programmers need to understand and use 0-based indexing, but try to explain it to a layperson :-)

When dealing with lines of file, you rarely do pointer arithmetic - a file of text lines is simply a higher level of abstraction. And more so, as text files are used by a lot of people who aren't C programmers, just "simple" users. Making their life more complicated by forcing them to learn a low level implementation detail would be totally counterproductive.

And one more important thing: text files (and before them, punch cards) have been around for decades before C came into existence, so I believe by the time C was created, counting their lines/rows from 1 was already a well established convention.


问:
When is a version control commit too large?
I've heard in several places "Don't make large commits" but I've never actually understood whats a "large" commit. Is it large if you work on a bunch of files even if there related? How many parts of a project should you be working on at once?

To me, I have trouble trying to make "small commits" since I forget or create something that creates something else that creates something else. You then end up with stuff like this:

```
Made custom outgoing queue

Bot
-New field msgQueue which is nothing more than a SingleThreadExecutor
-sendMsg blocks until message is sent, and adds wait between when messages get
sent
-adminExist calls updated (see controller)
-Removed calles to sendMessage

Controller
-New field msgWait denotes time to wait between messages
-Starting of service plugins moved to reloadPlugins
-adminExists moved from Server because of Global admins. Checks at the channel,
server, and global level

Admin
-New methods getServer and getChannel that get the appropiate object Admin
belongs to

BotEvent
-toString() also show's extra and extra1

Channel
-channel field renamed to name
-Fixed typo in channel(int)

Server
-Moved adminExists to Controller

PluginExecutor
-Minor testing added, will be removed later

JS Plugins
-Updated to framework changes
-Replaced InstanceTracker.getController() with Controller.instance
-VLC talk now in own file

Various NB project updates and changes

---

Affected files
Modify  /trunk/Quackbot-Core/dist/Quackbot-Core.jar
Modify  /trunk/Quackbot-Core/dist/README.TXT
Modify  /trunk/Quackbot-Core/nbproject/private/private.properties
Modify  /trunk/Quackbot-Core/nbproject/private/private.xml
Modify  /trunk/Quackbot-Core/src/Quackbot/Bot.java
Modify  /trunk/Quackbot-Core/src/Quackbot/Controller.java
Modify  /trunk/Quackbot-Core/src/Quackbot/PluginExecutor.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/Admin.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/BotEvent.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/Channel.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/Server.java
Modify  /trunk/Quackbot-GUI/dist/Quackbot-GUI.jar
Modify  /trunk/Quackbot-GUI/dist/README.TXT
Modify  /trunk/Quackbot-GUI/dist/lib/Quackbot-Core.jar
Modify  /trunk/Quackbot-GUI/nbproject/private/private.properties
Modify  /trunk/Quackbot-GUI/nbproject/private/private.xml
Modify  /trunk/Quackbot-GUI/src/Quackbot/GUI.java
Modify  /trunk/Quackbot-GUI/src/Quackbot/log/ControlAppender.java
Delete  /trunk/Quackbot-GUI/src/Quackbot/log/WriteOutput.java
Modify  /trunk/Quackbot-Impl/dist/Quackbot-Impl.jar
Modify  /trunk/Quackbot-Impl/dist/README.TXT
Modify  /trunk/Quackbot-Impl/dist/lib/Quackbot-Core.jar
Modify  /trunk/Quackbot-Impl/dist/lib/Quackbot-GUI.jar
Modify  /trunk/Quackbot-Impl/dist/lib/Quackbot-Plugins.jar
Modify  /trunk/Quackbot-Impl/lib/javarebel.stats
Add /trunk/Quackbot-Impl/lib/jrebel.info
Modify  /trunk/Quackbot-Impl/nbproject/private/private.properties
Modify  /trunk/Quackbot-Impl/nbproject/private/private.xml
Modify  /trunk/Quackbot-Impl/nbproject/project.properties
Modify  /trunk/Quackbot-Impl/plugins/CMDs/Admin/reload.js
Add /trunk/Quackbot-Impl/plugins/CMDs/Operator/hostBan
Modify  /trunk/Quackbot-Impl/plugins/CMDs/Operator/mute.js
Modify  /trunk/Quackbot-Impl/plugins/CMDs/lyokofreak/curPlaying.js
Modify  /trunk/Quackbot-Impl/plugins/CMDs/lyokofreak/lfautomode.js
Modify  /trunk/Quackbot-Impl/plugins/listeners/onJoin.js
Modify  /trunk/Quackbot-Impl/plugins/listeners/onQuit.js
Modify  /trunk/Quackbot-Impl/plugins/testCase.js
Add /trunk/Quackbot-Impl/plugins/utils/whatsPlaying.js
Modify  /trunk/Quackbot-Impl/src/Quackbot/impl/SandBox.java
Add /trunk/Quackbot-Impl/vlc_http
Add /trunk/Quackbot-Impl/vlc_http/current.html
Modify  /trunk/Quackbot-Plugins/dist/Quackbot-Plugins.jar
Modify  /trunk/Quackbot-Plugins/dist/README.TXT
Modify  /trunk/Quackbot-Plugins/dist/lib/Quackbot-Core.jar
Modify  /trunk/Quackbot-Plugins/nbproject/private/private.properties
Modify  /trunk/Quackbot-Plugins/nbproject/private/private.xml
Modify  /trunk/Quackbot-Plugins/src/Quackbot/plugins/JSPlugin.java
Add /trunk/Quackbot-Plugins/vlc_http
Add /trunk/global-lib/jrebel.jar
```

Yea....

So for questions:

What are some factors for when a commit becomes too large (non-obvious stuff)?

How can you prevent such commits? Please give specifics

What about when your in semi-early stages of development when things are moving quickly? Are huge commits still okay?

答:
This example shows a commit that is too large.

As a rule of thumb, describe the change in one sentence or one line of text.  (Based on this rule, the commit should be broken into 10-15 smaller ones.)  If you can't adequately comment a commit in one line, then it's already too large.

To practice smaller commits, take notes in your notepad (or in Notepad) of what you've already changed or added.  Commit before it becomes a long list or before you make a code change unrelated to what you already have in the notepad.