问:
What software do you use to help plan your team work, and why?
Planning is very difficult. We are not naturally good at estimating our own future, and many cognitive biases exacerbate the problem. Group planning is even harder. Incomplete information, inconsistent views of a situation, and communication problems compound the difficulty.

Agile methods provide one framework for organizing group planning--making planning visible to everyone (user stories), breaking it into smaller chunks (sprints), and providing retrospective analysis so you get better at planning. But finding good tools to support these practices is proving tricky.

What software tools do you use to achieve these goals? Why are you using that tool? What successes have you had with a particular tool?

答:
We use an issue tracker called FIT  (I work for this company as on outsourced contractor so it was my choice what to use).  Fogbugz was expensive in comparison.
It has a small footprint, web based, inexpensive and does the usual things.  I looked at Redmine which is a wonderful package but management was uneasy about an open source package that was still bleeding edge.

  For a tool like an issue tracker I didn't want to maintain it or upgrade it or customize it:  I just wanted it to work right out of the box and stay that way.


问:
Compute costs of bad code
I am looking for arguments to convince management to invest effort into refactoring.

We log work using Jira and relate every svn-commit to a jira call.

My idea is to do the following:

manually spot an area of code which is extremely bad implemented, but often used: both from User-POV and of Developer-POV (bugfixes)

get the svn-commits which contain the JIRA-Issues

filter the issues according to some criteria (issue type, version, prio. etc...)

compute the time/effort spent on these bugs

estimate efforts and risks of refactoring

present the numbers and ask for effort to fix it.

What do you think of this? Would such a measurement be useful and/or convincing? What are the Pros and Cons?

答:
I've found that if you can provide valid numbers, managers are more likely to act. (If they can understand the logic and the cost/benefit.)

IMHO, to make a convincing case, you would need the following to show how bad it is:

number of support incidents logged for the issues

time spent in hours maintaining/band-aiding bad code/doing support
fixes

time cost based on hourly rate of people doing the maintenance/band
aids/support

some way to demonstrate how mission critical these items are to the
business

And to make the case for refactoring, you'll need:

time estimate to refactor and implement each of the top 3 of these
bad things

cost estimate for implementation (same hourly rates as used above)

With these, you can make the case for time savings if the refactoring takes a whole lot less than support time for 3 incidents for each of those top 3 items.  You can argue that this shorter amount of time spent will

be less than n more support incidents

there won't be any more of these incidents for these things (EVEN BETTER!)

However, the hardest part of this sell will be answering the following question, since lots of people don't budget time in schedules for all the support you're doing:

How much longer will I have to wait for current project Y to get done while you're spending time working on these issues with X?????  (despite the current support timesinks, which can't be predicted and scheduled in Gantt charts)

This depends a lot on how well you communicate with the decision makers, and how they understand the situation.

I DEFINITELY think this is worth doing, so you get the practice of building the case with the metrics, and to save yourselves time, even if they don't go for it.  Unfortunately, not everyone is easy to convince, despite the data.   GOOD LUCK!

OwnerDisplayName: Bastl

ContentLicense: CC BY-SA 3.0

Title: Compute costs of bad code


问:
What is the benefit of not using Hungarian notation?
One of the things I struggle with is not using Hungarian notation.  I don't want to have to go to the variable definition just to see what type it is.  When a project gets extensive, it's nice to be able to look at a variable prefixed by 'bool' and know that it's looking for true/false instead of a 0/1 value.

I also do a lot of work in SQL Server.  I prefix my stored procedures with 'sp' and my tables with 'tbl', not to mention all of my variables in the database respectively.

I see everywhere that nobody really wants to use Hungarian notation, to the point where they avoid it.  My question is, what is the benefit of not using Hungarian notation, and why does the majority of developers avoid it like the plague?

答:
The one place where I still regularly use either Hungarian or analogous suffixes is in contexts where the same semantic data is present in two different forms, like data conversion.  This may be in cases where there are multiple units of measurement, or where there are multiple forms (e.g., String "123" and integer 123 ).

I find the reasons given here for not using it compelling for not imposing Hungarian on others, but only mildly suggestive, for deciding on your own practice.

The source code of a program is a user interface in its own right - displaying algorithms and metadata to the maintainer - and redundancy in user interfaces is a virtue, not a sin.  See, e.g, the pictures in "The Design of Everyday Things", and look at the doors labelled "Push" that look like you pull them, and at the beer taps the operators hacked onto the important nuclear reactor controls because somehow "hovering over them in the IDE" wasn't quite good enough.

The "just hover in an IDE" is not a reason not to use Hungarian - only a reason some people might not find it useful.  Your mileage may differ.

The idea that Hungarian imposes a significant maintenance burden when variable types change is silly - how often do you change variable types?  Besides, renaming variables is easy:

Just use the IDE to rename all the occurences.   -Gander, replying to Goose

If Hungarian really helps you quickly grok a piece of code and reliably maintain it, use it.  If not, don't.  If other people tell you that you're wrong about your own experience, I'd suggest that they're probably the ones in error.


答:
All such numbers are ultimately based on guesses, in your case comparing the amount you guess it would cost not to refactor vs. what you guess it would cost to refactor.  The best you can do is show you have some kind of numeric, factual basis for the guesses, and you have a pretty good one.

The pros are that it will probably be effective in convincing them to let you refactor, and it might go well and reduce the number of bugs.

The cons are that if the amount of time spent fixing bugs doesn't drop by at least as much as the time spent refactoring, you probably won't be allowed to refactor anymore, and you will probably be blamed for the "wasted" time.

The savings in debugging time gained by reducing complexity of the overall project, or in making it easier to add features, may be too hard to measure to help you much, but you could mention that those exist.

Title: Compute costs of bad code

Body:
I am looking for arguments to convince management to invest effort into refactoring.

We log work using Jira and relate every svn-commit to a jira call.

My idea is to do the following:

manually spot an area of code which is extremely bad implemented, but often used: both from User-POV and of Developer-POV (bugfixes)

get the svn-commits which contain the JIRA-Issues

filter the issues according to some criteria (issue type, version, prio. etc...)

compute the time/effort spent on these bugs

estimate efforts and risks of refactoring

present the numbers and ask for effort to fix it.

What do you think of this? Would such a measurement be useful and/or convincing? What are the Pros and Cons?


问:
How do you prevent the piracy of your software?
Is it still worth it to protect our software against piracy? Are there reasonably effective ways to prevent or at least make piracy difficult?</p>

答:
Just because copy protection isn't 100% effective doesn't mean it's worthless. It keeps honest people honest. Customers need SOME incentive to pay for software and most of the time that's what copy protection provides. If your price is reasonable, most people aren't going to spend the time and effort trying to circumvent the protections you have in place. Of course, if the protections make the core functionality a bitch to use, that's another issue.

This blog post is an excellent evaluation of the value of copy protection: http://www.kalzumeus.com/2006/09/05/everything-you-need-to-know-about-registration-systems/

As far as a reasonably effective way to provide SOME protections for your software, I highly recommend Infralution Licensing System. It's inexpensive and performs well.

ContentLicense: CC BY-SA 2.5


问:
Why and when should I make a class 'static'? What is the purpose of 'static' keyword on classes?
The static keyword on a member in many languages mean that you shouldn't create an instance of that class to be able to have access to that member. However, I don't see any justification to make an entire class static. Why and when should I make a class static?

What benefits do I get from making a class static? I mean, after declaring a static class, one should still declare all members which he/she wants to have access to without instantiation, as static too.

This means that for example, Math class could be declared normal (not static), without affecting how developers code. In other words, making a class static or normal is kind of transparent to developers.

答:
For me, a static class (in C#) is kind of like calling out a function.

For example

```<code>public static string DoSomething(string DoSomethingWithThisString){}
</code>```

I pass in a string and get back a string.  Everything is contained in that method.  No access to member variable, etc.

Honestly, mostly its use for me has been to lessen the lines of code:

Why do:

```<code>MyClass class = new MyClass();
String s = class.DoSomething("test");
</code>```

When I can do this:

```<code>String s = MyClass.DoSomething("test");
</code>```

So, I would use static classes in those cases, when I wanted to do something without the need for a class and would mean less typing.

Mark S. points are valid, but for me if I have some utility methods its just easier to pretend I'm calling a function to reference them as one liners.

That may be simplistic, but that's mostly how I have used static.

Body:
For me, a static class (in C#) is kind of like calling out a function.

For example

public static string DoSomething(string DoSomethingWithThisString){}

I pass in a string and get back a string.  Everything is contained in that method.  No access to member variable, etc.

Honestly, mostly its use for me has been to lessen the lines of code:

Why do:

MyClass class = new MyClass();
String s = class.DoSomething("test");

When I can do this:

String s = MyClass.DoSomething("test");

So, I would use static classes in those cases, when I wanted to do something without the need for a class and would mean less typing.

Mark S. points are valid, but for me if I have some utility methods its just easier to pretend I'm calling a function to reference them as one liners.

That may be simplistic, but that's mostly how I have used static.


问:
why are all the functional programming tutorials so mathy?
I've been trying to learn functional programming and most tutorials I have found use math as examples for the more complicated constructs (even the simple ones in some cases). Why is this? I would imagine something easier could be used. Its making it difficult to learn.

Background Info:
I have been writing software for 12 years. I understand some of the concepts such as closures, functions as first class citizens, and generics. I may be having problems with higher-order functions at some advanced level, but I would like to believe I have a basic grasp. Monads are biting me in the butt, and at this point I haven't gotten past that (I'm sure I will eventually, because I'm persistent).

答:
I think "The Little Schemer" is an awesome introduction to functional programming and is not at all mathy. It doesn't get into Monads, so it might be too basic for your tastes, but does do a derivation of the Y-combinator towards the end.

I recently went through it after not doing any functional programming since college 12 years ago, and it was a great refresher, I definitely feel ready to tackle more advanced stuff after working most of the problems in the book using Racket.


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

答:
It sounds like you are trying to convince yourself that C is useless and therefore can be ignored. Let's break your question down:

"I figured that someone would only learn C for testing only if there is development done in C."

No, there are many reasons to learn C. Even if you didn't know that I would still avoid using blanket statements like that, especially in conjunction with circular logic. Obviously one needs to know the language the code is written in to be able to properly test/fix it but that assumes that the langauge is still used as a given and is true for any language and not just C.

"In my knowledge, all the development related to COM and hardware design are also done in C++."

That is incorrect.

"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?"

This is the most questionable logic of all. First of all, historic significance is something you should believe in, because if you did you'd know that C is a subset of C++ and, because of that, knowing C can help you be a better C++ programmer. Of course, C was also influential to most languages that came after it so the benefits don't stop there. In addition, because C is so important it can not be considered as having only historical significance. It is still widely used and thus cannot be relegated to a secondary position like that. You can argue that it's not a language that every programmer needs to use and have a thorough knowledge of and that would be right but please don't build your argument on saying that you don't believe something without examining its true merits first.


问:
Developers Terms and Conditions
I've recently been approached to do some development work for a start up.

The fellow has requested my terms and conditions.

Being new to the industry, what sort of information would/should I include in this?

Obviously pay rate and maybe information about ownership of Intellectual Property perhaps.

Is there anything I'm missing?

答: Don't forget liability.  Do what you can to prevent them from being able to sue you when it doesn't work, or when it turns out that you violated a patent on organizing source code using line breaks.</p>

Title: Developers Terms and Conditions


答:
1) I do it SaaS way - Software as a Service

2) I make the software free for download and use, but requires a connection to a server for limited, paid access.

Title: How do you prevent the piracy of your software?

Body: Is it still worth it to protect our software against piracy? Are there reasonably effective ways to prevent or at least make piracy difficult?</p>


问:
What are the key differences between software engineers and programmers?
What are the key differences between software engineers and programmers?</p>

答: Software Engineers tend to work on systems that are very large taking many man years to develop e.g. 5 to 16 years for instance. Programmers tend to have this stereotype of just coding and nothing else. But it really depends on the organization you work and how HR are marketing the role as explained above. They are essentially the same thing. Just don't get too attached to a title because it is synonymous.</p>

OwnerDisplayName: Siamac Nikoo


问:
I have a hard time explaining what I learn

Possible Duplicates:

  How do you share your craft with non programmers?

  https://softwareengineering.stackexchange.com/questions/1985/how-to-explain-programming-to-a-non-programmer

  https://softwareengineering.stackexchange.com/questions/8022/how-do-i-become-more-articulate

I love programming and I like to learn everything I read about the subject. However, I'm having a hard time explaining what I've learned to someone who does not know anything about programming or even to a fellow programmer.

There is a quote by Albert Einstein that goes something like this:

```<code> If you can't explain it to a six year old, you don't understand it yourself.
</code>```

or

```<code> If you can't explain it simply, you don't understand it well enough.
</code>```

Does anyone else find themselves in the situation I'm in? This can also affect my job interviews; when someone asks me to explain some concepts that I know but can't put it well enough in words, they might think I'm not well prepared when in fact I am but I'm crippled by my inability to explain myself.

How can I overcome this and be more articulate?

答: There is a widely recommended book that covers exactly the problem you face. It's called "Even a Geek Can Speak". I've not had need of it myself but I do hear it's effective.</p>


答:
Dumb as it sounds, have a conversation with an imaginary 6 year old until you think you are explaining it well.

Oh, and in the case of technical things for non technical speakers.  Don't explain it at all.  They don't care.

(As an aside, don't try the converstation with an actual 6 year old.  There is a reason Einstein was not a frequent guest speaker at first grade classrooms.  Probably lots of reasons).

Title: I have a hard time explaining what I learn

Body:
Possible Duplicates:

  How do you share your craft with non programmers?

  https://softwareengineering.stackexchange.com/questions/1985/how-to-explain-programming-to-a-non-programmer

  https://softwareengineering.stackexchange.com/questions/8022/how-do-i-become-more-articulate

I love programming and I like to learn everything I read about the subject. However, I'm having a hard time explaining what I've learned to someone who does not know anything about programming or even to a fellow programmer.

There is a quote by Albert Einstein that goes something like this:

```<code> If you can't explain it to a six year old, you don't understand it yourself.
</code>```

or

```<code> If you can't explain it simply, you don't understand it well enough.
</code>```

Does anyone else find themselves in the situation I'm in? This can also affect my job interviews; when someone asks me to explain some concepts that I know but can't put it well enough in words, they might think I'm not well prepared when in fact I am but I'm crippled by my inability to explain myself.

How can I overcome this and be more articulate?


答:
```<code>You read, you forget.
You read again, you remember.
You explain to others, you understand.
</code>```

-can't remember who said it.

If you can't explain what you have learned, then you either have communication problems or you didn't understand it in the first place. It's one or the other... or both.

Einstein is right.

Since we are on a programmer related site I'll address a way of fixing the "I didn't understand". Start answering questions on stackoverflow or programmers.SE, explain stuff to others...

You will get feedback from those people and it's likely that you'll see dents in your knowledge witch you will try to fix by researching the subject to get a new understanding on things... again providing answers to others....

And now you are also communicating with people, and with time, your communications skills will also improve.

That's two birds with one stone :D

Body:
You read, you forget.
You read again, you remember.
You explain to others, you understand.

-can't remember who said it.

If you can't explain what you have learned, then you either have communication problems or you didn't understand it in the first place. It's one or the other... or both.

Einstein is right.

Since we are on a programmer related site I'll address a way of fixing the "I didn't understand". Start answering questions on stackoverflow or programmers.SE, explain stuff to others...

You will get feedback from those people and it's likely that you'll see dents in your knowledge witch you will try to fix by researching the subject to get a new understanding on things... again providing answers to others....

And now you are also communicating with people, and with time, your communications skills will also improve.

That's two birds with one stone :D


答:
Try out different methods of communication. If you find that you're having issues explaining yourself in a face-to-face conversation, try whiteboarding the problem and do a walkthrough of the solution (sometimes this can help clear things up for you yourself).

The key is to slow down. Describe a problem and its solution in atomic units.


答: Explain it with an example or by drawing the concept. This makes it easier to stay focused on the global concept, rather than losing yourself in the details.</p>


答:
I've found the use of analogies to work very well for explaining complex programming concepts to my son, as well as my older Father-in-law :). For example, explaining the DNS system using the White Pages in the phone book to describe how addresses are looked up, and forwarded to their corresponding server. IP Addresses are Phone Numbers, DNS servers are Phone Books, and your request for a website is like dialing 411 and having them auto-route you to the server you want.

Start making comparison to things "in the real world" to explain complex programming topics, and I think you'll go a long way to being able to explain what you're learning to the layman. That being said, a deep understanding of the topic will help you realize which analogies to use to make this happen.

I hope that helps,

Dan


问:
Should I remove unreferenced code?
I'm working on a medium sized (100k lines) code base, it's all relatively recent code (less than a year old) and has good unit test coverage.

I keep coming across methods which are either no longer used anywhere or only referenced in unit tests which only test that specific method.

Should I remove this code if I'm certain that it's no longer needed?

Reasons to remove it:

Less code, less bugs

Less code is easier for others to digest

It's still under source control

Reasons to keep it:

Can be used as reference

It may be useful sometime

It may have been written to 'round-out' the functionality for a class

答:
"Can be used as a reference" I would not tend to agree with being a good reason to leave in unused code. Often, only a small portion of the unused code is actually demonstrating something interesting. There are multiple ways to document and store useful but unused code.

Although version control will contain a history which will easily allow you to restore particular functionality if you later decide the code is needed, knowing that you need to go look in the version control history to find x y or z from who knows what previous revision can be a bit tedious, and often is overlooked unless you have a fairly specific idea what you are looking for.

The code could be commented out with a note about when it was removed and why it wasn't simply deleted from the code. However, this is generally considered bad style, and code that isn't used and not maintained properly can introduce all sorts of bugs if it is uncommented later on, so this is generally better as a temporary debugging/testing step while mid-refactoring than a way to leave production code.

My favorite way to store the deleted code, if it appears to be useful in the future, is to make a secondary reference document containing all the various chunks of worthwhile deleted code. Each block of code is labeled with a brief mention of where it came from or anything else pertinent to remember such as when it was removed or the revision number it was last in the code at. Everything removed but "potentially useful" is in one place, easily searchable, but not requiring constant effort to maintain and test on an ongoing basis (that testing is defered to whatever point the code is re-introduced).

Title: Should I remove unreferenced code?


问:
What's the career path for a developer who doesn't like management?
If you're developer (Senior or Lead Developer) and you'd rather stay with code/design than pursue a management career, what are the available career paths at your company, or any you've heard of? How far can you go?

Is it possible to continue being a geek until you bite the dust or is that too naive?

Are people like Uncle Bob for example still considered developers, as they claim?

答: If you work for a small company being a developer may be the highest role unless you start your own company. You will then become a Developer/Director. Don't worry too much about reaching the highest technical role in a company. Just do what makes you happy.</p>


问:
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 asked myself this question a lot : which is better ? C# or Java ?

I will give you an advice and this advice is the conclusion of my research : None of them is better, only the language you know well and you can do a lot of fascinating applications with is the best.

Learn how to program and then train yourself a lot using one language and when you become perfect in writing code with it, think about other languages and believe me, you will learn the other languages like a piece of cake.

OwnerDisplayName: Edin Dazdarevic

Title: Java vs. C# - Productivity perspective


问:
What is a Ph.D. good for in the software industry?
I'm a self-taught programmer and have just started a computer science degree to supplement my knowledge and fill in the gaps.

However, I'm already debating the direction of my education. I want a 4 year bachelor's degree for sure, but after that, I'm not sure: Is it worth it to get an M.Sc? What about a Ph.D.? What opportunities do these degrees open up?

Currently my goal is to be a software developer, but there are a number of fascinating fields in the software industry and I'm certainly interested in investigating many of them. It is in this respect that I think a higher degree may be worth it -- even if it wouldn't necessarily help a career of software development.

So will it be worth it? Will grad school open doors?

答: PhD qualification is good if you want to work for companies such as Oracle, Google, Microsoft, IBM etc. It's also important to have when working as a researcher or lecturer/professor at a university. Don't do it simply because of the title as in that 3 or 4 years you can accomplish a lot more in life then getting another piece of paper. You will save time and money and do other things you enjoy such as dancing, cooking, snowboarding, traveling, running a business etc. Lastly, don't rush the decision. Take your time and find out what you really want to do and what makes you happy. If you just like developing software then an undergrad degree is fine for many companies.</p>


答:
Practicing paraphrasing and clarifying is definitely the main tactic I'd suggest to overcoming this.  Consider adding new words to your vocabulary that may help in translating things from one level to another.  For example, consider these pair of sentences:

I'm going home.

Fire the synapses of my central nervous system to tell my body to erect itself away from this chair, proceed down the hall towards my vehicle parked downstairs, turn on the vehicle and operate it to move my body back to my personal residence where I woke up this morning.

Both statements are about the same thing of me getting home though the latter is way more detailed and likely overkill for most people wanting to know, "What are you going to do this afternoon?"  There are probably more than a few in between phrasings that could be created that may be a fun exercise to consider.

Social Anxiety may also be a factor that could be worth exploring.  I have Generalized Anxiety but it was initially thought to just be Social Anxiety. Emotional Intelligence would be another possible area to study if you want other things that may help in interpersonal and communication skills.


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

答:
This reminds me of something I read about the difference between "software engineering" (what I would call programming) and the other engineering disciplines. Come to think of it, I think it was the original Design Patterns book.  I'm sure someone here can quote it off the top of his head.

Anyway, the point (although not exactly geared toward algorithm design) was that the engineering disciplines are codified; no civil engineers are likely to spend time trying to reinvent the I-beam, but programmers do it all the time.  The problem (and I realize that I am merely echoing the sentiments of many) is that this behavior is wasteful and error-prone, and serves the ego more than the solution.

Computer science led me to programming, and I love both.  However, I am a much better programmer than computer scientist.  I would never accuse you of being incompetent because you couldn't reinvent Dijkstra's algorithm in an afternoon.  I would question your competence as a programmer if you couldn't recognize a problem that could be solved via a shortest-path graph algorithm.

That said, I believe that thinking about algorithms and trying to design and implement new ones is (potentially) fun and (almost) always instructive.  I just try to cleanly separate my CS time from my programming time.  For  programmers, our (especially paid) time is better spent solving practical problems instead of asbtract ones.  Besides, CS time almost always crushes my confidence.


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

答:
what is the point of checking a third state when a third state is
  logically impossible?

What about a Boolean? that allows for a NULL state that is neither true nor false.  Now what should the software do?  Some software has to be highly crash-resistant like pacemakers.  Ever seen someone add a column to a database that was a Boolean and initialize the current data to NULL initially?  I know I've seen it.

Here are a few links that discuss what it means to be robust in terms of software:

Robust Programming

Robust Definition

Robustness, the forgotten code quality.

How to write robust code

If you think there is one universally agreed upon definition of "robust" here, good luck.  There can be some synonyms like bomb-proof or idiot-proof.  The Duct Tape Programmer would be an example of someone that usually writes robust code at least in my understanding of the terms.

Title: What defines robust code?

ContentLicense: CC BY-SA 4.0


答:
I beg to differ for what most of the answers say. While I wouldn't expect a programmer of any level to be able to come up by himself on Dijkstra's algorithm, I definitely would expect him to come up with any way (efficient or not) to solve the problem.

For example, you said as a side comment that you were able to come up with bubble sort on your own. I know its the stinkiest of sorting algorithms, but you found a way to solve a problem, and that's what I do expect programmers to be able to: find a way to solve problems.

Of course, investigating and finding solutions done by others also work, but the extreme of that point is a guy that does not think of himself and whose programs are a compendium of Google searches.

I think I'm sounding harsher than I actually want to, but my point is: I would expect a programmer to be creative enough to come up with a solution to a problem, even if the solution is buggy or messy.

So, coming back to your case, I don't think you should have to come up with Dijkstra's algorithm, but if you have the ability to write an algorithm to try out several possibilities and find the shortest path without ending on a infinite loop, then you've got my approval.

(BTW my approval counts in the same order of importance as a free car wash coupon.)

Title: Should a competent programmer be able to come up with his own shortest path algorithm?

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


问:
Should I bother to develop for JavaScript disabled?
Should I bother to develop for JavaScript disabled?

I feel that my time is better spent developing for the majority.

答:
< 5% of users disable javascript

According to BrowserStatistics,  in 2008, only 5% of users had JavaScript turned off. The trend has steadily been declining so it's very safe to assume that now near 2011, that number is much smaller.

Downgrade Gradefully

Your site should never be broken - no matter if the users have JS on or off. Even if it's as simple as displaying a message that your site needs javascript turned on, you should make sure that your website renders and behaves in an acceptable, non-broken manner for those select few.

Reworking for non-JS users? Normally: No.

The ordinary developer has no need to create a non-javascript version in another language. However, if it is known that your clients have anti-javascript needs, then you obviously are forced to cater to it. (Even GMail has a no-JS version)


答: FWIW, Microsoft (like other large companies, I'm sure) has career paths for non-managers that go to VP equivalent levels (Distinghished Engineer and Technical Fellow). MS is really big on showing a career path for non-managers.</p>

Title: What's the career path for a developer who doesn't like management?

Body:
If you're developer (Senior or Lead Developer) and you'd rather stay with code/design than pursue a management career, what are the available career paths at your company, or any you've heard of? How far can you go?

Is it possible to continue being a geek until you bite the dust or is that too naive?

Are people like Uncle Bob for example still considered developers, as they claim?


答:
Must Haves

Limited Liability

Lawyers and angry customers are not nice people and will not hesitate to sue your ass. Be sure to cover your rear end with a limited liability statement. The standard practice is that your liability cannot exceed the cost of services rendered so far.

Statement of Work

Don't say "I do the website" in your contract because it is too vauge and opens a can of worms for never-ending contracts. Use a specific, itemized list of things you will perform. List initial delivery dates; it's okay to group items into "phases".

Payment

Shaking hands to $50/hr or $2,000 for the job is not enough. You need to put it in writing. HR departments might also ask you to include a "maximum payment" that cannot be exceeded in case things run over. A good guideline for this is 10%.

Taxes, Benefits

If you haven't considered taxes yet, you're in for a big surprise. At any rate, you need to state who pays for things like taxes and benefits. If it's more of a temporary employee gig, then usually the company pays, if it's more of a contractor job, then you're responsible for it all.

Contract Dates

Dates are very important. Your contract needs to have an expiration date that says how long the offer is valid for. It should also have a definite cut-off date for maintenance and bugs.

Contact Information

Have both party's contact information available on the contract. Billing address, phone number, contact names, email addresses. This will help in resolving any legal issues that arise.

Should Haves

Bugs and Maintenance

This needs to be addressed. What constitutes a bug, and not a change or addition? How long will you continue to address bugs? What's the maximum amount of time before a bug gets resolved? You should think about testing practices while you're at it.

When and How You Are Paid

Whatever you don't include in your contract puts you at risk for a terrible slap in the face. Often, billing departments can run super slow. How slow? So slow that you receive your first paycheck a year after the project is over. Try to agree on methods of payment and payment dates.

Agree for Written Changes Only

This is more of a scope creep thing, but you should require that your client can only change the contract with a written agreement for new/changed work items (and a separate price tag).

TimeSheet: Anytime, Anywhere Policy

HR departments like to look at your timesheet every once in a while. It also shows if you are working and provides a layer of transparency that clients appreciate. Nowadays this is super easy, and even a GMail SpreadSheet will do the job.

Best Advice

Find a lawyer. Any old friend of a friend of a friend will do as long as they are trust worthy and attentive to your needs. If you're going to be doing this contracting business often, consider becoming a LLC or being employed/under one. It will help with legal issues immensely.

And, remember your taxes! You will get fined if you don't.

Title: Developers Terms and Conditions

Body:
I've recently been approached to do some development work for a start up.

The fellow has requested my terms and conditions.

Being new to the industry, what sort of information would/should I include in this?

Obviously pay rate and maybe information about ownership of Intellectual Property perhaps.

Is there anything I'm missing?


答:
I think the professor might be confusing "error" and "bug". Robust code should certainly have few/no bugs. Robust code may, and in a hostile environment, must, have good error management (be it exception handling or rigorous return status tests).

I agree that the professor's code example is silly, but not as silly as mine.

```<code>// Assign 3 to x
var x = 3;
x = 3;   // again, just for sure
while (x < 3 or x > 3) { x = 3; }  // being robust
if (x != 3) { ... }  // this got to be an error!
</code>```

Title: What defines robust code?

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

Body:
I think the professor might be confusing "error" and "bug". Robust code should certainly have few/no bugs. Robust code may, and in a hostile environment, must, have good error management (be it exception handling or rigorous return status tests).

I agree that the professor's code example is silly, but not as silly as mine.

// Assign 3 to x
var x = 3;
x = 3;   // again, just for sure
while (x < 3 or x > 3) { x = 3; }  // being robust
if (x != 3) { ... }  // this got to be an error!


问:
Single Line Statements & Good Practices
I have recently acquired a habit which I know many of you may frown upon, but which, in the end, helps me keeping an eye on global code structure rather than on the structure of a single, (sometimes) repetitive method: grouping a number of statements in a single line, like this:

textBox1.Text = "Something!"; textBox2.Text = "Another thing!"; textBox3.Text = "Yet another thing!";
```

<p>as opposed to</p>

<pre class="lang-cs prettyprint-override"><code>textBox1.Text = "Something!";
textBox2.Text = "Another thing!";
textBox3.Text = "Yet another thing!";
</code>```

I use to do that for repetitive tasks to maintain overall code "beauty" and to help me tracking program structure easily, but I admit it may not be a good practice. I actually use it a lot, so I would like to know what are your thoughts on this. Also, do you think that anyone which would ever have to maintain my code have problems with this approach?

答:
Syntactically, there is really nothing wrong with it. It really depends on the coding style of your team.

As most of the code I have seen (including the code that is inside the standard c++ headers) is done this way, I would go with your first method.

```<code>textBox1.Text = "Something!";
textBox2.Text = "Another thing!";
textBox3.Text = "Yet another thing!";
</code>```

OwnerDisplayName: User

Title: Single Line Statements & Good Practices

Body:
Syntactically, there is really nothing wrong with it. It really depends on the coding style of your team.

As most of the code I have seen (including the code that is inside the standard c++ headers) is done this way, I would go with your first method.

textBox1.Text = "Something!";
textBox2.Text = "Another thing!";
textBox3.Text = "Yet another thing!";

OwnerDisplayName: Nick


答:
One-statement-per-line is a widely used coding style. As a result, most developers who look at your code in future will probably wince when they see multiple statements per line. When you're used to seeing something one way, it can be disorienting to see it another way.

For this reason I advise against it, except in rare circumstances.

Title: Single Line Statements & Good Practices

Body:
I have recently acquired a habit which I know many of you may frown upon, but which, in the end, helps me keeping an eye on global code structure rather than on the structure of a single, (sometimes) repetitive method: grouping a number of statements in a single line, like this:

textBox1.Text = "Something!"; textBox2.Text = "Another thing!"; textBox3.Text = "Yet another thing!";
```

<p>as opposed to</p>

<pre class="lang-cs prettyprint-override"><code>textBox1.Text = "Something!";
textBox2.Text = "Another thing!";
textBox3.Text = "Yet another thing!";
</code>```

I use to do that for repetitive tasks to maintain overall code "beauty" and to help me tracking program structure easily, but I admit it may not be a good practice. I actually use it a lot, so I would like to know what are your thoughts on this. Also, do you think that anyone which would ever have to maintain my code have problems with this approach?

OwnerDisplayName: Charles


答:
This is really unusual coding style.

I would recommend you to use empty lines to delimit logical parts of code instead.

Title: Single Line Statements & Good Practices

OwnerDisplayName: svick


问:
Learning on the Fly
I would like to know what other developers do when a situation arises to implement a couple of features in language unknown to you.

You are familiar with Javascript, and you do not know jquery, how do you go by implementing some features in jquery assuming you have not much time.

答: Dig in and get dirty but try not to leave a mess. Try to find good examples at sites you trust and if you can try to talk to someone that is experienced in the technology and run your design by them... you could have someone peer review your code too. Don't just settle with the first thing you get to work, question if there is a different way you should consider.</p>

OwnerDisplayName: funlearning

Title: Learning on the Fly


答:
Going too far off to the right can create just as many problems as multiple lines.

I've had to deal with some sql statements with dozens of fields. Normally, I'd put one per line, but on a few occassions, I've consolidated 3 or 4 to a row. This seems like a good idea during development when you're having to scroll up and down several times.

I regret returning to this code. Having extra rows just doesn't seem to create that much of a problem so I usually clean it up.

Title: Single Line Statements & Good Practices


答:
JavaScript disabled is extremely important and you should support it. The porn industry is notorious for spamming users with rogue pop-ups. Disabling JavaScript is pretty much required if you navigate into this territory.

Do you really want to force users to constantly turn JavaScript on/off as they go from sites of questionable repute to your app?

Body:
Should I bother to develop for JavaScript disabled?

I feel that my time is better spent developing for the majority.


答:
I've flipped back and forth between Java and .NET, starting with Java 1.2 up to 1.6, and .NET 1 up to 4.0, over about 10 years of professional work experience (being a C/C++ programmer before that).

At one time, like .NET 2.0, I would say that Java and C# would be about the same, especially for back-end work. The language constructs were still very similar. .NET would have probably gained the edge in desktop UI programming, because of the WinForms designer in Visual Studio, and Java would have had the edge in Web / Server stuff, primarily because you weren't stuck with IIS.

Now moving in to .NET 3.5 and 4, I give the productivity edge to .NET, hands-down.  This is primarily, in my opinion, because .NET is a much quicker evolving language, since MS can make language decisions relatively quickly, as opposed to pushing changes through the politics of the JCP.  Big improvements are the var keyword, the entirety of Linq, Extension Methods, the Null-coalescing operator ??, dynamic, and probably a lot more great stuff that really boosts productivity.

Now, that said, the "most productive" language for a project is almost always the one that the most developers are the most comfortable and experienced with. The learning curve is always the biggest productivity killer.

Title: Java vs. C# - Productivity perspective

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


答:
One thing that I have noticed is many C#/.NET shops have a "not invented here" attitude and ban all third party/open source libraries while many Java shops are more willing to use open source libraries.  Also there seem to be more libraries available for Java.  Even if you look at some cool third party libraries in .NET e.g. NHibernate, NPOI, Spring.NET, etc. they are ports of the Java libraries and hence are behind them.  It certainly seems like many of these innovations came first to Java and after time a .NET port was created.  From a library perspective it certainly seems Java wins in terms of new innovative discoveries.

Still Microsoft does make some official libraries e.g. ASP MVC, LINQ, etc..  But often like with ASP MVC third party libraries like Struts, Spring MVC, etc. were already out for Java and Microsoft was late entering the model view controller web paradigm.

Of course, many of these libraries save a ton of time and make you more productive.  Core language to core language C# and Java are not that different and for me it is too close to call.  Throw in the army of third party libraries and the scale certainly tilts towards Java.  Still with an open shop a lot of that tilt balances out.  It's just a lot of .NET shops have the not invented here attitude while a lot of Java shops are whatever it takes to get the job done...  This is even true within the company I work, the .NET team does not get much (due to management) while the Java team has many approved third party libraries/utilities.  Also with .NET a lot more of the good stuff is not free (e.g. prior to NPOI if you wanted to work with Microsoft office documents, most of the solutions [not counting office automation] were not free.  Whereas java had POI since 2001 I don't think NPOI came out until 2008, it's hard to tell based on the npoi project site.

Title: Java vs. C# - Productivity perspective


答:
I really think readability would suffer greatly both for you and certainly anyone else reading the code. It all makes sense when you write it the first time because it's actively in your mind. It's different when you're scanning code to see what variables and functions are where...you're destroying your own ability to scan your own code. That's a huge no-no, and beyond bad if anyone else ever has to read your code.

Also, think about how you read code. It's always top down, scrolling down. Your method doesn't mesh with this, and even introduces one of the ugliest possible issues in code reading; scrolling horizontally.  Never underestimate how hard that can make reading code. You never scroll horizontally, you never make people scroll horizontally, in almost any context it's extremely unnatural.

Also, if your issue is repetitive code entry...don't forget Ctrl-C. From your example code it might be more efficient to type that all out  manually, but if you have to copy a bunch of lines a bunch of times it seems like it would be just as efficient to copy line one plus a new line, paste it x times and make the changes, less likely to make a typo too.

Oh, and typos! Harming the readability of your code like that can make it a nightmare to find which of the 50 variable declarations you set wrong. Most compilers give errors at row AND column numbers now, but finding an error at a row is MUCH easier than finding a column.

Title: Single Line Statements & Good Practices


答:
I last did this 25 years ago using interpreted languages on small micros running with low clock speeds, where every space or carriage return eliminated gave a performance increase.

I wince now at the thought of it (though it was done for a good reason).

Unfortunately such code is difficult to read, and thus difficult to maintain.

Title: Single Line Statements & Good Practices


答: One statement per line also makes it easier to see what has changed in a side-by-side diff.</p>

Title: Single Line Statements & Good Practices


答:
While the example doesn't show this, there's another problem with grouping multiple statements on one line. What if one of the five statements you have on a single line throws an exception?

Your stack trace will say "EBlah at line N"... and now you have no idea which of those five statements threw the exception.

(The same thing happens with an excessively long statement of any kind.)

Title: Single Line Statements & Good Practices


问:
Which platform to choose, Java or .NET?
I am working in a private bank, a leading mid size bank in local market. We are going to create our core banking solution. Existing solution has been developed on Java using IBM Visual Age 4.0.

It is very important to discuss architecture first, we have currently more than 350 branches working in standalone mode, and it means they are working in self contained environment. They have their own database server (IBM DB2 9.7) and they are communicating with other branches via sockets to send and receive data.

Having experience of .NET for more than 5 years I am trying to convince my superiors to choose .NET platform, but they are reluctant and unwilling. It is my job to encourage them for choosing best available platform to create large scale enterprise application.

In simple word, we are going to create a very large scale enterprise financial application, a centralize and integrated which connects all branch networks plus having scalable, solid architecture that easily evolve over time.

I want professional people to comment on above scenarios. Which platform to choose .NET or Java? Our all resource is currently working in Java, we have homogeneous environment (no Linux, no Mac and no UNIX).

Any idea, any thoughts, any points technical or non-technical i.e. administrative or management point of view will be really appreciated.

答: Your attachment to .Net is scary for someone responsibe for architecture, perhaps you are best surrendering to a lead programming role. Given that a lot of the code base is already in Java, there will be years of business logic, refinements and bug fixes, the appetite to 'rewrite' from scratch is very dangerous. </p>

Title: Which platform to choose, Java or .NET?


答:
First you need to convince yourself in support of .NET. If you need samples, you wont find .NET surpassing the Java in this department. Most of the Core Banking Solutions are developed in Java

You might find .Net vs. Java: Five Factors to Consider helpful

Title: Which platform to choose, Java or .NET?

Body:
I am working in a private bank, a leading mid size bank in local market. We are going to create our core banking solution. Existing solution has been developed on Java using IBM Visual Age 4.0.

It is very important to discuss architecture first, we have currently more than 350 branches working in standalone mode, and it means they are working in self contained environment. They have their own database server (IBM DB2 9.7) and they are communicating with other branches via sockets to send and receive data.

Having experience of .NET for more than 5 years I am trying to convince my superiors to choose .NET platform, but they are reluctant and unwilling. It is my job to encourage them for choosing best available platform to create large scale enterprise application.

In simple word, we are going to create a very large scale enterprise financial application, a centralize and integrated which connects all branch networks plus having scalable, solid architecture that easily evolve over time.

I want professional people to comment on above scenarios. Which platform to choose .NET or Java? Our all resource is currently working in Java, we have homogeneous environment (no Linux, no Mac and no UNIX).

Any idea, any thoughts, any points technical or non-technical i.e. administrative or management point of view will be really appreciated.


答:
I'll refer you to https://softwareengineering.stackexchange.com/questions/39371/what-are-the-factors-that-have-made-java-a-success-as-a-programming-language-in-e and What would you choose for your project between .NET and Java at this point in time?

But in short, you don't find many financial institutions going with .NET for the core platform after its well publicised failure at the London Stock Exchange. Java and *nix (despite some of their drawbacks) are a proven backbone.

.NET for front end layers?  Or some business apps that run on top of the core?  Sure thing!  Lots of successful business cases of that at financials.

Title: Which platform to choose, Java or .NET?


答: For a bank of your size, I am surprised you are thinking of building software like this from scratch - I would suggest that you buy a proven solution and there are several ones for banks.</p>

Title: Which platform to choose, Java or .NET?


答:
For the sake of my discussion a Bool can have 2 states, True or False. Anything else is non-conformance to the programming langugae specification. If your tool chain is non-conformant to its specification, you are hosed no matter what you do.
If a developer created a type of Bool that had more than 2 states, it's the last thing he would ever do on my codebase.

Option A.

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

Option B

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

I assert Option B is more robust.....

Any twit can tell you to handle unexpected errors. They are usually trivally easy to detect once you think of them. The example your professior has given is not something that could happen, so it's a very poor example.

A is impossible to test without convoluted test harnesses. If you can't create it, how are you going to test it? If you have not tested the code, how do you know it works? If you don't know it works, then you are not writing robust software. I think they still call that a Catch22 (Great movie, watch it sometime).

Option B is trivial to test.

Next problem, ask you professor this question "What do you want me to do it about it if a Boolean is neither True nor False?"
That should lead into an a very interesting discussion.....

Most cases, a core dump is approriate, at worst it annoys the user or costs a lot of money.  What if, say, the module is the Space shuttle realtime reentry calculation system? Any answer, no matter how inaccurate, cannot be worse than aborting, which will kill the users. So what to do, if you know the answer might be wrong, go for the 50/50, or abort and go fo the 100% failure. If I was a crew member, I'd take the 50/50.

Option A kills me
Option B gives me an even chance of survival.

But wait - it's a simulation of the space shuttle reentry - then what? Abort so you know about it. Sound like a good idea? - NOT - because you need to test with the code you plan to ship.

Option A is better for simluation, but can't be deployed. It's useless
Option B is the deployed code so the simulation performs the same as the live systems.

Let's say this was a valid concern. The better solution would be to isolate the error handling from the application logic.

```<code>if (var != true || var != false) {
    errorReport("Hell just froze over, var must be true or false")
}
......
if (var == true){
 ....
} else {
 ....
}
</code>```

Futher reading - Therac-25 Xray machine, Ariane 5 Rocket failure and others
(Link has many broken links but enough info that Google will help)

Title: What defines robust code?

Body:
For the sake of my discussion a Bool can have 2 states, True or False. Anything else is non-conformance to the programming langugae specification. If your tool chain is non-conformant to its specification, you are hosed no matter what you do.
If a developer created a type of Bool that had more than 2 states, it's the last thing he would ever do on my codebase.

Option A.

if (var == true) {
    ...
} else if (var == false) {
    ...
} else {
    ...
}

Option B

if (var == true) {
    ...
} else {
    ...
}

I assert Option B is more robust.....

Any twit can tell you to handle unexpected errors. They are usually trivally easy to detect once you think of them. The example your professior has given is not something that could happen, so it's a very poor example.

A is impossible to test without convoluted test harnesses. If you can't create it, how are you going to test it? If you have not tested the code, how do you know it works? If you don't know it works, then you are not writing robust software. I think they still call that a Catch22 (Great movie, watch it sometime).

Option B is trivial to test.

Next problem, ask you professor this question "What do you want me to do it about it if a Boolean is neither True nor False?"
That should lead into an a very interesting discussion.....

Most cases, a core dump is approriate, at worst it annoys the user or costs a lot of money.  What if, say, the module is the Space shuttle realtime reentry calculation system? Any answer, no matter how inaccurate, cannot be worse than aborting, which will kill the users. So what to do, if you know the answer might be wrong, go for the 50/50, or abort and go fo the 100% failure. If I was a crew member, I'd take the 50/50.

Option A kills me
Option B gives me an even chance of survival.

But wait - it's a simulation of the space shuttle reentry - then what? Abort so you know about it. Sound like a good idea? - NOT - because you need to test with the code you plan to ship.

Option A is better for simluation, but can't be deployed. It's useless
Option B is the deployed code so the simulation performs the same as the live systems.

Let's say this was a valid concern. The better solution would be to isolate the error handling from the application logic.

if (var != true || var != false) {
    errorReport("Hell just froze over, var must be true or false")
}
......
if (var == true){
 ....
} else {
 ....
}

Futher reading - Therac-25 Xray machine, Ariane 5 Rocket failure and others
(Link has many broken links but enough info that Google will help)


答:
Let's talk about costs:

You state that everything has been done in Java so far? Why change then? You might use parts of the old system or create a reusable domain model. Integration will be easier. The developers are probably used to Java, so why would you spend money to train them on .NET? There's no reason for this, as .NET has no outstanding advantage over Java in your scenario. Development costs are most likely the biggest lot, followed by maintenance costs. Why would you want to increase these for a personal preference and little to no infrastructural/architectural gain?

So if I was your boss, you'd better prove that in the long run it's cheaper (while maintaining quality) to migrate to .NET. But I doubt you can prove that.

Let's talk about the strategic decisions:

So I have a java environment, I don't have to pay huge license fees. Most of the software I use is open source and Java's portability is great. Why should I lock myself into sort of an unportable one vendor system? There'd better be a reason for this! Better support for the systems? Better scalability and distribution? Not really.

Please take my advice:

In your situtation I wouldn't dare switching from Java to .NET. There'e no obvious reasons to do it. The primary strength of .NET is still rich GUIs, quite in contrast to Java. Maybe frontend/client software can be written in .NET, but for your backend, I'd stick with Java and I wouldn't try to start the grand rewrite in .NET.

Please note that as a developer, I, too, prefer .NET to Java. But as always such decisions depend on various other factors. From a manager's perpective, I can see no reason to change to platforms. Quite the contrary.

Title: Which platform to choose, Java or .NET?


答: Graph theory, and the algorithms that apply to it, look simple on the surface but are generally far from it. You'd think the formation of non-crossing (planar) graphs is simple, for instance, at first glance. Last year I looked extensively into this problem (planarity via elimination of Kuratowski subgraphs). I can tell you, from that experience, that the people who write these algorithms typically spend the duration of their PhD studies doing so, and sometimes that research is done in teams. And as researchers, that is their sole working focus over that period of time. It isn't sensible to think that we on-the-ground engineers can expect the same. As someone else here rightly said, its blindingly obvious once the solution is in front of you. That always seems to be the case!


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

答: If you're not attempting to learn you're a worse programmer than if you were. But, I don't understand why you need a specific comparative measure. You won't get a better job or a bigger pay rise by saying "I'm better than programmer A" you'll get one by being the best you personally can be.</p>


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

I'd go as far as to say that if you're able to invent an algorithm for a well-known problem like Shortest Path all on your own, you're being a bad programmer.

It'd mean you're ignoring quite a history on the Shortest Path problem, going from a O(|V|^4) algoritm published in 1955 to the O(E + V log V) algorithm published in 1984 (which is Dijkstra's algorithm with Fibonacci trees). You're almost guaranteed to do worse than the algorithms already devised. Worse still, there's a good chance your algorithm has gaps or errors making it incorrect. In addition, you'll almost surely spend a lot more time thinking up your algorithm, implementing it and testing it than the time it'd take to re-use an existing algorithm.

Leave the design of algorithms to the algorithms designers. Programmers are consumers of their results. Programmers combine algorithms and put them to work on real-world tasks. A police officer need not be able to reinvent the law to be able to work, or to be a good officer.

I even encourage you to use implementations made by experts rather than implementing the algorithms yourself for any moderately complicated algorithm. It's more likely to be correct, chances are they made it faster than you ever will and it saves you a lot of time. This is particularly true for cryptographic algorithms, because you get the additional demand of security, which usually only experts can provide you.


问:
Java Vs .NET Vs Oracle(DBMS), Which technology is for Long Term Career?
I want to know about Which language is best for long term career and How?

Which language should I choose among Java and .NET Platform or Should I choose Oracle like DBMS Language (SQL/PLSQL)? I am confused?

Detailed answer would be appreciated.

答: Between database development(sql/plsql) and normal development(.net/Java) go for the one suits better to you. If you choose normal development, choose any of .net and Java. Consider switching if situation requires.</p>


答:
James, before picking a role model (for any field), you need to look at what you enjoy. If it's Java, then what aspect of Java is it that interests you? Mobile computing, distributed computing etc? Sit down and pencil what you enjoy as a developer and where you'd like to be in 10 years time as a ramification of what your doing. At this point, start looking at people out there that are doing it already and doing it well.

My role models have changed through time, but I've always gravitated towards individuals who challenge conventional thinking, they don't accept things as they are and constantly look for improvement (Richard Stallman is one example imho), not only for their own gain, but for their colleagues too. Admittedly, I get tired of people who utter "Spolksy says..." like it's gospel. Joel Spolsky has done some really good things in his career, but you should not blindly accept anything that's uttered from him or from anyone else for that matter. Nothing is gospel, use the information as part of your decision making as opposed to your religion.

As well as positive role models, you should have anti-role models; people you don't want to emulate. In my case,  I've listened to developers in conference calls talking to customers about JPanels, device drivers, OEL etc and the usual reply is "Can I get that in English please?". I'd say that's not an exemplary demonstration of how to talk to customers on the phone when pitching for work. If nothing else, it shows you live in a rather restricted world.

Title: Scaling yourself up against a better programmer/role model?

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


答:
I personally describe a code as 'robust' which has this one, important attributes:

If my mom sits in front of it and work with it, she can't break the system

Now, by break I mean either getting the system into an unstable state, or causing an UNHANDLED exception. You know, sometimes for a simple concept, you can make a complex definition and explanation. But I'd prefer simple definitions. Users are pretty good at finding robust applications. If the user of your application send you many requests about bugs, about state loss, about unintuitive workflows, etc., then there is something wrong with your programming.

Title: What defines robust code?


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

答:
There's no one right answer for this. However, you have to make it clear that these things take your time and so have to be paid for in some way. Where the cut off between something that's trivial for you to do and something that will take a significant amount of time is only something that you can really decide.

However, taking your examples as a starting point it might be better for you to build admin functions into your websites so that users can do these things for themselves. This means that they won't have to bother you and you can concentrate on creating new sites and new functionality.

It could be argued that the first (uploading a new logo) should have been in the site in the first place - but that's splitting hairs - tell them that you are going add this functionality at some point but it will cost them a small one-off amount. Otherwise you'll have to charge them each time they want these things doing.

Adding functionality for the second (analytics) sounds like it's a change in requirements so should be charged as a new development - or again you you'll have to charge for each request.

If you've done these things for free in the past then you'll need to tread more carefully, but if you introduce the idea that your time cost money they should understand. Also if you bring in a couple of changes at the same time (e.g. the ability to upload a new logo) then they should see the benefit of this approach.


答:
Two things:

Every application should have a section for super users who can manage it. This section is usually called management or admin, and users with enough privilege can log into it and upload the new logo or see the online users or anything of this sort. Your application probably doesn't have this section. You can make a contract to build this section, or:

You can add up all these minutes till the sum gets big enough to become chargeable (for example, 2 hours).

But please, don't work for free, not because what you earn from an hour of work is a noticeable amount, but because this behavior causes customers to think that providing free support service is just a must in development field.

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

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


答:
I watched that video, and I think you may be taking the wrong lesson from it. Comparing yourself against role models is just one way of getting instant feedback on your performance, and a pretty subjective one, at that. What you need to decide is, "what aspect of my performance would I like to work on?", then "how can I measure my success in that area?", then "how can I change my technique to improve my results?"

For example, though I didn't consciously put it into a framework like this, years ago I started looking to see how often I needed to change code that I had thought complete, with the aim of reducing that time. I observed that I spent a disproportionate amount of time maintaining code that shared state with other threads, so I started trying to reduce how much state was shared with other threads, and my results improved. This fits into the model I described, and fits into the model I think Foer described in that video, but did not require a role model or mentor.


答:
Neogitiate a maintenance/support contract or make them buy time-contingents. It's as simple as that.

Have statistics on the average amount of time you spend per month and then hand them a simple maintenance contract. That's fair.

If they don't want a contract or don't want to buy time-contingents, then charge them every once in a while for a minor task when some time has been accumluated.

However, I also agree with giving them some freebies if you have been paid generously for development. I also give our customers a small freebie every now and then to improve the relationship.


答:
Actually your code is not more robust but LESS robust. The final else is simply dead code that you can't test.

In critical software such as in spacecrafts, dead code and more generally untested code is forbidden: If a cosmic ray produces a single event upset that in turn makes your dead code being activated, anything is possible. If the SEU activates a portion of robust code, the (unexpected) behaviour stays under control.

Title: What defines robust code?


答:
There is no agreed upon definition of Robust Code, as for many things in programming it's more or less subjective...

The example your professor gives depends on the language:

In Haskell, a Boolean can be either True or False, there is no third option

In C++, a bool can be true, false, or (unfortunately) come from some dubious cast that put it in an unknown case... This should not happen, but may, as a result of a previous error.

However, what your professor is advising obscures the code by introducing extraneous logic for should-not-happen events in the middle of the core program, so I will point you, instead, toward Defensive Programming.

In university case, you could even augment it by adopting a Design By Contract strategy:

Establish invariants for classes (eg, size is the number of items in the data list)

Establish pre-conditions and post-conditions for each function (e.g., this function may only be invoked with a being less than 10)

Test each of those at the entry and exit points of each of your functions

Example:

```<code>class List:
  def __init__(self, items):
    self.__size = len(items)
    self.__data = items

  def __invariant(self):
    assert self.__size == len(self.__data)

  def size(self):
    self.__invariant()

    return self.__size

  def at(self, index):
    """index should be in [0,size)"""
    self.__invariant()
    assert index >= 0 and index < self.__size

    return self.__data[index]

  def pushback(self, item):
    """the subsequent list is one item longer
       the item can be retrieved by self.at(self.size()-1)"""
    self.__invariant()

    self.__data.append(item)
    self.__size += 1

    self.__invariant()
    assert self.at(self.size()-1) == item
</code>```

Title: What defines robust code?

Body:
There is no agreed upon definition of Robust Code, as for many things in programming it's more or less subjective...

The example your professor gives depends on the language:

In Haskell, a Boolean can be either True or False, there is no third option

In C++, a bool can be true, false, or (unfortunately) come from some dubious cast that put it in an unknown case... This should not happen, but may, as a result of a previous error.

However, what your professor is advising obscures the code by introducing extraneous logic for should-not-happen events in the middle of the core program, so I will point you, instead, toward Defensive Programming.

In university case, you could even augment it by adopting a Design By Contract strategy:

Establish invariants for classes (eg, size is the number of items in the data list)

Establish pre-conditions and post-conditions for each function (e.g., this function may only be invoked with a being less than 10)

Test each of those at the entry and exit points of each of your functions

Example:

class List:
  def __init__(self, items):
    self.__size = len(items)
    self.__data = items

  def __invariant(self):
    assert self.__size == len(self.__data)

  def size(self):
    self.__invariant()

    return self.__size

  def at(self, index):
    """index should be in [0,size)"""
    self.__invariant()
    assert index >= 0 and index < self.__size

    return self.__data[index]

  def pushback(self, item):
    """the subsequent list is one item longer
       the item can be retrieved by self.at(self.size()-1)"""
    self.__invariant()

    self.__data.append(item)
    self.__size += 1

    self.__invariant()
    assert self.at(self.size()-1) == item


答:
Robust code is simply code that handles failures well.  No more, no less.

Of failures, there are many types: incorrect code, incomplete code, unexpected values, unexpected states, exceptions, resource exhaustion, ....  Robust code handles these well.

Title: What defines robust code?


问:
How to make models do more than setting and getting data and validation
I am asking this question because after developing a few small custom cms solutions in a framework, I developed the idea that Models can be easily substituted with ORMs which ease up the task of validating, getting and setting data, as thats all they are needed for.

I recently got an order for a complex custom client management solution. After researching a bit on how to proceed on it, I found this:

http://blog.astrumfutura.com/2008/12/the-m-in-mvc-why-models-are-misunderstood-and-unappreciated/

Now the idea is not new as thats what i had read about the MVC approach, models handle the business logic. But I am finding it hard to plan out an approach in which Models handle the business logic and are classes which are complete in themselves because of the type of work i have gotten used to.

Please help me out here by explaining the idea and pointing me to some examples, articles etc

答:
You should read more about Domain Driven Design. Basically you try to capture the requirements of the business into a pure model (in oop mostly object models) which can do all necessary business logical tasks. This model can then be invoked from an application layer (e.g. the view or the controller in MVC, in MVP you call it and adjust it for the GUI in a Presenter). The model should also be as ignorant of persistence and other technical things as possible.

Encapsulating the business logic in such a domain model has some great advantages:

Reusability

Ease of use and extension

Generally leads to a better architecture

It clearly communicates coherences and the business requirements ...

... and thus improves communication between developers, customers, analysts etc.

I recommend Eric Evan's book on Domain Driven Design for further reading, as it will point you in the right direction and give you some good examples on where to put which logic. I bet that by the time you've read it, a large percentage of your entities will contain more than flat data.

But I am finding it hard to plan out an approach in which Models
  handle the business logic and are classes which are complete in
  themselves.

I assume, that by model you're mostly referring to entities in this context. Putting business logic/behaviour in the entities is not a trivial task. But you should always think about what an entity is and what an entity does. Does it have some responsibilities or behaviours? Sometimes it's ok to have flat entities if behaviours or responsibilities are better expressed as services.

Suppose you have an animal. While its attributes can be saved flatly to a database, it has some behaviour, too. It needs to eat. But a herbivore won't eat meat, so you've got to make sure it'll show its behaviour when the programmer wants it to consume meat by force. It can move and it can make it's own unique noise. These are some things that should be modelled into the entity for example. You sure wouldn't rely on procedural services to make those animals eat, move or make their noise.

But all examples are shallow without a concrete business domain. So think about your business domain and about its entities, behaviours and responsibilities. An other business domain may contain entities which look much the same to an outsider, but are indeed something entirely different or show a totally different behaviour. The model needs to first and foremost depicture the domain of its users as accurate as possible.


答:
The more pertinent question is why?:

Stop measuring yourself to others.  Go solve problems, everything else just becomes a side effect :)


问:
How to implement DRY principle when using 'using' keyword?
Consider these methods:

```<code>public List<Employee> GetAllEmployees()
{
    using (Entities entities = new Entities())
    {
        return entities.Employees.ToList();
    }
}

public List<Job> GetAllJobs()
{
    using (Entities entities = new Entities())
    {
        return entities.Jobs.ToList();
    }
}

public List<Task> GetAllTasksOfTheJob(Job job)
{
    using (Entities entities = new Entities())
    {
        return entities.Tasks.Where(t => t.JobId == job.Id).ToList();
    }
}
</code>```

Using block is the same and has been repeated 3 times here (of course, more than 100 times in the real application). How is it possible to implement DRY (Don't Repeat Yourself) principal for using block? Is it considered a breach of DRY principal at all?

Update: I'm not talking about what has been implemented inside the using block. What I actually mean here, is the using (Entities entities = new Entities()). This line is repeated 100 times or more.

答:
Since you're creating and destroying the same disposable object over and over, your class is itself a good candidate for implementing the IDisposable pattern.

```<code>class ThisClass : IDisposable
{
    protected virtual Entities Context { get; set; }

    protected virtual void Dispose( bool disposing )
    {
        if ( disposing && Context != null )
            Context.Dispose();
    }

    public void Dispose()
    {
        Dispose( true );
    }

    public ThisClass()
    {
        Context = new Entities();
    }

    public List<Employee> GetAllEmployees()
    {
        return Context.Employees.ToList();
    }

    public List<Job> GetAllJobs()
    {
        return Context.Jobs.ToList();
    }

    public List<Task> GetAllTasksOfTheJob(Job job)
    {
        return Context.Tasks.Where(t => t.JobId == job.Id).ToList();
    }
}
</code>```

This leaves you only needing the "using" when creating an instance of your class. If you don't want the class to be responsible for disposing the objects, then you could make the methods accept the dependency as an argument:

```<code>public static List<Employee> GetAllEmployees( Entities entities )
{
    return entities.Employees.ToList();
}

public static List<Job> GetAllJobs( Entities entities )
{
    return entities.Jobs.ToList();
}

public static List<Task> GetAllTasksOfTheJob( Entities entities, Job job )
{
    return entities.Tasks.Where(t => t.JobId == job.Id).ToList();
}
</code>```

Body:
Since you're creating and destroying the same disposable object over and over, your class is itself a good candidate for implementing the IDisposable pattern.

class ThisClass : IDisposable
{
    protected virtual Entities Context { get; set; }

    protected virtual void Dispose( bool disposing )
    {
        if ( disposing && Context != null )
            Context.Dispose();
    }

    public void Dispose()
    {
        Dispose( true );
    }

    public ThisClass()
    {
        Context = new Entities();
    }

    public List<Employee> GetAllEmployees()
    {
        return Context.Employees.ToList();
    }

    public List<Job> GetAllJobs()
    {
        return Context.Jobs.ToList();
    }

    public List<Task> GetAllTasksOfTheJob(Job job)
    {
        return Context.Tasks.Where(t => t.JobId == job.Id).ToList();
    }
}

This leaves you only needing the "using" when creating an instance of your class. If you don't want the class to be responsible for disposing the objects, then you could make the methods accept the dependency as an argument:

public static List<Employee> GetAllEmployees( Entities entities )
{
    return entities.Employees.ToList();
}

public static List<Job> GetAllJobs( Entities entities )
{
    return entities.Jobs.ToList();
}

public static List<Task> GetAllTasksOfTheJob( Entities entities, Job job )
{
    return entities.Tasks.Where(t => t.JobId == job.Id).ToList();
}


答:
Price is defined roughly by

What your customer will pay for a thing or service

Who can provide that service at a given price

So, charge what it's worth to the customer.  If you gouge them, then you risk that they may take future business elsewhere at contract renegotiation time, but you have a strong advantage of being the current service provider / incumbent.  Don't underestimate how strong this is- finding a new supplier is usually a complicated process that most businesses avoid if they can.  They can't switch companies as easy, so they'll be willing to pay more.  Don't think for a second that if they could get the same service you provide for less money with a seamless transition that they wouldn't drop you!

The point is: just because something takes you 5 minutes does not mean it's worth a pittance.  That's called profit (and sole-valuation based on hours worked is called communism).

In your particular case I'd charge monthly for metrics (want a metric? pay for a month of service that gets you X many of Y kind of reports either on demand or on a schedule).  For the site upgrade/logo swap I'd charge that as a discrete activity since a smart company isn't going to change its brand logo very often.


答:
My girlfriend has a hair dresser who insists that she comes back for free 5 minute bang trims whenever her bangs grow too long (much more often than a full hair cut).  She loves her hair dresser, recommends him to friends, and tips him well whenever she needs her bangs trimmed.

Perhaps you can exploit this model.


问:
Why and when should I make a class 'static'? What is the purpose of 'static' keyword on classes?
The static keyword on a member in many languages mean that you shouldn't create an instance of that class to be able to have access to that member. However, I don't see any justification to make an entire class static. Why and when should I make a class static?

What benefits do I get from making a class static? I mean, after declaring a static class, one should still declare all members which he/she wants to have access to without instantiation, as static too.

This means that for example, Math class could be declared normal (not static), without affecting how developers code. In other words, making a class static or normal is kind of transparent to developers.

答:
I'm surprised no one else has mentioned that static classes allow extension methods - safely extending an existing type (including adding method definitions to interfaces) that you don't own. For instance, what in Scala is

```<code>trait MyFoo {
  def foo: Int
  def plusFoo(a: Int) = foo + a
}
</code>```

may be expressed in C# as

```<code>public interface IMyFoo {
  int Foo();
}

public static class MyFooExtensions {
  public static int PlusFoo(this IMyFoo f, int a) {
    return f.Foo() + a;
  }
}
</code>```

Body:
I'm surprised no one else has mentioned that static classes allow extension methods - safely extending an existing type (including adding method definitions to interfaces) that you don't own. For instance, what in Scala is

trait MyFoo {
  def foo: Int
  def plusFoo(a: Int) = foo + a
}

may be expressed in C# as

public interface IMyFoo {
  int Foo();
}

public static class MyFooExtensions {
  public static int PlusFoo(this IMyFoo f, int a) {
    return f.Foo() + a;
  }
}


问:
Compute costs of bad code
I am looking for arguments to convince management to invest effort into refactoring.

We log work using Jira and relate every svn-commit to a jira call.

My idea is to do the following:

manually spot an area of code which is extremely bad implemented, but often used: both from User-POV and of Developer-POV (bugfixes)

get the svn-commits which contain the JIRA-Issues

filter the issues according to some criteria (issue type, version, prio. etc...)

compute the time/effort spent on these bugs

estimate efforts and risks of refactoring

present the numbers and ask for effort to fix it.

What do you think of this? Would such a measurement be useful and/or convincing? What are the Pros and Cons?

答:
Keep in mind that refactoring introduces bugs as well (which you will catch in your testing, but nonetheless are bugs and must be fixed).  Don't pull a Netscape on accident.  It depends on your personal definition of "refactoring."  To some, this means "rewrite all the code" to others it means "change some internals."  How do you tell what kind you are?  Ask yourself the following question:

Am I changing the public interface at all?

If the answer is yes, you are doing redesign.  If the answer is no, you are doing refactoring and can probably just do it along the course of your daily activities without special approval.  This is relevant to your question because a redesign will generate many more bugs, while a refactoring is usually easier to perform (since your tests will already exercise the public interface and will not themselves need to be modified).

It is a difficult case to make, because no one ever knows how much X would have cost with or without the refactor that was done a year ago.  In my experience the pragmatic managers always shoot this kind of thing down because:

No direct revenue stream comes from the effort (financial cost, not billable)

Ugly working code is still working code, you risk creating problems instead of fixing them (potential quality cost)

Other projects will be delayed while you refactor (time cost)

Title: Compute costs of bad code


答:
These "5 minute changes" often involve more work than one would think. OK, changing a logo is easy, but are you sure there aren't more versions of that logo lurking around the application? What if the size they give you isn't right? What if they change their mind 4 hours later? All this stuff adds up. It can come back and bite you hard no matter how well you know your application.

If they need a change, clients should be willing to pay for it. By giving it out for free or for a very low cost, it could encourage these clients to not value your time as much as they should. Future RFQ's might get sloppy if they think that they they can just hit you up for nickel and dime changes as needed. In the end it hurts everyone involved.

Another way to think about is that the time you actually spending making a change is worth something. However, so is the ability to make it at a moment's notice at the whim of the client. I can't imagine even the most trivial change being worth less than 1-2 hours of your time. If something is so trivial it is not worth "pocket change" from a company's point of view, it probably isn't worth doing anyway (and yes, "pocket change" is a few hundred bucks).


答: I would do occasional tiny changes for free, but make it very clear that the free maintenance is only because the changes they are asking for are tiny and infrequent, and that if they need bigger or more frequent changes then you will have to start charging a maintenance fee.</p>