问:
Ideas on writing a meaningful resume which is not a compilation of buzz words?
I'm am about to commence redesigning my resume all over. What I'm stuck with is where should I  draw the line between writing everything down and writing too little.

I don't want my resume to be a pack of buzzwords nor do I want to seem to not know any of the things I do know.

Keep these thoughts in mind and wanting to write a meaningful resume, how do I go about it. Someone reading my resume should be able to tell if I'm a hacker culture person or someone who went to computer school just for the heck of it.

Edit: In view of answer majorly focusing on buzzwords I would like to point out I'm also looking for things that make my resume more meaningful - I want the reader to be able to tell the difference between a hacker person and just another guy who went to computer school.

答:
As a hiring manager, I do consider buzzwords important, but I always make sure that the buzzwords listed are backed up by job experience. For example, if someone claims to know PostgreSQL but doesn't also list it anywhere in job experience, then my assumption is that they only know of it or at best at a very shallow level.

If there's too many of these holes in the resume, then it's likely that I won't follow up with an interview, as I don't feel I can trust the overall veracity of their resume.


答:
With these newfangled things like word processors and laser printers, it's pretty darn easy to customize your résumé for each job that you apply for. So you don't need to include every single buzzword for which you can claim proficiency; include only the right buzzwords for the job in question. Leaving irrelevant buzzwords out will make it easier for readers to spot the ones that they're likely to care about.

An early step in the hiring process, after advertising a position, is to go through the stack of applicants and eliminate the ones that are clearly not qualified. That usually means scanning each résumé for skills and experience that meet the stated job requirements. If you want to avoid being eliminated in the first round, then, make sure that your résumé addresses the job requirements. (And make sure that you actually have the skills that you claim. If you don't, you'll look like a dork in the interview and be eliminated anyway.)

ContentLicense: CC BY-SA 3.0

Title: Ideas on writing a meaningful resume which is not a compilation of buzz words?

Body:
I'm am about to commence redesigning my resume all over. What I'm stuck with is where should I  draw the line between writing everything down and writing too little.

I don't want my resume to be a pack of buzzwords nor do I want to seem to not know any of the things I do know.

Keep these thoughts in mind and wanting to write a meaningful resume, how do I go about it. Someone reading my resume should be able to tell if I'm a hacker culture person or someone who went to computer school just for the heck of it.

Edit: In view of answer majorly focusing on buzzwords I would like to point out I'm also looking for things that make my resume more meaningful - I want the reader to be able to tell the difference between a hacker person and just another guy who went to computer school.


答:
If you are a hacker person, I am sure you have some personal projects that are worth mentioning. If you haven't contributed to opensource or have personal projects, then your resume will more or less converge to "3 years experience in J2EE,2 years experience in Oracle..." etc. This is going to put you in the league of "just another guy".

What you would ideally want to do is clearly state the following

Personal projects/open source projects (indicates passion/learning)

If you have work experience, state significant improvements you made that directly resulted in profits or eased other developers work.

Lastly, do not put everything you have touched in your resume. For example, if you have read python some years back and it's in your resume, you will be asked a couple of questions on that. You don't want to answer "I forgot". Remove things which you do not know clearly.


答:
A resume is something similar to an autobiography. No autobiography can be found without buzzwords. In fact, a resume without buzzword is simply a paper containing some lists. I think the art is not to reduce the buzzword. The art is to provide a coherent, meaningful, appealing and well-organized content.

Another thing that usually people forget when creating their resumes is the concept of Form & Content. No matter how much the content of your resume is of high quality, low representation (low graphical layout, typography, colors for titles and text, etc.) can ruin the whole point.

Content is what you provide and write, and form is how you represent it. For some good examples of representation, see this article.


问:
Formatting 'Complex' Math
Note: by 'complex' math I mean an equation with many steps involved and a wide mix of operators.

A programmer should know the order that operators are evaluated in an equation. However it can be a royal pain to look at an equation such as:

```<code>result = value_1 + value_2 * value_1 + value_3 / value_4 % value_5;
</code>```

One option is to write out the equation in multiple steps such as:

```<code>part1 = value_2 * value_1;
part1 += value_1;

part2 = value_4 % value_5;
part2 = value_3 / part2;

result = part1 + part2;
</code>```

Another option is to format the original equation with parenthesis such as:

```<code>result = (value_1 + (value_2 * value_1)) + (value_3 / (value_4 % value_5));
</code>```

When dealing with complex math in code, how do you typically format it to maximize readability?

答:
Generally, write for programmer first, for computer second. Compilers are aggressive optimizer these days (which sucks if you are trying to implement Kahan summation), so take liberty at introducing temp variables that make sense. Mixing more than two of [*, /, and % and ** (exp)] in one line is a bad idea, IMO - too many opportunities for bugs and it slows down whoever is trying to read this code. If you can use FP, then you have many tools to control the complexity. I would go through SICP book and videos that you can dl via torrent.

Just as with regular code, try to avoid 'formatting' - rather split things up into small functions and/or temp variables that make sense. The SICP book does complex stuff, and yet the code is never long. If you have to leave a long line on occasion, just do what makes sense. Again, a good lesson from LISP would be to try to align parenthesis from one line to the next.

In other languages see these examples:

http://en.wikipedia.org/wiki/Kahan_summation_algorithm

http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance

The math is somewhat complex, and yet the code is not. It is all about controlling the complexity. Hopefully these two examples can set you in the right direction.

Title: Formatting 'Complex' Math


答:
I use a mix:

I heavily use temp variables in particular for results that are used multiple times (this is a bit of a micro optimization but it soothes my mind)

and when it's still not really clear I use parenthesis and play with the spacing of it so priorities are clear at a glance and similar stuff lines up nicely even when not all variables are the same length:

```<code>result = (val_1   + value_2*val_1   ) +
         (value_3 -   val_4%value_5 );
</code>```

Title: Formatting 'Complex' Math

Body:
Note: by 'complex' math I mean an equation with many steps involved and a wide mix of operators.

A programmer should know the order that operators are evaluated in an equation. However it can be a royal pain to look at an equation such as:

```<code>result = value_1 + value_2 * value_1 + value_3 / value_4 % value_5;
</code>```

One option is to write out the equation in multiple steps such as:

```<code>part1 = value_2 * value_1;
part1 += value_1;

part2 = value_4 % value_5;
part2 = value_3 / part2;

result = part1 + part2;
</code>```

Another option is to format the original equation with parenthesis such as:

```<code>result = (value_1 + (value_2 * value_1)) + (value_3 / (value_4 % value_5));
</code>```

When dealing with complex math in code, how do you typically format it to maximize readability?

Body:
I use a mix:

I heavily use temp variables in particular for results that are used multiple times (this is a bit of a micro optimization but it soothes my mind)

and when it's still not really clear I use parenthesis and play with the spacing of it so priorities are clear at a glance and similar stuff lines up nicely even when not all variables are the same length:

result = (val_1   + value_2*val_1   ) +
         (value_3 -   val_4%value_5 );


答:
You're right -- every programmer should indeed know order of operations. If you come across code like your example:

```<code>result = value_1 + value_2 * value_1 + value_3 / value_4 % value_5;
</code>```

and you're not sure whether % takes precedence over /, then you should absolutely look it up. Every smart programmer keeps at least one reliable reference manual for their language of choice within arm's reach. Learning (or re-learning) details like this is the way that you gain experience. If you take these opportunities every time they present themselves you'll soon find that you never have to look anything up because you know it cold.

The deeper problem with the example above is that it doesn't convey the programmer's intent. You should be able to read that line and know exactly what it does, but there's no way to know if it does what the author intended. Even if you wrote it, you probably won't remember exactly what you were thinking at the time. Well-named variables, white space, parentheses, and functions are all tools that you can use to help communicate what you expect your code to do and why. There's no sense in choosing to use one of those options; use whichever combination seems clear. Instead of:

```<code>float w = (m1 + m2 + m3) * a * d;
</code>```

write:

```<code>float totalMass = mass1 + mass2 + mass3;
float force = totalMass * acceleration;
float work = force * displacement;
</code>```

Title: Formatting 'Complex' Math

Body:
You're right -- every programmer should indeed know order of operations. If you come across code like your example:

result = value_1 + value_2 * value_1 + value_3 / value_4 % value_5;

and you're not sure whether % takes precedence over /, then you should absolutely look it up. Every smart programmer keeps at least one reliable reference manual for their language of choice within arm's reach. Learning (or re-learning) details like this is the way that you gain experience. If you take these opportunities every time they present themselves you'll soon find that you never have to look anything up because you know it cold.

The deeper problem with the example above is that it doesn't convey the programmer's intent. You should be able to read that line and know exactly what it does, but there's no way to know if it does what the author intended. Even if you wrote it, you probably won't remember exactly what you were thinking at the time. Well-named variables, white space, parentheses, and functions are all tools that you can use to help communicate what you expect your code to do and why. There's no sense in choosing to use one of those options; use whichever combination seems clear. Instead of:

float w = (m1 + m2 + m3) * a * d;

write:

float totalMass = mass1 + mass2 + mass3;
float force = totalMass * acceleration;
float work = force * displacement;


答:
I think readability is not such a big issue in such cases. Using parenthesis is one option. Other thing one can do is to use the multi-line statements like the one used by ratchet. Also, you use use commenting in all the programming language. </p>

<p>Therefore, just concentrate more on the computing algorithm and equations. Rest are very minor things to worry about </p>

Title: Formatting 'Complex' Math

Body:
I think readability is not such a big issue in such cases. Using parenthesis is one option. Other thing one can do is to use the multi-line statements like the one used by ratchet. Also, you use use commenting in all the programming language.

Therefore, just concentrate more on the computing algorithm and equations. Rest are very minor things to worry about


问:
Scaling yourself up against a better programmer/role model?
After having watched this video I have to ask how a programmer can go about measuring themselves against other, better programmers much as a chess player would.

How would you decide who is a role model to start with? I mean James Gosling is known by every Java programmer but he invented the language and there is almost certainly an expert out there  who could show him a few tricks.

Now say you have you found that role model. This could be, say, StackOverflow's own superstar Jon Skeet. It's possible to read his answers on StackExchange, visit his blog and read his books but what about actual programming skill? How could you go about fixing challenges and determining where you are in the programming skill spectrum?

答:
IMO, role model concept is good only in sports. Having role model in programming is something new I have heard lately. Though, you need to learn appreciating good code-work. This art gives you the ability to understand better programming, along with lending traits for optimal coding.

Because, you seldom come across legendary programmers, it's hard to imitate them. Apparently, you come across their work more often than not, so use that work to enhance your gravity and thinking.


问:
What defines robust code?
My professor keeps referring to this Java example when he speaks of "robust" code:

```<code>if (var == true) {
    ...
} else if (var == false) {
    ...
} else {
    ...
}
</code>```

He claims that "robust code" means that your program takes into account all possibilities, and that there is no such thing as an error - all situations are handled by the code and result in valid state, hence the "else".

I am doubtful, however. If the variable is a boolean, what is the point of checking a third state when a third state is logically impossible?

"Having no such thing as an error" seems ridiculous as well; even Google applications show errors directly to the user instead of swallowing them up silently or somehow considering them as valid state. And it's good - I like knowing when something goes wrong. And it seems quite the claim to say an application would never have any errors.

So what is the actual definition of "robust code"?

答:
I would consider the code you gave as an example of defensive programming (at least as I use the term). Part of defensive programming is to make choices that minimise assumptions made about the behaviour of the rest of the system.  For example, which of these is better:

```<code>for (int i = 0; i != sequence.length(); ++i) {
    // do something with sequence[i]
}
</code>```

Or:

```<code>for (int i = 0; i < sequence.length(); ++i) {
    // do something with sequence[i]
}
</code>```

(In case you're having trouble seeing the difference, check the loop test: the first uses !=, the second uses <).

Now, under most circumstances, the two loops will behave in exactly the same way. However, the first (comparing with !=) makes an assumption that i will be incremented only once per iteration. If it skips the value sequence.length() then the loop could continue beyond the bounds of the sequence and cause an error.

You can therefore make an argument that the second implementation is more robust: it does not depend on assumptions about whether loop body changes i (note: actually it still makes the assumption that i is never negative).

To give some motivation for why you might not want to make that assumption, imagine that the loop is scanning a string, doing some text processing. You write the loop and everything is fine. Now your requirements change and you decide you need to support escape characters in the text string, so you change the loop body such that if it detects an escape character (say, backslash), it increments i to skip the character immediately following the escape. Now the first loop has a bug because if the last character of the text is backslash, the loop body will increment i and the loop will continue on beyond the end of the sequence.

Title: What defines robust code?

Body:
I would consider the code you gave as an example of defensive programming (at least as I use the term). Part of defensive programming is to make choices that minimise assumptions made about the behaviour of the rest of the system.  For example, which of these is better:

for (int i = 0; i != sequence.length(); ++i) {
    // do something with sequence[i]
}

Or:

for (int i = 0; i < sequence.length(); ++i) {
    // do something with sequence[i]
}

(In case you're having trouble seeing the difference, check the loop test: the first uses !=, the second uses <).

Now, under most circumstances, the two loops will behave in exactly the same way. However, the first (comparing with !=) makes an assumption that i will be incremented only once per iteration. If it skips the value sequence.length() then the loop could continue beyond the bounds of the sequence and cause an error.

You can therefore make an argument that the second implementation is more robust: it does not depend on assumptions about whether loop body changes i (note: actually it still makes the assumption that i is never negative).

To give some motivation for why you might not want to make that assumption, imagine that the loop is scanning a string, doing some text processing. You write the loop and everything is fine. Now your requirements change and you decide you need to support escape characters in the text string, so you change the loop body such that if it detects an escape character (say, backslash), it increments i to skip the character immediately following the escape. Now the first loop has a bug because if the last character of the text is backslash, the loop body will increment i and the loop will continue on beyond the end of the sequence.


问:
Do working on open source projects and freelancing count as "rendering services to another company"
My contract explicitly states that I can't render services to another company.  I would like to know if working on open source projects or freelancing count as such because I would like to work on some other projects without violating my contract.  Freelancing might count as rendering services, but would open source work count too?</p>

答:
Yes it is counting. Before contacting a lawyer, I highly suggest you to discuss with your employer to negociate that right.

Most employers will see the value of you working in open source projects.

However, freelancing in the same industry may be a problem.

In any case, don't try to bypass the laws, talk with your employer first, then your lawyer if you can't get a written approval.

ContentLicense: CC BY-SA 2.5


问:
How can I configure my programming environment to enable rapid switching between projects?
It often happens that I develop multiple different projects at once, so I need a solution to switch from one environment to another.

I have created batch files to do the job but as this thing grows, I'll soon need something better.

Some things I do are:

Map drives

Launch applications

Load test databases

Set environment variables

etc.

Any suggestions on that?

Edited:
I want to unify the development process in some way. We use VS, Eclipse, Notepad++ or what ever the developer needs.
The goal is to be able to load a project in any windows machine without having compiling or other issues.

Example:

The solution might need to reference files, sdk folders, test data paths or other stuff.
To solve this: I have mapped the code to a drive. The project doesn't need to know whether the dev is using c:\dev or c:\programming folders (user choice). They only need to map their coding folder to a drive (lets say W:) every file of the solution is under W:

Another problem is the SDKs. An sdk can be in c:\programfiles\Microsoft sdks\etc.. or in c:\programfiles x86\Microsoft sdks\etc..
Those Sdks should also need mapping to a standard folder that the solution knows.

Another thing is that we want services running (apache lets say) if we develop a website. We don't want this to run all the time.

The solution so far is to distribute batch files that the developer edits once in order to match their paths to the solutions and they run the batch before they start their new task.

I am thinking on developing a app that will set the environment as desired. Preconfigured sets that are distributed. The developer executes them in order to set the enviromnent as desired.

I hope to be clear now on the problem. Any suggestions on doing that in a better way?

答: Many people (ok, the vi and emacs people) cope with that by using the same editor, with the same config, on everything from their PC to their iPhone, to their Toaster.


答:
What I'm stuck with is where should I draw the line between writing everything down and writing too little.

Sounds familiar. What works best for me is a three-point combination:

1-pager

detailed online CV

studying LinkedIn profiles

With the emphasize on 1-pager. First, it typically saves me time: whenever I am asked to just send a CV I go with 1-pager - and whenever it happened, I never seen a recruiter being unhappy with that. Some of them ask for something else, but not many mind you - this is likely because my 1-pager includes link to my detailed online CV which they typically seem to be happy to check for details when needed.

Second, and probably most important, I am using 1-pager to drive the quality of detailed CV. You know I always find it tough to rank the importance of details and to compose them the right way. Making 1-pager gives me invaluable opportunity to learn, practice and further use that skill to improve my detailed CV. (Did I mention it gives quite some pain? well it does - study is rather hard.)

It goes about as follows.

I start with just a heap of everything I would want to put there. This heap takes 6 or maybe 8 or 10 pages doesn't matter and in the beginning it looks awful. Anyway I put it into detailed CV draft and start tossing and squeezing it, learning what I can do to make it a bit smaller while keeping most of the important details.

After "drying out", say 2 pages of 10, I return back to "backup copy" of my detailed version and improve it based on stuff I learned.

Then goes the next round, and next and next until I am done and have a real 1-pager. At this stage, my detailed CV somehow magically got good enough (given the number of revisions and pain I've got while doing 1-pager this maybe is not that magic after all)

After that, I put detailed CV online so that it's easy to improve it and to refer to it. The URL goes to 1-pager. Of about a dozen various sites and services I tried for online CVs my favorites are SO careers and LinkedIn.

Of these two, SO careers seems noticeably easier to design, maintain, backup and it's more er programmer friendly so to speak. The power of LinkedIn (CV-wise) is that one can learn how this stuff is done in others profiles. I learned a lot that way. Hint by the way: one doesn't need many connections to learn that way - just joining a group (eg stackoverflow group) allows to view and study profiles of group members.

As for the buzzwords, well figuring when and how to use was tricky to me. But 1-pager exercises and learning from others profiles at LinkedIn helped here too.


问:
Should a competent programmer be able to come up with his own shortest path algorithm?
I'm suffering a crisis of confidence in my ability as a computer programmer.

Yesterday I tried to come up with my own shortest path algorithm for a graph and after some hours I simply threw in the towel and learned Dijkstra's algorithm.

Is this the kind of thing a good programmer should be able to "reinvent" in a couple of hours or am I being unrealistic?

Oh well, at least I was able to reinvent bubble sort :D

答:
Do Not Worry

As a Perl Programmer, I am all about never reinventing the wheel. That is the job of CPAN. If there is a simple, well supported algorithm or module, we use it. If there isn't a good module, then we invent the wheel. That is one of the greatest things about Perl.

So what I am saying is this:

I do not recommend reinventing the wheel but when you do...

Try not to completely reinvent it and...

Do not worry if you cannot do it. That's why we have a programming community :-).


问:
"Joel test" for B2B hardware/software developers
I discovered the Joel test recently and applied it to my team. However, I but found hard to apply some points to my company since we are developing small chips with both "wired" and programmable algorithm.

5: Do you fix bugs before writing new code?

Since we cannot patch the hardware/software once delivered, we cannot tolerate any know bug, and a whole team of senior developer are building tools used for tracking them. This point should be for example "do you have 2 different implementations for each of your products, and are you testing test against each other?"

12: Do you do hallway usability testing?

We don't develop UI. This point seems irrelevant.

How can we adapt this test to the kind of development we do?

答:
Joel's test is a good rule of thumb, but is not sacred. For example, the rule number 5 you quoted is a bit problematic. Yes, it is desirable to fix bugs before writing new code. No, these are not mutually exclusive activities.

There's a "revised" version that you might want to take a look at here. I like it much more than the original.

ContentLicense: CC BY-SA 4.0


问:
Will you consider a Software Team Lead position with previous employer
Say you left your previous employer about 3.5 years ago to pursue a growth opportunity, my primary motivation for moving. If a position currently opens up in that same company today for a Software Team Lead, would you:

Apply for this position, if you still have a lot of good relationships

If you would apply and can speak to the Engineering Director, who did all he could to keep you, would you call him to discuss about their needs and your interest? If not, how would you go about this?

As the Engineering Director, would you consider this candidate for Software Team Lead who left you 3 years ago despite all you tried to do to keep him, knowing that this guy has a tendency to seek opportunities for growth every 3-5 years? Yes, this person meets all of the requirements and has the potential to be a good leader.

答:
knowing that this guy has a tendency to seek opportunities for growth
  every 3-5 years

You're saying it like it's a bad thing. I would be very cautious towards people who stayed in the same position for more than 3-5 years.

I see no problem with people leaving if they can't find what they need at their current place. As long as they were professional and left without causing problems and on good terms - there's no reason for them not to come back when an opportunity arises.

For the company its definitely a good thing: shorter learning period, they already know what the person can or cannot do, there are personal relationships which will make it easier to get back into business faster, and of course it is much easier to evaluate if the person fits if he already fitted once. Much better than trying to guess based on a 1-hour interview.


答:
Ask yourself: why do your projects need different environments? Can't you launch your development tools for two projects at once? That means:

Map drives: if your project need a specific drive mapping, there seems to be a design flaw, at least a missing configuration option

Launch applications: should be possible in parallel (main memory is cheap, if that's your problem)

Load test databases: same as "Launch applications"

set environment variables: can't this be done in parallel for both projects? Any collisions here?

So switching between those two projects becomes very simple after that.

If you really need separated environments, try using virtualization. So you don't have to  "load your test databases" or "launch your applications" - just freeze your virtual machine when you end your work and restart it later, having the complete environment reset to the previuos state at once, without any batch scripts.

EDIT: seems you have changed your original question to "how do I manage different environments of different developers". That's a different question. My suggestion:

avoid absolute paths in your build process whereever possible - each project should have a single root folder after checking it out from your source control, and it should make no difference for the build process where this root folder lies. Avoid any need for a special drive mapping.

try to convince your team that every tool or SDK you are using will be installed in the same folder on each workstation. If that is not possible, try to build some auto-detection into your build scripts for finding the installation folder and setting environment variables appropriately

if you can't solve your problem by some simple batch scripts, there seems too much diversity between the different developer environments - solve that first before introducing another complex element like a full-fledged application instead of those scripts.

Title: How can I configure my programming environment to enable rapid switching between projects?

Body:
It often happens that I develop multiple different projects at once, so I need a solution to switch from one environment to another.

I have created batch files to do the job but as this thing grows, I'll soon need something better.

Some things I do are:

Map drives

Launch applications

Load test databases

Set environment variables

etc.

Any suggestions on that?

Edited:
I want to unify the development process in some way. We use VS, Eclipse, Notepad++ or what ever the developer needs.
The goal is to be able to load a project in any windows machine without having compiling or other issues.

Example:

The solution might need to reference files, sdk folders, test data paths or other stuff.
To solve this: I have mapped the code to a drive. The project doesn't need to know whether the dev is using c:\dev or c:\programming folders (user choice). They only need to map their coding folder to a drive (lets say W:) every file of the solution is under W:

Another problem is the SDKs. An sdk can be in c:\programfiles\Microsoft sdks\etc.. or in c:\programfiles x86\Microsoft sdks\etc..
Those Sdks should also need mapping to a standard folder that the solution knows.

Another thing is that we want services running (apache lets say) if we develop a website. We don't want this to run all the time.

The solution so far is to distribute batch files that the developer edits once in order to match their paths to the solutions and they run the batch before they start their new task.

I am thinking on developing a app that will set the environment as desired. Preconfigured sets that are distributed. The developer executes them in order to set the enviromnent as desired.

I hope to be clear now on the problem. Any suggestions on doing that in a better way?


答:
In Algol-like languages, I would do it like this:

```<code>result := value_1 +
          value_2 * value_1 +
          (value_3 / value_4) % value_5;
</code>```

Note that I assume an arbitrary precedence rule for / over %.  I would use explicit parentheses in any language for this.

Lisp has standard formatting guidelines for such things, and it is completely explicit, e.g.:

```<code>(let ((result (+ value-1
                 (* value-2 value-1)
                 (mod (/ value-3 value-4)
                      value-5))))
  (do-something-with result))
</code>```

Title: Formatting 'Complex' Math

Body:
In Algol-like languages, I would do it like this:

result := value_1 +
          value_2 * value_1 +
          (value_3 / value_4) % value_5;

Note that I assume an arbitrary precedence rule for / over %.  I would use explicit parentheses in any language for this.

Lisp has standard formatting guidelines for such things, and it is completely explicit, e.g.:

(let ((result (+ value-1
                 (* value-2 value-1)
                 (mod (/ value-3 value-4)
                      value-5))))
  (do-something-with result))


答:
Your question is about maximizing readability of an equation. I suggest the following:

A. Put in a comment or in your documentation with the equation clearly stated in its original mathematical form. Complex calculations should have a reference outside the code for people to build test cases and to understand where do the equations come form.

B. Splitting the equation enhances debugging of parts of the equation. It also allows you to catch overflows and similar problems that could occur. For example:

x= ((b*b) + Sqrt(b*b-(4*a*c))) / -1*2*a may lead to an error if b*b-(4*a*c) is negative or if a is zero. you can split this expression to report each case separately with a different error message.

If you have several expression, there may be a sub expression that repeats in several equations. It would be more efficient to calculate that expression separately to improve performance.

C. If you split an expression, make sure the intermediate expressions are assigned to the correct variable type. For example,

int j=Sqrt(b*b-(4*a*c)) is not good.

D. Writing long un-split equations may be not readable and makes tracking braces difficutl

So, I suggest you split with care.

Title: Formatting 'Complex' Math


答: How can the Engineering Director be sure another candidate for this position (perhaps someone new to him) will not leave after 3 to 5 years? And what if you get the job and leave after 3 years again - that might be 3 years for the company of having (hopefully) a good Software Team Leader, which is not too bad for them. </p>

Title: Will you consider a Software Team Lead position with previous employer

Body:
Say you left your previous employer about 3.5 years ago to pursue a growth opportunity, my primary motivation for moving. If a position currently opens up in that same company today for a Software Team Lead, would you:

Apply for this position, if you still have a lot of good relationships

If you would apply and can speak to the Engineering Director, who did all he could to keep you, would you call him to discuss about their needs and your interest? If not, how would you go about this?

As the Engineering Director, would you consider this candidate for Software Team Lead who left you 3 years ago despite all you tried to do to keep him, knowing that this guy has a tendency to seek opportunities for growth every 3-5 years? Yes, this person meets all of the requirements and has the potential to be a good leader.


问:
Best resources to really understand run-time complexity
I'm familiar with the basics of run-time analysis such as what makes certain types of code O(n) and O(n^2).  But I'm having real trouble learning, understanding, and really remembering how to analyze pieces of code that run in other complexities such as O(n log n) or O(2^n).  I'm looking for resources that explain in simple terms how these other complexities work and some practice problems to really force my understanding.</p>

答:
What works for me is to know a little bit of information theory.
Specifically, when a program executes an IF statement like this:

```<code>if (test){
  ... code A ...
} else {
  ... code B ...
}
</code>```

test has a certain probability P of being true, and 1-P of being false, and the information gained (into the program counter) when making that branch is I = log(1/P) (base 2).

If P is 0.5 (equally likely to be true as false), then I = log(2) = 1 no matter which branch is taken. That's the amount the program counter "learns" in making that choice.

Now Entropy (scary word, I know) is just average information gained over all branches, which is 1, right?
So you could say that branch does 1 bit of work when it is executed.

Suppose P isn't 0.5. Suppose you are doing a linear search in a table of 1024 entries. The first test you do says "Is the 0th entry the one I'm looking for?".
If the answer really could be anywhere, then P = 1/1024, and 1-P = 1023/1024.

So if the element you're looking for happens to be the first one, you gain log(1024) = ten bits, but if it isn't, you only gain log(1024/1023) or essentially zero bits.
What's the entropy?
It's the sum of the information you gain on each branch times the probability of that branch.
It's 1/1024 * 10  +  1023/1024 * 0, which is about 1/102.4.
That test "learns" less than 1-hundredth of a bit on average.

Since to find an element in a 1024-entry table, you need to learn 10 bits, you can see why linear search is slow.
In fact, if N is the number of bits you need to learn, it's exponential!

That's why searches based on equally likely binary decision points are O(logN).
A way to make a search faster than that is indexing. That's where you have an index and use it to locate an element of an array.
If the array is 1024 elements long, that's like a decision point with 1024 outcomes.
If they are all equally likely, what's the entropy?
It's 1/1024 * log(1024) + 1/1024 * log(1024) ... for 1024 terms, which comes out to - ten bits.
You learn all ten bits in a single operation!

OK, how about sorting?
If you have N items, you need to search for where each one belongs in the array, so it basically costs N times the cost of the search.
Couldn't be simpler.

Body:
What works for me is to know a little bit of information theory.
Specifically, when a program executes an IF statement like this:

if (test){
  ... code A ...
} else {
  ... code B ...
}

test has a certain probability P of being true, and 1-P of being false, and the information gained (into the program counter) when making that branch is I = log(1/P) (base 2).

If P is 0.5 (equally likely to be true as false), then I = log(2) = 1 no matter which branch is taken. That's the amount the program counter "learns" in making that choice.

Now Entropy (scary word, I know) is just average information gained over all branches, which is 1, right?
So you could say that branch does 1 bit of work when it is executed.

Suppose P isn't 0.5. Suppose you are doing a linear search in a table of 1024 entries. The first test you do says "Is the 0th entry the one I'm looking for?".
If the answer really could be anywhere, then P = 1/1024, and 1-P = 1023/1024.

So if the element you're looking for happens to be the first one, you gain log(1024) = ten bits, but if it isn't, you only gain log(1024/1023) or essentially zero bits.
What's the entropy?
It's the sum of the information you gain on each branch times the probability of that branch.
It's 1/1024 * 10  +  1023/1024 * 0, which is about 1/102.4.
That test "learns" less than 1-hundredth of a bit on average.

Since to find an element in a 1024-entry table, you need to learn 10 bits, you can see why linear search is slow.
In fact, if N is the number of bits you need to learn, it's exponential!

That's why searches based on equally likely binary decision points are O(logN).
A way to make a search faster than that is indexing. That's where you have an index and use it to locate an element of an array.
If the array is 1024 elements long, that's like a decision point with 1024 outcomes.
If they are all equally likely, what's the entropy?
It's 1/1024 * log(1024) + 1/1024 * log(1024) ... for 1024 terms, which comes out to - ten bits.
You learn all ten bits in a single operation!

OK, how about sorting?
If you have N items, you need to search for where each one belongs in the array, so it basically costs N times the cost of the search.
Couldn't be simpler.


答: I have read a lot of resumes.  I don't care much which technologies a candidate has used previously, but I strongly prefer people with a lot of tools in the drawer.  The most important part of the resume is the candidate's work history.  Vague statements like "member of team...", "worked on ..." leave me wondering if the candidate contributed anything at all.  I am impressed by specific statements, e.g. "Wrote module to optimally ...", "Introduced team to test-driven development, reducing bug rate from ... to ...", "Wrote custom jQuery UI widgets for ..." etc.  </p>


问:
Would it be ethical to create an open source alternative to the software you've been hired to create?
Say you were hired to create education software that will be sold to students of a particular academic institution. You are the only developer working on this project and have written all of the code. An open source alternative to the project has the potential of benefiting underprivileged students from around the world. In short, a free alternative would contribute to the greater good of humanity. Would it be "OK" to create an open source alternative to the software that you are being paid to develop?

P.S. The software will only be used by the students of the institution. There are no plans to distribute it commercially. The application does not make use of other people's intellectual property.

答: In your situation, I'd take your question to the people who hired you, and see what their views on the matter are first.  The big question of ethics is that of conflicts of interest, when you have two different interests or requirements pulling you in two different directions.  One of them is your obligation to the client here, and if the client doesn't mind you building an open-source project on this idea, then their interests are not in conflict with yours.</p>


答:
What you describe actually happened to me. I left a company and came back a year later to what would become a team lead role. After 3.5 years, I left again.

Regarding your questions, yes, it's ok to go back, there are a lot of wins for both you and the company to be had. And yes, if you left on good terms then I don't see why your director wouldn't be pleased to have someone back that doesn't have to endure as big a learning curve.

The responses from Doc Brown and littleadv were both good.

I would add these concerns and considerations:

There might not be a third time. If you left again as I did, it might be the last time. I left the second time for exactly the reasons you specified: I hit a ceiling and the company's IT department doesn't provide much of a career path; it's a small shop and there's just not much room to move in. Despite leaving on decent terms though, I think the company would probably not want to go through a third stint. It might not be that way in your situation, and of course things could change if the regime changes. But even though we should be logical about hiring quality people, we're also human and it's quite possible people in the company will feel you've slighted them a second time and will not be interested in future associations. That might be perfectly OK; in my case, even though I still like the company and the people, I don't suspect the company will change significantly enough to remove the barriers that caused me to leave. It's just something to consider.

Is taking this position going to be a wasteful diversion? I don't consider my second foray with the company a total loss, but looking back, I wonder if it ended up being a 3.5 year detour from the path I should have taken. I gained valuable leadership experience, but  I went back to yet another traditional IT shop that doesn't get IT, answers to the CFO instead of the CEO, is reactive rather than strategic or innovative, values deadlines over quality, and didn't have much room for growth. These things didn't change when I left the first time, and had I been more careful about analyzing it, perhaps I would have done things differently. I think I'd have been financially much better off if I'd stayed at my former position for another year and then gone to consulting as I have, or found a different company entirely. But if you feel this second stint will still be of value, go for it. If you eventually feel you have to leave to earn more and learn more, then it's the company's fault for not managing its employees.

Is it the right time to go back? Related to both points above, if you're going to go back, and you want a career path, and given that there might not be a third time, is there a possibility you could wait for a manager or director job instead? Of course you can't time how all these things will work out, but if you really like the company and there's a chance you could get a position that you'd stay in for longer or that had more growth potential, that might be better.

No right or wrong answer in the end. It's up to you to do what you feel works best.


答:
Ethical?

Many times over yes. In the same way it's ethical for you to take the skills you learn at the current employer and use them at your next job, it's ethical to use your skills in your free time, however you want to

Legal?

Maybe. While it's not up to the company to control what you do with your free time, it's standard for the company to have NDA and non competition agreements as part of your contract. You also will likely not be allowed to use any kind of proprietary information and patents etc... developed and owned by your current company in your work, as well as, very obviously, you'd have to start from scratch when writing the code. It's neither ethical, nor legal, to steal from your current employer.

Notes

I am not a lawyer. Ask a lawyer for advice regarding your contract.

I assume you're a regular employee. A shareholder or co-owner of the company has other obligations

This may not be obvious, but working on the OSS alternative while working for your current employer is a bad idea. I assume you're talking of developing it after the end of your employment

How you do it is just as important as what you end up doing. The professional way to do this is to do it openly - to let your current employer know what you're doing.

Consult a lawyer, especially regarding the nitpicky details of NDA and non compete agreements. The enforceability, legality, applicability and various consequences of breaking NDA, non-compete and other agreements is extremely context specific; it varies between states, countries, industries, etc... Also be aware of the potential cost of litigation - there are many corner cases where you can be forced to pony up legal fees just to prove your point, costs which might be debilitating even if you've done nothing wrong

Title: Would it be ethical to create an open source alternative to the software you've been hired to create?

Body:
Say you were hired to create education software that will be sold to students of a particular academic institution. You are the only developer working on this project and have written all of the code. An open source alternative to the project has the potential of benefiting underprivileged students from around the world. In short, a free alternative would contribute to the greater good of humanity. Would it be "OK" to create an open source alternative to the software that you are being paid to develop?

P.S. The software will only be used by the students of the institution. There are no plans to distribute it commercially. The application does not make use of other people's intellectual property.


问:
Programming your own linux distribution?
So, during the couple of days I've been thinking what it takes to make your own linux distribution. Where should I actually start? I'd like to have some very basic tips for this. I consider myself a decent programmer, mainly in c++ and objective c. And what limits there are in making a distro?</p>

答: 99.5% of what's in a Linux distribution is aggregation of existing packages.  Unless you have some ideas for a new way to do installations or package management or intend to rewrite everything from awk to zcat from scratch, there really isn't a lot of programming involved.


问:
Java vs. C# - Productivity perspective
If you have a number of years experience in working with Java and a number of years experience in working with C# and .NET, I would value your opinion on software development productivity differences between these two environments. One of our customers is considering replacing their existing software solution. As the replacement will require approx. 10 - 15 man years work, a choice for Java or .NET, based on productivity differences between the them, may significantly influence the investment required and time-to-market.

Would you be able to provide us, an indication of software development productivity differences between Java and C#/.NET? I would prefer to receive an answer as follows:

My experience is based on X years
  experience working with Java and X
  years experience working with C#/.NET.
  Java is X% more productive then C#.NET
  or C#/.NET is X% more productive than
  Java if you take the the following
  into account.

答:
I have 10+ years of experience with Java (since version 1.1, really!) and 7 years of experience with .NET (C# mostly).

You have a very though decision to make but mostly you should try to break down into a couple of scenarios:

Desktop Application

If you are developing a desktop application you have to go with the major platform you will be working with. If it's a Microsoft platform use .NET, there are no better solution than the platform developed by the mother ship itself.
If it's a Linux or Multi-platform scenario consider Java or moving to a web based solution.

Web Based Application

This is a very hard decision to make because each one has their own strength and weakness.
Here's a few:

C#

Strength: Currently has more momentum building new features into the language and the platform/framework. Everything comes from one vendor and definitely this is an advantage. You can also put to use some very powerful components like DevExpress for example (Java doesn't get even close to have something like what the DX team has put together over the years and this represents a huge productivity boost).

Weakness: For enterprise application .NET is not as mature as Java. You don't have that many vendors building enterprise software in .NET as you have for Java.

Java

Strength: More mature (already explained) and has a big community with several great open source projects that can help. Several .NET so called open source projects are really just a copy-cat of projects from Java.

Weakness: Oracle owns Java (I know, not the JCP) and that is definitely a risk to be considered. Their intentions are not very clear and I personally don't like where the language is going right now (I know a lot of Java developers have similar concerns).

Server Side Application

It's basically the same arguments as the Web Based Applications but because you don't have to worry too much about UI Java gets stronger in this case. But again, if the platform is mostly Windows .NET might be a better choice.

Overall Considerations

Overall, in my opinion, .NET has the advantage mostly because of the tight integration of Visual Studio 2010 (hands down the best IDE out there), MS SQL, Entity Framework, IIS and so on. This all represent a huge productivity boost and I have tons of experience proving that. Also I work with mostly Java developers that turned to .NET and they share basically the same opinion.

I think it's also a good point that Microsoft is stronger than ever meaning .NET will be there for a while. So when looking 10-15 years ahead I feel more secure with .NET than Java.

OwnerDisplayName: Edin Dazdarevic

Title: Java vs. C# - Productivity perspective


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

答:
Code effort is typically about 20% (+-10%) of a project budget. Focusing on getting code correct is pointless, theres 80% of the effort that you have not addressed, so getting perfect code managment still leaves you with only 20 of the work done.

What if your project has no users? What if it's perfect but published one week after "Acme Patent Trolls" file for a patent on the idea, and it turns out to be the next Facebook?

Look at the following standard project lifecycle issues
Requirements, Design, Code, Test, Integration, Deployment, Defect tracking and correction, requirement change management (enhancement requests). Release plans, resource allocation (how many hours are day are you planning to, and will you actually do on the project), Legal (Freedon to operate) etc.

If all the above are in place, even very bad code will be successful. If none of the above are in place, the best code will fail.

I am not a betting man, but I would put money on it your first "big" project will fail, in many and varied ways you can't imagine. Don't worry, go ahead and fail, learn from it and do the next. Not starting would be the real crime. If you do succeed first time, you have a solid career in business management, not programming.

So to answer you question, put away the software tools, and pull out your "business planning" tools. Work out WHY you are doing it, for WHO then WHY and WHEN they want it. (You can be your own customer, but do the exercise anyway).
Write this down in a "Business plan" and build from their.


答:
I think Linus put it best

Nobody should start to undertake a large project. You start with a
  small trivial project, and you should never expect it to get large. If
  you do, you'll just overdesign and generally think it is more
  important than it likely is at that stage. Or worse, you might be
  scared away by the sheer size of the work you envision. So start
  small, and think about the details. Don't think about some big picture
  and fancy design. If it doesn't solve some fairly immediate need, it's
  almost certainly over-designed. And don't expect people to jump in and
  help you. That's not how these things work. You need to get something
  half-way useful first, and then others will say "hey, that almost
  works for me", and they'll get involved in the project.
                                               -- Linus Torvalds

Title: What are the steps in beginning a large project, when all I have is a big idea?

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


答:
there is no reason to do anything without a purpose. You need user stories that show the need for the code you want to write. You should frame these user stories in the following format:

As a [X]

I want [Y]

so that [Z]

This may seem over simplistic, but it gives you the framework to not only define the user, but to also specify the need and what the end result is in a single sentence. You will have many of these. You will come up with more as time progresses. After you have some you can begin development on your code. When you have more ideas or figure out other things. You go back and write more user stories so that you don't forget them. That is the best place to start.

Behavior Driven Development uses this approach and the site at the link has several examples of using this format to express user stories.

I think it will be the quickest and most organized way to get from idea to code.


问:
What's the best way to version a multi-component project
I have a program which is built of 5 major components. I find the standard version numbering too limiting because I would like to see what version each compoment is at.

Has anyone found an easy way to do this other than list each separately?

答: We have this exact same issue with our product, and we decided to do individual version numbers for each component and the product version is only a marketing version which is composed of the various components at a specific revision.</p>


答:
Versioning is a problem that is separate from component-based application development. Either you want to version each component, or you want to version the whole application.

A good well-known pattern for versioning is from Microsoft:

```<code>major version.minor version.build number.revision
</code>```

For example, you can see the DLL files in .NET platform to have versions like 2.0.3600.1, or something like that.

So, I recommend that you first determine that whether you want to version the whole system or its components. If you want to version the whole system, then after each integration, build the entire project, and increase the build number part. If not, then simply version each component on build.

Title: What's the best way to version a multi-component project

Body:
I have a program which is built of 5 major components. I find the standard version numbering too limiting because I would like to see what version each compoment is at.

Has anyone found an easy way to do this other than list each separately?

Body:
Versioning is a problem that is separate from component-based application development. Either you want to version each component, or you want to version the whole application.

A good well-known pattern for versioning is from Microsoft:

major version.minor version.build number.revision

For example, you can see the DLL files in .NET platform to have versions like 2.0.3600.1, or something like that.

So, I recommend that you first determine that whether you want to version the whole system or its components. If you want to version the whole system, then after each integration, build the entire project, and increase the build number part. If not, then simply version each component on build.


答:
Most version numbers use a major and minor revision that is driven by marketing, so you can't use those for tracking individual component versions.  In short, you need to find some other part of the version that you can use for tracking versions of individual components, and reserve the major and minor version numbers for tracking the whole package.

If you are following something akin to the Microsoft pattern:

```<code>major-version.minor-version.build-number.revision
</code>```

You can use the .revision to track each individual component's version, and use the minor and major revision numbers to track a complete product change, in the usual way.

If you are following a pattern similar to this:

```<code>Major-Version.Minor-Version.Build-Number
</code>```

You will have to use the build number to track the individual component versions.

Body:
Most version numbers use a major and minor revision that is driven by marketing, so you can't use those for tracking individual component versions.  In short, you need to find some other part of the version that you can use for tracking versions of individual components, and reserve the major and minor version numbers for tracking the whole package.

If you are following something akin to the Microsoft pattern:

major-version.minor-version.build-number.revision

You can use the .revision to track each individual component's version, and use the minor and major revision numbers to track a complete product change, in the usual way.

If you are following a pattern similar to this:

Major-Version.Minor-Version.Build-Number

You will have to use the build number to track the individual component versions.


答: We have a "system release version",  which is a standard version number that describes a particular configuration of components, then a separate file lists the individual component versions for that particular system release.  Customers say 5.2.1 but we can look up the individual build if necessary.  Usually for a major release we sync up all the individual versions so everything gets built out of the same branch number again.</p>


问:
Is the C programming language still used?
I am a C# programmer, and most of my development is for websites along with a few Windows applications. As far as C goes, I haven't used it in a long time, as there was no need to. It came to me as a surprise when one of my friends said that she needs to learn C for testing jobs, while I was helping her learn C#.

I figured that someone would only learn C for testing if there is development being done in C. From my knowledge, all development related to COM and hardware design is also done in C++. Therefore, learning C doesn't make sense if you need to use C++. I also don't believe in historic significance, so why waste time and money in learning C?

Is C still used in any kind of new software development or anything else?

答:
Well I think C is the most powerful language Due to the following reasons!

1) AT first C , It's a systems language (which means it can be used to do low-level programming with minimal or no run-time).

2) Speed of the resulting application. C source code can be optimized much more than higher-level languages because the language set is relatively small and very efficient. It is about as close as you can get to programming in assembly language, without programming in assembly language. and you can even use assembly and C together!

3)  C has which is its application in Firmware programming (hardware). That is due to its ability to use/work with assembly and communicate directly with controllers, processors and other devices.

4) C is a building block for many other currently known languages. Look up the history of C and you will find that it has been around for some time (as programming languages go anyway). Take a look at Python for example a fully Object-Oriented High-Level programming language. It is written in C (perhaps C++ too). That tells you if you ever want to know what is going on under the hood in other languages; understanding C and how it works is essential.

An applications language is used for high-level programming, e.g. writing a word processor or game. Examples of applications languages are Java, C#. The reason is because they contain garbage collection, automatic typing, run-time validation, etc. - where the focus is productivity.

A systems language is used for low-level programming. e.g. A micro-controller, a driver, and OS kernel. Examples include assembly, C. They require little or no runtime to run code directly on the hardware, and the focus is for the programmer to have direct control over the hardware.

Overall, it's declining as an applications language, but still holding strong as a systems language.


答:
Whole books are written about versioning software.

Here is an approach that I use.

Each part has a version in the form:

major.minor.developmental

Each of these is a number, starting at 0.

For a formal release (ie to customers), the developmental part must always be 0 as a matter of policy.

Major is incremented by marketing decision.

Minor is incremented by feature sets being released - to market.

Example:

I start development on a new component, so my version number will 0.0.1. As I release off my desk to my colleages, for example, for internal testing, the development number goes up to 0.0.2, 0.0.3, and so on.

I release this new thing to market as 1.0.0, where the only permitted change from the end of development to release was to change the version number (eg 0.0.43 -> 1.0.0).

Some new features are to be added. I start work on the 1.0.0 baseline, adding these features, so the versions I release to my colleagues for testing are 1.0.1, 1.0.2, and so on.

The next features are released to market as 1.1.0.

Marketing decide that the next big thing will be really big, so it will go out as 2.0.0. I start work on 1.1.1, progressing through 1.1.x, and release as 2.0.0.

And so the cycle repeats.

This approach, for each component, gives you traceability of ancestry.

Internal to your source (and object) revision management system, use branches and tags (labels, whatever your terminology of the day is) to manage the development.

Your revision control may then manage each component completely separately, with development branches and labels/tags for each. Or you can bundle them all up together, in which case you may wish to branch by work package - but be sure to label/tag by release of each component (and when you do, label/tag everything, not just the bits for the component. This way you have a snapshot of the state of everything at the time.)

It's likely that your release process will require careful thought. Using this approach does include some manual steps, and this may be undesirable - this all depends on how your build system pokes the version numbers into the final object. For much embedded code where the version numbers are just named numbers (eg #defined in C code), you have little choice but to do this all manually anyhow. Desktop platforms with nice GUIs often make this all much friendlier.


问:
Is the JavaScript syntax the same for all browsers?
As for interacting with the DOM, different browsers will offer methods -and results- that are different between them to some or other extent.

But how about JavaScript itself? Do all browsers (or platforms e.g. Adobe Reader) implement the same syntax and behavior?

Aspects that particularly worry me are function/object handling and arithmetical operations.

答:
Different browsers support different versions of JavaScript, and different versions of JavaScript have changes in their syntax. So no, the syntax is not the same, except if you stick with the version old enough to be supported in most browsers.

For example, you can see some cool syntax which, for some, is available in JavaScript 1.8, released in June 2008 and incompatible with FF2 and, as usual, all releases of IE except 9.


答: The current JavaScript version is 1.8.5. JavaScript has evolved over many stages. So different browsers not only differ in their DOM models, but also in syntax. An overview for browsers is given in Wikipedia. So you should be careful when using advanced features.</p>

Title: Is the JavaScript syntax the same for all browsers?

Body:
As for interacting with the DOM, different browsers will offer methods -and results- that are different between them to some or other extent.

But how about JavaScript itself? Do all browsers (or platforms e.g. Adobe Reader) implement the same syntax and behavior?

Aspects that particularly worry me are function/object handling and arithmetical operations.


问:
What's the better way to charge for a cloud platform, simple but more expensive, or complicated but cheaper for most?
I'm working on a cloud platform, and was curious what people prefer in terms of paying for web services.

There's the option of very simple pricing (tiers and such), which is easy to project costs on, easy to compare, but (possibly significantly) more expensive for the average user, because you're always either underpaying or overpaying.

The other option is a complicated pricing structure with many different factors, a lot harder to project costs on, but you're literally paying only for what you use, so it comes out to a lower price for the average user.

Which do you prefer?

答:
Like all good questions, the answer depends. It depends on your application: Is it something you are likely going to be using periodically? A lot on some days of every month and very little the rest of the month? Once a year? Then a pay-as-you-go model would be 'nicer'.

It also depends on the sophistication of your users. Will they bother to do the mental arithmetic if you explain the PAYG model to them? Will they care?

How much will your users be spending? $5? $10? They might simple not care for that amount of money to optimize their experience and would probably rather go for something that is simple or easy.

Could the two models make a differences as large as $1000? Then you might find people are more than willing to have a look at the PAYG terms...


问:
Dealing with change requests from clients for an old system that only take 5 minutes to implement

Possible Duplicate:

  How should I charge for programming things which take two minutes to fix?

On some systems I created, every now and then I get tiny change requests from clients that are very easy for me to do, but the client can not do it themselves.

For example:

Hey, we made a new logo, could you please upload it to our website?

Can you check how many users we had this month?

Most of them basically just requires me to log on to the FTP server and upload a file which takes 2 minutes max. Sometimes even answering the email or writing the bill takes longer!

How do I charge the client for these changes? I could easily do it for free, because at the moment I don't get them frequently at all, maybe once per month. If the initial cost of the system is big it would seem like a nice gesture to the client to give and take a bit. What I'm afraid of is that they will become more and more frequent and then the client will get used to getting these changes for free. Also where do I draw the line for what to give away, 2 minutes? 5 minutes? 15 minutes? I want to be consistent in the pricing so it doesn't seem like I charge whatever I feel for at the moment.

Some ideas:

Charge per started hour/half hour/quarter, that is, 1 minute counts as 1 hour, 61 minutes as 2 hours (at least for the first hour).

Accumulate small changes into a pool of time. Instead of sending out bills for 2 minutes each they add up to a sum at the end of every 3 months or something.

Only charge if they want the fix NOW. Otherwise say they'll get it once I have time, within the next weeks.

Be an ass and pretend it's a big fix.

答:
The trouble with "5 minute" jobs is there is really no such thing.

By the time you get the request, open it, read it, think about it, log in, do stuff, check it.... doing ANYTHING in 5 minutes is really not going to happen.

15 minutes, perhaps.

The there is the effect on you of context switch time - the down time caused to get your mental gears changed over.

And then there is opportunity cost - the $ you are not earning by doing this stuff for free.

Put that all together, and this is costing you money. Each "5 minute" job request is probably worth around 15 to 30 minutes of real genuine chargeable time, in thinking about it, actually doing it, and the time taken off other more useful (and probably better paying) jobs.

So - charge 1/2 hour for every task as a minimum, and probably go in 15 minute increments from there.

A support agreement is a good thing to have but you still need a means of judging how to cost that agreement. The above should be a suitable basis whether you invoice each task, or you debit the outstanding amount of "support time" for a client. Do less, and you are being less than honest with yourself.


答:
But how about JavaScript itself? Do all browsers (or platforms e.g.
  Adobe Reader) implement the same syntax and behavior?

No. Every browsers support a different version of JavaScript. Not only that, event different versions of the same browsers have different JavaScript capabilities.

This is way there are now numerous ways of ensuring cross-browsers compatibilities for the same JavaScript task, usually requiring feature-detection and then acting based on it.

A good practice to ensure compatibility is to always check for feature detection rather than version detection for browsers.


问:
Automatic programming: write code that writes code
After reading the book The Pragmatic Programmer, one of the arguments I found most interesting was "write code that writes code".

I tried searching over the net for some more explanations or articles about it, and while I found some good articles on the subject, I still haven't found any specific code implementation or good examples.

I feel it's still not a so common argument, something that lacks documentation or it's not embraced by so many people, and I would like to know more about it.

What do you think about the subject? Is it something that will really increase your productivity? What are some good resources on the subject, among books, blogs, slideshows, etc?

Some code examples would be greatly appreciated to allow me to better understand its implementation.

Here's the wiki page on the subject with various relevant programming techniques, like Meta Programming, Generative Programming and Code Generation.

答:
Metaprogramming has been part of programming for a long time. Consider not just tools like SWIG, or WYSIWYG designers, which create code, but also in-language tools like C's preprocessor, or even C++'s templates and C#/Java's generics- not to mention Reflection.

In fact, you could argue that every compiler is just another metaprogram- they take in program text and output machine or VM code. And, life without compilers? Owch.


答:
Meta programming can be very difficult to maintain. At first it looks elegant, but when you start running into corner cases, the errors are caught late (on the code that have been generated), and the whole thing becomes a nightmare to use/debug.

I have mainly wrote python code, and in my experience meta programming is always a bad choice with this language. You can always refactor things to do it with boring normal language features. The result is less funky, but easier to live with.

Title: Automatic programming: write code that writes code

Body:
After reading the book The Pragmatic Programmer, one of the arguments I found most interesting was "write code that writes code".

I tried searching over the net for some more explanations or articles about it, and while I found some good articles on the subject, I still haven't found any specific code implementation or good examples.

I feel it's still not a so common argument, something that lacks documentation or it's not embraced by so many people, and I would like to know more about it.

What do you think about the subject? Is it something that will really increase your productivity? What are some good resources on the subject, among books, blogs, slideshows, etc?

Some code examples would be greatly appreciated to allow me to better understand its implementation.

Here's the wiki page on the subject with various relevant programming techniques, like Meta Programming, Generative Programming and Code Generation.


问:
Classes naming: singular or plural?
It is always difficult for me to choose between singular and plural forms for classes names:

```<code>CustomerRepository vs. CustomersRepository
CustomerService vs. CustomersService
CustomerController vs. CustomersController
</code>```

And for composite names it is even more difficult:

OrderCustomerRepository vs. OrderCustomersRepository vs.
  OrdersCustomersRepository

What approach do you prefer and why?

答:
Use singular. The tool to turn screws with is called "screw driver" not "screws driver".

However, pluralize your method and property names accordingly, to indicate whether one value or a collection of them will be returned.

Title: Classes naming: singular or plural?


问:
Is it efficient to attach a comment on every function?
I moved to this company recently, and my first reaction of the development process leaves me with doubts.

Here is where I really doubt the efficiency:  Every single function must have Javadoc style comment, and the code is tested by White-box Test automatically.
Even when I write simple & short function, the function must have a Javadoc style comment.

For example:

```<code>void request_ait(void)
{
      hoa_request_ait();
}
</code>```

If I write code without a Javadoc style comment, even for this simple function, the QA tool register it as a defect.  So I write a simple comment template.

For example:

```<code>/**
  * @author peter
  * @version 1.0
  * @since   2011-08-28
  */
    void request_ait(void)
    {
          hoa_request_ait();
    }
</code>```

I know that comments on API functions or important functions are really useful. But forcing every function to have a Javadoc style comment is inefficient...

I want to listen your opinion.

Am I wrong?

答:
Setting a strict policy like this helps avoid forgetting comments on functions which are not obvious, or which are obvious only to the person who wrote it. Filling out just enough to silence the automatic warnings is defeating the point; you should be actually putting a useful comment there.

Take your request_ait(), for example. It may be obvious to you what it does, but not to me. What does it do? Why does it just forward to hoa_request_ait()? What's the difference between request_ait() and hoa_request_ait()? Do I need to be holding some kind of lock to call it? What kind of exceptions might it throw? Are there any preconditions I should know about? etc. All of these questions can and should be answered in a good doc comment.

OwnerDisplayName: sunglim

OwnerDisplayName: bdonlan


答: You are right. Usually the function name should be enough documentation for short function. But the name should explain what the function does. But if there are more complex functions or a large number of parameters, you should document the function.</p>

Title: Is it efficient to attach a comment on every function?

Body:
I moved to this company recently, and my first reaction of the development process leaves me with doubts.

Here is where I really doubt the efficiency:  Every single function must have Javadoc style comment, and the code is tested by White-box Test automatically.
Even when I write simple & short function, the function must have a Javadoc style comment.

For example:

```<code>void request_ait(void)
{
      hoa_request_ait();
}
</code>```

If I write code without a Javadoc style comment, even for this simple function, the QA tool register it as a defect.  So I write a simple comment template.

For example:

```<code>/**
  * @author peter
  * @version 1.0
  * @since   2011-08-28
  */
    void request_ait(void)
    {
          hoa_request_ait();
    }
</code>```

I know that comments on API functions or important functions are really useful. But forcing every function to have a Javadoc style comment is inefficient...

I want to listen your opinion.

Am I wrong?

OwnerDisplayName: alfa


问:
How do I appropriately license my open-source project?
I have just recently completed my first open source project and while it is mostly a tool I still want to release it as open source considering it is C# so if someone wanted to they could decompile it. Also, I'm not looking to sell it.

I was researching licensing but the wording is a bit over my head. Mostly I'm just looking for a license that recognizes me as the creator and does not allow anyone else to put their name on it and "steal it." I'm most likely going to use either google code or sourcefourge to host the project and ideally I could have a donation button. I'm not sure if or which software licenses would prevent that sort of thing?

Also, I'm not really sure how licenses and copyrights "work." Do I just choose a license and paste it at the top of every source file? Should I include my name as well? Do I also put the licenses in the project's root directory? How does one obtain a copyright? It seems like most people just stick it on their stuff. Is there an actual process to obtaining one?

As for software licenses I've looked at so far, it seems like Apache 2.0 or MIT/BSD is what I'm looking for but I'm not exactly sure. Basically I just don't want anyone to steal my program and put their name on it. Other than that I'm fine with people looking at the source code, modifying it, or taking pieces from it, as long as they credit me.

答:
It's common in source-code to place a so called license-plate on top of each file. Those tell typically:

Of which program that file is part of.

The copyright holder and date (and how to contact, e.g. email).

The license terms, either abbreviated (and referenced) or in full.

If you open your source-code repository to the public, this (per-file) method ensures that your copyright and licensing terms are visible before someone modifying the file.

It's normally best to choose an established license so actually users reading the code understand the licensing terms. But the choice of the license is fore-most entirely your business.

Some source-code repositories do only allow some of the known licenses however, namely any OSI approved license for google project hosting.

You might want to make use of copyleft for your code. Copyleft ensures that the freedom you give with your software will be preserved for future users because they are reciprocal, users of your code need to distribute the code under the same license.

Copyleft licenses for code are the GNU GPL or LGPL. The GPL is most famously used by software authors across the globe to preserve software freedom. But that's your decision, the GNU website has more information about licenses and licensing that might be helpful.

Non-reciprocal licenses often do not require to pass on changes under the same license / in source-code form. Examples of those are Apache 2.0 or BSD Two Clause. Some users prefer these licenses because they want that their code can be incorporated into non-free works.

So it's basically your decision under which terms you want to publish your code and how much control you want to give your users.

A personal note:

For projects I don't know where they head to, I often choose the GNU GPL because this will keep things open for the future publicly. And it makes it harder for others to snap the project and build something on top of it keeping me out. That's especially true if your code is not that advanced that users actually need you to modify it because of your expertise.

OwnerDisplayName: James


答:
Depends on why you're doing it.

If you're into the learning experience, check out Linux From Scratch.

If you need to deliver a functioning product, and a customized Linux distro is part of the solution, you are better off basing your Linux on a suitable mainstream distro (say, Debian, SuSE, RedHat / CentOS, Fedora, etc.), learning to use their packaging system, and setting up your own repositories.

In either case, this is not so much a programming task as a packaging and system administration task - a distribution is mainly an aggregation of existing software, selected to work together, with all dependencies automatically managed (this is what package managers do), and usually precompiled into suitable binaries (though some distros, e.g. Gentoo, download sources and compile on the target system).

Also, if you're looking for a practical solution, there are literally hundreds of Linux distributions, and some of them are extremely customizable. Chances are whatever you need has already been done.

Title: Programming your own linux distribution?

Body: So, during the couple of days I've been thinking what it takes to make your own linux distribution. Where should I actually start? I'd like to have some very basic tips for this. I consider myself a decent programmer, mainly in c++ and objective c. And what limits there are in making a distro?</p>


问:
Well designed / high-quality open source software
I'm taking a software design class where I should choose an open source software to analyze from the Software Design point of view.

It has to be a big project: not less then 100,000 lines of code.

I would really like to choose a software that is very well designed and architected to have good insights on good software design.

By good design I mean things like meaningful classes and architecture, good use of (design) patterns, good use of abstraction, good organization of components, high cohesion and low coupling between components, etc...

Do you have any software to suggest me?

Note that the software just need to have a good design, the design does not need to be documented! :)

It does not need to be an application for the end user... It can also be a library, a tool, etc...

答:
I have been looking for such a project myself, and settled for CLang.

It is relatively new (offspring of LLVM which is only 10 years old), so no (or not that I have seen) stale code

A modular design (as LLVM), extremely well thought out, which I think is very important nowadays

Very clean code, well commented (you often see quotes from the Standard to explain things)

A very nicely designed test-suite/test-environment

There are not many Design Patterns there, a few Visitors here and there but that's about it. The class hierarchies are simple, and straight-forward... Actually, I think simplicity is the goal, there does not seem to be any over-engineering going on.

That said, being performance critical, a number of design decisions might seem dubious (avoiding virtual functions for numerous objects, compiling without RTTI/exceptions), so not everything is applicable to everyday software.


答:
I work at a company where function headers are enforced by the culture (not by QA).  They always follow the form ...

```<code>/*************************************************************
 *
 * functionName - brief one line summary
 *
 * A more detailed description about what the function is supposed
 * to do.  Usage information is very important and should be added
 * here or under a special CAVEAT section.
 *
 * RETURNS: list the possible return values and what they mean
 *
 * ERRNOS: list the errnos that may be set and their conditions
 */
</code>```

I've been at this company for close to 10 years and have found function headers for every routine to be extremely useful.  They help everyone who has to wander through unfamiliar code, whether they have to review it, use it, track down defects.  They even help as reminders and navigation when we know the code; they help in so many ways.  Our customers can have access to the source code.  These comments help them too.  We also generate part of documentation from these comments.  Again, they help in so many ways!

With all that in mind, I see your stub comment as not adding value to the code base.

Body:
I work at a company where function headers are enforced by the culture (not by QA).  They always follow the form ...

/*************************************************************
 *
 * functionName - brief one line summary
 *
 * A more detailed description about what the function is supposed
 * to do.  Usage information is very important and should be added
 * here or under a special CAVEAT section.
 *
 * RETURNS: list the possible return values and what they mean
 *
 * ERRNOS: list the errnos that may be set and their conditions
 */

I've been at this company for close to 10 years and have found function headers for every routine to be extremely useful.  They help everyone who has to wander through unfamiliar code, whether they have to review it, use it, track down defects.  They even help as reminders and navigation when we know the code; they help in so many ways.  Our customers can have access to the source code.  These comments help them too.  We also generate part of documentation from these comments.  Again, they help in so many ways!

With all that in mind, I see your stub comment as not adding value to the code base.


答:
I'd probably be annoyed by enforced javadoc-style comments, but that's more because I find all that formatting annoying, and not the comment in and of itself. I generally leave a comment explaining all functions other than getters and setters; I've been bitten too many times by things which were obvious to me when I wrote them being total mysteries when looking at them months later.

For that function the necessity of a comment depends a lot on that term "ait". I mean, I have no idea what that means so a comment would be helpful. On the other hand, perhaps that's a common jargon term in whatever domain you work in.


答:
Commenting out a function is always a good choice in my opinion.

First and foremost you can actually understand what the function does without having to look deep into the code. This way your code will be easier to understand for other people. You can then need to use less comments for single lines of code, which may result in out of date code (bad documentation is far worse than no documentation at all).

Secondly, you can implement a function contract (see "Design by contract" approach). Design by contract is a good practice that will give you a glance of a function not function properly, not doing what it's supposed to do.

Additionally, a correctly formatted comments can be used to automatically create documentation for all your function in no time, and can be used to track down functions versions and revisions for version-control needs.

You should follow all possible way of having a self-explaining function, starting from the name of the function, to the name of the variables, methods, etc... All these things help other people better understand your code, and help save lot of time in debugging.

Write comments before the function is one of those good practice I advise you to follow.


问:
Best practices for releasing an open source PHP application
I'm a PHP developer for a living but have never worked on or contributed to any open source projects before.

I am developing a CMS for my own use. I have a working prototype and I think that once it's ready (probably a couple of months time) this could be something the PHP community would be interested in.

I'm a fairly confident developer but there are areas where my knowledge is lacking, especially when it comes to open source issues:

What's the best way to publicise the project and/or find others who might be interested in collaborating

My CMS is powered by CakePHP and basically sits as a layer on top of it. I've forked the CakePHP project on GitHub: I've used version control systems (SVN) before but I'm fairly new to GIT so want to be sure I'm doing things in "the best way"

How can I find out about licensing issues? Which open source license would be best for my app? Also, my project borrows from a lot of other open source projects, for example I have sections of code (which I have heavily modified) but which had copyright/licensing notices in place- I've no idea what my obligations are in terms of keeping these in

These are just a couple of examples of the questions I have, but I feel like there must be some resources out there which would be useful to me. Where's the best place to get started, what are the best communities/sites out there which cover these issues? I've had a look around but haven't been able to come up with much...

答:
I'm no Lawyer, but I'll give this one a try.

CakePHP is licensed under the MIT license, which basically means it permits reuse within proprietary software on the condition that the license is distributed with that software. It is compatible with GPL licenses, which a lot of open source projects released under.

As for the other projects you "borrow", you'll have to check their license types and check their compatibility with each other and the license type you decide to use. If any of them use a GPL license, you'll also have to release with GPL, as the terms of the license state

The GPL is the first copyleft license for general use, which means that derived works can only be distributed under the same license terms.

...

The GPL is the first copyleft license for general use, which means that derived works can only be distributed under the same license terms.

My suggestion is to release under the GNU GPL v3 license as it gives you adequate ownership rights over your work while allowing others to potentially use it in both commercial and open projects. Remember, though, the licenses of the "borrowed" projects must be compatible.

As for best practices with Git and Github, use git submodule to include other projects in your own library. This is better than including the files directly as you aren't recommiting the work as your own.

```<code>$ git submodule add git://github.com/cakephp/cakephp.git vendor/cake-php
$ git submodule update --init
</code>```

Body:
I'm no Lawyer, but I'll give this one a try.

CakePHP is licensed under the MIT license, which basically means it permits reuse within proprietary software on the condition that the license is distributed with that software. It is compatible with GPL licenses, which a lot of open source projects released under.

As for the other projects you "borrow", you'll have to check their license types and check their compatibility with each other and the license type you decide to use. If any of them use a GPL license, you'll also have to release with GPL, as the terms of the license state

The GPL is the first copyleft license for general use, which means that derived works can only be distributed under the same license terms.

...

The GPL is the first copyleft license for general use, which means that derived works can only be distributed under the same license terms.

My suggestion is to release under the GNU GPL v3 license as it gives you adequate ownership rights over your work while allowing others to potentially use it in both commercial and open projects. Remember, though, the licenses of the "borrowed" projects must be compatible.

As for best practices with Git and Github, use git submodule to include other projects in your own library. This is better than including the files directly as you aren't recommiting the work as your own.

$ git submodule add git://github.com/cakephp/cakephp.git vendor/cake-php
$ git submodule update --init

OwnerDisplayName: adlawson


问:
Will you consider a Software Team Lead position with previous employer
Say you left your previous employer about 3.5 years ago to pursue a growth opportunity, my primary motivation for moving. If a position currently opens up in that same company today for a Software Team Lead, would you:

Apply for this position, if you still have a lot of good relationships

If you would apply and can speak to the Engineering Director, who did all he could to keep you, would you call him to discuss about their needs and your interest? If not, how would you go about this?

As the Engineering Director, would you consider this candidate for Software Team Lead who left you 3 years ago despite all you tried to do to keep him, knowing that this guy has a tendency to seek opportunities for growth every 3-5 years? Yes, this person meets all of the requirements and has the potential to be a good leader.

答:
You may as well go for it. Three and a half years is a long time, and I assume that they aren't going to hire you just to fire you, so really your only risk is that you go for an interview at which you have no chance.

If you have a connection to someone who was in a position to actively try to get you to stay, then you should very well use it. I assume that your old engineering director is a well-balanced person who doesn't resent your departure and will be glad to have you back, based on your description.


答:
Be careful with versioning, it might kill you :-) Don't try to make things too complicated.

I think the following approach might help you:

Version each component individually with whatever versioning schema you want. From your comments I understand that you have a VCS in place. I also assume that each component has a file where its version is kept (right?). Once per day/week (whichever works better for your team) add a tag to one of the most recent revisions in VCS that marks that revision as the latest official revision (and optionally increment a super-revision number). Now you can query the VCS for the revisions with that tag and then look for the version of the components in that official build.

If you just want locally, write a small script that will aggregate the version of each component from the place where is stored in code.

If you want to make it even fancier, once you do the tagging you can look at the files belonging to each component, considering that you can identifiy the files that belong to a specific component. If any changed, increment the version for that specific component. The alternative is to do this manually. Another alternative is a combination of branching and merging with version tracking.


答:
There are a few gotchas to do with basic Javascript syntax that Internet Explorer will choke on (it might be better in IE9, but IE 6/7/8 had horrible problems).

Things like a trailing comma after the last element in an array (think something like [a, b, c,], every browser will handle it fine except IE.

There are quite a few more along that vein as well.


答:
Check out this guide from Eric S. Raymond (the rest of the book is also worth reading).

Personally, I wouldn't worry about it much - you're not going to make money off of this directly, and neither is anyone else, as there is an abundance of excellent free general-purpose CMSs already. I suggest you go with the most liberal license you can (MIT or BSD), unless you borrow code that is under a viral license (typically GPL or a variety thereof), in which case you are forced into that license one way or another.

Be sure to carefully read all the licenses of the libraries and snippets you're using; they should state whether you are allowed to redistribute and modify the code, and whether you need to include them in any derived works (most licenses require it, and even for those that don't, attribution is the least you can do to thank the original authors for their work).

Title: Best practices for releasing an open source PHP application

Body:
I'm a PHP developer for a living but have never worked on or contributed to any open source projects before.

I am developing a CMS for my own use. I have a working prototype and I think that once it's ready (probably a couple of months time) this could be something the PHP community would be interested in.

I'm a fairly confident developer but there are areas where my knowledge is lacking, especially when it comes to open source issues:

What's the best way to publicise the project and/or find others who might be interested in collaborating

My CMS is powered by CakePHP and basically sits as a layer on top of it. I've forked the CakePHP project on GitHub: I've used version control systems (SVN) before but I'm fairly new to GIT so want to be sure I'm doing things in "the best way"

How can I find out about licensing issues? Which open source license would be best for my app? Also, my project borrows from a lot of other open source projects, for example I have sections of code (which I have heavily modified) but which had copyright/licensing notices in place- I've no idea what my obligations are in terms of keeping these in

These are just a couple of examples of the questions I have, but I feel like there must be some resources out there which would be useful to me. Where's the best place to get started, what are the best communities/sites out there which cover these issues? I've had a look around but haven't been able to come up with much...