问:
Under what conditions is the use of MVVM appropriate?
Model View View-Model was developed by Microsoft to target UI development platforms which support event-driven programming, specifically Windows Presentation Foundation (WPF) and Silverlight on the .NET platforms using XAML and .NET languages.  In the years since, many Javascript frameworks such as Angular, Knockout and ExtJS have adopted the pattern.

Like most software patterns, MVVM has its appropriate uses, and its abuses.  Under what conditions is the use of MVVM appropriate?  When is it ill-advised?

答:
Using MVVM does not make sense when:

You are not working with WPF or Silverlight

You are testing a concept

That's it. I can't really think of why you would NOT use MVVM when working with WPF/Silverlight, unless you're testing or debugging something in a separate project. I find the design pattern ideal for WPF/Silverlight development because of the way the XAML Bindings work.

The whole point of MVVM is that your entire application is run in your ViewModels, and your Views are simply a pretty layer that users can use to interact with your ViewModels. You want to click a button, you're actually running a ViewModel method. You want to change the page, you're actually changing the CurrentPage property in the ViewModel.

I use MVVM for all WPF/Silverlight development, even small, simple single-page projects, although how I use MVVM is different based on the size of the project and what I need. The one time I did a small app without MVVM, I ended up regretting it (it later got refactored to use MVVM while adding an update)


问:
How is Node.js different from other server-side frameworks?
I've noticed that Node.js has become very popular, and I've seen several instances of people doing small-scale projects in it.

I've also looked at pros and cons lists to get an idea of what Node.js can do, but I'm still not clear on how it differs from other, more mature server-side tech like PHP, Perl, or Ruby on Rails.

What, specifically, differentiates Node.js from the current alternatives, and why?

答:
Its diffrent because its event-driven. This makes the server highly scalable.

In a nutshell;

Thread Model

Client asks for something

Server goes off and process the request

Gives it back to the client

Ready to process a new request

Event Model

Client asks for something

Server passes the request on for processing. Ready to process a new request

Server handles more requests as they come in

Server gives data back to the client when the request has finished processing

ContentLicense: CC BY-SA 3.0


问:
PHP framework most similar to ASP.NET MVC3?
I've done a bit of work with CodeIgniter and a lot with straight PHP...

I had the opportunity to use asp.net mvc3 recently and was absolutely blown away with my productivity. Despite not "knowing" the framework, the combination of scaffolding + intellisense + code generation through the context menus left me feeling just as productive with asp.net as with PHP.

I've evaluated YII, CakePHP, symfony (a long time ago, pre 2.0), and Kohana... and while YII seems most promising none quite matched up to my experience with mvc3.

答:
Until you find an IDE for PHP which is half confortable and fast than Visual Studio for C#, I do not think you can really compare the experience working with ASP MV3 and a PHP framework.

That being said ASP MVC3 looks a lot like many JEE framework, the best match to me would be Play Framework.

PHP MVC frameworks tends to be inspired by JEE. In that regard I've played a bit with Synfony 2 and must say I was really impressed by it.

But then I do not think you can be as confortable with a PHP framework as ASP MV3.


问:
Should I unit test
Most of the logic for my webservice involves talking to our supplier's webservices (checking availability, ordering etc.) They don't have a test environment and the majority of calls can't be run arbitrarily (for example a cease would be run once and would actually stop a service).

Is it feasible to run unit tests in this environment? I could simulate typical responses but I'm worried that hardcoding supplier responses would undermine the point of unit tests.

答:
ROI

This is really an Return On Investment question.  Do you feel that investing in unit tests is worth what you will get back.  Namely, your code tested in isolation.  As well as all the other benefits of unit testing.

You can contrast this with say an automated acceptance test approach where you would get a test account from your supplier actually test the integrated system with the tests.  Is the cost of doing ATDD worth what you get back.  Namely, testing of the system as a whole.

It's up to you to do the analysis and figure if you should do unit testing, automated acceptance testing, both, neither, or something else.

Title: Should I unit test


问:
Genetic programming
I recently was browsing Reddit and came across a post linking to a "JavaScript genetic algorithm" example. I've really been fascinated with the concepts of genetic algorithms and programming, however even after some Googling I am still left slightly confused. How does it work?

I suppose the vocabulary terms are confusing me more than anything else. I would appreciate brief examples and perhaps explanations. Just the concept of genetic programming and how I could implement it in my projects and why?

答:
Genetic programming is a way of having the computer write programs for you!

Don't think "programs" like MS Word, think of "programs" as the following:

```<code>function(x){ return x*2; }
</code>```

This function (or program), by itself, doesn't have a reason to exist. We are looking for solutions to problems. If you need to find the sum of two numbers, you just open the calculator and do the math. What if someone gave you the following table and asked you to figure out the relationship between result and x and y:

```<code>x   y   result
99  1   (3.02)
79  88   2.01
21  62   5.01
84  52  (6.58)
12  70   5.54
67  18   0.73
</code>```

This data is your "training" data. Your computer will use this data to generate some hypothesis, then you will test it against actual data.

Say you don't know statistics and decide this problem is too hard to figure out on your own, so you'll get the computer to figure it out for you.

Have the computer randomly generate wild guesses

You have the computer generate a million answers, and see if any of them stick (guess...a million times!). Following is an example of a couple of guesses:

```<code>function(x,y){ return x+y; } // wrong
function(x,y){ return x/1*1*1*1*1*1+y; } //wrong, silly
</code>```

You may or may not know this, but functions or programs can also be represented as trees, for example, the second function would be:

```<code>(+ (/ x (* 1 (* 1 (* 1 (* 1 (* 1 1)))) y)
</code>```

You can make it look more like a tree by indenting it like so (btw, look up reverse polish notation and lisp syntax...but you will understand why we represent programs like this shortly):

```<code>(+
    (/ x
        (* 1
            (* 1
                (* 1
                    (* 1
                        (* 1 1))))
    y)
</code>```

(+ is at the top with two "leaves" of / and y. / itself has several children, etc.)

This is why you read so much about "trees" in genetic programming. In any case, we plug in the values of x and y into this function and it gives us the WRONG answer. Not surprising though since we randomly generated this.

You now decide to generate a million such solutions.  All of them are wrong. However, you notice that some answers are closer to the right answer than others. In other words, some solutions are more "fit" than others. Note that the computer doesn't know what is "right" and "wrong" so you have to provide your own "fitness function." This function gets handed a potential solution, the training data, and is responsible for telling the GP system just how "fit" this solution is. As you can imagine, this function gets run millions upon millions of times.

What makes GP different

Here is what makes genetic programming different from wild guesses. You decide to do another round of million guesses; however, you do it a little more intelligently. You take the top 10% of the guesses (the ones that were closes to the actual values) and make them part of the second generation. You also take many of these solutions (perhaps the same 10%...i don't remember) and decide to "mix them up."

You randomly pick two solutions, randomly pick sub-trees and start swapping them. So part of solution A ends up under solution B and vice versa -- you just "crossed" them. You also take some solutions and simply "mutate" them...take some subtree and 'screw it up' a bit (hey, if the solution is terrible, 'screwing with it for no reason' might actually improve it).

A good way of thinking of this is the following: your mom and dad have certain attributes--hair color, height, likelihood of disease, etc. You, as a child inherit different attributes from both of your parents. If both of your parents were olympic athletes, you will also be a super athlete, right? Well, biologists, sociologists and even historians might take issue with this idea, but computer scientists are not concerned with the morality of eugenics here. They just saw a "system" doing a pretty good job providing solutions, so they decided to model it in software.

If it doesn't actually match biology, but still provides good answers... many computer scientists collectively say "whatever dude, and thanks for the terminology." Also note that all your brothers and sisters and not EXACTLY the same... even through they have same parents. Each person has genes which mutate for whatever reason (please don't show this to a biologist, the point is to understand the motivation behind much of the terminology).

So now we are getting the computer to generate millions of programs and measuring their fitness. The best solutions survive into the next generation. We also "mutate" and do cross-over on the "population" (notice how language of genetics and biology is being used). Once the second generation is created, fitness is again measured. Since this generation has the best solutions from the previous generation AND we crossed over and mutated the best solutions (along with mediocre population -- to keep up diversity), this generation should be at least a little better than the previous generation.

We continue this for a very large number of generations. Each generation (hopefully) provides better and better solutions, until we get the right answer. For example:

```<code>(+ (- 2.2 (/ x 11) (* 7 (cos y))))
</code>```

Well look at this, this is correct!

(I copied this from http://en.wikipedia.org/wiki/Genetic_programming, which also has a graphic representation of this tree)

Odds and Ends

There are some important issues, like how do you decide which "terminals" (+, -, *, /, cos, sin, tan) are available to your GP system, how do you write the fitness function and how does the system handle non-sensical programs such as (1 + cos) or (2 / "hello") (among many others).

It is pretty boring to evolve equations. It gets more interesting if your terminal set looks like the following: (fire, sense enemy, move, ...) and your fitness function measures your health and the number of dead bodies of martial monsters.

I wrote most of this from memory but this is the basic idea. I did some GP in my college years. You should definitely play around with it. Don't worry about understanding all the terminology, just download some free GP systems, run through a few examples to get a feel for it and make up your own interesting examples (find relationships between different data sets, try to hook it up to game APIs, etc.)

Title: Genetic programming

Body:
Genetic programming is a way of having the computer write programs for you!

Don't think "programs" like MS Word, think of "programs" as the following:

function(x){ return x*2; }

This function (or program), by itself, doesn't have a reason to exist. We are looking for solutions to problems. If you need to find the sum of two numbers, you just open the calculator and do the math. What if someone gave you the following table and asked you to figure out the relationship between result and x and y:

x   y   result
99  1   (3.02)
79  88   2.01
21  62   5.01
84  52  (6.58)
12  70   5.54
67  18   0.73

This data is your "training" data. Your computer will use this data to generate some hypothesis, then you will test it against actual data.

Say you don't know statistics and decide this problem is too hard to figure out on your own, so you'll get the computer to figure it out for you.

Have the computer randomly generate wild guesses

You have the computer generate a million answers, and see if any of them stick (guess...a million times!). Following is an example of a couple of guesses:

function(x,y){ return x+y; } // wrong
function(x,y){ return x/1*1*1*1*1*1+y; } //wrong, silly

You may or may not know this, but functions or programs can also be represented as trees, for example, the second function would be:

(+ (/ x (* 1 (* 1 (* 1 (* 1 (* 1 1)))) y)

You can make it look more like a tree by indenting it like so (btw, look up reverse polish notation and lisp syntax...but you will understand why we represent programs like this shortly):

(+
    (/ x
        (* 1
            (* 1
                (* 1
                    (* 1
                        (* 1 1))))
    y)

(+ is at the top with two "leaves" of / and y. / itself has several children, etc.)

This is why you read so much about "trees" in genetic programming. In any case, we plug in the values of x and y into this function and it gives us the WRONG answer. Not surprising though since we randomly generated this.

You now decide to generate a million such solutions.  All of them are wrong. However, you notice that some answers are closer to the right answer than others. In other words, some solutions are more "fit" than others. Note that the computer doesn't know what is "right" and "wrong" so you have to provide your own "fitness function." This function gets handed a potential solution, the training data, and is responsible for telling the GP system just how "fit" this solution is. As you can imagine, this function gets run millions upon millions of times.

What makes GP different

Here is what makes genetic programming different from wild guesses. You decide to do another round of million guesses; however, you do it a little more intelligently. You take the top 10% of the guesses (the ones that were closes to the actual values) and make them part of the second generation. You also take many of these solutions (perhaps the same 10%...i don't remember) and decide to "mix them up."

You randomly pick two solutions, randomly pick sub-trees and start swapping them. So part of solution A ends up under solution B and vice versa -- you just "crossed" them. You also take some solutions and simply "mutate" them...take some subtree and 'screw it up' a bit (hey, if the solution is terrible, 'screwing with it for no reason' might actually improve it).

A good way of thinking of this is the following: your mom and dad have certain attributes--hair color, height, likelihood of disease, etc. You, as a child inherit different attributes from both of your parents. If both of your parents were olympic athletes, you will also be a super athlete, right? Well, biologists, sociologists and even historians might take issue with this idea, but computer scientists are not concerned with the morality of eugenics here. They just saw a "system" doing a pretty good job providing solutions, so they decided to model it in software.

If it doesn't actually match biology, but still provides good answers... many computer scientists collectively say "whatever dude, and thanks for the terminology." Also note that all your brothers and sisters and not EXACTLY the same... even through they have same parents. Each person has genes which mutate for whatever reason (please don't show this to a biologist, the point is to understand the motivation behind much of the terminology).

So now we are getting the computer to generate millions of programs and measuring their fitness. The best solutions survive into the next generation. We also "mutate" and do cross-over on the "population" (notice how language of genetics and biology is being used). Once the second generation is created, fitness is again measured. Since this generation has the best solutions from the previous generation AND we crossed over and mutated the best solutions (along with mediocre population -- to keep up diversity), this generation should be at least a little better than the previous generation.

We continue this for a very large number of generations. Each generation (hopefully) provides better and better solutions, until we get the right answer. For example:

(+ (- 2.2 (/ x 11) (* 7 (cos y))))

Well look at this, this is correct!

(I copied this from http://en.wikipedia.org/wiki/Genetic_programming, which also has a graphic representation of this tree)

Odds and Ends

There are some important issues, like how do you decide which "terminals" (+, -, *, /, cos, sin, tan) are available to your GP system, how do you write the fitness function and how does the system handle non-sensical programs such as (1 + cos) or (2 / "hello") (among many others).

It is pretty boring to evolve equations. It gets more interesting if your terminal set looks like the following: (fire, sense enemy, move, ...) and your fitness function measures your health and the number of dead bodies of martial monsters.

I wrote most of this from memory but this is the basic idea. I did some GP in my college years. You should definitely play around with it. Don't worry about understanding all the terminology, just download some free GP systems, run through a few examples to get a feel for it and make up your own interesting examples (find relationships between different data sets, try to hook it up to game APIs, etc.)


问:
What Types of Stories Should Be In a Sprint Review?
This is sort of a follow-up to my previous question Should we quit trying to do agile if QA takes 12 weeks?

For the second time in as many sprints, we've set a sprint review that is scheduled to feature just a single issue that essentially amounts to an obscure bug fix or at most an esoteric enhancement to some small portion of our product. The only real stakeholders for this issue are the single developer and the customer who opened the issue.

It seems to me that given these parameters, we are probably better off just not doing a sprint review. Is there a general consensus on what types of stories should be discussed during a sprint review and what should be left out, or should everything be fair game? We haven't been doing retrospectives at all unfortunately, so unless that changes, that reason is kind of out as a reason to go ahead with the review.

答:
The purpose of a sprint review is to demonstrate all the things your team accomplished during the sprint, to show that you met your team's sprint goals.  Per Mountain Goat Software a sprint review meeting should be lightweight, informal, and hands on - that is, don't spend a lot of time preparing for it, be ready to answer stakeholders' questions and address concerns, and show them working software.

In my experience the sprint review is a great opportunity for the team to pat yourselves on the back and brag a little.  Writing high quality software is difficult and any release is a time to celebrate.  It helps keep a pulse on progress, builds morale, and builds confidence with the stakeholders.  For this reason I think anything you can demonstrate is fair game for a sprint review.  If you're collecting software metrics (e.g. complexity and size) you might even demonstrate behind-the-scenes things like technical debt reduction during a sprint review but this depends a lot on your stakeholders.

If you are feeling like there is nothing to show and that the sprint review is of little value, I wonder whether the team added meaningful value to the software during the last sprint?  What was everyone else on the team doing during this time?  Why is there nothing else to show?  What were the goals for the sprint and were they met?  How do you know the goals were satisfied (show me, don't tell me)?  Is the team proud of the work they've accomplished?  Answers to these questions will likely point to problems beyond whether or not to do a sprint review.


问:
How to "read" rails apps?
I've just finished the first rails tutorial and now want to learn something about how other developers use it. So is it possible to "read" rails web applications to learn about its architecture and design?</p>

答: It's certainly a good idea to read other people's code, and you will probably be able to understand most of what a Rails app does, but also beware of picking up bad habits or out-dated approaches.</p>

Title: How to "read" rails apps?


答:
How long of a meeting were you thinking this to be?  I could this being a fairly short meeting though it may be worthwhile to get feedback on what other enhancements or changes the customer that initiated the change may want in future releases.  This is also the time for the developer to show to the team what was done that may be important for others to see or note down the road.  In seeing the feature, the customer may have some new questions or concerns that are worth noting for future work.

Retrospectives are different from reviews as the former is just the team meeting to discuss how things are going.  What is working well?  What could be improved?  These are part of the heart of having that meeting where a team can check its performance and see how it is doing.  Why are the retrospectives not happening?  Is it a matter of time, priority, maturity, or something else?

Title: What Types of Stories Should Be In a Sprint Review?

Body:
This is sort of a follow-up to my previous question Should we quit trying to do agile if QA takes 12 weeks?

For the second time in as many sprints, we've set a sprint review that is scheduled to feature just a single issue that essentially amounts to an obscure bug fix or at most an esoteric enhancement to some small portion of our product. The only real stakeholders for this issue are the single developer and the customer who opened the issue.

It seems to me that given these parameters, we are probably better off just not doing a sprint review. Is there a general consensus on what types of stories should be discussed during a sprint review and what should be left out, or should everything be fair game? We haven't been doing retrospectives at all unfortunately, so unless that changes, that reason is kind of out as a reason to go ahead with the review.


问:
Saying "no" to people asking questions

Possible Duplicate:

  When do you not give help to less experienced programmers?

Currently, I am finding a lot of my day is taken up by people asking domain knowledge/system questions.  This impacts personal productivity.

Should developers learn to say "no" more to ensure they get asked less questions and be more productive, or should the developers help each other out?  Stuff does get documented, but it is often easier to ask a "quick question".

How do you handle this sort of scenario?

答: I hate to say it, but: Is this good for the company? If what you're working on is more important than what they're asking (to the company's bottom line), then say "I'll help you when I'm finished with this." If, honestly, their problem is more pressing to the company's success, say "I'll help you in two minutes." And finish your train of programming thought.

Title: Saying "no" to people asking questions


问:
What happens at [platform] user groups?
I'm a .NET developer, but I've never been to a .NET user group meeting or anything like that.

I might have the opportunity soon to start attending one, but I'm wondering. What happens at user groups? I'm not looking necessarily for info specifically about .NET ones, but they are preferred.

What do you get out of it excluding the opportunity for networking?

答:
I used to belong to a Ruby users' group. At meetings, we mostly caught up with Ruby/Rails news (the group was heavily Rails-centric). Members would show off cool projects or brainstorm solutions with the group if they were stuck on an issue. A couple people would give a mini lecture or presentation on some piece of technology. It wasn't even Ruby-specific: sometimes we'd talk about, e.g., Scala, Clojure, or Cocoa programming, too. One time a guy even gave a presentation on using zsh, and another gave one on using vim.

And, of course, we drank beer and ate pizza. :)

ContentLicense: CC BY-SA 2.5

Title: What happens at [platform] user groups?


答:
How sure are you of most of your day being eaten away by this?  I'd suggest tracking for a week to see what is really happening.  Perhaps you get a few questions a day but seems like more as those become your highlight/lowlight of the day.  The key being to get some hard data first just to confirm what you suspect.

Second, after you have the data, take a look to consider how good or bad was it to answer those questions.  Maybe things worked out really well because you answered those questions and so your company did better than it otherwise would.  Alternatively, you may now really see how much of your time is being sapped up by these questions.  This is where I'd try to formulate various strategies to improve but also to state what general operating procedures are there here.  For example, in some places I've worked it wouldn't be unusual to see developers ask, "What's the ticket # for this request?" and if there isn't one, kindly ask the person to make a ticket and then you'll be happy to help as the request is properly tracked in this case.  While this can seem annoying to be sticking to policy the idea here is that if there is a ticket then the work is tracked while if there isn't, who knows how many questions were asked here.

Third, confirm with your manager and co-workers how much time should be spent doing this kind of stuff.  If you are more senior in the team or been at a place longer then you may be expected to do knowledge transfer and help get others up to speed.  Should you be protected more than you are now?  Should you answer other questions more and that really is most of your job now?  I don't know but this should be a discussion had at some point.

Title: Saying "no" to people asking questions

Body:
Possible Duplicate:

  When do you not give help to less experienced programmers?

Currently, I am finding a lot of my day is taken up by people asking domain knowledge/system questions.  This impacts personal productivity.

Should developers learn to say "no" more to ensure they get asked less questions and be more productive, or should the developers help each other out?  Stuff does get documented, but it is often easier to ask a "quick question".

How do you handle this sort of scenario?


问:
Is wrapping third-party API calls a design smell?
Five methods within my API call the same third-party method. In trying to abide by DRY, does it make sense to wrap this call in a private method?</p>

答:
Actually, I think wrapping or isolating third-party api's in a "shim" layer is good design. There are a number of advantage in doing this.

For instance, what happens if you change operating systems assuming you are not developing in managed environment like .NET (Which basically provides the shim layer for you)? If you put a shim layer over of all the system calls like message queues, mutexs, etc, this process is much less painful. I used the operating system example, because I have done this, but it applies to any type of "swap-able" code module/library. As another example, suppose you use a graphics library and at some point decide to change your vendor. The shim layer essentially allows the main application to run in a number of different environments possibly without any other changes besides what the shim layer is actually doing. This is massively advantageous when you are developing cross platform applications. Plus, everything that needs to change is on one convenient spot.


答:
I've been under the impression that it's popularity was due to the use of JavaScript.  Since lots of web developers know JavaScript, it is a selling point that they can now develop server-side code using the same language.  This has a few advantages that I can think of:

Code files can be shared between server and client, preventing duplication of effort just to handle the two sides of the system.

Developers don't need to mentally switch between languages. (not a big deal in my opinion)

Architects don't need to choose multiple languages when architecting a web solution.

Someone who never developed server-side code can now do so without learning a different language. (Not likely to be a valuable argument, IMHO)

Title: How is Node.js different from other server-side frameworks?

Body:
I've noticed that Node.js has become very popular, and I've seen several instances of people doing small-scale projects in it.

I've also looked at pros and cons lists to get an idea of what Node.js can do, but I'm still not clear on how it differs from other, more mature server-side tech like PHP, Perl, or Ruby on Rails.

What, specifically, differentiates Node.js from the current alternatives, and why?


答:
I would by all means answer them, but if it becomes too much there are some things you can do to improve the process.

Try to teach them to answer the questions themselves: show them where relevant documentation can be found, how to find out who knows the most about the stuff etc.

Make clear to them that it is good style to first do a little research themselves, and if that doesn't help to collect some questions such that they don't come to you every few minutes.

Define some "don't disturb" hours.

Title: Saying "no" to people asking questions


答:
There is two important things that make Node.js different to existing server-side frameworks, asynchronous events and the use of JavaScript as a programming language.

Asynchronous Events

While most of the existing server side frameworks use a synchronous architecture, Node.js uses an asynchronous architecture, which JavaScript can handle well. This means that the server reacts to events and sends events (messages) to e.g. the database. This style of programming is very different to a synchronous style, and may be hard to use with other languages. Node.js employs an asynchronous style with asynchronous IO and can scale well.

See also Event Driven Architecture

JavaScript

JavaScript is the programming language that web applications are using on the client. Using the same language on the server-side means that the developer can apply his JavaScript knowledge both on the client and the server, and use the same functions as needed.

I would recommend the presentation Introduction to Node.js with Ryan Dahl where he explains Node.js event-driven architecture in more detail.


问:
Best way to save application settings
In Windows the default way is registry. This allow you to differentiate system-wide and per-user settings.

In Unix you should use text files in the /etc folder for system-wide settings (what's the convention for per-user settings?).

Many new programs (and especially those designed for being portable) use XML files.

What's the best way (and location) to store non-BLOB settings?

Should we follow each system default or have a unified solution?

And what's the best portable way?

答:
I think it's best to use the preferred platform-specific mechanism. For example, on OS X, the preferred mechanism is to place a property list in ~/Library/Preferences, and the Cocoa API has a really simple interface for storing and retrieving settings from there.

If your app is cross-platform, you can abstract this away with a class or whatnot.

Title: Best way to save application settings


问:
In Scrum, why shouldn't the Product Owner and ScrumMaster roles be combined?
In the more traditional projects that I've worked on, the project manager (and, on larger projects, there might be associate/deputy/assistant project managers should one person be unavailable) is the person responsible for communicating with the customer, receiving project health and status updates, determining scheduling and budgeting, managing the process, ensuring the team has what they need to complete tasks, and so on.

In Scrum, however, these responsibilities are split between the Product Owner and the ScrumMaster. The Product Owner is the voice of the customer. They interact directly with the customer, create user stories, organize and prioritize the product backlog, and other user/customer facing issues. The ScrumMaster handles the process, overseeing meetings (including estimation and planning), removing impediments, and monitoring the overall health of the project, making adjustments as needed.

I've read in multiple sources, including Wikipedia, that the role of ScrumMaster and Product Owner should be held by two different people. I've not only read about, but worked on successful "traditional" style projects where the activities of both were handled by a single individual. In fact, it makes more sense for one to three people to be responsible for handling project (including human resources/staffing) and process level tasks, as they often go hand-in-hand. Process changes have an impact on scheduling, budgeting, quality, and other project-level goals, and project changes have an impact on process.

Why does Scrum call for isolating these activities into two roles? What advantages does this actually provide? Has anyone been on a successful Scrum project where the Product Owner and ScrumMaster were the same individual?

答:
The people in the Product Owner and Scrum Master roles may have conflicting desires, goals, requirements and constraints, more so than 2 random programmers.  Humans may or may not be able to equally value conflicting objectives well, and may be more likely to make errors in judgement when faced with conflicting objectives.  Two people with slightly different focuses or biases may be less likely to together make the same errors or the same degree of errors in judgement.

Two people may also allot more total man-hours to focusing on each differing aspect of the problem/project (e.g. the goals of the 2 different roles).


问:
Approaches to updating and adding features to PHP websites
I would like to know how people approach with developing their websites that are in production.

For example:-

How do you manage versions, etc.

Also, do you create a subdirectory within the production server and work there or do you use any other environment and roll the updates there

Do you have any special management software where you keep notes, tips, deadlines, etc.

I am asking this because I have a website which I would like to add new features to. But that website is in production. So, what are your suggestions on how you would update your websites and add new features?

I use PHP with Apache on CentOS

答:
As far as I'm concerned, versioning can be used for anything. I'm comfortable with SVN.

It's preferable to work in separated environments (development / production).

There's a wide range of tools for software management. You could check some bug trackers (BlueBug, VersionOne, Trac, etc.), todo-lists (ToDoList, todo.ly, etc.), you name it.

OwnerDisplayName: Anush

OwnerDisplayName: Joel Alejandro


答:
You can use SVN

No. A sub domain

Project Management

Title: Approaches to updating and adding features to PHP websites

Body:
I would like to know how people approach with developing their websites that are in production.

For example:-

How do you manage versions, etc.

Also, do you create a subdirectory within the production server and work there or do you use any other environment and roll the updates there

Do you have any special management software where you keep notes, tips, deadlines, etc.

I am asking this because I have a website which I would like to add new features to. But that website is in production. So, what are your suggestions on how you would update your websites and add new features?

I use PHP with Apache on CentOS

OwnerDisplayName: genesis


答:
This is a BIG subject with a lot of personal opinion and taste involved.

1) Use version control. There is a lot to choose from here but the more common ones you'll bump into are Subversion (SVN) and Git. I would very much recommend staying away from SUbversion and go for Git, which is what most of the newer open source projects use nowadays.

GitHub has a very good introduction to Git. While you're there - sign up for an account!

2) Keep your environments separate from each other. I recommend having one local site where you do your development and one production which you do not touch unless to deploy a new version. Inbetween you can also have a development machine to test your code or show it off to your client.

I would look into editing your hosts file for this. Personally I use local.example.com for my local machine, dev.example.com for the development environment and www.example.com for production.

3) Again - GitHub provides a very good issue tracker. I could also recommend having a look at Unfuddle and AgileZen. I also hear good things about Sifter App and Lighthouse but I have not tried them myself.

OwnerDisplayName: Tobias Sjösten


答:
That is a broad question. I tend to work as follows:

Dev on my laptop, which duplicates completely my production LAMP

before starting a 'feature' release, i code-branch for the new feature, in case i have to push an emergency bug fix on the current trunk (in production)

I have a staging LAMP that is an exact duplicate of my production server. Before pushing to production, i push to stage and do some functional and non-functional tests there;

I keep three sym links on production servers, 'current' , 'previous' , 'next', each pointing to a directory named SVN_TAG_NUMBER;

When I push, I actually create the new SVN_TAG_NUMBER directory that embeds the code and configuration files, etc... so the switchover is basically just to change my current/previous/next sym links (very fast);

Before flipping the sym links, i do a quick test with the 'next' (the new feature in your case). I can do this with the help of mod_rewrite : i have a virtual host that points to next, so i can 'go live' privately on the new build. If all pans out, i flip the sym links.

OwnerDisplayName: YvesLeBorg


问:
How can I best implement 'cache until further notice' with memcache in multiple tiers?
the term "client" used here is not referring to client's browser, but client server

Before cache workflow

```<code>1. client make a HTTP request -->
2. server process -->
3. store parsed results into memcache for next use (cache indefinitely) -->
4. return results to client -->
5. client get the result, store into client's local memcache with TTL
</code>```

After cache workflow

```<code>1. another client make a HTTP request -->
2. memcache found return memcache results to client -->
3. client get the result, store into client's local memcache with TTL
</code>```

TTL = time to live

Is possible for me to know when the data was updated,

and to expire relevant memcache(s) accordingly.

However, the pitfalls on client site cache TTL

Any data update before the TTL is not pick-up by client memcache.

In reverse manner, where there is no update, client memcache still expire after the TTL

First request (or concurrent requests) after cache TTL will get throttle as it need to repeat the "Before cache workflow"

In the event where client require several HTTP requests on a single web page,

it could be very bad in performance.

Ideal solution should be client to cache indefinitely until further notice.

Here are the three proposals about futher notice

Proposal 1 : Make use on HTTP header (current implementation)

```<code>1. client sent HTTP request last modified time header
2. server check if last data modified time=last cache time return status 304
3. client based on header to decide further processing

GOOD?
----
- save some parsing for client
- lesser data transfer

BAD?
----
- fire a HTTP request is still slow
- server end still need to process lots of requests
</code>```

Proposal 2 : Consistently issue a HTTP request to check all data group last modified time

```<code>1. client fire a HTTP request
2. server to return last modified time for all data group
3. client compare local last cache time with the result
4. if data group last cache time < server last modified time
   then request again for that data group only

GOOD?
----
- only fetch what is no up-to-date
- less requests for server

BAD?
----
- every web page require a HTTP request
</code>```

Proposal 3 : Tell client when new data is available (Push)

```<code> 1. when server end notice there is a change on a data group
 2. notify clients on the changes
 3. help clients to fetch again data
 4. then reset client local memcache after data is parsed

GOOD?
----
- let the cache act/behave like a true cache

BAD?
----
- encourage race condition
</code>```

My preference is on proposal 3,

and something like Gearman could be ideal

Where there is a change, Gearman server to sent the task to multiple clients (workers).

Am I crazy?

(I know my first question is a bit crazy)

答:
You know your preference, so it is most likely the correct one for you situation. I would suggest you go for it.

HTTP is designed to be stateless. HTTP also has a well defined standard of caching. http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

Of course, HTTP is also designed to separate client and server implementations. If you can control both, you could create your own lightweight protocol that would allow your preferred method with the push technology.

The only question I could find was "Am I crazy?" And the answer is no, these are all valid suggestions for different scenarios, depending on multiple factors like load, time sensitivity of the data, and many I've haven't though of.


问:
My boss wants a narrated line-by-line English explanation of our code
I have been specifically asked to give line by line (or as appropriate - for example, image by image, etc.) explanation or commentary which my boss wants to be able to read and follow.

Since he is not a programmer, he can not follow the code so wants it all translated into English.

Has anyone been asked to do this before?

I have commented on all of the source code and used JSDoc to generate full documentation of all functions, variables, etc... and included an implementation example, and full working demos with comments throughout.

Is there anything else I can do to comment the code for non-programmers?

This isn't a reasonable request, is it?

UPDATE

In the end, I managed to explain why it was not a good use of time to do what he was asking. He is a reasonable guy, and just did not have an understanding of what my job involves. Once he saw this post, I think he quickly understood that it was not a normal request.

I did provide documentation that is suitable for another programmer to follow (JSDoc and inline comments - as well as some extra notes on technical issues), and a very broad flow chart diagram of the main logic of the program for my boss to follow.

In the end, all parties were satisfied and we have moved on.

答:
I would also point out to your boss that to do this would take X hours of your time.  after he sees what this will take, I'd be suprised if he asks you to continue.

I'd also invite him/her into a code review of your feature.  Not so he/she can understand anything, but just to understand that this is what you and your team do internally to NOT have to verbalize your code.  If your boss is asking for this, my gut is telling me he/she doesn't trust your team or trust that they are taking due diligence.  By letting him/her sit through a code review, it would demonstrate that due dilligence and he/she would hopefully leave you alone.

OwnerDisplayName: BIlly Moon


答:
I use git, creating a branch for each new feature or bug fix, testing on that branch and then merging it into master only once that branch has been successfully deployed to all production webservers. I generally refer to things by the git SHA when working with the deployment so I make sure I get a specific code version. If I were to refer to the branch instead of the git SHA, I would always be getting the latest code that has been checked into that branch.

I do all the development on my laptop (OS X), test in a VM that is a mirror of the production machines (linux) and deploy to the production web servers in a staged manner, watching for new errors or problems as I deploy to each web server. Basically I take one machine out of the load balancer, checkout the appropriate git SHA on that machine, very no problems, then roll out to the rest of the servers. If there's an issue, I just checkout master, otherwise I merge the branch/SHA into master.

I use JIRA (it's nearly free for small teams), putting a git SHA into each ticket and letting that ticket be the authoritative source for a bug.

You can replace git with most other revision control systems but I prefer git for it's power and flexibility.


问:
How should one handle "free projects"? Should one accept them or not?
Ok, as a software engineer, I feel that my skills are valuable in other contexts, for instance, a friend came to me and asked me to setup a website for her research and I did it for free. At first I thought it would put my name out there and give me something to work with and hone my skills in my spare time... But I couldn't stop thinking that I was wasting my time with an unpaid job.

Now, a second friend comes to me with the same story: "Could you do it for me? I will put your name there, you know, it will get tons of views... Yadda Yadda..."

How do you handle this? Do you charge for services in your spare time, even if we are talking about friends? If so, how would you charge for it, for instance, as a consultant?

答:
"Free" is no problem - you do it if it amuses you; and there are no obligations to do more, better or different than you feel like.

"Bargain Rate" is a big problem. I Just don't do it.  There's no limit to how large a bargain project can become, and once you start accepting any money there's an expectation to see the project through.


问:
How important is it to be syntactically correct during an interview?
When asking an interview candidate to write a program on the whiteboard, do you expect the candidate to write code that is syntactically correct?

I had two candidates, one of which wrote a syntactically correct program but the logic was not up to the mark, and the other had the logic better written but the syntax was crap.

I favor the first candidate.

答:
The person who cannot logically satisfy the answer is unqualified. There are too many people in our industry producing garbage code that complies but doesn't actually do what it should do or handle errors or edge cases.

The second person may or may not be unqualified depending on the type and number of errors and the difficulty of what you are expecting them to write.  In SQL terms (the language I write in), the person who can't remember the syntax for an explicit join is unqualified for a job requiring you to query a database - no exceptions; the one who can't remember how to to a recusive CTE (but who knows they exist and tries to use one) is not. In other words, I would expect the syntax to be more correct for the basic code you write all the time but not for things done only occasionally and not for complex syntax.

If I was considering a person who I knew had excellent qualifications in a related area but only minimal knowldge of my specific language, I would probably be more forgiving of syntax errors as well. I'd rather hire a great Oracle developer than a mediocre SQl Server developer for a SQL Server job (Of course a great SQL Server person would be best) and would not expect that person to know SQL Server syntax if they could show me how to do it in Oracle. Same thing with Java and C# people, the person with excellent problem solving skills beats the one with excellent language skills, but the one with both wins every time (they are just hard to find sometimes).


问:
How do you determine a 'release' date when a team uses Scrum
I'm new to scrum and using it on a project.  We do 3 week iterations, estimate at the beginning and then collect the points at the end.

We have a product back log (probably not complete).

If you do estimates of the entire back log at the beginning aren't those estimate just 'wild ass guesses'

So when do you estimate the back log and how do you determine a release date?

ep

答:
If you do estimates of the entire back log at the beginning aren't those estimate just 'wild ass guesses'?

Correct.

So when do you estimate the back log and how do you determine a release date?

You have periodic release sprints in and among your build sprints.

Don't wait.

Put software in the hands of users as early and often as possible.

In principle, each sprint leads to something that could be released to users.

If your sprints aren't releasable, you're planning them poorly.

You should consider that each sprint is eligible for demonstration or acceptance testing.  And you should release more often than once at the very end.

At some point, you'll have a release which users really like and backlog that's non-zero, but so low-value that the product owner decides that no more active development sprints are needed.

In one sense, you're done.  Users are happy.

In another sense, you're not done.  Backlog is not empty.

This point is very, very difficult to foresee, but is the most important part of Agile methods.  You've created enough value and avoided wasting time on low-value elements of the original vision.


问:
Creating a platform agnostic development team hegemony
I work at a company where we have a lot of different skillsets in the development team.

We do all of the following (generally geared towards web):

.NET (MVC, Umbraco, ASP.NET, Surface)

Java (Spring, Hibernate, Android)

PHP (Zend, Code igniter)

Actionscript 3

AIR

Objective-C

Html/Javascript (obviously)

We're trying to streamline our development process.

We currently have a TeamCity server that builds and deploys .NET projects with msbuild/msdeploy/nant.

What I want is something like maven that will give us a standard project template structure that works for most projects to allow people from different teams to move between projects easily.

Currently this works on one platform because we tend to do things in a standard way for that platform (as long as certain people have been involved) however I want to use something like maven to standardise how a project is laid out and built.

Has anyone tried anything like this before? Experiences? Books?

答:
Currently we employ several languages in our project: C++, Java, Ruby, Perl, OCaml, Shell, PHP and JavaScript.  And we don't have any problems to put up with them all.  Because each component has its own structure and directory layout.  The build is glued together with simple recursive Makefiles processed by GNU make.  They sometimes call other build systems, if necessary (for example, they invoke Java's Ant to build the Java code).  If these build systems are tied to a specific layout, it's no problem, because each component has its own, and it could be tuned to fulfill the build system's requirements.

The key idea was to keep every component separately from the others.  Inside its directory we just stored the files as we thought it would be useful for this particular component.  We don't have large blobs like src/ directories that contain, for example, all the code for one language.  This way we didn't experience any problems with editing code in different components.


答:
Our approach is that, we tend to guess required time only roughly at the planning meeting. This gives product owner a feel of how much a PBI would cost. He then prioritizes items based on this, and he defines some milestones. I think those milestones are releases.

For example, we work for 3 sprints, and while we deliver working products at the end of each sprint, only after 3 sprints we release our product to the end users. Then after another 4 sprints we deliver the second part of the product.

I think it depends on the user, and delivery mechanism. For example, if your product is something like Microsoft Office, then you should deliver the entire applications (Word, Excel, Access, PowerPoint, etc.) in a package to the end users. This means that release date should be the date when all of the applications are ready. But, you may release Word separately from Excel, to your stakeholder or to an internal user. This means that release date for you is when you deliver Word, but release date for sales manager would be when he/she can sell the product in the market.

Title: How do you determine a 'release' date when a team uses Scrum

Body:
I'm new to scrum and using it on a project.  We do 3 week iterations, estimate at the beginning and then collect the points at the end.

We have a product back log (probably not complete).

If you do estimates of the entire back log at the beginning aren't those estimate just 'wild ass guesses'

So when do you estimate the back log and how do you determine a release date?

ep


答:
"Sure no problem"

Start at line one of your JavaScript application, <!DOCTYPE html>

And drill down all the way to the CPU electronics...

Do this for each byte of code.

Explain what doctype is, explain the prupose, explain the history, explain the alternatives.

Problem?

Title: My boss wants a narrated line-by-line English explanation of our code

Body:
I have been specifically asked to give line by line (or as appropriate - for example, image by image, etc.) explanation or commentary which my boss wants to be able to read and follow.

Since he is not a programmer, he can not follow the code so wants it all translated into English.

Has anyone been asked to do this before?

I have commented on all of the source code and used JSDoc to generate full documentation of all functions, variables, etc... and included an implementation example, and full working demos with comments throughout.

Is there anything else I can do to comment the code for non-programmers?

This isn't a reasonable request, is it?

UPDATE

In the end, I managed to explain why it was not a good use of time to do what he was asking. He is a reasonable guy, and just did not have an understanding of what my job involves. Once he saw this post, I think he quickly understood that it was not a normal request.

I did provide documentation that is suitable for another programmer to follow (JSDoc and inline comments - as well as some extra notes on technical issues), and a very broad flow chart diagram of the main logic of the program for my boss to follow.

In the end, all parties were satisfied and we have moved on.


答:
One of the better ways I've found to really get into the "meat" of a Rails app is to go to Github and find some of the Rails demo/example applications that people put up there; there are even some fully-featured applications (FatFreeCRM comes to mind) but be aware these are usually anything but simple and I would not recommend a beginner who just has an intro tutorial under their belt to dive into, say, FatFreeCRM.  There should be a plethora of similar but lighter-weight apps floating around Github; just as others have said be mindful of the date/version they were using as a lot has changed in Rails in the various versions.

Try to find an application that has a full suite of tests (or specs), so you can at the least follow the tests to get an overall approach of the application, and this will also train you for a career as a professional Rails developer as if you were brought onto an existing Rails app as a new developer, chances are you would "learn the guts" of the app by reading through the tests/specs.

Title: How to "read" rails apps?

Body: I've just finished the first rails tutorial and now want to learn something about how other developers use it. So is it possible to "read" rails web applications to learn about its architecture and design?</p>


答:
I generally see question answering as increasing the overall productivity of the enterprise - especially if they're domain / business insight type questions that can't just be googled / RTFM'd.

If in a given hour two people are stopped and I'm working, that's less productive than me spending 10 mins answering each person's questions. The first asker can then get working for 50 mins and the other two of us then working for 40 mins.

I see it as removing roadblocks or bottlenecks.  If you're more senior you may have access to context that the others don't.  Especially if what they're actually doing is coming to you not with a question, but looking for a decision to be made.  You may have the context to point them down the right path (e.g. the customer doesn't need it to have that bell & whistle, move on versus that's a great enhancement, the customer will love that)

That said, several of the techniques listed elsewhere for getting the regularly needed knowledge documented are also vital to save everyone time in the long run.

Title: Saying "no" to people asking questions


问:
For ASP.NET Programmers: Does the executable 'dcpromo' have any significance?
Dcpromo.exe is famous among MCSEs for being they only way to create a Windows Domain Controller (in other words an Active Directory Domain) ... which in turn is often used by the ASP.NET Membership system.

I'm trying to determine if I should put content on "www.dcpromo.com" geared for developers or more towards sysadmins.

To me, a logical extension of this "domain controller on the internet" is to use WIF for the ASP.NET Membership system.  We'd then have a website that will serve the developer's interests in the SSO, SAML, user managment and identity areas we all struggle with.

So my question is:

Q:  Do programmers see a connection between the utility dcpromo.exe and ASP.NET Membership?  If so does it make sense to have a purpose of http://www.dcpromo.com  help developers in the areas of membership and cloud computing?

答: I'm an asp.net newbie, having been working with it for only about 3 months, though I've played with membership a little bit.  That said, I've never heard of dcpromo.  Just my 2 cents.</p>


问:
What are the pros and cons for the employer of code questions during an interview?
The Joel Test question #11 is: "Do new candidates write code during their interview?". What are arguments for and against to ask new candidates to write code during the interview and to make a decision upon it?</p>

答:
I would say:

Pros

Demonstrates the candidate has at least a passable knowledge of programming, since resumes can be fabricated/embellished

If the interviewer discusses the code with the candidate, as opposed to it being more like a written test, could be a good indicator of how you "mesh" socially and if the candidate is a good fit for the company/company and team are good fits for the candidate

Cons

Could be insulting to candidates if the questions are rote/trivial nonsense that would never come up during the job (e.g. "Write a bubble sort" when all modern frameworks that one would be using on the job have sorting built in, "Reverse a string" when there's a built-in Reverse method or similar, or for written tests things like "What are the arguments to the Foo method of the Bar class", when any idiot could Google that or use the documentation) as opposed to architectural/design questions that show the candidate can get things done and solve business problems.


答:
According to the Scrum Guide,

Product backlog grooming is the act of adding detail, estimates, and order to items in the Product Backlog... Grooming is a part-time activity during a Sprint between the Product Owner and the Development Team... Grooming usually consumes no more than 10% of the capacity of the Development Team.

So you should be working with the Product Owner to add detail and estimates to your Product Backlog items throughout the Sprint, not just during Sprint Planning, which should concentrate more on planning your goal for the current Sprint. Estimates for fuzzy items should be large, because of the uncertainty involved. As you get more feedback from customers, discussion with the Product Owner, etc., you can improve your estimates.

At the end of a Sprint, the new Increment must be "Done,"... It must be in usable condition regardless of whether the Product Owner decides to actually release it.

So, it's up to the Product Owner when it gets released. He may decide he wants to wait until some specific set of high-priority features has been included in the Increment, or he may have a fixed release date at which point whatever is Done gets released. In any case, whatever the Team delivers at the end of a Sprint should be ready to ship to customers, so that the Product Owner is free to make that decision.

Since the Product Backlog is ordered, the Product Owner can also use the Team's velocity to make an estimate of what Product Backlog items will be Done by the end of a given Sprint. He may thus plan a release date well ahead of time based on when he feels his set of high-priority features will be done, or he may order features in such a way that whatever is needed for a given release will be done by the time that release date rolls around.

Note that early in a project, a Team's velocity will likely be all over the place as they nail down their Definition of "Done" and possibly take out some early-project technical debt, so it's hard to make these kinds of projections. If you need to determine release dates at an early stage, it's probably better to set fixed release milestones, or to just wait until the outcome of a Sprint is deemed to contain enough value to be released.


问:
Developing a simple web-application?
I decided to do a mini-project by myself to help me understand a bit more about developing web applications before starting the new university semester. Using the Java SE and JEE/J2EE platforms. I will be creating a simple web application that will retrieve data from a database and display the data.

I decided to use a Model-View-Controller type pattern and so far decided that the:

Models: Will be Java objects which are persisted in the database using a framework.
View: will only be the front end, probably written in HTML with some CSS.

I have not (at a high level) decided how the controller should be implemented, I initially went along with the idea that I will use JDBC to query results from the database and display it to the front end but the use of frameworks should ease the process.

I was told that there are some open source frame-works that help in making web application and a few I looked up were Spring and Hibernate.

My question then is there a way of incorporating these frameworks to what I proposed and if so how can I learn about these frameworks in order to create a web application?

Would appreciate advice and experiences about developing web-applications.
This is something I have not done before so it’s all a new and a learning process for me.

In essence I want to create is a web-application using Java as the primary programming language in which database querying functionalities help in displaying outputs to the front end.

Edit: Edited question to make it clearer for those who want to start similar type projects.

答: I would recommend to use Play Framework, it's a modern Java (and Scala) web framework, that is easy to work with. It's inspired by Ruby on Rails and has a very short development cycle.</p>

Title: Developing a simple web-application?


问:
Ideal programming language learning sequence?
What do you think? What is the ideal programming language learning sequence which will cover most of the heavily used languages and paradigms today as well as help to grasp common programming basics, ideas and practices?
You can even suggest learning sequence for paradigms rather than languages.

N.B. : This is port of the question I asked in stackoverflow and was closed for being subjective and argumentative.

答:
It's hard to claim that any sequence is ideal, but I'll lay out a plan that I can justify:

C

Learning C demands patience and diligence, and will introduce you to the basic ways that computers deal with data and show you almost the widest set of responsibilities that a programmer can accept to deal with such a machine.

Perl

As an antidote to the rigor required by C, try the unbelievably forgiving Perl. What took a week to write in C you can write in an hour in Perl. It introduces a different kind of delight to be found in programming, and shows how excluding certain concerns and details frees the programmer to focus on different things.

C++, or maybe Java

Next see how C's focus on low-level and primitive aspects of programming serve as a foundation for raising the abstraction level, noting the trades one makes in efficiency when moving up in abstraction. Explore how to form abstractions that can still retain the efficiencies that matter for your program.

Common Lisp

This is the reward for the preceding slog. You'll find echoes of what you learned in all the preceding languages, and see how silly so many of the preceding concessions seem when programming in Lisp. C's preprocessor and C++'s templates prepare one to appreciate Lisp's macro system. You'll regain the ease of expression from Perl, the opportunities for low-level optimization from C, the abstraction-building capabilities of C++ or Java, and go well past them all. None of the preceding three — perhaps except Perl's debugger — will have prepared you for the interactive programming experience with a capable REPL ("read, eval, print loop"). Working with an image-based environment — which changes the relationship between your source code and the idea of an "executable program" — will change your whole idea of what it means to build a program.

Beyond those four, exploring other styles of programming, such as functional programming in Haskell, or logic programming in Prolog, makes for more comprehensive understanding of the range of programming — wide knowledge, if you will — but at that point your time is better served by improving your craft — deep knowledge — with any language you know.

Having tasted enough distinct languages, your view will raise to focus on the ideas that transcend any one of them. It's kind of like the difference between learning to drive your father's car and knowing how to drive any car: You may not enjoy having to drive the rental mini-van for a few days, knowing full well the pleasures of driving a favorite sports car, but you'll figure out how to operate it, and will surely coax more out of the poor beast than an amateur.


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

答:
Functional languages, by definition, should not maintain state
  variables

Your definition is wrong. Language that cannot maintain state simply cannot be used.

The difference between functional and imperative languages is not that one of them has state and the other does not. It's in a way they maintain the state.

Imperative languages have state spread all over the program.

Functional languages isolate and maintain the state explicitly via type signatures. And that's the reason they provide sophisticated state management mechanisms like STM.


问:
Difference between these 3 manager roles
Roles:

Development Manager

Program Manager

Project Manager

I have read a bit and independently I understand them well enough. However when you combine them, it seems to me that some responsibilities overlap and it becomes uncertain who is responsible for what.

Does anyone have a clear way of defining how each role differentiate from the other? Or mainly which tasks are exclusive to each one? I want to avoid overlapping of responsibilities.

I know there are other similar questions on the matter, but none exactly the same...

Thanks

EDIT:

This 2 questions help a little, but still can't quite place each role when pushed together:

What is the difference between a Program Manager and a Project Manager?

The Written Roles of Software Development Manager

答:
A Programme Manager manages a number of projects (or portfolio), each run by project managers, that help to achieve a common goal.  From wikipedia:

Program management or programme management is the process of managing
  several related projects, often with the intention of improving an
  organization's performance. In practice and in its aims it is often
  closely related to systems engineering and industrial engineering.

A Project Manager manages an individual project, which might be within a wider programme.  Their aim is to deliver the project they've been tasked with to the required quality, budget and timescale.

The project manager is focussed on delivering their individual project, where the programme manager understands the interdependencies between projects and may need to make decisions and assign priorities between projects when they come into competition or are competing for a scarce resource.

A development manager is often sat to the side of this, managing a pool of developers from a career progression point of view.  They assign developers to individual projects in response to requests from Project Managers.  The development manager is typically responsible for things like training (except where required for a specific project need), appraisals etc.  You might have the same development manager for several years, over which time you are assigned to multiple projects (potentially over several programmes) with different project / programme managers.

Alternatively on a big project, there might be an overall project manager, then separate project managers with a focus on different workstreams e.g. Development Manager, Test Manager etc. They manage their focus area within the wider project.

That's the way it works in 'Enterprise IT' anyway.


答: In an organization where I used to work (over a decade ago) the development manager was in charge of developing the whole IT function (both hardware and software). The programming manager was in charge of all programming functions (software only). A project manager was in charge of individual projects, usually related to programming, occasionally to hardware.</p>

Title: Difference between these 3 manager roles

Body:
Roles:

Development Manager

Program Manager

Project Manager

I have read a bit and independently I understand them well enough. However when you combine them, it seems to me that some responsibilities overlap and it becomes uncertain who is responsible for what.

Does anyone have a clear way of defining how each role differentiate from the other? Or mainly which tasks are exclusive to each one? I want to avoid overlapping of responsibilities.

I know there are other similar questions on the matter, but none exactly the same...

Thanks

EDIT:

This 2 questions help a little, but still can't quite place each role when pushed together:

What is the difference between a Program Manager and a Project Manager?

The Written Roles of Software Development Manager


答:
Is the favor reasonable for our friendship?  (My fiancee can ask for something more time-intensive than a facebook acquaintence),

Do I think its worthwhile? (I don't like wasting my time),

Do I have the relevant expertise? (I'm not going to learn adobe flash for a free project),

Is it fairly enjoyable (I'm not going to volunteer my free time for something I will hate),

Do I have the time?

Will they appreciate the favor?

If I do a favor, I also like making sure they put in their share of the work.  They want a simple javascript action on their website?  Make sure they fully specify in writing, what the behavior they want is (and I'll let them know the finished product may differ), with as little to no ambiguities.  Also make sure the friend is there while I'm developing (not looking over my shoulder -- but around so I could ask questions)--say they make me dinner and I'll do a couple hours of coding for them.

Title: How should one handle "free projects"? Should one accept them or not?

Body:
Ok, as a software engineer, I feel that my skills are valuable in other contexts, for instance, a friend came to me and asked me to setup a website for her research and I did it for free. At first I thought it would put my name out there and give me something to work with and hone my skills in my spare time... But I couldn't stop thinking that I was wasting my time with an unpaid job.

Now, a second friend comes to me with the same story: "Could you do it for me? I will put your name there, you know, it will get tons of views... Yadda Yadda..."

How do you handle this? Do you charge for services in your spare time, even if we are talking about friends? If so, how would you charge for it, for instance, as a consultant?


答:
Your roughly describing the Gateway pattern.  No smell at all.

...Interesting software rarely lives in isolation. Even the purest object-oriented system often has to deal with things that aren't objects, such as relational data-base tables, CICS transactions, and XML data structures.

When accessing external resources like this, you'll usually get APIs for them. However, these APIs are naturally going to be somewhat complicated because they take the nature of the resource into account. Anyone who needs to under-stand a resource needs to understand its API - whether JDBC and SQL for rela-tional databases or W3C or JDOM for XML. Not only does this make the software harder to understand, it also makes it much harder to change should you shift some data from a relational database to an XML message at some point in the future.

The answer is so common that it's hardly worth stating. Wrap all the special API code into a class whose interface looks like a regular object. Other objects access the resource through this Gateway, which translates the simple method calls into the appropriate specialized API.

Title: Is wrapping third-party API calls a design smell?

Body: Five methods within my API call the same third-party method. In trying to abide by DRY, does it make sense to wrap this call in a private method?</p>


问:
Best way to use source control for a project (1-3 people)
So my partner and I are working on a practice management system and at first we didn't use any version control, then I persuaded him to use git. At the moment our system is that we have three branches: develop, master and release. Our git repo is on an external server, which has Apache, MySQL, etc. We do our daily coding on the develop branch (commits) and then we we have done some testing to make sure it's (semi) bug-free we merge it into the master branch. If we want to do something radical we just make a branch of master, mess around and if it works, good, we merge it back in, if not, we delete the branch.

Finally when we go for our weekly release we merge to the release branch to make sure we have a copy of the project as it was when we released. Unfortunately we don't track all files in git as it slows down git too much (e.g. images, especially since this is on an old server with a single-core 1.4 GHz AMD Sempron), as a git status usually changes from around 3s to about 1 minute; or because we can't (mysql databases). For us the slowdown is not workable so we just leave them out, and this has never seemed to be a problem because we haven't deleted any images, but we may start to soon as we start to optimize. So when we checkout previous commits sometimes the files aren't there and so it is broken (a big problem is we can't use version control on the database (because we don't know how), so because the schema has changed it is also broken if we go back).

And that's pretty much our workflow.

So after my background, my question is: Do you think that there are any improvements we could make to the above?

And on a side note: Does any know a reliable and easy-medium difficulty (i.e. not too hard) way to track mysql databases in git?

答:
Here's a simple php script (I called it dbschema.php) that outputs the database schema in a simple format.

Run it as: ./dbschema db name db user db pass > schema.txt

Then put the output schema.txt under version control and you have a solution.

Everytime you change the schema, rerun the script.

The code is:

```<code>#!/usr/bin/php -q
<?
if (!isset($_SERVER["argv"][1])) die("ERROR: Need arguments\n");
if (!isset($_SERVER["argv"][3])) die("ERROR: Too few arguments\n");
$db_name=$_SERVER["argv"][1];
$db_user = $_SERVER["argv"][2];
$db_pass = $_SERVER["argv"][3];
mysql_connect('localhost', $db_user, $db_pass) or die ("ERROR: Could not connect to the database server\n");
$use_query="Use $db_name";
$use_result=mysql_query($use_query) or die("Error using " . $db_name . " | " . mysql_error());

// show the tables of the currently selected database
$table_query="show tables";
$table_result=mysql_query($table_query) or die("ERROR: Error getting a list of tables from " . $db_name . " | " . mysql_error());
while($table_row=mysql_fetch_row($table_result))
{
    $table_name=$table_row[0];
    echo "\n"."TABLE NAME " . $table_name . "\n";
    // now describe the selected table
    $field_query="describe $table_name";
    $field_result=mysql_query($field_query) or die("Error describing the table " . $table_name . " | " . mysql_error());
    while($field_row=mysql_fetch_row($field_result))
    {
        if (strlen($field_row[0]) >= 16){ $tab = "\t";}
        elseif (strlen($field_row[0]) >= 8){ $tab = "\t\t";}
        else{ $tab = "\t\t\t";}
        echo "$field_row[0]". $tab .$field_row[1]. "\n";
        }
}
?>
</code>```

Body:
Here's a simple php script (I called it dbschema.php) that outputs the database schema in a simple format.

Run it as: ./dbschema db name db user db pass > schema.txt

Then put the output schema.txt under version control and you have a solution.

Everytime you change the schema, rerun the script.

The code is:

#!/usr/bin/php -q
<?
if (!isset($_SERVER["argv"][1])) die("ERROR: Need arguments\n");
if (!isset($_SERVER["argv"][3])) die("ERROR: Too few arguments\n");
$db_name=$_SERVER["argv"][1];
$db_user = $_SERVER["argv"][2];
$db_pass = $_SERVER["argv"][3];
mysql_connect('localhost', $db_user, $db_pass) or die ("ERROR: Could not connect to the database server\n");
$use_query="Use $db_name";
$use_result=mysql_query($use_query) or die("Error using " . $db_name . " | " . mysql_error());

// show the tables of the currently selected database
$table_query="show tables";
$table_result=mysql_query($table_query) or die("ERROR: Error getting a list of tables from " . $db_name . " | " . mysql_error());
while($table_row=mysql_fetch_row($table_result))
{
    $table_name=$table_row[0];
    echo "\n"."TABLE NAME " . $table_name . "\n";
    // now describe the selected table
    $field_query="describe $table_name";
    $field_result=mysql_query($field_query) or die("Error describing the table " . $table_name . " | " . mysql_error());
    while($field_row=mysql_fetch_row($field_result))
    {
        if (strlen($field_row[0]) >= 16){ $tab = "\t";}
        elseif (strlen($field_row[0]) >= 8){ $tab = "\t\t";}
        else{ $tab = "\t\t\t";}
        echo "$field_row[0]". $tab .$field_row[1]. "\n";
        }
}
?>


答: Proposal 3 is certainly the most efficient, however it is also the most time consuming to implement. Memcache doesn't include this feature, so you'd either have to find some other framework or roll your own (using Gearman in this case). It's not super hard, but it's not trivial and it adds a significant moving part to your system that can fail. I'd make sure to d all the appropriate research before committing to any decision. You might find that proposal 1/2 won't be a huge bottleneck after all and you could save yourself several days of time.</p>

Title: How can I best implement 'cache until further notice' with memcache in multiple tiers?

Body:
the term "client" used here is not referring to client's browser, but client server

Before cache workflow

```<code>1. client make a HTTP request -->
2. server process -->
3. store parsed results into memcache for next use (cache indefinitely) -->
4. return results to client -->
5. client get the result, store into client's local memcache with TTL
</code>```

After cache workflow

```<code>1. another client make a HTTP request -->
2. memcache found return memcache results to client -->
3. client get the result, store into client's local memcache with TTL
</code>```

TTL = time to live

Is possible for me to know when the data was updated,

and to expire relevant memcache(s) accordingly.

However, the pitfalls on client site cache TTL

Any data update before the TTL is not pick-up by client memcache.

In reverse manner, where there is no update, client memcache still expire after the TTL

First request (or concurrent requests) after cache TTL will get throttle as it need to repeat the "Before cache workflow"

In the event where client require several HTTP requests on a single web page,

it could be very bad in performance.

Ideal solution should be client to cache indefinitely until further notice.

Here are the three proposals about futher notice

Proposal 1 : Make use on HTTP header (current implementation)

```<code>1. client sent HTTP request last modified time header
2. server check if last data modified time=last cache time return status 304
3. client based on header to decide further processing

GOOD?
----
- save some parsing for client
- lesser data transfer

BAD?
----
- fire a HTTP request is still slow
- server end still need to process lots of requests
</code>```

Proposal 2 : Consistently issue a HTTP request to check all data group last modified time

```<code>1. client fire a HTTP request
2. server to return last modified time for all data group
3. client compare local last cache time with the result
4. if data group last cache time < server last modified time
   then request again for that data group only

GOOD?
----
- only fetch what is no up-to-date
- less requests for server

BAD?
----
- every web page require a HTTP request
</code>```

Proposal 3 : Tell client when new data is available (Push)

```<code> 1. when server end notice there is a change on a data group
 2. notify clients on the changes
 3. help clients to fetch again data
 4. then reset client local memcache after data is parsed

GOOD?
----
- let the cache act/behave like a true cache

BAD?
----
- encourage race condition
</code>```

My preference is on proposal 3,

and something like Gearman could be ideal

Where there is a change, Gearman server to sent the task to multiple clients (workers).

Am I crazy?

(I know my first question is a bit crazy)


问:
Under what circumstances are flowcharts still a valuable and useful tool?
When I first started programming, I relied heavily on flowcharts (and printer spacing charts). While I was in COBOL class, I couldn't start writing any code until my flowchart was signed off by the instructor. Back then, I had to make flowchart for everything.

Today, twenty-five years later, I find myself only flowcharting two types of things. Very specific algorithms where the logic is tricky or very general concepts to ensure that I get all the big steps defined and in the proper order.

Are there other use cases for flowcharts that I've simply overlooked?

答:
Absolutely.

Whenever I'm implementing something that I haven't done before (and the algorithm takes more than a few steps), I'll chart it out. I find that it really forces me to analyze the entire solution at a more atomic level and more thoroughly than if it wasn't charted out. I find that there are three major benefits to this practice:

Fewer "oh craps" because I've thought the entire algorithm through

Flushes out any potential knock on issues that may occur throughout the rest of the system

Allows me to easily walk someone else through the algorithm

The two different occasions where I actually use these are:

Low(ish) level algorithms. I mean a very specific solution to a very specific problem. I'll generally pass these by peers prior to implementation.

User flow. Not only can I use this to pass by a peer, but I'll also use it to explain (in a very non-technical manner) flow to a usability expert.

Having said all that, I don't produce flowcharts daily (and even when they're done, it's a generally a whiteboard session unless I'm writing a technical design doc).


问:
What are the steps in beginning a large project, when all I have is a big idea?
I am computer engineering student. I've been thinking about
how I can handle a big project. What should be my first step to reach my goal in a more efficient and effective way?

When I come up with a project, I don't know how I should start working on it. Many times, I just ignore it. However, I don't want to ignore my project ideas anymore.

Now, I am asking to all of you, can anyone share his/her experiences? How should I start a project when all I have is an idea?

答:
I would grab a stack of yellow stickies and a magic marker and sit in a room where there's a big white board so I could brainstorm.

I would just just start writing down simple phrases that came to mind such as Main Menu, Reports, Database, Authentication etc. I'd stick these on the white board and just stare and get more ideas say for example how the main menu should look:

File Open, File Save, File Save As, Print etc and stick these on the white board under main menu.

As ideas pop into your head write them down... good, bad, stupid whatever just get ceative. Stick them on the board. As you look at the board more ideas will surface and patterns will emerge. At some point you will start to get a feel for what you plan on developing.

Yellow stickies are great they can be moved around fairly quickly.

Once things start coming together, you split these thought into groups. Then you can brainstorm at a single group level. I'd take pictures of the white board at various stages in case you want to see what it looked like twenty minutes ago before things got shifted around.

Eventually, you will have a pretty good idea of the main chunks of stuff that has to get done. You could get a single folder for each of these chunks and just keep tossing ideas into them as they come to you.


问:
Do you have to be good at math to be a good programmer?
It seems that conventional wisdom suggests that good programmers are also good at math. Or that the two are somehow intrinsically linked. Many programming books I have read provide many examples that are solutions to math problems, or are somehow related to math as if these examples are what make sense to most people.

So the question I would like to float is: do you have to be good at math to be a good programmer?

答:
Is it possible for people who don't like math to become a good programmer?

No, no-no, no, yes and no!

No, because often you need it.

```<code>(! (a | (! (b && c) || d) && (! e)))
</code>```

Why doesn't it work?

```<code>foo ('a', 'b', 19, g(h))
bar ('c', 'd', 44)
</code>```

can it be rewritten in a more abstract way?

Is 968 ms more or less than 0.7 s? How many MB do you need, how many Ghz does the machine have, will a byte be enough - math is everyday part of the job. Sometimes explicitly and higher math.

Always implicitly lower math.

Math is a wide field, from calculating, to matrix, to geometry, logic, statistic, category theory, graph theory. So if you believe you're programming without using math - maybe you're wrong.

If you look at problems at the Project Euler page, you will find puzzles, where I don't have an idea, how math is used to solve it. (Not that I could solve them without math.) Note that the problem size is normally that big, that you can't solve them with brute force.

However - since I can't solve lot of them (about 2/3 by now), does it mean that I don't like math?

If you didn't study math, you will probably not know, where you can find math your daily life, including programming.

Even if you just specialised in moving GUI-components on the screen to look good, you're doing math in some way.

OwnerDisplayName: Charles Roper

Body:
Is it possible for people who don't like math to become a good programmer?

No, no-no, no, yes and no!

No, because often you need it.

(! (a | (! (b && c) || d) && (! e)))

Why doesn't it work?

foo ('a', 'b', 19, g(h))
bar ('c', 'd', 44)

can it be rewritten in a more abstract way?

Is 968 ms more or less than 0.7 s? How many MB do you need, how many Ghz does the machine have, will a byte be enough - math is everyday part of the job. Sometimes explicitly and higher math.

Always implicitly lower math.

Math is a wide field, from calculating, to matrix, to geometry, logic, statistic, category theory, graph theory. So if you believe you're programming without using math - maybe you're wrong.

If you look at problems at the Project Euler page, you will find puzzles, where I don't have an idea, how math is used to solve it. (Not that I could solve them without math.) Note that the problem size is normally that big, that you can't solve them with brute force.

However - since I can't solve lot of them (about 2/3 by now), does it mean that I don't like math?

If you didn't study math, you will probably not know, where you can find math your daily life, including programming.

Even if you just specialised in moving GUI-components on the screen to look good, you're doing math in some way.


答:
I use flowcharts all the time for a number of reasons:

They are better than UML use case diagrams in my opinion.  They can reflect a number of different use cases and how they interact, and they do a better job overall bringing the user experience and decisions together.

They are easier to understand and more intuitive.  Your mind naturally follows the arrows like a maze from start to finish.  You can use flowcharts to end and reference another flowchart for a different user story.  I can typically print them in a page numbered book and quickly flip pages to navigate to the next flow chart.

They are universal.  Few people outside of software engineering know and understand UML diagrams, where Flowchart diagrams are much more recognizable by users and business analysts.  I try to communicate complex use cases to a customer and they struggle to comprehend sometimes, I draw them a flowchart and they understand why the finally understand all the nuances that make it MUCH MORE complex than they thought.

Title: Under what circumstances are flowcharts still a valuable and useful tool?

Body:
When I first started programming, I relied heavily on flowcharts (and printer spacing charts). While I was in COBOL class, I couldn't start writing any code until my flowchart was signed off by the instructor. Back then, I had to make flowchart for everything.

Today, twenty-five years later, I find myself only flowcharting two types of things. Very specific algorithms where the logic is tricky or very general concepts to ensure that I get all the big steps defined and in the proper order.

Are there other use cases for flowcharts that I've simply overlooked?


答:
Never

Flowcharts - especially as practiced 25+ years ago - have been superseded by far more expressive diagramming techniques (c.f. Action Diagrams, Sequence Charts, State Charts, et al).

IBM's own studies showed that the use of flowcharts had no effect on the quality of a system's design or implementation (though they were marginally useful for communicating with users and other developers) [precise reference not readily available, but was cited in James Martin's Diagramming Techniques for Analysts and Programmers].


答:
I haven't drawn a classical flow chart since my first programming class in 1976, and haven't seen anyone else create one since the early 80's.  Flow charts were useful to communicate program logic when the code was in assembly language.  By the late 1960's, assembly language programmers were using pseudo-code.  When programming in modern OO languages, neither flow charts nor pseudo-code have any value.  You may just as well write high-level code in the implementation language.

I do occasionally draw UML diagrams, mostly on paper, to express design ideas, but those diagrams only live until the end of the discussion.  I also draw state transition diagrams from time to time, then convert them to a state table in the implementation language.


问:
How do I decide whether to take a job I can't add to my portfolio?
I am a programmer, but since I've barely been in the professional market my portfolio is rather bare right now. Still, I started to try and get my website up and running to help a little bit, but what I really need right now is to be able to expand my portfolio.

I have a guy who wants me to do a lot of work for him, and I'm willing to do it for a while at least until I can get better jobs. The real problem, though, is that he does not want me to tell anyone that I have been doing work for him. Naturally, since I'm both trying to earn money and expand my portfolio, this poses a problem.

Part of the reason for doing an app was to prove I can develop one, but if I can't tell anyone I wrote it, then developing the app seems pointless; I may be better off creating my own app and eating the loss in profit because I can get more work out of it, but of course, at the same time, I'm in desperate need of cash. I do have jobs lined up elsewhere, but I'll likely get paid faster through doing this specific job.

What factors should I be looking at when making a decision on whether or not I should take a job for money that I can't talk about?

答:
It sounds fishy to me.

Part of the reason he doesn't want anyone to know I've worked for him is because his website uses an application he paid a lot of money for.

That doesn't make sense to me. I can understand (but not necessarily agree) if he wants to keep it secret what technologies he uses. But you should be able to say something like "made extensions to an application in PHP" on your resume; without mentioning the application itself.

One thing to consider is that every secret has a lifetime. The software he bought may give him a competitive edge now, but that edge won't last forever. So you might have some negotiation space there, too.

HTH.


答:
UML Activity Diagram and Flowchart are useful to show low-to-medium complexity of a process or algorithm.

They are very good when communicating with business users about business rules.

A variation exists on the form of BPMN 2.0 which is very useful in Business Process Modeling.

Some BPMN tools can generate running web applications from charts.

So yes, flowcharts still have a place but they need to be used wisely.


问:
Which database to prefer while developing a WPF medical inventory system?
I have a project to develop an inventory system for a medical shop. Till date, I confronted simple requirements which were fulfilled with XML as the backend db. My interaction knowledge with XML is pretty-good and I can make almost anything with XML using LINQ-TO-XML.

Since, this is an inventory system, I am bit confused as to which database should I use. Can i stick with XML or proceed with SQL Server 2008. In case I use SQL Server, will I need to install the SQL Server on Client Machine as well. This is important information because SQL Server is a commercial product, hence i need to include this in my project estimation cost.

答:
You don't need SQL Server. You can use any number of open source databases such as MySQL and PostgreSQL. There are others such as MongoDB, CouchDB, neo4j, etc, but you're not really in need of NoSQL solution (and imho, they have a little more of a learning curve as they aren't ORM friendly and still relatively new).

Depending on the size of the application, I might also recommend SQLite, which is a file-based database ;) However, I'd only recommend SQLite if you don't have a large number of concurrent users or a very large dataset. See this document for further reasons as to why to and not to use SQLite.

I would highly suggest not using XML for your back end solution as it isn't scalable and much more error prone than using a proper database solution.

Take a look at http://sqlite.phxsoftware.com/ for a managed wrapper for SQLite.

Side note: I haven't used C# in a number of years, so I may be missing something in terms of managed support outside of SQLite.


答:
While your requirements are not very clear, here are some points you need to consider:

1-XML has no indexing mechanism, if you want to search by several criteria or join different data you can't

2-XML data is mainly plain text, it can be tampered with easier than a database

3-XML does not provide aggregate functions like SQL - So you will need to code aggregate functions, etc.

4-XML has no concurrency management, you work with a file not a row

5-User security and user rights need to be secured - This is usually handled via database or Windows integrated security

6-Most report generators require a data source that is either csv or a database (of course you can build a datatable or similar using XML and pass that to the report generator as an object, this depends on your selected tool)

7-Databases offer simple and generally quick backup.

8-You can add/remove columns from database with relative ease

9-Database offer consistency checks and constraints as well as transcriptional processing allowing you to rollback in case of errors.

10-Databases offer stored procedure that allows you to encapsulation server logic within them

11-Using a database, you can allow your user to enter dynamic sql queries instead of programming every possible report

As "Demian Brecht" suggested, you can use SQLLite, MySQL, SqlServer/SqlServer Express, SybaseAnyWhere, and the new "SQL Server Denali". This link may also help you:
https://stackoverflow.com/questions/3630/sqlite-vs-mysql
and
XML vs SQL for small projects?

Title: Which database to prefer while developing a WPF medical inventory system?

Body:
I have a project to develop an inventory system for a medical shop. Till date, I confronted simple requirements which were fulfilled with XML as the backend db. My interaction knowledge with XML is pretty-good and I can make almost anything with XML using LINQ-TO-XML.

Since, this is an inventory system, I am bit confused as to which database should I use. Can i stick with XML or proceed with SQL Server 2008. In case I use SQL Server, will I need to install the SQL Server on Client Machine as well. This is important information because SQL Server is a commercial product, hence i need to include this in my project estimation cost.