答:
You can hire people.

You can try and start a project in a fairly homogenous programming community that may be highly interested in your idea. For example, the blender.org crowd could surely be interested in using Microsoft's Kinect in some way. Just use the usual tools and languages the community uses, and something may get done.

You can go the "usual" way and start to publish something reasonably documented and reasonably useful on github, and hope someone else also gets interested.

In my humble experience, most other ways really won't work.

You seem to under-estimate the time and effort it takes to plan and organize a project with complete strangers with no one knowing the other people's skills and interests.

You won't be saving time vs doing it on your own, until LONG into the project. But likely, it will break apart long before then, over a dispute over some silly thing (which programming language / framework to use for feature X, how to implement feature Y), or any other such thing.

It is much better to either be able to dictate the terms of the project (because you're the employer) or having laid down some framework for the project by providing the first implementation, if you want to get anything done.

Title: How would you go about looking for collaborators?

Body:
I seem to have a never ending stream of more-or-less original, more-or-less cool ideas for software/apps/stuff yet to be written on my mind. Sometimes, I decide to just start implementing my idea. Several hours later, I end up with a decent, more-or-less working prototype of what I'm trying to build. Then, my alarm clock goes ringing and I have to get back to the real world, tired as hell. In most cases, the stuff I started remains unfinished forever. Sometimes, that's okay. Other times, I honestly feel like that's a bummer.

But I realize that there are sites like GitHub and there are many other coders out there. Is there a place where one can post ideas, proposals, concepts, or rough-around-the-edges-code in order to find people who are interested in collaborating on projects?

Edit: I am aware of "the usual way" – keep developing on your own for some period of time, open-source the code, mention your project on dev blogs, IRC or wherever else you go; eventually attracts others.

What I'm looking for is a place to connect with other devs (e.g. of different specializations) on the early stages of a project.


问:
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?

答:
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?

A small company (management) that is planning to use agile practices is in a great starting position since its typically developers who drive adoption.  I would recommend that you identify leaders willing to continue driving adoption at the team level (Training, institutionalization, etc.)

With requirements in hand, ask your users what they would want to see in one iteration.  Then, deliver it.  Do it again the next iteration and again.  Users who are able to touch your work early will help refine the requirements as you go.  If you do not have automated processes in place now or the team does not understand continuous development then schedule time to make sure they do.

OwnerDisplayName: TK Lee

ContentLicense: CC BY-SA 3.0


问:
Theta notation on constant time. Why we use the 1?
In asymptotic notation when it is stated that if the problem size is small enough (e.g. n<c for some constant c) the solution takes constant time and is writen as Theta(1).

Why we write 1  inside the Theta?

What does the 1 mean? Why not Theta(c)?

答: O(c) specifically means that the associated class of algorithms grows linearly with c, where c is the size of an input to the algorithm or a parameter to the algorithm. It isn't the same c that is used to explain O-notation, because that c is only relevant to the explanation, not the usage. O(c) contains a different c that must come from the algorithm input context.


问:
Product Owner introduces ungroomed (unfamiliar, not estimated) User Story(s) into the Sprint Planning meeting
A problem that I am facing and would like some input into is; a Product Owner introduces ungroomed (unfamiliar, not estimated) User Story(s) into the Sprint Planning meeting.

The issue that this has caused is the team rushes to understand and estimate the User Story(s), which puts significant time pressure on the commitment portion of the Sprint Planning meeting. The team also seems to be unsure of their estimate due to the rushed nature of grooming them in the Sprint Planning meeting. The end result of this is a rushed, half hearted Sprint commitment, which is usually an under-commitment due to so much uncertainty.

I have seen two distinctly different causes for the late introduction of the User Story(s):

The team is new to Scrum and has been having difficulties grooming
stories, prior to planning.

A brand new high priority User Story has
appeared just before the Sprint Planning meeting.

I have discussed these issues with the Product Owner and we have decided upon on actions, I am wondering what have you tried when the Product Owner introduces a brand new high priority User Story just before or even in the Sprint Planning meeting? What worked, what failed?

The team that is having difficulty grooming User Stories in new to Scrum; hence I suspect that some facilitation of their grooming sessions, mentoring and some time will help them.

Do you have any other suggestions for helping teams come up prompt Planning Poker estimates?

答:
A useful tool in this situation is Planning Poker.  The team spends a few minutes asking the product owner questions about the story and then they each estimate the story points.  The variety of estimates are used to probe for gaps.  Using this tool over time, the PO will begin to realize what questions need to be answered before planning.

The Agile Project Manager (Scrum Master) should work closely with the Product Owner to develop appropriate sized clearly defined stories.  The PM should protect the developers from having to estimate incomplete stories and developers should not commit to a story that is not achievable - ever.

OwnerDisplayName: Andrew Rusling


问:
Using Microsoft Office software as part of my web service backend?
What licensing issues arise if I install and use Microsoft Office software (in this case Visio) as part of my web service backend?

My company's flagship piece of software can convert Microsoft Visio files for use in their environment, but of course requires a local install of Visio to decode the files. The system I'm to create is to offer a sort of web service where people can upload their Visio files, and then we can show off one of the benefits of buying our full price software.

In order to do this I'd need an install of our software on the server, as well as Visio. What I'm a little concerned about is technically any visitor to the site is technically using Visio. I can't really find any other examples when searching online so any advice would be greatly appreciated!

答:
If you have a single license per each web server that should be fine. Technically, your software/the website user identity is using the software.

So long as you don't distribute Visio through the site you are OK.

If you look through technet/MSDN, there are many articles about automating office on the server side, so this is evidence that using office on the server is a supported and expected scenario.

You should contact Microsoft directly and get confirmation from MS - it depends on what Office license you have.


问:
Testing-related methodologies except TDD/BDD
Are there any testing-related methodologies except TDD/BDD? I see a lot of people who practice their own testing approaches (e. g., see Ayende post), but I don't see any formalization for it, no naming for these approaches.</p>

答:
Most test methodologies are integral to the development process they support.  For example, in the Waterfall Model, testing follows as feasibility, requirements analysis, system design conformity, Code/Unit testing, Integration/System Testing and finally deployment review/refactoring.  It's arguable that this would be called the "Waterfall test" methodology but in effect, that's what it is.

In agile testing, more emphasis is placed on test automation, paired programming (instant test feedback!) and QA within the iterative build cycle.

There are very well defined test methods depending on the software life-cycle needs.  Exhaustive lists are available elsewhere but the more common methods include, unit, integration, stress, performance and system testing.

Unlike development processes, however, rigorously defined test methodologies as a standalone practice is lacking.  Instead, QA standards are set by a variety of bodies including ISO and CMMi.


问:
What are the benefits of not including other header files in a header file?
Sometimes, a header file uses objects that are in declared in other header files. The user of this header file would have to include the dependency anyway and get the order correct too.</p>

答:
Assuming we are talking about C/C++ like languages that use #include

It is best (like all rules of thumb there are exceptions) to include only the things you explicitly need.

Anything that is not explicitly needed should be forward declared. This helps to prevent cycle dependencies in the code. Also when you do maintenance on the code it prevent you accidentally removing dependencies that have been implicitly introduced.

Full class definitions are needed if:

You inherit from them

You have member objects of that type (not pointers or references).

You have parameters passed by value of that type.

If you just use something by reference then you should try and use a forward declaration.


问:
How to manage a Closed Source High-Risk Project?
I am currently planning to develop a J2EE website and wish to bring in 1 developer and 1 web designer to assist me. The project is a financial app within a niche market.

I plan to keep the source closed. However, I fear that my would-be employees could easily copy the codebase and use it or sell it to a third party. The app development will take 4-6 months, perhaps more, and I may bring in additional employees after the app goes live.

But how do I keep the source to myself. Are there techniques companies use to guard their source?

I foresee disabling USB drives and DVD writers on my development machines, but uploading data or attaching the code in email would still be possible.

My question is incomplete. But programmers who have been in my situation, please advice. How should I go about this? Building a team, maintaining code-secrecy,etc.

I am looking forward to sign a secrecy contract with the employees if needed too.
(Please add relevant tags)

Update

Thank you for all the answers. I certainly won't be disabling all USB ports and DVD writers now. But I think I should be logging activity(How exactly should I do that?) I am wary of scalpers who would join and then run off with the existing code. I haven't met any, but I have been advised to be wary of them. I would include a secrecy clause, but given this is a startup with almost no funding and in a highly competitive business niche with bigger players in the field, I doubt I would be able to detect or pursue any scalpers.

How do I hire people I trust, when I don't know them personally. Their resume will be helpful but otherwise trust will develop only with time.

But finally even if they do run away with the code, it is service that matters after the sale is made. So I am not really worried for the long term.

答:
If this is some sort of startup, then the number one thing you need to do is get a product built.  You need good developers who will work hard and be dedicated to the project.

One really easy way to get rid of them, or at least to sap their morale and dedication, is to show them up front that you don't trust them.  In fact, they're likely to start thinking of ways they can get the code out (although they almost certainly won't follow through), and if they can come up with a way they'll think you not only paranoid but stupid.  (There are organizations where this level of caution is justified, and a financial website startup will not be considered one of them.)

A few clauses in the contract about how the software is your property will be fine.  If somebody will violate that, they'll violate any more severe language you've got, and probably feel more justified.  Non-compete clauses that aren't narrow and time-limited will just chase off the people you want, and may in fact not be legal in your jurisdiction (consult a local lawyer to find out).

If you hire good people, they can rewrite the software later.  If you hire beginners, they won't know how to further develop what they walk off with, and anybody building on it will be running serious legal risks to come in late with an inferior version of what you've got.

In short, this should be way low on the things you worry about.  If you hire bad people, you're sunk no matter what.  Concentrate on hiring good people and let this slide.

ContentLicense: CC BY-SA 2.5


答:
On the Help menu, click About Visio, Click View the Microsoft Software License Terms.

Not all Microsoft Office software is authorized for use in a sever environment. For example, Excel is not authorized for use on a server.  There are also restrictions for use in Terminal Services environments.

Title: Using Microsoft Office software as part of my web service backend?

Body:
What licensing issues arise if I install and use Microsoft Office software (in this case Visio) as part of my web service backend?

My company's flagship piece of software can convert Microsoft Visio files for use in their environment, but of course requires a local install of Visio to decode the files. The system I'm to create is to offer a sort of web service where people can upload their Visio files, and then we can show off one of the benefits of buying our full price software.

In order to do this I'd need an install of our software on the server, as well as Visio. What I'm a little concerned about is technically any visitor to the site is technically using Visio. I can't really find any other examples when searching online so any advice would be greatly appreciated!


问:
Should code from an incomplete story be removed from the build?
During the sprint review the product owner may say that a particular story is incomplete or the team itself may not have completed some committed tasks.

In what situations do you leave the code in the build?  If the code is left in the build, is this a conscious decision made during the review?  In other words, do you discuss this issue during the review?

Are there specific instances where code should be removed?

答:
An incomplete feature should come out. But if this can be done without removing the code (feature flags, just removing the wiring, etc.) then that's fine -- preferable, in fact. Why? Because it limits the changes to a product which is already mostly-tested.

I would recommend that, if a story is medium-to-high risk, developers should always code with its possible removal in mind and make sure that task is as risk-free as possible.


答:
Do what makes sense.

If the code isn't going to cause any problems (say it's a function that can't be called), and/or if you are going to finish the story next sprint, then taking it out's just kinda wasting time pulling it out in order to put it back in.

If, on the other hand, the code is destabilizing something else, or is user-visible in a way that doesn't work, or it has the potential to break things, and you aren't getting back to the story right away, then removing it is probably the right thing to do.

Title: Should code from an incomplete story be removed from the build?

Body:
During the sprint review the product owner may say that a particular story is incomplete or the team itself may not have completed some committed tasks.

In what situations do you leave the code in the build?  If the code is left in the build, is this a conscious decision made during the review?  In other words, do you discuss this issue during the review?

Are there specific instances where code should be removed?


问:
What does long-term freelancing say about a developer's experience?
I have been interviewing candidates lately for a developer position requiring 10+ years experience and have come across a couple of CVs that I am not sure how to understand: I have interviewed a few of these people and so far have had no luck.

What are people's experience with developers with about 10 years experience, but who from day one have been working as mostly project-based freelancers? Are there potential benefits or drawbacks to a software development firm in having that type of experience?

答:
This depends a lot on the developer. And the job you're interviewing for. And what exactly you mean by freelancing.

There may be a concern over their ability to work as part of a team (they may not be keen on code-reviews, for example). But then freelancing might involve going to a company and working as part of a team, or even working as part of a team of freelancers.

There may be a concern over their lack of experience maintaining a product, assuming you work for a company who has a legacy product to maintain, but it could be that the nature of their work has given them that experience.

There may be a concern over their ability to stay in one place. Or that may be exactly why they're trying to get out of freelancing (plus, I've had salaried staff leave after a year).

And it might be that all those things are a problem but it doesn't matter in your workplace.

On the other hand, there is a good chance they'll be better at other parts of the development lifecycle (such as project management, gathering requirements, testing) but it's possible that they've had someone else doing that for them, or that the companies they've worked for have taken on that part of the job.

So, in the end, it's just like interviewing anyone else. Identify your concerns before the interview, make sure you ask the right questions and don't waste time on stuff like "what do you think is your biggest weakness?"


答:
Short Quick answer

Can you check with previous employers / customers, performance ?

Can the candidates give you a good reason why to work as a "freelancer" instead of a "company job" ?

There are several situations currently on the I.T. industry that pushes people to go "freelancer" instead of a "payroll job"

Long extended boring answer

This is a trickly situation.

Many "old fashion payroll HeadHunters", take "freelancers" as "inestable" or "untrustable" or "cannot keep a job" candidates. And some cases may be.

But, these days, Many companies that require Software Developers have change from been a "payroll" or "long term work within customer office contract" jobs to "short term within customer office contract" or "freelance work at home contract" .

There also some situations where developers may choose to go "freelance", and still be responsible, and perform well (I personally think these are good reasons, but, its subjective):

Lack of jobs on living area, but unavailable to change location

Age discrimination, you're over 35, and the company decides you to replace you, even if you have a good performance, and other companies do the same

Has a disability, that doesn't allow to have a job at a company,
but, can work at home

Have some independence, like parents with children, that can adjust or move its work time
(have to get the kids at school at 9 AM)

No job promotion, companies decide to hire "Ivy League Business Project Managers", and keep 5 to 10 year employees as "junior developers" for the rest of their productive life

Have tattoes, piercing, weird hairstyle of clothing, have a rock band, and still be very responsible at work

"Freelance" is a half way to "Own Software Developer Company"...

What are your reasons to accept a "freelancer" ?

What are your reasons to reject a "freelancer" ?

Does the "freelancer" paradigm works well in some projects, and bad in others ?

Title: What does long-term freelancing say about a developer's experience?

Body:
I have been interviewing candidates lately for a developer position requiring 10+ years experience and have come across a couple of CVs that I am not sure how to understand: I have interviewed a few of these people and so far have had no luck.

What are people's experience with developers with about 10 years experience, but who from day one have been working as mostly project-based freelancers? Are there potential benefits or drawbacks to a software development firm in having that type of experience?


答:
If the code that is there already has sufficient test coverage (unit tests etc), then you can keep it as it will still be being tested. If you have not got much automated testing going on, then you should probably remove it as unused code will rot, and the state of it will only be known later when it is again used.
Unused, untested code is mostly noise.</p>


答:
Thomas Owens comment is pretty to the point. Having been been a freelancer doesn't say anything about someone as a person or as a developer.

Personally, I have been working in software development in a couple of distinct capacities:

As an employee of a (large) consultancy organisation. I would work on their clients' projects at their clients' place of business. An hour-invoice type of deal, this was at a time when the concept of fixed price project was still at its infancy.

As a freelancer / self-employed contractor. Essentially this was the same as being employed through a consultancy organisation but I had the power to say "no" and could go after projects I liked.

As an employee of an in-house development shop.

As an employee of an independent software vendor.

As a business owner, developing smaller software applications for clients.

What does that say about me as a developer? Nothing.

There are many prejudices about freelancers, for example that they don't have any staying power, are easily bored, can only be trusted with the simplest of assignments. They probably are true for some, because if you do get that itch or your quality isn't up to scratch it may be easier to jump from project to project than to stay with one organisation for a longer period of time.

Freelancers are willing to take their skills and put them on the line. They get the boot quicker than any other employee, often simply because the money ran out or company politics killed the project they were hired to do. If someone has 10+ years experience as a freelancer, he or she has been able to pay the bills for all that time without the comfort of job-security. To me that is a positive. Even spells of many short contracts (3 months) are not necessarily a warning sign, while that would most certainly set alarm bells ringing for someone who was an employee all that time.

And what about someone who was employed all that time by a couple of consultancy organisations? They could easily hide the fact that they were booted from every project they worked on, simply by not mentioning specific/any projects or being vague about their duration.

Or someone who was employed by let's say three big organisations with large in-house development shops? Are they any better? More stable? Again it would be easy for someone with an employment history like that to hide less attractive facts in a general description of their employment. Never mind they were spat out by every team they were assigned to.

TLDR

The type of contract someone had when working on a project means tiddly squat. Having been a freelancer your entire career doesn't say anything about your worth as a developer. Nor does having been an employed person all your career say anything about your worth as a developer.

Your projects do. Your skills do. Your colleagues do. Your references do.


问:
how do you back up your code on your local computer?

Possible Duplicate:

  Version control for independent developers?

I have a folder containing all my code (working code, experiment code). I'd like to back it up to a zip file on an external hard drive or whatever is best. How do you guys backup your code?

Do you setup your own source control server?

Do you use a script to zip all files?

答:
Locally : I would have the code in two drives, along with a copy of code in USB Pendrive

Internet : I use google project hosting, or microsoft sky-drive. There are other sites too like Codeplex, git-hub but i haven't used them.

IMO Internet is more secure, because one can't really expect Google and Microsoft to go down :-)


答:
I write code on my Mac / Linux box and have a separate Linux shell account online with my Web host. So I wrote a shell script that tars and gzips my code's directory and then scp's it to my online shell account. The script kind of looks like:</p>

```<code>#!/bin/csh -f

if ($#argv == 0) then
    echo "Usage: archive_and_upload.csh dir"
    exit 1
endif

set filename = $argv[1]

if (! -e $filename) then
    echo "$filename does not exist"
    exit 1

else if ((-e $filename) && (! -d $filename)) then
    echo "$filename exists but is not a directory"
    exit 1

endif

set timestamp = `date "+%Y_%m_%d__%H_%M"`

set output_link = "${filename}_${timestamp}"

if (-e $output_link) then
    echo "The link $output_link could not be created because it already exists."
    exit 1
else
    ln -sf $filename $output_link
endif

set output_tar_filename = "${output_link}.tar"
set output_targz_filename = "${output_tar_filename}.gz"

# Create tar file

echo ""
echo "Creating tar file '$output_tar_filename'"

tar hcvpf $output_tar_filename $output_link
set tar_status = $status
if ($tar_status != 0) then
    echo "tar failed with status $tar_status"
    # Clean up
    if (-e $output_link) then
        rm $output_link
    endif
    exit 1
endif
echo "Done."

# Create gzip file

echo ""
echo "Gzipping tar file '$output_tar_filename'"

gzip $output_tar_filename
set gzip_status = $status
if ($gzip_status != 0) then
    echo "tar failed with status $gzip_status"
    # Clean up
    if (-e $output_link) then
        rm $output_link
    endif
    exit 1
endif
echo "Done."

# Upload to the server

echo ""
echo "Uploading  '$output_targz_filename'  to server"
echo ""

scp -p $output_targz_filename  MYACCOUNT@ACCOUNTHOST.COM:target/directory/

# Clean up
if (-e $output_link) then
    rm $output_link
endif

exit 0
</code>```

Title: how do you back up your code on your local computer?

Body:
Possible Duplicate:

  Version control for independent developers?

I have a folder containing all my code (working code, experiment code). I'd like to back it up to a zip file on an external hard drive or whatever is best. How do you guys backup your code?

Do you setup your own source control server?

Do you use a script to zip all files?

Body:
I write code on my Mac / Linux box and have a separate Linux shell account online with my Web host. So I wrote a shell script that tars and gzips my code's directory and then scp's it to my online shell account. The script kind of looks like:

#!/bin/csh -f

if ($#argv == 0) then
    echo "Usage: archive_and_upload.csh dir"
    exit 1
endif

set filename = $argv[1]

if (! -e $filename) then
    echo "$filename does not exist"
    exit 1

else if ((-e $filename) && (! -d $filename)) then
    echo "$filename exists but is not a directory"
    exit 1

endif

set timestamp = `date "+%Y_%m_%d__%H_%M"`

set output_link = "${filename}_${timestamp}"

if (-e $output_link) then
    echo "The link $output_link could not be created because it already exists."
    exit 1
else
    ln -sf $filename $output_link
endif

set output_tar_filename = "${output_link}.tar"
set output_targz_filename = "${output_tar_filename}.gz"

# Create tar file

echo ""
echo "Creating tar file '$output_tar_filename'"

tar hcvpf $output_tar_filename $output_link
set tar_status = $status
if ($tar_status != 0) then
    echo "tar failed with status $tar_status"
    # Clean up
    if (-e $output_link) then
        rm $output_link
    endif
    exit 1
endif
echo "Done."

# Create gzip file

echo ""
echo "Gzipping tar file '$output_tar_filename'"

gzip $output_tar_filename
set gzip_status = $status
if ($gzip_status != 0) then
    echo "tar failed with status $gzip_status"
    # Clean up
    if (-e $output_link) then
        rm $output_link
    endif
    exit 1
endif
echo "Done."

# Upload to the server

echo ""
echo "Uploading  '$output_targz_filename'  to server"
echo ""

scp -p $output_targz_filename  MYACCOUNT@ACCOUNTHOST.COM:target/directory/

# Clean up
if (-e $output_link) then
    rm $output_link
endif

exit 0


答:
I use one of these two techniques:

A. Use source control, github, google code, codeplex

B. If source control is overkill for your project, use dropbox or live mesh to basically duplicate code across multiple machines.


答:
One word: Git.

Commit locally as often as you like, giving you a backup. Push remotely as often as you like, giving you an offsite backup. Have a full history of all changes, be able to fork locally and remotely, so that you can play around with ideas.

And it's dead easy to set up. It's not sooo easy to learn, but anyone who can learn to code can learn to use Git by experience.


问:
Do companies care about university grades when hiring programmers?
Most of my fellow students that I've talked to claim that aiming for good grades is useless as the companies don't care about them when hiring programmers. To them, it's enough to have simply attended courses which may be important, and that's that.

Is this true? Are university grades useless when leaving campus, or do employers ask to see them for an interview?

答:
You're trying to figure out what a hiring manager will value... and that can be tricky. My experience is mostly with companies doing systems programming, compilers, and embedded software.

I've worked at two companies who had a minimum GPA to be considered, but it wasn't too onerous. (3.0 out of 4) Some hiring managers view overall GPA as a half decent "performance evaluation" of the candidate over a long term period, and a decent measure of self-motivation. This is not entirely inaccurate.

When I'm hiring, I will look at GPA as something of a base requirement. Do I really want to hire someone who managed to spend four years of his life and how-many thousands of dollars, and couldn't put forth enough effort to beat a 2.5? Frankly, in order to even look at a below-B-average student, they need to have absolutely stellar projects on the side that they've been working on. (core components of a large open source project would be acceptable, for example... senior thesis would not be)

On the other side of the coin, the difference between a 3.3 GPA and a 3.9 GPA is negligible from an employers standpoint. A 4.0 is notable, but a bit of a bias exists that the "4.0 student" is really aiming for academia, and may leave soon to pursue that goal. Others in this thread mention that some employers insist on a 3.5, but I haven't personally come across them.

In summary, I would work hard to keep your grades above a 3.5. At least at my school, it was several orders of magnitude more difficult to maintain a 4.0 (or just short of it) from a 3.6-3.7 range. While that first job you want might not require it, you won't be shut out of interesting opportunities with a "high A-B student" grade, and you very well may get more out of your classes anyway.

"First Job only": Some have mentioned that the employers after the first don't really care about grades. While this is true to a great extent, it's also true that there are "job development paths", and it's much easier to move to higher paying positions if you start out at a higher-paying/more-technically-challenging first job, which will often have more strict requirements.


答:
I can only offer my personal experience. I've never worked as a freelancer, but I have worked with several folks who only worked as freelancers. They've all been very good. We would have been please to hire them as permanent employees, but they preferred to stick with freelancing.

Someone who has kept themselves employed as a freelancer for ten years and has been through at least one down business cycle will generally have good judgment, a lot of drive, and enough technical chops to keep most of his customers happy. You can't make a hiring decision based on this point alone: somebody with ten years of freelance web design isn't magically going to be a great low-level coder on a database server. However, if they'd been working in the right general arena, somebody with a ten year record of successful freelancing would go straight to the top of my resume pile.

They may not be inclined to put up with tedious busy work, or pointless bureaucracy. The folks I worked with did fine with bureaucracy in general, but they drew the line at pointless bureaucracy.

Obviously you have to call the previous employers and customers to verify their work history and quality.


问:
Does anyone prefer proportional fonts?
I was reading the wikipedia article on programming style and noticed something in an argument against vertically aligned code:

Reliance on mono-spaced font; tabular
  formatting assumes that the editor
  uses a fixed-width font. Most modern
  code editors support proportional
  fonts, and the programmer may prefer
  to use a proportional font for
  readability.

To be honest, I don't think I've ever met a programmer who preferred a proportional font.  Nor can I think of any really good reasons for using them.  Why would someone prefer a proportional font?

答:
For languages that have short lines and lots of open space, I prefer monospaced fonts. I find that variable width fonts can improve readability where you have long lines and dense syntax.

The problem with most proportional fonts is that they weren't designed for programming. This page shows some fonts that were.

Title: Does anyone prefer proportional fonts?


答:
There is a reason which makes it practically impossible to use fonts other than monospace for coding, but was not mentioned in other answers: rectangular selections.

This feature, often not very useful and not very known when working with ordinary text, is essential for developers. You may imagine a multitude of scenarios: removing // comments on several lines, adding parenthesis or other characters, etc. This is even more valuable with advanced support of rectangular selections, as in Visual Studio 2010, where you can not only select and remove text, but select and replace it.

Let's take an example:

```<code>private IEnumerable<SELove> StackExchangeRocks()
{
    var howILoveSEWebsites = new []
    {
        new SELove { SiteName = "Stack Overflow", MyReputation = 5269,  MyRating = Rating.Outstanding, },
        new SELove { SiteName = "Programmers",    MyReputation = 16937, MyRating = Rating.Outstanding, },
        new SELove { SiteName = "Super User",     MyReputation = 650,   MyRating = Rating.QuiteGood,   },
        new SELove { SiteName = "Server Fault",   MyReputation = 489,   MyRating = Rating.Good,        },
        // Initialize other websites here.
    };

    return howILoveSEWebsites.OrderByDescending(c => c.MyRating);
}

private class SELove
{
    public string SiteName { get; set; }
    public int MyReputation { get; set; }
    public Rating MyRating { get; set; }
}

private enum Rating
{
    Outstanding,
    Good,
    QuiteGood,
}
</code>```

In this legacy code, I want to replace in-code rating by a method which will load my rating from Stack Exchange websites themselves, being able to always have an up-to-date data. I started to refactor the MyReputation property, and now I want to remove the initialization, in scope. Imagine that I have not four, but all 84 SE websites.

Here's what happens when using Consolas, a monospace font. I press Backspace, and that's all, I can spend the remaining time to do something actually useful.

And here the same thing with Segoe UI. Ouch!

Title: Does anyone prefer proportional fonts?

Body:
I was reading the wikipedia article on programming style and noticed something in an argument against vertically aligned code:

Reliance on mono-spaced font; tabular
  formatting assumes that the editor
  uses a fixed-width font. Most modern
  code editors support proportional
  fonts, and the programmer may prefer
  to use a proportional font for
  readability.

To be honest, I don't think I've ever met a programmer who preferred a proportional font.  Nor can I think of any really good reasons for using them.  Why would someone prefer a proportional font?

Body:
There is a reason which makes it practically impossible to use fonts other than monospace for coding, but was not mentioned in other answers: rectangular selections.

This feature, often not very useful and not very known when working with ordinary text, is essential for developers. You may imagine a multitude of scenarios: removing // comments on several lines, adding parenthesis or other characters, etc. This is even more valuable with advanced support of rectangular selections, as in Visual Studio 2010, where you can not only select and remove text, but select and replace it.

Let's take an example:

private IEnumerable<SELove> StackExchangeRocks()
{
    var howILoveSEWebsites = new []
    {
        new SELove { SiteName = "Stack Overflow", MyReputation = 5269,  MyRating = Rating.Outstanding, },
        new SELove { SiteName = "Programmers",    MyReputation = 16937, MyRating = Rating.Outstanding, },
        new SELove { SiteName = "Super User",     MyReputation = 650,   MyRating = Rating.QuiteGood,   },
        new SELove { SiteName = "Server Fault",   MyReputation = 489,   MyRating = Rating.Good,        },
        // Initialize other websites here.
    };

    return howILoveSEWebsites.OrderByDescending(c => c.MyRating);
}

private class SELove
{
    public string SiteName { get; set; }
    public int MyReputation { get; set; }
    public Rating MyRating { get; set; }
}

private enum Rating
{
    Outstanding,
    Good,
    QuiteGood,
}

In this legacy code, I want to replace in-code rating by a method which will load my rating from Stack Exchange websites themselves, being able to always have an up-to-date data. I started to refactor the MyReputation property, and now I want to remove the initialization, in scope. Imagine that I have not four, but all 84 SE websites.

Here's what happens when using Consolas, a monospace font. I press Backspace, and that's all, I can spend the remaining time to do something actually useful.

And here the same thing with Segoe UI. Ouch!


答: Online backup service.  There are many now.   But a local cvs respostory is a good idea for backup of code, because the development history it provides is eventually invaluable.</p>


答: I do most of my work at home under Mac OS X. I have my own Subversion repository. I run TimeMachine, which does continuous backups of the entire system to an external drive. At the end of every month I swap external drives and take the offline drive to work for safekeeping. I'm sure there are TimeMachine equivalents for Linux and Windows.</p>


答:
I use BitBucket which provides both git and mercurial revision control systems. For free you can have unlimited private repositories (the only limits are on the number of people with access.)

For anything not in version control (mostly non-code stuff) I use dropbox.


答:
Local personal projects: Git to a repo stored in my Dropbox account.

Local work projects: SVN to a remote server, and a rotating copy stored in my Dropbox just in case.


问:
Open source projects - motivation

Possible Duplicate:

  Why programming open source?

I've seen a lot of, for example, where prospective employees put open source projects on their resumes. However, I don't really understand the practice of open source projects. If I have an idea, then however little value it has (being realistic here), that value belongs to me and me alone, and I'm not gonna stick it out there for nothing.

What I'm really asking is, why do people create open source projects? What are the benefits? Do those projects really get completed to a high quality? And is it viable for people in general to make a living from open source software, or is it mostly just large companies who can bill for technical support?

答:
What I'm really asking is, why do people create open source projects? What are the benefits?

You might be interested in reading The Cathedral and the Bazaar, which is a collection of papers by Eric S. Raymond on Linux and open-source software. Those questions are answered quite well.

Everything in the book is freely available, although you can purchase a printed and bound copy as well.

There's a lot of reasons why open source software exists, ranging from the personal desire to show off (and maybe get famous) to experimentation to security (Linus' Law: "given enough eyeballs, all bugs are shallow", from The Cathedral and the Bazaar). Different people have different motivations.

Do those projects really get completed to a high quality?

Define quality. Open source software delivers value.

I've never done an analysis of the Linux kernel source code, the Apache web server, OpenOffice.org, PostgreSQL, or MediaWiki. I can't speak to the quality of the source code of these systems. There are high quality code systems out there - Spinellis wrote Code Quality: The Open Source Perspective where he examined a number of open source software projects and used them as examples of high quality code.

Also note where these software packages are deployed. Last time I looked, Apache was a major player in web servers. Many computers around the world are running open source Linux or BSD distributions (even commercial distributions use the open source kernels), and some of these are functioning in air traffic control, defense, military, finance and banking, and other demanding environments.

And is it viable for people in general to make a living from open source software, or is it mostly just large companies who can bill for technical support?

I never have, although I personally know people who have made "playing money" on donations from open source software. It's not enough to live on, but it supplements his income nicely from what I understand. It's a matter of finding a niche and delivering software that people find valuable. I've donated to open source software that I've found valuable in order to thank the developers and maybe do something to offset the time and resources needed to provide the software.

Title: Open source projects - motivation


答: I've learned that the important thing is not to sell what you have done for other companies. Instead, sell what you're capable of doing for this company.


答:
If I have an idea, then however little value it has (being realistic
  here), that value belongs to me and me alone, and I'm not gonna stick
  it out there for nothing.

This is, of course, your very own business. If you think you can sell it, then go ahead. I mean, it is absolutely not morally questionable to do so.

OTOH, I bet you yourself have made good use of software that was open source. Or, when did you pay last time for a web browser, the compiler of your favorite language, a highly complex and sophisticated IDE (like Eclipse) or such?

When you think about it, you may come to the conclusion that it may be a good thing to give something back to the great SW community if you can. To repeat it, there is nothing that would force you to. It is your decision. You are a free man. You must decide.

Usually, one cannot make a living out of open source software per se. But do you think Linus Thorwald, the inventor of Limux, has any difficulties to find a job? Also, he will probably not go to an interview. Employers will be happy when he allows them to send in offers.

Title: Open source projects - motivation

Body:
Possible Duplicate:

  Why programming open source?

I've seen a lot of, for example, where prospective employees put open source projects on their resumes. However, I don't really understand the practice of open source projects. If I have an idea, then however little value it has (being realistic here), that value belongs to me and me alone, and I'm not gonna stick it out there for nothing.

What I'm really asking is, why do people create open source projects? What are the benefits? Do those projects really get completed to a high quality? And is it viable for people in general to make a living from open source software, or is it mostly just large companies who can bill for technical support?


答: Some of the longest jobs I've had in my career have been as a contract programmer.  I spent 4 years on a contract at one company, spent 4 years on 3 "full time" jobs, and then went back to the same company on another contract that lasted over 6 years.  I cared as much about the success of the project and lost as much sleep over problems as anybody on those projects.  I did design, coding, customer site visits and weekends on call.  I dare say I'd be as invested in the success or failure as if I'd owned the company.  I resent the implication that because I was a contract programmer that I didn't care or work as hard as anybody else.  The only difference is that I didn't get a health care plan.</p>


问:
What's your favourite quote about programming?
What's your favourite quote about programming?

One quote per answer, and please check for duplicates before posting!

答:
Concentrate Your Effort

Don't write too much. Concentrate your sweat on one story, rather than dissipate it over a dozen.

Jack London

Somehow, I missed the (paraphrased, shorter) duplicate of this one:

Be Diligent

Don't loaf and invite inspiration; light out after it with a club, and if you don't get it you will nonetheless get something that looks remarkably like it."

Part of one quote; I split them to narrow down the topic.

LastEditorDisplayName: Roger Pate


答:
Dead Code

Dead code, code that is not used, should always be removed unless it's going to be used in the near future.

Incomplete Stories

Just because a story is incomplete doesn't mean there is not value in running what you have.  If there isn't any value in it then I think it qualifies as dead code.


问:
How would you go about looking for collaborators?
I seem to have a never ending stream of more-or-less original, more-or-less cool ideas for software/apps/stuff yet to be written on my mind. Sometimes, I decide to just start implementing my idea. Several hours later, I end up with a decent, more-or-less working prototype of what I'm trying to build. Then, my alarm clock goes ringing and I have to get back to the real world, tired as hell. In most cases, the stuff I started remains unfinished forever. Sometimes, that's okay. Other times, I honestly feel like that's a bummer.

But I realize that there are sites like GitHub and there are many other coders out there. Is there a place where one can post ideas, proposals, concepts, or rough-around-the-edges-code in order to find people who are interested in collaborating on projects?

Edit: I am aware of "the usual way" – keep developing on your own for some period of time, open-source the code, mention your project on dev blogs, IRC or wherever else you go; eventually attracts others.

What I'm looking for is a place to connect with other devs (e.g. of different specializations) on the early stages of a project.

答:
Sounds like a match-making site for developers. You can make it free and then take a lot of time to weed through all those who know Java for example. No one is going to qualify candidates in the areas of: verify experience, test skills, availability for necessary time commitment for free for those who lack the expertise to evaluate programmers.

The same is true for developers being able to verify those with domain knowledge. Who is going to pay for a site where people list their ideas? Regardless if I have the skill set you need, I don't know if your idea is any good nor do I know if you are capable of implementing the sales and marketing side. You may have the greatest idea to sell to lawyers, but I would have no idea if it would work or how much sweat-equity I'd put into it.


答:
The ten year freelancer is probably a better developer than the developer who spent ten years working on one product at one company.

The freelancer has ten one year periods of experience.

The ten year company developer who had the 'real job' very possibly has one year of experience ten times.

I say that as someone with 8 years in my present gig.


问:
Is it worth it for a developer to be a scrum master? Is it an official designation or?
Is it beneficial for a developer to become a 'scrum master'?

Is this an official certification or just someone who specializes?

What are the steps towards becoming one?

答:
Is it beneficial for a developer to become a 'scrum master'?

I would say it's often not beneficial. While a developer-as-scrum-master understands the working conditions of those in the trenches, management/the boss/the client may see complaints from this person not as, "the scrum master advising management what should be changed" but, "grumpy Bob just has a chip on his shoulder because he had to work late Friday - ignore him".

For this reason I think this separation of concerns is important, especially when/if the management/client/boss has a hard time knowing if Bob is wearing his "Bob the solitary programmer hat" vs his "Bob the Scrum master, facilitator for the team, hat".

Because, if it's perceived that complaints from the team are actually complaints from Bob personally, it poisons the well: every point Bob tries to bring up to management will be dismissed because Bob's (obviously, to management's eyes) a troublemaker.


问:
My customer wants me to record a video of how I develop his software product
Working as a freelancer, I often see strange requests from my customers, some of which can negatively affect my daily work¹, and others trying to set some sort of control. I usually encounter those things during preliminary negotiations, so it's easy enough at this stage to explain to the customer that I do care about my work and productivity and expect my customers to trust my work.

Things were much harder² on a project I just accepted, since it's only after the end of the negotiations (the contract has already been signed and did not mention anything about video tracking) and after I started to work on the project that my customer requested that I record a video of all I do on my machine when working on his project, that is, a video which will show that I move the cursor, type a character, open a file, move a window, etc.

I work in my own company, using my own PCs.

I answered to this customer that such request cannot be accepted, since:

Hundreds of hours of work on a dual-screen PC will require a large amount of disk space for the recorded videos. If I don't care about space, I do care about this customer wasting my bandwidth downloading those videos.

Recording a video can affect the overall performance and decrease my productivity (which is not actually true, since the machine is powerful enough to record this video without performance loss, but, well, it still looks like a valid argument).

I can't always remember to turn the video recording on before starting the work, and off at the end.

It may be a privacy concern. What if I switch to my mails when recording the video? What if, to open the directory with the files about this customers project, I first open the parent directory containing the list of all of my customers?

Such video cannot be a reliable source to track the cost of a project (I'm paid by the hour), since some work is done with just a pencil and a paper (which is actually true, since I do lots of draft work without using the PC).

Despite those points, the customer considers that if I don't want to record the video, it's because I have something to hide and want to lie about the real time spent on his project³.

How to explain to him that it is not usual practice for freelancers to record videos of their daily work, and that such extravagant requests must be reserved for exceptional circumstances⁴?

¹ The most frequent example is to be requested to work through Remote Desktop on a more-than-slow server which uses a more-than-slow Internet connection, or to be forced to use outdated software such as Windows Me without serious justification such as legacy support.

² In fact, I already did a lot of management and system design related work, which is essential, but usually misunderstood by customers and perceived as a waste of time and money. Observing the concerned customer, I'm pretty sure that he will refuse to pay a large amount of money for what was already done, since there is actually zero lines of code. Even if legally I can easily prove that there was a lot of work undertaken on the design level, I don't want to end my relation with this customer in a court.

³ Which is not as risky as it could be, since I gave this customer the expected and the maximum cost of the project, so the customer is sure to never be asked to pay more than the maximum amount, specified in the contract, even if the real work costs more.

⁴ One case when I effectively record on my own initiative the video of actions is when I have to do some manipulations directly on a production server of a customer, especially when it comes to security issues. Recording those steps may be a good idea to know precisely what was done, and also ensure that there were no errors in my work, or see what those errors were.

First update

Since the question attracted much more attention and had many more answers than I expected, I imagine that it can be relevant to other people, so here is an update. First, to summarize the answers and the comments, it was suggested to (ordered randomly):

Suggest other ways of tracking, as shown in Twitter Code Swarm video, or deliver a "short milestone with a simple, clear deliverable, followed by more complex milestones", etc.

Explain that video is not a reliable source and can be faked, and that it would be difficult to implement, especially for support.

Explain that video is not a reliable source since it shows only a small part of the work: a large amount of work is done without using a computer, not counting the extra hours spent thinking about a solution to a problem.

Stick with the contract; if the customer wants to change it, he must expect new negotiations and a higher price.

Do the video, "but require that the customer put [the] entire fee into an escrow account", require a lawyer to video tape all billable time, etc., in other words, "operate in an environment void of trust", requiring the customer to support the additional cost.

Search for the laws which forbid this. Several people asked in what country I live. I'm in France. Such laws exist to protect the employees of a company (there is a strict regulation about security cameras etc., but I'm pretty sure nothing forbids a freelancer to sign consciously a contract which forces him to record the screen while he works on a project.

Just do it and send the videos: the customer will "watch a few ten second snippets of activity he won't understand", then throw those videos away.

Say no. After all, it's my business, and I'm the only one to decide how to conduct it. Also, the contract is already signed, and has nothing about video tracking.

Say no. The processes and practices I employ in my company can be considered as trade secrets and are or can be classified.

Quit. If the relation starts like this, chances are it will end badly sooner or later. Also, "if he's treating you like a thief - and that is what he's suggesting - then it's just going to get worse later when XYZ feature doesn't work exactly the way he envisioned".

While all those suggestions are equally valuable, I've personally chosen to say to my customer that I accept to do the videos, but in this case, we must renegotiate the contract, keeping in mind that there will be a considerable cost, including the additional fee for copyright release. The new overall cost would be on average three times the actual cost of the project. Knowing this customer, I'm completely sure that he would never accept to pay so much, so the problem is solved.

Second update

The customer effectively declined the proposal to renegotiate the original contract, taking into account the considerable additional cost. He agreed to continue the project without video recording.

The project continued without video recording. Eventually, the customer seemed satisfied by the final result and cost, so the video recording was not mentioned again.

答:
I'd simply argue, that it is not feasible. The biggest concerns are the privacy, and intellectual property of your company and other customers; and the fact, that time spent at the whiteboard, in a meeting, etc. is not recorded.

Sometimes you may need to consult a book, ask someone in IRC or even here, on one of the Stackexchange sites. Sometimes you need to make a call, talk to on-site admins in data centers, etc.

What if the video leaks into the internet, or gets otherwise stolen? In case he doesn't believe you, you could offer code metrics, and have them scrutinized by a 3rd party expert. This however, will add significantly to the cost, if not doubling them.

If he can't understand this, and can't be convinced otherwise, I wouldn't work for him at all. That kind of employee supervision is forbidden by law in Germany.

Before you start working on the project, you'd make a complexity analysis of the main identifiable sections of your project. Those will tell you the man-hours you need to implement or integrate parts of the program. If you stay around that time frame, there is nothing to argue about.

Lawyers, bankers, etc. work in a similar manner. They don't video-blog themselves when they do work for you either...

ContentLicense: CC BY-SA 4.0


答: I wouldn't deal with this guy, period.  It sounds like simply doesn't understand that much of the job is thought.  If you supplied him with the video he's going to nitpick all the time you spend ignoring him (thinking about the situation.)</p>

Title: My customer wants me to record a video of how I develop his software product

Body:
Working as a freelancer, I often see strange requests from my customers, some of which can negatively affect my daily work¹, and others trying to set some sort of control. I usually encounter those things during preliminary negotiations, so it's easy enough at this stage to explain to the customer that I do care about my work and productivity and expect my customers to trust my work.

Things were much harder² on a project I just accepted, since it's only after the end of the negotiations (the contract has already been signed and did not mention anything about video tracking) and after I started to work on the project that my customer requested that I record a video of all I do on my machine when working on his project, that is, a video which will show that I move the cursor, type a character, open a file, move a window, etc.

I work in my own company, using my own PCs.

I answered to this customer that such request cannot be accepted, since:

Hundreds of hours of work on a dual-screen PC will require a large amount of disk space for the recorded videos. If I don't care about space, I do care about this customer wasting my bandwidth downloading those videos.

Recording a video can affect the overall performance and decrease my productivity (which is not actually true, since the machine is powerful enough to record this video without performance loss, but, well, it still looks like a valid argument).

I can't always remember to turn the video recording on before starting the work, and off at the end.

It may be a privacy concern. What if I switch to my mails when recording the video? What if, to open the directory with the files about this customers project, I first open the parent directory containing the list of all of my customers?

Such video cannot be a reliable source to track the cost of a project (I'm paid by the hour), since some work is done with just a pencil and a paper (which is actually true, since I do lots of draft work without using the PC).

Despite those points, the customer considers that if I don't want to record the video, it's because I have something to hide and want to lie about the real time spent on his project³.

How to explain to him that it is not usual practice for freelancers to record videos of their daily work, and that such extravagant requests must be reserved for exceptional circumstances⁴?

¹ The most frequent example is to be requested to work through Remote Desktop on a more-than-slow server which uses a more-than-slow Internet connection, or to be forced to use outdated software such as Windows Me without serious justification such as legacy support.

² In fact, I already did a lot of management and system design related work, which is essential, but usually misunderstood by customers and perceived as a waste of time and money. Observing the concerned customer, I'm pretty sure that he will refuse to pay a large amount of money for what was already done, since there is actually zero lines of code. Even if legally I can easily prove that there was a lot of work undertaken on the design level, I don't want to end my relation with this customer in a court.

³ Which is not as risky as it could be, since I gave this customer the expected and the maximum cost of the project, so the customer is sure to never be asked to pay more than the maximum amount, specified in the contract, even if the real work costs more.

⁴ One case when I effectively record on my own initiative the video of actions is when I have to do some manipulations directly on a production server of a customer, especially when it comes to security issues. Recording those steps may be a good idea to know precisely what was done, and also ensure that there were no errors in my work, or see what those errors were.

First update

Since the question attracted much more attention and had many more answers than I expected, I imagine that it can be relevant to other people, so here is an update. First, to summarize the answers and the comments, it was suggested to (ordered randomly):

Suggest other ways of tracking, as shown in Twitter Code Swarm video, or deliver a "short milestone with a simple, clear deliverable, followed by more complex milestones", etc.

Explain that video is not a reliable source and can be faked, and that it would be difficult to implement, especially for support.

Explain that video is not a reliable source since it shows only a small part of the work: a large amount of work is done without using a computer, not counting the extra hours spent thinking about a solution to a problem.

Stick with the contract; if the customer wants to change it, he must expect new negotiations and a higher price.

Do the video, "but require that the customer put [the] entire fee into an escrow account", require a lawyer to video tape all billable time, etc., in other words, "operate in an environment void of trust", requiring the customer to support the additional cost.

Search for the laws which forbid this. Several people asked in what country I live. I'm in France. Such laws exist to protect the employees of a company (there is a strict regulation about security cameras etc., but I'm pretty sure nothing forbids a freelancer to sign consciously a contract which forces him to record the screen while he works on a project.

Just do it and send the videos: the customer will "watch a few ten second snippets of activity he won't understand", then throw those videos away.

Say no. After all, it's my business, and I'm the only one to decide how to conduct it. Also, the contract is already signed, and has nothing about video tracking.

Say no. The processes and practices I employ in my company can be considered as trade secrets and are or can be classified.

Quit. If the relation starts like this, chances are it will end badly sooner or later. Also, "if he's treating you like a thief - and that is what he's suggesting - then it's just going to get worse later when XYZ feature doesn't work exactly the way he envisioned".

While all those suggestions are equally valuable, I've personally chosen to say to my customer that I accept to do the videos, but in this case, we must renegotiate the contract, keeping in mind that there will be a considerable cost, including the additional fee for copyright release. The new overall cost would be on average three times the actual cost of the project. Knowing this customer, I'm completely sure that he would never accept to pay so much, so the problem is solved.

Second update

The customer effectively declined the proposal to renegotiate the original contract, taking into account the considerable additional cost. He agreed to continue the project without video recording.

The project continued without video recording. Eventually, the customer seemed satisfied by the final result and cost, so the video recording was not mentioned again.


答:
You don't explain; not further, not at all.  You just say no.

This is your business, and your choices about how to conduct it are not up for discussion.  The terms of any contract are up for discussion; before signing, that is.

He's giving you multiple big red flags that this contract will be a miserable experience, that it will continue to be so even after you've billed for it, and that he will have nothing but mistrustful things to say to others about your work.  Smile, because you're fortunate that he's communicated this before you're stuck with the jerk.

Thank him graciously for his time, return his deposit, and kick him to the curb.

Really, he's never going to be persuaded of your professionalism no matter what you tell him.


问:
Database source control
Should database files(scripts etc.) be on source control?
If so, what is the best method to keep it and update it there?

Is there even a need for database files to be on source control since we can put it on a development server where everyone can use it and make changes to it if needed. But, then we can't get it back if someone messes it up.

What approach is best used for databases on source-control?

答:
For our PHP/MySQL projects, we've been using a (once-) little tool named Ladder. It's designed to facilitate the organic growth of a database over time. All of the migrations for a project are stored in revision/source/version control, and are tracked along with the code.

It supports adding / altering / dropping columns, running queries, adding / dropping indexes, constraints, etc, etc. It'll keep track of the state the database is in, and apply any missing migrations. It also allows you to "step back in time" by specifying a migration you need to be at. (php ladder.php migrate 15)

Oh, and the latest addition is database diffing. Run the diff-save command, add and remove some columns from the database, and run its diff command. You'll see automatically-generated migration code based on the database state.

Title: Database source control


问:
Source control approach for plugins?
I'm writing an application and a set of many small plugins—where “many” means dozens and “small” means one or two sources. It's not necessarily going to be possible to divide the plugins into neat, non-overlapping categories. Which would be the best strategy for source control:

Many repositories, one for each plugin; or

One repository, with a directory for each plugin?

Other suggestions are of course welcome. I'm using Mercurial and hosting on Bitbucket.

答:
'Dozens' of components isn't that many really. I've had projects with hundreds.

Since there isn't a convenient way to sort these plug-ins into groups, just use one repo to rule them all.

Title: Source control approach for plugins?


答: Even if you are working as a freelancer, you need to maintain your work ethics and culture. If possible ask your customer to find another developer. Never entertain such requests.</p>


答:
Is there a same team who maintains all the plugins? Are all the plugins maintained regularly?

I would use one repository per plugin, and use a single repository for all plugins only if there are serious reasons to do so. In fact:

Security management on directories of a single repository may be either complicated, or impossible. (I don't know what is the case with Mercurial, so maybe this point is invalid for you)

If there are several teams which work on different plugins, mixing them in a same repository would not be a good idea.

What if you want to open source one of the plugins? Having a separate repository would be easier than extracting a directory from a large repository.

If there are many abandoned plugins, you don't want to pollute your repository with them. If they are in a separate repository, you just forget about them, and that's all.

When a fresh developer wants to start working on a plugin, it's much faster to get the source of one plugin from the repository, compared to the time required to load the whole codebase containing thousands and thousands of lines of code.

Title: Source control approach for plugins?

Body:
I'm writing an application and a set of many small plugins—where “many” means dozens and “small” means one or two sources. It's not necessarily going to be possible to divide the plugins into neat, non-overlapping categories. Which would be the best strategy for source control:

Many repositories, one for each plugin; or

One repository, with a directory for each plugin?

Other suggestions are of course welcome. I'm using Mercurial and hosting on Bitbucket.


问:
Why do some functional languages need software transactional memory?
Functional languages, by definition, should not maintain state variables. Why, then, do Haskell, Clojure, and others provide software transactional memory (STM) implementations? Is there a conflict between two approaches?</p>

答:
There is nothing wrong with a functional language maintaining mutable state. Even "pure" functional languages such as Haskell need to maintain state in order to interact with the real world. "Impure" functional languages like Clojure allow side effects which can include mutating state.

The main point is that functional languages discourage mutable state unless you really need it. The general style is to program using pure functions and immutable data, and only interact with "impure" mutable state in the specific parts of your code that require it. That way, you can keep the rest of your code base "pure".

I think there are several reasons why STM is more common in functional languages:

Research: STM is a hot research topic, and programming language researchers frequently prefer to work with functional langauges (a reasearch topic in themselves, plus it is easier to create "proofs" about program behaviour)

Lock don't compose: STM can be seen as an alternative to lock-based approaches to concurrency, which starts to run into problems when you scale up to complex systems by composing different components. This is arguably the main "pragmatic" reason for STM

STM fits well with immutability: If you have a large immutable structure, you want to make sure it stays immutable, so you don't want some other thread coming in and mutating some sub-element. Likewise, if you can guarantee immutability of said data structure, you can reliably treat is as a stable "value" in your STM system.

I personally like Clojure's approach of allowing mutability, but only in the context of strictly controlled "managed references" that may participate in STM transactions. Everything else in the language is "purely functional".

```<code>  ;; define two accounts as managed references
  (def account-a (ref 100))
  (def account-b (ref 100))

  ;; define a transactional "transfer" function
  (defn transfer [ref-1 ref-2 amount]
    (dosync
      (if (>= @ref-1 amount)
        (do
          (alter ref-1 - amount)
          (alter ref-2 + amount))
        (throw (Error. "Insufficient balance!")))))

  ;; make a stranfer
  (transfer account-a account-b 75)

  ;; inspect the accounts
  @account-a
  => 25

  @account-b
  => 175
</code>```

Note the above code is fully transactional and atomic - an external observer reading the two balances within another transaction will always see a consistent atomic state, i.e. the two balances will always sum to 200. With lock-based concurrency, this is a surprisingly hard problem to solve in a large complex system with many transactional entities.

For some extra enlightenment, Rich Hickey does an excellent job of explaining Clojure's STM in this video

Body:
There is nothing wrong with a functional language maintaining mutable state. Even "pure" functional languages such as Haskell need to maintain state in order to interact with the real world. "Impure" functional languages like Clojure allow side effects which can include mutating state.

The main point is that functional languages discourage mutable state unless you really need it. The general style is to program using pure functions and immutable data, and only interact with "impure" mutable state in the specific parts of your code that require it. That way, you can keep the rest of your code base "pure".

I think there are several reasons why STM is more common in functional languages:

Research: STM is a hot research topic, and programming language researchers frequently prefer to work with functional langauges (a reasearch topic in themselves, plus it is easier to create "proofs" about program behaviour)

Lock don't compose: STM can be seen as an alternative to lock-based approaches to concurrency, which starts to run into problems when you scale up to complex systems by composing different components. This is arguably the main "pragmatic" reason for STM

STM fits well with immutability: If you have a large immutable structure, you want to make sure it stays immutable, so you don't want some other thread coming in and mutating some sub-element. Likewise, if you can guarantee immutability of said data structure, you can reliably treat is as a stable "value" in your STM system.

I personally like Clojure's approach of allowing mutability, but only in the context of strictly controlled "managed references" that may participate in STM transactions. Everything else in the language is "purely functional".

  ;; define two accounts as managed references
  (def account-a (ref 100))
  (def account-b (ref 100))

  ;; define a transactional "transfer" function
  (defn transfer [ref-1 ref-2 amount]
    (dosync
      (if (>= @ref-1 amount)
        (do
          (alter ref-1 - amount)
          (alter ref-2 + amount))
        (throw (Error. "Insufficient balance!")))))

  ;; make a stranfer
  (transfer account-a account-b 75)

  ;; inspect the accounts
  @account-a
  => 25

  @account-b
  => 175

Note the above code is fully transactional and atomic - an external observer reading the two balances within another transaction will always see a consistent atomic state, i.e. the two balances will always sum to 200. With lock-based concurrency, this is a surprisingly hard problem to solve in a large complex system with many transactional entities.

For some extra enlightenment, Rich Hickey does an excellent job of explaining Clojure's STM in this video


答:
(Or, the flip-side of my previous advice...)

You stop giving protestations, and say yes.

"Yes, I would be happy to write a new contract for these additional deliverables.  Project-complete tutelege in my proprietary tradecraft is valued at (value of my projected income for the next $N years).  There will also be a licensing fee $Y, for physical file ownership rights.  If you would like to also own the video's content, I'll get back to you shortly with an additional fee for copyright release."

Lest you think that preposterous: seriously, what price makes it worthwhile to risk your business?

A competitor could use that video to criticize, mimic, or undercut your practices.

The client could edit it to make you look dishonest.

You've sacrificed the potential to monetize your business through video tutorials if he chooses to post excerpts of this one for free (or heck, what if he sold them?).

Value of a work product is not equal to the value of (work product + expertise + work processes)

An employer gets to own and direct all of these.  A client only gets to ask "Do you offer__, and if so what do you charge for it?"

So, yep, these are reasonable terms for accommodating an unreasonable request.

BUT unless he accepts those terms and without further howling, I still say a flat "no" is the most persuasive you can possibly be that what he wants is infeasible.


答:
The client doesn't understand software development if he thinks he needs a video of your work. A good programmer will generate the most value for the customer when they don't appear to be doing anything with the computer at all.  Maybe he'd like you to start billing extra for those times when you invariably think of a solution to a problem during your personal time, or while browsing Stack Overflow looking for something else.

The privacy issue (your personal e-mail being recorded) alone is enough to flat out refuse this request.


问:
New Team Lead - How to deal with a resentful former peer
I've been told that I am to be a team lead of an upcoming project. I've not ever been team lead before but the responsibilities are what you would typically expect, with revolving door of 3 to 4 other developers through the 8 or 9 months it takes to complete the project.

My problem is this: one of the developers who will no doubt be working on this project will be a problem. He has more experience than me, has called me an idiot several times in the past, and has told me that he has taken this job because he is a natural leader. He has expected to be promoted to a leadership position with every new project (which has not happened to date), and even once told me that I was to report to him, even though the actual team lead was under no such illusion. Moreover, I've both observed and heard from others that he is extremely unprofessional (watches non-work videos at client sites - with no head phones, dresses unprofessionally, comes to work late, makes inappropriate jokes, etc.) He took or attempted to take credit for my work or insights multiple times while I worked with him as a peer. My current team lead told me that she threw out 1/2 of this guy's code once he left her project because the quality was no good. I could go on.

My fear is that this guy will actively work against me, because he will resent having to report to someone that he considers an inferior, especially since I have been given this opportunity before him. I've successfully dealt with this type of personality as a peer or even reporting to managers like this in the past. I've not dealt with, or ever thought about, having to deal with this type of character who is reporting to me.

My question is: what kind of strategies can I use to effectively and professionally deal with this? Especially now, before it has become a problem, is there any way to cut it off before it gets out of hand etc. If anyone has a similar experience how did they deal with it?

答:
It seems that no one recommended the author to think about what it cost to be a team leader. Obviously being a team leader limits your ability to program, learn new programming stuff, hack a lot and become more and more professional developer. That is because a team leader receives a new responsibility - to help other developers, fix their bugs or just point them what to do / what to fix. Then all these endless meetings. I can not tell for an author, but for me this would be a perfect step(may be even with 15-20% bonus in salary) but in a wrong direction. Like getting extra 20% for converting my job from  passion to something where I never wanted to be.

-Dont take this responsibility. Someone should be a leader, someone should be a cleaner in toilets,others destiny are even worse, but you can be a programmer and just increase your hourly rate / skills day by day. Working with computer and working with people are skills which are rarely both on a high level for one person.

-Other programmers should not affect you. They can go to job nude, watch their porn videos,do other crazy stuff - but that is their lives and your boss pain. Just demand such work conditions, like working from home or in an izolated room, where you feel yourself perfect and ready to code

-In case your work on a project and you are blocked by someone from your team - write them politely email with your boss in CC. This is bad - "Hey, I am waiting for your functions str2int for 2 weeks, so I just don't do anything at all!".       This is what I do - " Hi, xxx. It seems that you can not deliver the function str2int to me, so I just replacing it with my own implementation, which is slow but mostly works. If you are going to add it - just confirm to this interface ".

I hope that non standard answer may help an author, or someone else to do his job well and remain happy.


问:
How do you annotate code changes and code authorship
What is the best way to annotate who authored a file and subsequent changes that were made?

I'm a contractor on a new project, one that's just starting, which is using Subversion. The other day I noticed a team member had updated a script written by an outside consultant, and he updated the header from "Written by X" to "Writen by Y and X" (since he had made a decent number of updates).

I didn't think this was a good idea, because others after us may update that script with small or large changes and it'd be unclear when to update the "Written by" header (or how to order the names). I pitched the way I had done it at my previous company (with an edit log at the top of each file - which was enforced by whoever verified the changes, we were using Clear Case so changes wouldn't be pushed up until they were verified), but then he mentioned we could just use the "svn log" command to see edits and it'd be hard to enforce an edit log.

So now I'm not so sure what the best way to annotate authorship and changes is. Files can completely change over time, so I don't like the idea of a stale "Written by" header. And a "Written by" header that just includes a long list of people with no context doesn't seem useful. There's removing the authorship header, and simply using the subversion change log, but then what do you do about "Written by" headers from code that's given to you (from consultants, old code bases, downloaded from the net, etc)? How do other teams handle this?

答:
I'm with you, modern source control documents who did what to what in source code a lot better than some random comment in a header file.

Your customer is wrong, he is wasting time and adding garbage to his files. But he's still the customer.

If you are a contractor you ought to go with the client's coding standards.

If this is just an ego thing, just forget about header comments and do your job.


答:
Why would you bother accepting a contract with such a pesky customer? If they don't trust you before you've committed to the deal it's not going to get better.

It's quite possible your customer has been burned in the past, and that's something you can sympathize with, but you need them to understand that programming is intellectual work, and time at keyboard isn't necessarily reflective of work product or value generated.

I've seen that certain low-end freelancing sites like odesk have software that they encourage freelancers to use which samples occasional frames from your desktop and allow the companies you engage with to see this video, but for me that seems at best a means to prove that you're not spending all your working hours browsing news and entertainment sites. It certainly can't prove whether you're "working" or not until the software can read your mind.

Sane customers will tolerate any of the following as a means to build trust:

A short milestone with a simple, clear deliverable, followed by more complex milestones. Offer the option of canceling future milestones if the cost or results don't meet expectations.

Lawyer-style billing with work items documented with the resolution defined at an agreed increment (6 minute, 15 minute, 30 minute, 1 hour), presented frequently (weekly or monthly). Ability to cancel future work at any time.

An upper limit on hours for any specified work item, after which you agree to discuss any revised estimates based on the new facts that come to light (car mechanic style).

Once you establish a track record with a sane client, you won't need Orwellian monitoring techniques to make them happy. If you present yourself professionally and you can deliver the value the customer needs on a timely basis, nobody will care whether you were typing code at 80 wpm or thinking.

Personally, I prefer to work on projects that timebox deliverables (What can we achieve over the next 3 weeks or 4 weeks), and work on improving velocity as my team gets to know the business problem. In such a case, the customer has the ability the constantly reevaluate whether you're making forward progress or not and whether you're worth the money. I suppose this is why I work as an independent contractor than as a freelancer, and I tend to take on complex business problems rather than things with a "make me a web page" kind of scope, but in my world nobody worries about seeing what's on my screen every waking minute. If a customer had time to review every minute of video generated they'd have a pretty poor performing business.


答:
I have to agree with Jim.

Any version control tool will do a better job than a large text blob at the top of a file.  The version control system will be accurate, up to date and provide diffs dating back to the creation of the file.  The header method will say:

11/01/98 - Redesigned file - KPR

04/15/05 - Patch to work around small bug - JSC

Comments should describe what a file/class/function/line does NOW.  It's history is pointless to record in-line.  It is a hold-over from the days before cheap/awesome version control.

You should explain to the client it will increase costs to do it that way and let that it would speed up development to let tools do the job properly.

Title: How do you annotate code changes and code authorship

Body:
What is the best way to annotate who authored a file and subsequent changes that were made?

I'm a contractor on a new project, one that's just starting, which is using Subversion. The other day I noticed a team member had updated a script written by an outside consultant, and he updated the header from "Written by X" to "Writen by Y and X" (since he had made a decent number of updates).

I didn't think this was a good idea, because others after us may update that script with small or large changes and it'd be unclear when to update the "Written by" header (or how to order the names). I pitched the way I had done it at my previous company (with an edit log at the top of each file - which was enforced by whoever verified the changes, we were using Clear Case so changes wouldn't be pushed up until they were verified), but then he mentioned we could just use the "svn log" command to see edits and it'd be hard to enforce an edit log.

So now I'm not so sure what the best way to annotate authorship and changes is. Files can completely change over time, so I don't like the idea of a stale "Written by" header. And a "Written by" header that just includes a long list of people with no context doesn't seem useful. There's removing the authorship header, and simply using the subversion change log, but then what do you do about "Written by" headers from code that's given to you (from consultants, old code bases, downloaded from the net, etc)? How do other teams handle this?


答:
Let the SCM handle it. It's the only way to be sure the information is always up-to-date, it's granular to the source line level, and it's also the easiest way, since subversion tracks this information already. Even if you don't enforce commit messages, it's trivially easy to extract a revision number and accompanying changes from a blame, which should tell you all you need to know.

The only reason I can think of for wanting this information in comments is that svn blame or svn log are a bit slower than simply looking at the comments, but the price you pay for the tiny speed increase is that you have cruft in your code. The worst part, however, is that you're relying on manual processes for repetitive tasks.


问:
Binaries in source control
When developing for embedded devices and other odd worlds, it's very likely your build process will include multiple proprietary binaries, using very specific versions of them.
So the question is, are they part of your source control? My offices goes by the rule of "checking out from source control includes everything you need to compile the code" and this has led to some serious arguments.

The main arguments I see against this is bloating the source control DB, the lack of diffing binary files (see prior questions on the subject). This is against the ability to check out, build, knowing you have the precise environmental the previous developer intended and without hunting down the appropriate files (with specific versions no less!)

答:
The goal is to be able to get the latest code and build it without having to install/setup anything (so, a "single click" build).

In many places I have been, that means checking in binaries of dependencies. In others, this means that the build scripts download and get the dependencies automatically.

See this blog post by Derek Greer on the subject.

Title: Binaries in source control


答:
Yeah - absolutely not. My first instinct is to walk away - at such an early stage of the process, if he's treating you like a thief - and that is what he's suggesting - then it's just going to get worse later when XYZ feature doesn't work exactly the way he envisioned. Not doesn't work to spec, doesn't work to what he thought the spec should be.

If you absolutely can't walk away (we all have rent to pay), I'd suggest forcing the client to confront the monetized burden of his request. Create a set-up where all your concerns are solved. If he wants to pay for a dedicated machine, so there's no potential breech of information between other clients, the storage necessary to record said hours upon hours of video, and the administration support costs necessary for processing said video, then perhaps consider it. But if he wants you to document all your work, on video, for free - no way.


答:
I am working at a project with two different build stages

the "main program build" needs just a few binaries, compared to the thousands of source code text files, so the binaries are checked into the repository. This works fine.

the installer build needs a lot of third party components (some of them are just copied to the installation CD, like the Adobe Reader). We are not putting those into the repository. Instead, those components reside on a network drive (even older versions of them), and the build scripts copy them to the right place. Of course, to have reproducible builds, anyone has to be careful not to change any folder where the third party components are stored.

Both strategies work fine and fulfil the "checking out from source control includes everything you need to compile the code" requirement.

Title: Binaries in source control

Body:
When developing for embedded devices and other odd worlds, it's very likely your build process will include multiple proprietary binaries, using very specific versions of them.
So the question is, are they part of your source control? My offices goes by the rule of "checking out from source control includes everything you need to compile the code" and this has led to some serious arguments.

The main arguments I see against this is bloating the source control DB, the lack of diffing binary files (see prior questions on the subject). This is against the ability to check out, build, knowing you have the precise environmental the previous developer intended and without hunting down the appropriate files (with specific versions no less!)


答:
Your source control hold the sources to what you do.  If a given binary blob can be reconstructed from the sources it is not a source and should not go in the source code repository.  Only non-recreatable blobs should to in the source control.

You usually have another repository network folder of binary blobs you've built through time of the sources.  These can be deployed to customers or used in projects (instead of building everything from scratch every time).

So, put it in if it is a source.  Don't if not.

Title: Binaries in source control


问:
Do you write titles in code comments?
I was browsing some old code that I wrote (first year in the university) and noticed that I used to write comment titles preceeding various parts of the code. Stuff like (this is from a Monopoly game): </p>

```<code>/*Board initialization*/
...code...

/*Player initialization*/
...code...

/*Game logic starts here*/
/*Displaying current situation*/
...code...

/*Executing move*/
...code...

/*Handle special event*/
...code...

/*Commit changes, switch to next player*/
...code...
</code>```

<p>This might be redundant, and arguably unnecessary if the code is really super clear, but as I scanned through the file it surprised me how strongly I felt like I know what's going on even though I hardly looked at the actual code. I can definitely see this as being fitting in certain circumstances, so I wonder- do you do this? Do you think it's a good idea? Or is it too much? </p>

答:
I do this because I'm often communicating intent to myself, or essentially putting in a convenient bookmark for things like "Data cleaning begins here". Usually under that title is a brief little bit about the logic of what I'm doing and why.

I like redundancy. If I lose my lab notebook for one reason or another, or have to revisit code I wrote years ago, I dislike having to piece together what I was doing and why I was doing it. If at least some of that logic is in the code, its documented enough for me to at least work with it again.

I think part of my inclination towards it is a fair amount of my programming is statistical in nature, and thus somewhat repetitive. Whereas there might be a few pieces of code where I've got a helpfully named function to search for, I might have several dozen fairly similar uses of something like a general linear model function. It's useful to be able to go and find which of those was the "how sensitive are the results to Choice A vs. Choice B or C" code, and which was something else. That's often sped up by titles.

Title: Do you write titles in code comments?


问:
How often do you use DI container in your ASP.NET MVC application
While reading a book, I came across DI(dependency Injector) and the subsequent DI Container tool. Previously, I developed an application following a tutorial on asp.net website which never used such tool. So, my question can be summed-up in following two concerns :-

How often do you use DI Container ?

What requirements make you do so ?

EDIT : Examples with and without DI Container. I have written the codes to understand which is better approach.

Without DI Container --

```<code>LinqValueCalculator lc = new LinqValueCalculator();
ShoppingCart sc = new ShoppingCart(lc);
decimal total = sc.CalculateStockValue();
Console.WriteLine("Total: {0:c}", total);
</code>```

With DI Container -- (Ninject is used in this example)

```<code>IKernel ninjectKernel = new StandardKernel();
ninjectKernel.Bind<IValueCalculator>().To<LinqValueCalculator>();

IValueCalculator calcImpl = ninjectKernel.Get<IValueCalculator>();
ShoppingCart cart = new ShoppingCart(calcImpl);
Console.WriteLine("Total: {0:c}", cart.CalculateStockValue());
</code>```

I will be honest, I feel that writing first code was easier and seemed natural. But, your views are what counts as i am just learning the MVC.

答:
How often do I use a DI Container?

Very often. Close to always.

What requirements make me do so?

In ASP.NET MVC I always use a container, because when one uses Constructor Injection in Controllers one breaks the default convention of having default constructors. This means that a custom IControllerFactory is required, and while it's possible to write and maintain one by hand, it's more work. Using a DI Container that supports convention-based configuration, one can use Constructor Injection in a convention-based manner and less maintenance is required.

Can we do without them?

Yes, but at the cost of more maintenance of infrastructure code: https://stackoverflow.com/questions/5667801/arguments-against-inversion-of-control-containers/5668093#5668093