答:
My experience working with extremely complex business logic and a domain expert is that the time of the domain expert tends to be extremely valuable, even more so in a small sized company.

He is of course rattling off endless details and nuances to you because it comes naturally to him for one, and secondly because he is likely an extremely busy person.  These types of people don't like to have to repeat themselves.

I know this sounds strange but get a decent digital voice recorder like the kind a journalist might carry around with them.  Have a sit down and just let him brain dump.  While he is talking take notes but only write down the Main Points.

When you are done, tackle a single point at a time and replay the audio sections to recap all of the details that you missed.  If you are not an aural person you can dictate the conversation into text or if your office has a secretary or administrative assistant that you are allowed to utilize then ask her to copy the conversation into a textual document for you.

This is the best way in my opinion and you will find that the domain expert will be much more clear and descriptive knowing he/she is being recorded, just make sure he/she is comfortable with this before you do.  Further the weekends play havoc on your short term memory, you will come in on Monday and forget critical pieces of information forcing you to bug the domain expert with nagging questions that he has already been over.

Only then when you have the raw information can you formulate use cases and user stories.


问:
Planning to write research paper - Tips or resources?
I am a junior in high school and I've developed an optimization system for functional languages that could be very powerful.  My computer science professors at Boise State University believe I should write a paper and take my idea as far as I can.

I've formalized my method, but I haven't had an expert look at it rigorously.  I'm also being careful to retain intellectual property safety, so my options are a little limited.

Where should I start?  I have implemented the optimizer in Haskell (it doesn't actually compile and generate code, but it demonstrates the concept).  I'm thinking that I need to finish the research paper focusing on the system itself and see if I can publish it to a journal.

The doctor specializing in compiler optimizations at BSU said I might be able to present at Apple because I was planning to generate code with LLVM, which they want to encourage interesting projects for and demonstrate its versatility.  This sounds like an exciting prospect, but I'm guessing writing a research paper comes before that.

I feel slightly overwhelmed.  I'm not sure if I should implement the compiler further to lend my paper credibility, or see if the idea takes off and gather a small community to fully implement it.  I'd write the research paper (I have the methods section done), but I'm no expert at research papers, and I might need someone who knows about compiling functional languages that I can trust to look at it.  Also, I'm worried that I'll be discriminated for my age (I'm 16 years old).

What are some good resources on writing research papers, particularly computer science ones?  Where should I start when I have it written?  How would I develop interest and a community to implement and expand my idea?

答:
My computer science professors at Boise State University believe I
  should write a paper and take my idea as far as I can.

Copy the question you have written on this site into an email to the professors that advised you to write a paper on your idea. They will have input far more applicable and much more reliable than anything you'll get here.

Anyone in academia is usually very positive and willing to help younger in-experienced students. Consider getting someone more senior to co-author the paper with you.

ContentLicense: CC BY-SA 3.0


答:
What are some good resources on writing research papers, particularly
  computer science ones?

Where should I start when I have it written?

How would I develop interest and a community to implement and expand
  my idea?

Answer:

My computer science professors at Boise State University believe I
  should write a paper and take my idea as far as I can.

Talk to "computer science professors at Boise State University".  Immediately.  Don't waste time with a  bunch of random strangers.  Talk to them.  Focus on them.

Title: Planning to write research paper - Tips or resources?

Body:
I am a junior in high school and I've developed an optimization system for functional languages that could be very powerful.  My computer science professors at Boise State University believe I should write a paper and take my idea as far as I can.

I've formalized my method, but I haven't had an expert look at it rigorously.  I'm also being careful to retain intellectual property safety, so my options are a little limited.

Where should I start?  I have implemented the optimizer in Haskell (it doesn't actually compile and generate code, but it demonstrates the concept).  I'm thinking that I need to finish the research paper focusing on the system itself and see if I can publish it to a journal.

The doctor specializing in compiler optimizations at BSU said I might be able to present at Apple because I was planning to generate code with LLVM, which they want to encourage interesting projects for and demonstrate its versatility.  This sounds like an exciting prospect, but I'm guessing writing a research paper comes before that.

I feel slightly overwhelmed.  I'm not sure if I should implement the compiler further to lend my paper credibility, or see if the idea takes off and gather a small community to fully implement it.  I'd write the research paper (I have the methods section done), but I'm no expert at research papers, and I might need someone who knows about compiling functional languages that I can trust to look at it.  Also, I'm worried that I'll be discriminated for my age (I'm 16 years old).

What are some good resources on writing research papers, particularly computer science ones?  Where should I start when I have it written?  How would I develop interest and a community to implement and expand my idea?


答: In addition to getting the support of your professors, I'd go ahead and learn LaTeX. There's even a stack exchange site for it. This tutorial should help. </p>


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

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

Has anyone been asked to do this before?

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

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

This isn't a reasonable request, is it?

UPDATE

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

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

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

答:
I would say that showing him this question and all the answers that you have got, would help him understand that he's being unreasonable! So try and ask him to see all the answers here, but of course in a non-offensive and respectful way. He'll understand the way developers work!

Additionally, I would say try and use diagrams, like a lot of people already mentioned. But again, do give serious thought to showing him the responses given here!

OwnerDisplayName: BIlly Moon


问:
Pass in single settings object vs multiple setter methods?
Working with C++.  Suppose I have a class BoxFilter.  The class is used to filter boxes which have properties such as height, width, depth, weight, etc.  The filter might have something like MaxWidth so that boxes with a width greater than MaxWidth would not pass the filter.  Usage would be something like (C#-style pseudocode):

```<code>IBoxFilter filter = new BoxFilter();

foreach(Box box in boxes)
{
  if(filter.PassesFilter(box))
  {
     // do something
  }
}
</code>```

(sorry for the C# example but I think it's easier to understand)

In setting up the filter object I need to configure the settings of the filter.  The filter currently has 7 properties although it could get more over time.  I'm debating whether the filter class should have multiple setters such as SetWidthMax(), SetWidthMinimum(), SetHeightMax(), SetHeightMinimum(), etc or should I create a BoxFilterSettings object/struct and then have a single method on the box filter class called SetSettings(BoxFilterSettings settings)?

答:
My experience with jQuery tells me that passing a settings object is much more easier than having many setter methods. However, jQuery can do that, because it supports object literal notation. In other words, you can very simply create an object on the fly with minimum code and pass it to a function.

C# couldn't do that till it introduced the concept o object initializer alongside the concept of anonymous types.

I don't know about C++ syntax. But if you should create a strongly typed object first, and declare parameters for each setting, then create an instance of that class, and then assign values to each property on a new line, to create a settings object, I think sticking with the single method would be more fine.


问:
N-Tiered Web App Using JQuery/ASP.NET Web Services
For fairly small, non-complex web applications, we have utilized jQuery to make asynchronous calls to an ASP.NET web service for interaction with our Sqlite data store. This has proven to be a pretty clean way to isolate the application tiers while taking advantage of the powerful client-side functionality of JQuery.

However, we are currently in the process of designing a larger application that consists of potentially hundreds of data elements. I am concerned that the sort of architecture mentioned above could get unwieldy pretty fast if we are passing hundreds of elements into the web service from a jQuery ajax post.

I was interested in others experience with this sort of design and whether you would recommmend another approach.

答:
Based on the information you provided, I think people can only advice, not provide an architecture:

Try to wrap jQuery functionality, specifically ajax part, because you may want to create a centralized place to do something later in your project (for example, to implement client-side redirection to login page on ajax calls, which is commonly known as session management with ajax)

Avoid Page Methods and stick with web services. The main purpose of Page Methods is that, they are miniature web services, scoped to the page. But in large applications, sooner or later, you need that method in another page too. Thus, try to use web services as much as you can.

One of the biggest problems of large web applications is that, they get bloated with tens of client-side libraries. You need and HTML editor, you add many libraries. You need JavaScript lazy loading, you add libraries. You need unit testing in JavaScript, you add libraries, and so on and so forth. In small projects, people accept to include every library in a master page, even if it's not used in one derived page. However, in large applications, you may come across a point in which, you have 20 js libraries on one page, from which you only use jQuery. You need to address this problem on a regular basis.

Another problem I personally have experienced is paths (URLs) to your web services in JavaScript. They can become a headache when you simply reorganize the file system structure of your project as it gets bigger and bigger. I recommend either change to MVC (so to get the URL of actions via Url.Action method), or to just create some kind of PathBuilder utility class to generate the URL of a web service based on some parameters.

Server architecture seems to not being touched that much with larger projects.


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

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

答:
1. Smalltalk

Designed originally at least in part as a way for children to use computers to learn. The syntax is simple enough to describe in a paragraph. It, like LOGO, exemplifies the "low barrier to entry, high ceiling" principle.

Smalltalk's a pure OO language in the sense that "everything is an object".

It also teaches many functional techniques, particularly in its Collection API: chaining messages, higher order functions, map, reduce, and so on.

The Squeak community is vibrant and welcoming. You'll also see many discussions of advanced techniques: much like the lisp community, there are many very experienced Smalltalkers on the mailing list willing to share their knowledge. (It doesn't hurt that the Squeak community has a large sub-population of professional educators.) There's also another list for beginners.

2. PROLOG

A logic programming language that will give you a very different view of computation to just about any other language. Prolog is also highly declarative (but not completely so: the ! or cut operator can have a significant semantic effect on a predicate).

3. Common Lisp

Substitute Scheme here if you like. Common Lisp is supports multiple paradigms, especially OO and functional. It also has a long history (Lisp is the second oldest still-widely-used language: only FORTRAN's older).

4. Haskell

(Caveat: I've only just started learning it.) Probably the purest functional language on the planet. It has a very advanced static type system. Handy intro books exist.

5. C or Delphi

You need to know how computers work. You need to know how memory and CPU actually function. Both of these are traditionally "close to the metal" and have communities that encourage thinking of how their language compiles to assembly.

Why this order?

Smalltalk's very easy to learn, so you can quickly start concentrating on solving problems rather than fighting a compiler ("low barrier to entry"). Once you start programming, there's also no artificial limit on what you can do - "high ceiling".

Once you have a fair idea of how OO works (and - with the proviso that there are MANY different understandings of what "OO" means - it's fair to say that OO dominates the marketplace), moving onto Prolog ensures that you don't start thinking that OO is the only way. Prolog is very different to most languages, and will stretch your mental muscles so you don't start thinking that you know everything.

Common Lisp, in turn, is a grown-up's language. It has a mature standard, it has been leading language design for decades (along with Smalltalk) - all those fancy new features your favourite language just acquired? Chances are the ideas incubated in either Lisp or Smalltalk. Common Lisp's also a bit warty, and you'll find wartiness everywhere you go.

Haskell's fourth on the list because (I'm told: I've only just started learning it) its purity means that some very common things (like I/O) are more difficult to do than in less purely functional languages. The Haskell folks also use some fairly exotic terminologies (words like "catamorphism", say), and you'd probably be better off with some programming experience under your belt before tackling it. (But I must re-iterate, I've only just started learning it! Take this opinion with a pinch of salt!)

And why C/Delphi last? Because unless you work in embedded systems, you really shouldn't have to learn programming thinking that manual memory management's all there is. Garbage collection worked well enough for a 1980s level machine. Your phone is that powerful!

Finally, I haven't put Erlang in the above list even though I really should.

ContentLicense: CC BY-SA 2.5


问:
Namespace and class name guidelines
I'm having problems naming my classes and services correctly when utils and other help classes are involved.

How would you structure the following:

```<code>EventService.cs
EventServiceUtils.cs
EventServiceValidators.cs
EventServiceCoordinator.cs
</code>```

etc...

I have multiple services with the same needs as the above service. One thought is to separate all of this into a suitable namespace, making it look something like this:

```<code>Services.EventService.EventService.cs //(the actual service)
Services.EventService.Validators.DateValidator.cs
Services.EventService.Validators.ParticipantValidator.cs
Services.EventService.Coordinators.ParticipantCoordinator.cs
Services.EventService.ExtensionMethods.Extensions.cs
</code>```

and so on. Every namespace is of course a separate folder. But this doesn't feel 100%, since there are probably more DateValidators in the other services, which can easily lead to an unwanted reference.

And also the Services.EventService.EventService.cs includes the class name in the namespace, which is no good either. You could use Services.Event.EventService.cs, but there is of course already an entity with that name.

This is the domain model.

答:
Why don't you read General Naming Guidelines and Namespace Naming Guidelines from Microsoft to follow a universal pattern?

I think the formula <Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>] just works fine.

OwnerDisplayName: Mattias

Title: Namespace and class name guidelines


问:
Can you write an unambiguous specification in a natural language like English?
It seems to me that you cannot possibly write a software specification in English that is completely free of ambiguities, simply due to the informal nature of natural language - and therefore that a truly unambiguous specification must include code written in a formally specified language.

Is this a known result or am I missing something?

答:
I'm a W3C follower guy, and I tend to write articles based on their specifications. My experience tells me that reading any specification without written example codes, is simply a headache.

I completely agree and I think the main reason is that, developers tend to read and understand code better. Just imagine you get a mathematical paper without any formula.

```<code>To calculate the result, simply add variable x to variable y,
and then divide that by the b factor.
</code>```

or:

```<code>result = (x + y) / b
</code>```

Which one is shorter? Which one is more readable? Which brings more comprehension with it?

The same is true about specifications. Many times, when you get to the technical parts, writing one line of code can clarify a lengthy paragraph of explanation.

Body:
I'm a W3C follower guy, and I tend to write articles based on their specifications. My experience tells me that reading any specification without written example codes, is simply a headache.

I completely agree and I think the main reason is that, developers tend to read and understand code better. Just imagine you get a mathematical paper without any formula.

To calculate the result, simply add variable x to variable y,
and then divide that by the b factor.

or:

result = (x + y) / b

Which one is shorter? Which one is more readable? Which brings more comprehension with it?

The same is true about specifications. Many times, when you get to the technical parts, writing one line of code can clarify a lengthy paragraph of explanation.


问:
Reasons for C++ Prototyping
I'm a beginning programmer, trying to get a grasp on everything, so pardon the probably mundane theoretical question:

I see in a C++ tutorial that prototyping is needed to let the compiler know that a function(?) is coming up and not to throw up any errors.  Why does it not search throughout a document to find the function it's looking for?

Maybe the question I'm asking is; what is the purpose for prototyping?  And can it be used in other languages?

答:
The reason is that you can use the function outside of the file where you implemented it. In this case searching throughout a document won't help because the compiler won't find it, yet it has to know the definitions of the function in order to enforce the typing and to encode the function name correctly for the linker to match it to the implementation.

It can be multilingual, C++ code can include direct calls to C functions (or any other language that adheres to C conventions when compiling the source code), which have to be declared as extern "C".

Title: Reasons for C++ Prototyping


问:
Should a design document contain a discussion of the pros/cons to a given design or should it focus on facts and rationale?
I'm currently in the process of updating a design document so that it is correct and up-to-date for future developers.

Currently, the document focuses on only the facts, presenting how the design is. There is no rationale for any decisions presented. I believe that it's important to capture rationale so that developers know why something is the way it is, as that will probably affect future decisions. It's not possible for me to add rationale for all of the design decisions, especially those made before I started working on the project, but I'm doing what I can in this department.

However, some of the design decisions are, respectfully, very poor decisions given the requirements of the project. There are some good ones, though, as well.

My initial thought was that I should include a discussion of design problems and potential solutions or workarounds to these problems to focus the attention of future maintainers, but I'm not sure if the design document is a place for this type of discussion and information. I don't want a design "critique" to snowball into "ripping this design a new one" as other people work on this system and update the document, as that is clearly inappropriate.

My manager would support either decision, so it's up to me. Regardless of the approach that I take, the document produced would be officially versioned and provided to developers working on the system, typically before they are tasked with development work. It's expected that a new developer familiarize themself with the documents associated with a given software system prior to beginning development work.

Questions:

Should a design document stick to raw facts ("this is the design") and rationale ("here is why this is the design") or should it also be used to point out non-defective issues with the design that could be problematic for future developers?

If the design document should not be used to capture this information, what type of document should capture it, and what else should be captured with a discussion of design rationales, tradeoffs, and known issues (that aren't defects, as defects are tracked using other tools)?

答:
Yes. A design document should explain the benefits, risks, and assumptions associated with the design being described. A design document has several purposes:

Get the design written down so that everybody understands it, and so that each person's understanding doesn't drift over time.

Communicate the design to non-technical people working on the project.

Assist in scheduling, resource allocation, cost estimation, and other kinds of planning.

Becomes an important part of the overall project documentation. When you join a project in progress, or have to maintain one that's been completed, life is a lot easier if there's a well-written design document.

Is often one of the deliverables required by contract.

(There are probably others, but these are a good start.)

Every one of these purposes is well served by a design doc that clearly explains why this design was chosen and what the associated risks are:

It's essential that everyone on the team know what the risks and benefits are so that they can work together to avoid those risks and make best use of the design's benefits.

For non-technical team members, understanding the risks and benefits is often more important than the particulars of the design itself.

Risk management is one of the most important things a project manager can do to ensure success, and the first step is to identify the risks that need to be managed. It should be up to a manager to decide how to deal with risks, but it's the responsibility of the designer to point out known risks of the design.

Even when a risk is no longer a problem, it's often useful to have it documented because it can help explain the situation at the time the design was created. That can let a maintainer decide something like: "Okay, they did it this way back then because... but that's no longer a problem, so I can replace that code with a simpler, faster implementation." Same goes for benefits, of course.

If you're working on a project for a client, then it's particularly important to document risks and benefits. That puts the client on notice that things could go wrong under certain circumstances, or that requesting changes to the design could jeopardize some of the promised benefits.

I gather from the question that you're working with an existing design document for a system that has already been implemented. In that case, many of the possible risks are no longer risks, so it doesn't make much sense to try to document them after the fact. However, you now have the advantage of hindsight as you can see the parts of the original design that didn't work out so well. I think you should either: add a separate section that identifies current problem areas and proposes solutions (including associated risks!); or create a separate document that does the same thing. This new section/document may evolve into the design document for the next version of the software.

Here's a blog entry on writing design documents that you may find helpful.


答:
Ambiguity is actually a strength in this context.

To explain why, let's assume for a moment that it is possible to use the English language in a completely unambiguous way, so that any problem that can be solved programmatically can be expressed completely and unambiguously. If we use this variant of English, and our description does indeed describe the program to be written completely and unambiguously, then it logically follows that is must be possible to perform an automated translation into the target programming language - in other words, the variant of English we have conceived is actually a programming language itself.

People who read design documents (especially functional designs) don't actually want this level of detail - reading a program's source, whether in C++, Java, or Unambiguous English, is way over the average non-programmer's head. This is where natural languages come in: they allow the writer of a specification to slide either way on the detail scale, moving irrelevant implementation details into subtext, or leaving them unspecified entirely. Natural languages are full of devices to convey meaning relatively clearly even though you are not providing an exact definition (which is part of what makes automated translations so hard).

So the goal is usually not a complete, correct and unambiguous spec; the goal is to write a spec that illustrates clearly, to humans, what you are about to build.

Whenever you do need correct and unambiguous, and things are getting technical anyway, pseudocode is often more valuable than either natural languages or rigid formal ones - it can still leave out irrelevant details (by calling unspecified functions / processes), but the structure is unambiguous.

Title: Can you write an unambiguous specification in a natural language like English?

Body:
It seems to me that you cannot possibly write a software specification in English that is completely free of ambiguities, simply due to the informal nature of natural language - and therefore that a truly unambiguous specification must include code written in a formally specified language.

Is this a known result or am I missing something?


问:
Plagued by indecision - how to choose technologies to use for projects?
I have always been fascinated with the newest and best technologies available.  I graduate from college this year, and over the course of the past few years, I have spent a lot of time learning new programming languages, web frameworks, Linux distributions, IDEs, etc., in an effort to find the best of each.

I have installed and played around with Ubuntu, Gentoo, Debian, Arch Linux, SUSE, VectorLinux, Puppy Linux, Slackware, and Fedora, I have spend a good amount of time in Vim and Emacs, and have played around with Visual Studio, Eclipse, NetBeans, gedit, and several more obscure ones.

I have played with all sorts of languages - I started with the common ones like C, Java, Visual Basic, but always heard that they were "bad" (for relative definitions of bad). I then discovered the scripting languages and have quite a bit of experience in PHP, Perl, Python, and Ruby. Then I heard that functional languages are where it's at, so I played around with Scheme, Lisp, Haskell, Erlang, and OCaml. I've played around with obscure languages like Forth and J. When I do web development, I go back and forth between frameworks and languages. Should I use plain PHP, Ruby on Rails, Django, CakePHP, CodeIgniter, Yii, Kohana, or make my own?

I have a very broad and shallow knowledge of computer science. As soon as I have learned a useful amount of one technology, I see something else shiny and go after it. My progression often goes like this: "Perl is better than PHP, but wait, Python is better than Perl. Oh, but now I see that Ruby has the power of Perl and it is cooler than Python. Well, now that I have seen a little of Ruby, it is too complicated. Python is cleaner. Oh, but it is too hard to deploy Python, so I should use PHP if I want to do real web development." And so on and so forth.

What  technology should I use for projects? Should I just pick one language/framework/IDE and sort of forget about the other things that are available for a while? I don't have all that much in the way of completed projects, because I never stay with something long enough to finish it.

答:
Stop bikeshedding and start programming.

This might sound cliche, but it's true: good tools don't make bad programmers good, and bad tools don't make good programmers bad (despite what Dijkstra says). You can spend 90% of your time bikeshedding over technology X vs. technology Y and get nowhere. Or you can choose X (or Y, it doesn't matter) and use it to do real work and get useful experience.

Just pick a set of tools and master them, even if they have some drawbacks.

Once you really master your tools (that is, do more than half a dozen projects in them), you can play with others to try them out. In fact, it's recommended that you do so; you don't want to be a zealot who sees all other opinions as wrong. And sometimes, you might decide that another tool is indeed worth it over your current tool.

If you can't decide what to choose on your own, a good way to end your inner debate is to let others choose for you. For example: Python, Django, jQuery, Vim and Debian. Now go and learn them.


问:
Injecting properties/settings into an application
In applications that I write at work, I often need to have an external properties/settings file so that certain parameters can be configurable after the application is deployed with the end-user. The file will usually be text or XML and I will usually be implementing in C++ or Java.

In the past, I have created Singleton classes to manage the injection of these properties/settings into my application. The class would be initialised with the path to a file, be hardcoded with the property keys it is looking for in the file, read it in and store all the attributes. Other classes in the application would then perform a call such as propertySingleton::getInstance().getMyParameter().

The more I read and learn about software engineering, and design, the more this approach feels clumsy and inherently wrong. I was wondering if anyone had to perform similar tasks, and how they would approach this in a well-thought object-oriented fashion?

答: a singleton is an appropriate use for a global service; i see nothing wrong with this approach</p>


问:
What are the advantages and disadvantages of the various git modes available for emacs?
I just started using git, and because I tend to live in emacs, I want to use one of the emacs integration packages.  Looking at this list, I see that there are a lot of packages available, but the blurbs for each of them don't explain very much about their capabilities, especially since I don't know git very well.

Which git modes for emacs have you used, and what are the advantages and disadvantages of each?

答:
I've tried to describe these changes in my article about Emacs/Git integration.

There are following major modes: git-emacs is basic mode, that provides access to most of commands, but sometime not so handy in use. Egg - good mode, but not actively developed (imho).  Magit - is most advanced comparing to other modes, and has modular architecture to extend it, so it possible to add different extensions, such as git-svn, etc. And it developed very actively with good community, documentation, etc.

All other modes are mostly add-ons to existing modes, or implement only limited functionality, that often available in other modes (for example, gitsum's functionality is available in magit)


答:
You first must establish the extent of the request. You have to make sure you’re not making the bossster-under-the-desk scarier than the monster actually is.

Is it more:
    //The method gets a customer.
Or more:
           // Some long detailed programming explanation including what is an int, what does ‘void’ mean, and includes math rewritten into English concepts?

Likely it is somewhere in-between.

If it turns out that the request is too extreme:

I would suggest you explain to your boss that while it seems like a small thing, programmers are not trained to either thing or express themselves in this manner, apart from in the most general sense of code. There are people who are trained to convey complex ideas to laypeople, they’re called technical writers.

One issue I think have not been addressed well, or at all. In order to do this, it should be done as the code is written. Is he aware of how much time this will eat up when trying to meet deadlines?

Given these types of comments should not be in the code, there is no good way or tool (that I am aware of) to make this work.

This is a maintenance nightmare. Even if some method is found to pull this off when generating code, once the code enters maintenance how would the comments be maintained?

If after a chat, if you believe your boss still does not get it, start looking for new jobs. The person who only has a single bat-shit crazy idea is rarer than a unicorn.

And if this person is opening code files, I hope you have some really good source control in place.

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

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

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

Has anyone been asked to do this before?

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

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

This isn't a reasonable request, is it?

UPDATE

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

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

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


答:
I started with egg as it was said it's a fork of magit with some "extra" features. It was quite good but some operations like clone, push, and pull had to be done using shell commands.

Then recently I've turned to magit because I've found out that it has nice handling of pushing and pulling. It reports what changes have to be pushed, and if some interaction occurred with a remote repository it reports that some changes are yet to fetch. Also it seems to be still under active development as opposite to egg which seems to be abandoned.

I'm quite happy with magit now, but I still sometimes fall back to the command line because I'm still learning it. Also I'm not an expert in git itself because I started to use it only a year ago.

Title: What are the advantages and disadvantages of the various git modes available for emacs?

Body:
I just started using git, and because I tend to live in emacs, I want to use one of the emacs integration packages.  Looking at this list, I see that there are a lot of packages available, but the blurbs for each of them don't explain very much about their capabilities, especially since I don't know git very well.

Which git modes for emacs have you used, and what are the advantages and disadvantages of each?


答:
I think something like Spring PropertyPlaceHolderConfigurer or an extension of it may be handy in such cases. Where on one side you don't make your class Singleton and it allows your class to be properly tested.

And on the other side, you mark your bean to be a singleton so that there will be only one instance of it at a time in the system.

Title: Injecting properties/settings into an application

Body:
In applications that I write at work, I often need to have an external properties/settings file so that certain parameters can be configurable after the application is deployed with the end-user. The file will usually be text or XML and I will usually be implementing in C++ or Java.

In the past, I have created Singleton classes to manage the injection of these properties/settings into my application. The class would be initialised with the path to a file, be hardcoded with the property keys it is looking for in the file, read it in and store all the attributes. Other classes in the application would then perform a call such as propertySingleton::getInstance().getMyParameter().

The more I read and learn about software engineering, and design, the more this approach feels clumsy and inherently wrong. I was wondering if anyone had to perform similar tasks, and how they would approach this in a well-thought object-oriented fashion?


问:
Single statement if block - braces or no?
Which is better/more generally accepted?

This:

```<code>if(condition)
{
  statement;
}
</code>```

Or:

```<code>if(condition)
  statement;
</code>```

I tend to prefer the first one, because I think it makes it easier to tell what actually belongs in the if block, it saves others from adding the braces later (or creating a bug by forgetting to), and it makes all your if statements uniform instead of some with braces and some without.  The second one, however, is still syntactically correct and definitely more compact.  I'm curious to see which is more generally preferred by others though.

答:
I use the braces method - for all the reasons above plus one more.

Code merges.  It's been known to happen on projects I've worked on that single-statement ifs have been broken by automatic merges.  The scary thing is the indentation looks right even though the code is wrong, so this type of bug is hard to spot.

So I go with braces - on their own lines.  It's easier to spot the levels that way.  Yes, it does waste vertical screen real estate and that's a genuine downside.  On balance though, I think it's worth it.


答:
Your singleton approach is quite good if:

you don't look up the configuration with an absolute path (using a relative path, or even better a class path you should be fine)

if you don't reinvent the wheel, and in Java you use an API for loading the properties such as the JDK Properties or Apache's powerful PropertyConfiguration

Also, a much better solution, if you are using an IOC framework such as Spring for example, as suggested by Ankit, then using the PropertyPlaceholderConfigurer is really a nice option since you just need to configure this singleton bean and you don't need to write any code.


答:
Having your objects 'call out' to a static singleton to get settings creates a dependency. It is no better than the 'service locator' anti-pattern.

I would invert that dependency by making the settings constructor parameters/properties, and having my IOC container supply them. That way the only thing that is explicitly dependent on "settings" is the object responsible for construction.

Most IOC containers provide the ability to configure dependencies using XML, so this might serve as a better configuration system. I use Autofac and a custom solution here:

http://www.paulstovell.com/convention-configuration


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

答:
I think it's super useful, and I always do it, but since the benefits have been covered so well I'm going to discuss only the (apparent) negatives.

I think code tests are fairly unlikely to give you false positives: the odds are low that someone who actually can't write code will manage to fake it in an interview, at least if you have a scale of questions of increasing difficulty.  (Perhaps the most likely scenario is they're cheating by asking a friend, if it's not a face-to-face interview.)

The problems are more on the false-negative side: will code tests lead you to reject the person who's actually the best candidate?

Stage fright

You may have someone who's actually a really good developer, but who is very nervous about this interview, and they get essentially stage fright.  Performing under pressure is important to some extent, but dealing with stage fright is not such a key part of being a programmer (compared to other professions), and it would be unfortunate to reject someone who suffers badly from it.  This can compound: if the person can't answer a question they know they ought to answer, they may get more up tight.  Or, as in this question, they feel they can't talk and code at the same time.

mitigation: Start off with some getting-to-know-you questions about their background, goals, etc, before you jump into technical questions.  Perhaps start with some easier technical questions so they get some momentum.  Don't be a dick during the interview (quibbling about semicolons etc).

It's a noisy measure

Interesting code questions might have more than one correct answer.  If one person writes a correct answer, and another writes a correct and more efficient answer, how much weight should you put on that?

To some extent this is like the problem with some "puzzle" questions: the person either has the insight or not and you get a nearly binary result.  Intelligence probably affects the probability of having that insight, but sampling only a few times gives you a crude measure.

This bothers me about code questions (though I still use them.)  The best mitigation I can think of is to as much as possible have a ramp of possible solutions: the person can at least write a crude brute force answer, or an answer for a part of the problem.  Realizing that's better than nothing is a good sign.  Then if they discover more, they can make it more efficient or more elegant code.  As much as possible, avoid asking questions that get binary responses.

It's not really representative

Programming isn't a job of solving ten-minute algorithmic problems one after the other: there's lots more work about understanding and designing larger systems and concentrating for extended periods of time, to say nothing of the interpersonal skills.  Code questions don't really test this.

But, code questions aren't the only questions you're going to ask: you can look at their background, their references, their open source work (if any), to find evidence of sustained effort, creativity, interpersonal skills.

Knowing how to solve small algorithmic problems and how to reduce them to code is a necessary but not sufficient condition: if you can't solve small problems and you can't write nontrivial code then all the big-picture thinking in the world is not going to make you a productive developer.

Anybody could solve that

No, apparently not.  As the famous FizzBuzz post points out, problems you might think are trivial trap not only new graduates but people with years of industry experience.  I don't know why.  Either the code test is a poor measure (which is possible, though I think it's unlikely), or they weren't contributing very much to the projects on their resumé, or they were getting a lot done by copying-and-pasting non-algorithmic code (which is possible.)

It's worth acknowledging that you really can get a lot done without writing any algorithmic code.  People make a lot of money on apps whose value is in the graphics or business logic not in what you might call "programming", and that's fine.  But, if you actually need programmers, it's not a good fit.

It may not be well calibrated

If you come up with a question, the answer may very well seem easy to you.  However, if you're asked any otherwise comparable question out of the blue, or a question that's not skewed towards your own particular interests and background, it may be much harder.

mitigation: Run the tests over some developers you already know, and see how they do.  Perhaps someone already on your team, who you know is very smart, will have trouble with one of them and you can consider adjusting it.  Perhaps they will think of a better or different answer.

It's too much like trivia

I think code questions certainly can get in to trivia, if you insist people know obscure APIs by heart, or get the syntax perfect, or remember the exact definition of a nontrivial algorithm.  Those are all reasonable to rely on docs, web searches, or compiler errors to pick up, and have little correlation with real expertise.  Not even knowing where the API's likely to be is perhaps a clue the person hasn't used it recently, but that's not necessarily a problem as long as they're not lying on their resumé.

So the answer to this is pretty simple: don't ask trivial questions and don't get hung up on trivial mistakes.  Remind the candidate what the API is called or let them look it up; fix up syntax errors; don't test for people memorizing data structure definitions.

How do you compare?

If you have two candidates and both answer the questions well, how do you pick between them?  You could choose the one who finished fastest, but perhaps there you start to pick hares over tortoises.  You could do another round and ask much harder questions but I'm not sure about that either.  Perhaps you just give them both an A+ and try to choose between them on other criteria (or try to find the money to hire both.)


答:
I agree with you about putting rationale in the design document.

Anyway,

in the process of updating a design document written by someone else, I would stay humble and not try to guess why such decision has been taken.

So,

I would insert rationale only about changes that are made in the design during maintenance.

Title: Should a design document contain a discussion of the pros/cons to a given design or should it focus on facts and rationale?

Body:
I'm currently in the process of updating a design document so that it is correct and up-to-date for future developers.

Currently, the document focuses on only the facts, presenting how the design is. There is no rationale for any decisions presented. I believe that it's important to capture rationale so that developers know why something is the way it is, as that will probably affect future decisions. It's not possible for me to add rationale for all of the design decisions, especially those made before I started working on the project, but I'm doing what I can in this department.

However, some of the design decisions are, respectfully, very poor decisions given the requirements of the project. There are some good ones, though, as well.

My initial thought was that I should include a discussion of design problems and potential solutions or workarounds to these problems to focus the attention of future maintainers, but I'm not sure if the design document is a place for this type of discussion and information. I don't want a design "critique" to snowball into "ripping this design a new one" as other people work on this system and update the document, as that is clearly inappropriate.

My manager would support either decision, so it's up to me. Regardless of the approach that I take, the document produced would be officially versioned and provided to developers working on the system, typically before they are tasked with development work. It's expected that a new developer familiarize themself with the documents associated with a given software system prior to beginning development work.

Questions:

Should a design document stick to raw facts ("this is the design") and rationale ("here is why this is the design") or should it also be used to point out non-defective issues with the design that could be problematic for future developers?

If the design document should not be used to capture this information, what type of document should capture it, and what else should be captured with a discussion of design rationales, tradeoffs, and known issues (that aren't defects, as defects are tracked using other tools)?


问:
Javascript, Text Annotations and Ideas
I am very curious to hear input from others on a problem I've been contemplating for some time now.

Essentially I would like to present a user with a text document and allow him/her to make selections of text and annotate it.  Specific to the annotations i aim to achieve the following:

Allow users to make a text selection, annotate it, then save the selection and annotation for reference later

(UI) Support representing overlapped annotations.  For example if the string where: "This is the test sentence for my example test sentence", user1 might have an annotation on "is the test sentence for my example" and user2 might have an annotation on "for my example".

Account for a situations where the document's text changes.  The annotations would to be updated, if possible.

How would you tackle this from a technical perspective?

Some ideas I've had are:

Use javascript ranges and store an annotation as a pair of integers something like: (document_start_char, document_end_char).  Save this pair in the db.

Alternatively, using JS get the text selected and actually save the full text in the db. (not sure how i would then do overlapping annotations)

Represent overlapped annotations by applying a css style to highlight the text then darken the "stack" of annotations where they overlap.  Smallest annotation would always have to be on the top of the "stack".

What are your thoughts or areas of improvement?  How the heck could I support a document's text being updated without breaking all the annotations?

答:
You might want to take a look at Open Knowledge Foundation Annotator [ http://okfn.org/projects/annotator/ ] for inspiration, javascript library (GPL or MIT) + couchdb backend...there's also co-ment.org, marginalia which do what you describe I think

@trevor - Rangy [ https://github.com/timdown/rangy ] - a cross-browser JavaScript range and selection library - may solve the IE range selection problem - there's also a position (x,y) module in development in the demos.

Title: Javascript, Text Annotations and Ideas


问:
"Do you have any questions for us?" In an interview
You know the prospective company fairly well but are asked "Do you have any questions for us?".  To show interest, what are some of your favorite questions to reply?</p>

答:
I keep a list with all those things I experience during my work which I would like to not encounter again at a new work environment. The list is getting larger and larger.

Most stuff the Joel Test asks for lead to natural questions.

Also I won't work again with less than two well-sized monitors and
expect overtime to be compensated!

Also I like coffee and want a decent machine in the kitchen, nothing
fancy but certainly not cheap either.

...

If you are good then you might end up with more than one offer and then you want to know where the actual differences are.


答:
The first step is to find a mentor available enough to coach you. This may be your professor or a friend PhD student.

Then write a report about what you found, what you already completed and what is still in progress.

This report must be reviewed by your mentor and then refined by you. It will be the base of all future work.

With your mentor, find a workshop where junior researchers have the opportunity to present their results to an audience. The most important part is the interactions with peers. Listen to their questions and their suggestions. This will help to guide your work. Keep contact with your new friends, they may be interrested in your progress.

With more ideas you will eventually be able to write a paper for a conference or a journal.


答:
What is the staff turnover?

High turnover means there is something wrong with the company.  Low turnover means it's probably a good place to work.

This wouldn't have occurred to me to ask until I was talking about previous jobs with a co-worker.  He'd worked at a place that had 3 to 4 developers leaving per month.  The longest-serving developer had been there for just 2 years.  The smart ones left after one or two months in the job.

Title: "Do you have any questions for us?" In an interview

Body: You know the prospective company fairly well but are asked "Do you have any questions for us?".  To show interest, what are some of your favorite questions to reply?</p>


答:
All the answers so far (which I read) didn't address the fact that the Joel Test is NOT (just) a best practice list for  entrepreneurs but a check list to ease your evaluation of a prospect employer.

The thing is ... if they thoroughly test their candiates then they probably hire people who know their stuff ... that means for you

less headache and also

the increased chance of learning something from your co-workors

instead of bug-fixing after them ...

Title: What are the pros and cons for the employer of code questions during an interview?

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


问:
What's the best way for me to get started using version control in an opensource project?
It was suggested that I take my project open source due to its size and my lack of skills, so I checked out Google Code, and started making a project and now it's asking me if I want the project to have Git, Mercurial, or Subversion code hosting.

I don't even know what code hosting is, and a search just confused me more with the debates between all these things, and this is made even worse as Google Code is asking me which type of license I want.

I think I'm not quite understanding what open source really means, can someone pretty much make a quick layman's cheat sheet on what all this is? Much appreciated.

Edit There have been a lot of great responses on these three versions of code hosting, but I think I failed to communicate the real question: Basically I've no idea how this open source stuff works, why would I host the code somewhere like this? And would that mean I have to take the site off of my current hosting, or is this an entirely different type of hosting? What happens when I make my site open source, what rights do I have, what rights do I give away. How does it work, do people just come and throw code at me for free? Perhaps these are stupid questions, and if that's the case then I guess I need stupid answers, I seriously have no idea what open source is, except for the concept of sharing code...

答:
Open source means anybody can read, copy, modify, and distribute your code. You should have a firm understanding of the implications of this before you proceed.  Perhaps you should read a book or at least browse the Wikipedia articles on the topic and/or http://opensource.org/ until you feel you have a grasp of the concept.

(The O'Reilly book Open Sources http://oreilly.com/openbook/opensources/book/index.html is helpful but perhaps not precisely what you are looking for.)

What source code control system to use is completely of a secondary importance.  You could copy/paste your code on a web page and be done.  Having said that, version control is important, and a good vehicle for lowering the bar for developers to contribute.  Any of the options offered by Google Code are fine; go with the one you like, or perhaps defer the question until you can ask your contributors which one they would like to use.

OwnerDisplayName: Nathan


答:
Making your code or project open source means that everyone can take it and modify it as (s)he wants. This depends on which type of license you choose to use, but in general open source means the source code is available to anyone to download it, modify it and use as they please.

Anyway this code needs to be reachable by other people in order to get it.

Taking your code to a public online repository such as GitHub is the best way to do it. First, your code is now accessible to the public. Then, since such services also offers Version Control, your code is project organized. You can keep track of changes you and other people make. Since it also allow branching (separating) the project into other different projects, you can keep track of all the different version other people made of your code.

This also ensures your code is stored in a safe place, you don't have to worry about it being lost by a faulty hard disk on your pc for example. And when you want to work at it, you can work from any place because your code is online, you can find it anywhere.

If you then decide it's time to show off your code to the world, it's just a matter of sending the link to your online project repository. It's a technology people are getting used to, so since everybody knows it, it's easier to understand how to download it, post messages, create different versions, etc.

It's like a common standard of doing things, common practice.

Some links you may find useful to further explain open source:

Open Source definition

Open Source License

GPL

Free Software Foundation

Title: What's the best way for me to get started using version control in an opensource project?

Body:
It was suggested that I take my project open source due to its size and my lack of skills, so I checked out Google Code, and started making a project and now it's asking me if I want the project to have Git, Mercurial, or Subversion code hosting.

I don't even know what code hosting is, and a search just confused me more with the debates between all these things, and this is made even worse as Google Code is asking me which type of license I want.

I think I'm not quite understanding what open source really means, can someone pretty much make a quick layman's cheat sheet on what all this is? Much appreciated.

Edit There have been a lot of great responses on these three versions of code hosting, but I think I failed to communicate the real question: Basically I've no idea how this open source stuff works, why would I host the code somewhere like this? And would that mean I have to take the site off of my current hosting, or is this an entirely different type of hosting? What happens when I make my site open source, what rights do I have, what rights do I give away. How does it work, do people just come and throw code at me for free? Perhaps these are stupid questions, and if that's the case then I guess I need stupid answers, I seriously have no idea what open source is, except for the concept of sharing code...


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

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

答:
No, it won't. The point of unit tests is precisely to test your code in isolation, independent of the external world.

Testing your whole system interacting with external parties like web services etc. is integration/system testing. This is also needed in most to all real world projects, but it is a different level than unit tests. Actually it sounds like in your situation, since you have difficulties in integration testing, you need unit tests even more than usual.

As a long term goal, you may consider educating and/or pestering said suppliers to set up a test environment for themselves and their clients. You may need to invoke your management's support for this to succeed though, so get prepared with hard facts and figures to convince them about the business value of a test environment.

Title: Should I unit test


答:
Basically, it is because C++ is a statically typed language. That is, all types are fixed at compile-time, none resolved at run-time. (Some features, like virtual functions, somewhat weaken this principle, but do not invalidate it.)

In order to accept any identifier, be it a type, constant, variable, function, whatnot, the compiler needs to know the exact type of that identifier. That type is introduced by a declaration. The compiler uses this to check whether the identifier is used appropriately according to its type. This prevents you from incrementing a floating point variable, changing a constant, invoking a member function on an object of a class that doesn't have that member function, and call a function with the wrong number and type of arguments.

Later, the linker will link all references to a certain identifier to the definition of it. (So it has to be defined somewhere, and it has to be defined exactly once.) Now, every definition can be used in place of a declaration, so you could get away without declaring anything at all, if you defined everything before its use.

However, this does have serious drawbacks, the most obvious ones being that it would abandon separate compilation and leaves you no way to define two or more identifiers that reference each other.

Title: Reasons for C++ Prototyping

Body:
I'm a beginning programmer, trying to get a grasp on everything, so pardon the probably mundane theoretical question:

I see in a C++ tutorial that prototyping is needed to let the compiler know that a function(?) is coming up and not to throw up any errors.  Why does it not search throughout a document to find the function it's looking for?

Maybe the question I'm asking is; what is the purpose for prototyping?  And can it be used in other languages?


答: To support the "Header file" mechanism. This is applicable to C also. We implement functions, and their signatures or prototypes are exposed to external users through header files.</p>

Title: Reasons for C++ Prototyping


答:
These are aside from technical questions which have been already given...

General questions

Who will I be reporting to?

How many people are in the team?

How would you describe the daily duties within this position?

What training would I be given?

What is the company’s policy towards training?

What promotional prospects are there?

How frequent are the performance reviews?

What areas do you focus on in performance reviews?

How does one advance in the organisation?

How long will it take before you expect me to be fully competent?

What would my exact duties be?

How much decision-making authority will I have?

Will I be responsible for prioritizing my own work or will it be prioritized for me?

What resources are available to this position to achieve primary goals?

If I am hired and am successful, what will I have accomplished at the end of three months? One year?

The company

What are the benefits of working for this company?

Do you have any sports and social activities?

Is the company growing? If so, where is growth coming from?

Are there any plans for expansion or reduction in staff?

How is one judged? What accounts for success?

Could you describe your company's management style and the type of employee who fits well with it?

What do you find most frustrating about your position


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

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

Has anyone been asked to do this before?

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

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

This isn't a reasonable request, is it?

UPDATE

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

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

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

答:
Ideally, every code should be readable and understandable to either your colleagues or your boss. If your boss wants this, your code isn't expressive enough, it doesn't communicate your intent well enough. Don't narrate your code, write your code so that it resemble an English narration as much as possible! See Domain Specific Languages (DSLs) for details.

Some links:

Oh, The Methods You’ll Compose

Overcoming The Impedance Mismatch Between Source Code And Architecture


问:
Programming as a conversation
I have often wondered if it would be possible to write a programming language that would work as a conversation. I would tell the computer that I want to store coordinates and it would ask what representation I would use. I would then ask to find the shortest path between points and it would ask if I want to use Djkstra's, brute force or use Floyd's? What research has been done towards producing a system like this?</p>

答:
I think such a language would need an artificial intelligence in place, or at least a system that can learn.

The problem is that humans don't know what they want.

Also, even writing in classical imperative language we still make logical errors. Imagine trying telling a non-intelligent software what he has to do.

Title: Programming as a conversation


答:
If you are feeling brave, ask "Why shouldnt i work here?"
No place is perfect, and if you know beforehand what the bad buts of a job are, then you are more likely to last.

NWS


问:
Don't like my current job, want to leave, how to explain this in a job interview?
A few years ago I immigrated to another country and early last year I managed to get my master's degree. Back then I was desperately looking for a job and I was fortunate to get offered a job in a small software development company. For the record, back in my home company, I was a well-known developer with a very good track record and I used to work as a senior developer and team leader for a software development company.

Now after more than 1 year, for both technical and non-technical reasons I want to leave my current job. I can tolerate some of the technical problems we have but our manager and team leader are constantly disrespecting me and communicate with me in an offensive and belittling manner and for times and times this has made me feel depressed, anxious, stressed, and what not.

Now my question is, how should a person in my situation, respond to "why are you leaving your current job?". Obviously I cannot say "because my manager is a psycho who is disrespecting me and offending me all the time and I have had enough". How do you think I should respond to questions like this?

答: It's important to be honest in situations like these but you also don't want to seem petty. Don't go into too much detail but explain that your current manager isn't professional and you don't feel respected in the company. Give one quick (not too extreme) example of how they have been unprofessional in the past.</p>


答:
Don't mention the manager issues.

Say you wanted to expand your horizons, work in more challenging workplace with more career potential or some such.

Title: Don't like my current job, want to leave, how to explain this in a job interview?

Body:
A few years ago I immigrated to another country and early last year I managed to get my master's degree. Back then I was desperately looking for a job and I was fortunate to get offered a job in a small software development company. For the record, back in my home company, I was a well-known developer with a very good track record and I used to work as a senior developer and team leader for a software development company.

Now after more than 1 year, for both technical and non-technical reasons I want to leave my current job. I can tolerate some of the technical problems we have but our manager and team leader are constantly disrespecting me and communicate with me in an offensive and belittling manner and for times and times this has made me feel depressed, anxious, stressed, and what not.

Now my question is, how should a person in my situation, respond to "why are you leaving your current job?". Obviously I cannot say "because my manager is a psycho who is disrespecting me and offending me all the time and I have had enough". How do you think I should respond to questions like this?


答:
From my limited experience I would say be honest but phrase it in a professional way, so say things such as, “I disagreed with some of my manager’s decisions at a technical level, but I know that those decisions had to have nontechnical issues factored into them.” and so on.

Don't moan or appear over-critical/personal as that will not help you at all.


答:
People have said "there is no correct language to choose" but you might want to take some criteria into consideration when you are choosing one. For example, I've run into problems in the past having developed a large project in Rails, finding that at the time it was pretty hard to find anyone hosting Rails and ending up having to do a lot of server configuration and setup myself. So depending on what you are planning to build, you may find value in considering the kind of performance you're going to need, whether it's going to need to be hosted and if not whether it's going to have any pre-requisites that need to be installed on your end user's machine in order for it to work. If you are aiming to target a particular platform, which platform will it be? If you're planning to be cross-platform that will affect which libraries and languages you choose.

Thinking through what you're going to be doing and how you expect it to work can be a very useful guide to what language you want to be working in.

Title: Plagued by indecision - how to choose technologies to use for projects?

Body:
I have always been fascinated with the newest and best technologies available.  I graduate from college this year, and over the course of the past few years, I have spent a lot of time learning new programming languages, web frameworks, Linux distributions, IDEs, etc., in an effort to find the best of each.

I have installed and played around with Ubuntu, Gentoo, Debian, Arch Linux, SUSE, VectorLinux, Puppy Linux, Slackware, and Fedora, I have spend a good amount of time in Vim and Emacs, and have played around with Visual Studio, Eclipse, NetBeans, gedit, and several more obscure ones.

I have played with all sorts of languages - I started with the common ones like C, Java, Visual Basic, but always heard that they were "bad" (for relative definitions of bad). I then discovered the scripting languages and have quite a bit of experience in PHP, Perl, Python, and Ruby. Then I heard that functional languages are where it's at, so I played around with Scheme, Lisp, Haskell, Erlang, and OCaml. I've played around with obscure languages like Forth and J. When I do web development, I go back and forth between frameworks and languages. Should I use plain PHP, Ruby on Rails, Django, CakePHP, CodeIgniter, Yii, Kohana, or make my own?

I have a very broad and shallow knowledge of computer science. As soon as I have learned a useful amount of one technology, I see something else shiny and go after it. My progression often goes like this: "Perl is better than PHP, but wait, Python is better than Perl. Oh, but now I see that Ruby has the power of Perl and it is cooler than Python. Well, now that I have seen a little of Ruby, it is too complicated. Python is cleaner. Oh, but it is too hard to deploy Python, so I should use PHP if I want to do real web development." And so on and so forth.

What  technology should I use for projects? Should I just pick one language/framework/IDE and sort of forget about the other things that are available for a while? I don't have all that much in the way of completed projects, because I never stay with something long enough to finish it.


问:
What is ideal range (Min and Max date) for Calendar backup?
I need to take backup of calendar on my phone. We have requirement that we need to take backup of entire calendar data. Now, phone always supports recurring events. So, event may exist from 01-01-1601 to 31-12-3000. Logically, there is no point of taking backup from 01-01-1601 to 31-12-3000.

I just want to know your views on the ideal range for the same.

答:
Can't you record the recurring event once and the period of recursion?
For non-recurring events, you can record them all.</p>


答:
Ideal range == the maximum existing range. The backup will likely contain only existing events, so e.g. if you only have a single event in your calendar at 2011-09-09, it doesn't matter where the possible range begins and ends. As for recurring events - do you have your schedule booked all the way up to year 3000? That seems a bit...too optimistic, IMHO.

Logically, there's no point in having a "complete" backup which is not a complete backup, but only pretends to be.

BTW, it's such "cleverness" and cutting corners with dates ("naah, we'll never need that") which has brought us the famous Y2K.

Title: What is ideal range (Min and Max date) for Calendar backup?

Body:
I need to take backup of calendar on my phone. We have requirement that we need to take backup of entire calendar data. Now, phone always supports recurring events. So, event may exist from 01-01-1601 to 31-12-3000. Logically, there is no point of taking backup from 01-01-1601 to 31-12-3000.

I just want to know your views on the ideal range for the same.


问:
Saying "no" to people asking questions

Possible Duplicate:

  When do you not give help to less experienced programmers?

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

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

How do you handle this sort of scenario?

答:
What about producing a Wiki, so you can share that knowledge so when people come and ask you can say, "have you looked at the wiki?" and then that grows into a excellent documentation resource, as people should add their experience to it.

Where I work we do this and I found over time I only got asked questions that were not so obvious as they were answered in the wiki.

Title: Saying "no" to people asking questions


答: You could say that your current job is not challenging enough and you feel that you could do more than your job allows. Therefore, you are looking for new oportunities.</p>


答:
Talk to your manager and explain the situation.

It is his job to ensure you are productive and can do your job effectively.

One possible solution could be a "question hour" - where you can only be approached for questions within that one hour in the day and would be off-limits otherwise.

As for widespread knowledge sharing - there are several ways to do this. Run weekly sessions about the domain, the code base, design decisions etc, to ensure everyone is on the same page. Start a wiki to document this knowledge (a glossary is a good place to start) and every time someone asks a question add it to the wiki. Start pointing people at the wiki and encourage them to add to it and update it.

Of course, any solution that you come by should be suitable to yourself, your manager and the company.

Title: Saying "no" to people asking questions

Body:
Possible Duplicate:

  When do you not give help to less experienced programmers?

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

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

How do you handle this sort of scenario?


答:
I don't think you need to mention anything about your previous manager issue.

You can just simply tell the interviewee

don't like to work on the technology that your previous company possess

the current's job salary is very low


答:
Here is a couple of my favorites:

Why is the position available?

What is my typical day at the company going to look like?


答:
How do you think the phone stores the recurring appointments? Try to do the same. Mostly sure the recurring events are stored using three values: <start date, recurrence period, end date (optional)>.

For non-recurring events, just make a normal copy.

And to be really on-topic: store ALL the future events/appointments and, eventually, ask the user if anything from the past should be saved because some don't want at all, some want at most x months/weeks ago, some want everything.


答: Than explaining each and everything, just guide them to the place where they can find the answer. As times goes, they will start looking for the answers on their own</p>

Title: Saying "no" to people asking questions


答:
It really depends on who's asking, and why they're going to you specifically.

If they're all junior devs, new hires or similar, and you are a senior dev or appear to be (for whatever reason) the person who knows the most about the system, they may go to you to avoid making a mistake that might make MORE work for you in the longer term, fixing their mistakes.

As to how to fix it some options inclue:

start a wiki where you post answers to questions you receive more then a certain number of times.

spend a few days making the documentation better for answering quick questions

set up a specific email folder and filter so that they can send you questions at any time but they get filtered and you answer them for a set (small) time each day/week.

pass the question answering responsibility onto someone else as knowledgeable as you (so they don't just pass it straight back)

Spend a strictly fixed (maybe an hour) time answering any questions, and make it well known that you won't answer with anything more then a yes or no outside that time

Title: Saying "no" to people asking questions


答:
Don't say no. But don't answer immediately either.

Make it clear that:

you like to help out,

you have your own work to do,

you need to be able to do so without being interupted all the time

and ask your co-workers to:

batch questions so you work through a number of them in one sitting,

work on something else if they have a question that means they can't continue with what they are doing right now,

ask specific questions and show what they have done so far and where they are getting stuck,

ask questions in e-mails so you can think about the answer before you sit down with them.

It's something I have done with new colleagues that I was assigned to coach. It works quite well. They save their questions, often answering them themselves as they get further into the issue. And of course, they do know that when something urgent comes up that they get stuck on, they can interupt me.

Title: Saying "no" to people asking questions


答:
I understand feeling the need to get up and walk around the office talking to people every once in a while.  I do it myself when I need to clear my head and approach a problem from a different mindset.  Others might too.

What is terribly rude though is when people show up and just start asking questions or engaging in discussion with you without asking for your permission first.  You will have these in every office.  Personally when I approach somebodies cube I say hi, and the first thing I ask is if right now is a good time.  If they say no I smile and say I will come by later.

As simple and obvious as it seems some people don't do this and from what I have learned no amount of directing to documentation, subtle hints of aggravation, or saying no will get them to stop doing this.  It really is a fact of life that you just have to learn to deal with for the most part.

Title: Saying "no" to people asking questions


问:
What should you include in a development approach document?
I'm in the middle of co-producing a "development approach" document for off-shore resources as they ramp up onto our project.

The most recent (similar) document our company has used is over 80 pages, and that does not include coding standards/conventions documents.

My concern is that this document will not be consumable and will therefore fail.

What should be in a development approach document?
Are there any decent guidelines on this topic?

EDIT: The development approach document should detail the practices and techniques that will be used by software developers while software is designed, built, and tested.

答:
The most recent (similar) document our company has used is over 80 pages, and that does not include coding standards/conventions documents.

Since you already have some document(s), that's your starting point. Ask yourself:

What is useful in this document?

What is missing?

Why would(n't) I use this document?

After you get the answers, cut what is unwanted and add the missing parts.

The actual content of the document depends on the resources available and I belive is hard to speculate using the information provided.

Just a hint: you'll want to adjust this document over time so don't write too much ;)


答:
I've been in this situation before.

First of all, don't say no. Never refuse to provide people with answers to their questions. Instead try to guide them into an "appropriate" way of getting those answers.

This is what worked for me:

If you're not the right person for the question, redirect them instead of answering yourself. This prevents you becoming the "go-to" guy on all questions just because you always answer them.

All non-urgent questions must be asked via mail. Refuse to answer people at your desk and tell them to send you an email. When questioned on this policy, explain that this helps you organize your day and improve the quality of the answers to questions.

Ensure that documents or wiki entries exist for questions that are asked more than once. When someone asks you a question whose answer is in a document, mail them the document while they're standing right there at your desk. This dovetails nicely with the questions-by-mail policy because you can just forward a previous answer.

Title: Saying "no" to people asking questions


答:
Unit testing will also provide you with an unambiguous, executable specification of the behavior you expect from your suppliers.  This will probably make communicating with them much easier.

If there is some problem in the interaction between your and theirs, you can provide them with your unit tests to clearly state what behavior your code expects.  If their code does not behavior the same way your unit tests do, the differences are usually easy to spot.

Title: Should I unit test

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

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


答:
We had a similar situation in our office that is shared between developers, testers, and the relatively small help desk.  When the help desk got a question they couldn't answer, they would ask a developer or tester for assistance.  Over time, the help desk people asked fewer questions overall but they began asking the same person all the time because that person was either the most helpful or maybe the most pleasant to deal with.

That worked well for everyone but that one helpful developer that was getting all the questions (some of which could take a while to deal with).  He was being very helpful, but not getting much development done.

We ended up instituting a developer of the day that became the go-to person for all help desk questions.  If question was more appropriate for a different developer he would refer the question to them, but the help desk had to start with the developer of the day.

We rotated the responsibility between 5 developers. Each developer only had one day per week of major interruption and the help desk couldn't just wait until it was their favorite's turn because that could be several days off.

You should take it as a compliment that everyone respects your knowledge and is comfortable coming to you for help.  That really is huge.  Now you need to help your teammates grow in their expertise and ability to assist coworkers.

Title: Saying "no" to people asking questions


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

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

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

答: I would take that on a case by case basis, there maybe some "free projects" that interest you and give you opportunties to develop skills and experience for paid work and some that don't.</p>


答:
The ideal range is what the person/organisation that gave the requirement says anything else might be wrong.

If the requirement seems wrong/too complex then discuss it with the originator.


答:
I would be wary of doing free projects for friends and family.  They tend to snowball and go down hill quickly.  How do you tell one friend sure, but then when the next asks you say no.  Can lead to some strained relations

Doing free work for other projects that aren't for friends and family can be beneficial.  You may not only learn new technologies and techniques but very well may make some valuable contacts in the process.  The value of good contacts can not be overstated.

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

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

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

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


答:
Thats a tough thing to do if they are friends, but typically if it is a non-profit venture for charity then you can write off expenses on your taxes, (Eg. workstation, software, gas to drive to friends house to discuss requirements, etc...)  I did a website for a local politician but I am not sure if campaign contributions can be written off on taxes?(Disclaimer: I am not a tax attorney)

If it has even the slightest chance of profit then force yourself in as a business partner and take a percentage ownership of the venture.  Knowing I am the cofounder sometimes calms my racing thoughts about the whole mess being a giant waste of time.


答:
My simple rule is never to work for free. But this doesn't mean I always work for money. If I work for them, I ask them to give something in return. It might be even just be symbolic, like coming over and buying pizza if I spend an afternoon helping them typeset their thesis in LaTeX. A friend used to give me tennis classes and I helped him with his website. If they aren't willing to do something simple for me, I'm not willing to work for them.

I also avoid like hell doing something for family members. It just doesn't work out. A frank advice and critic will often be seen like if it's something personal. Might just be my family or my culture, maybe it's different in other places. But, from previous experiences, it's better to just avoid it. I just say I'm too busy.


答:
It is probably a big continuum, if it is a small thing that will take me a couple of minutes I will do it. If it extends into multiple hours I will usually try and offer to teach people what needs to be done.

Take this as an example, if you have a friend that earns a living as a plumber, and you have a plumbing job to do, would you expect him to come over and fix the problem for free ?


问:
How do I get into R&D?
I'm beginning to think that I might be best suited for a job in R&D.  The reason being that I like jobs that allow me to be creative and I generally am more interested in solving puzzles than building things.  I really dislike jobs that just boil down to translating requirements into code.

Here's the kicker though:  I don't have a bachelor's much less a masters or phd.  Is it possible for me to land a job like this?

答:
I would suggest you to apply for R&D jobs. If it's what you love, and can't do it in your current job, you must move until you become a zombie :)

If you persevere, you will find a position. This may take few months, but if you fail 10 interviews, that means nothing. Maybe the job is at interview 11. And you don't care if it's at interview 25. Each interview will allows you to capture typical questions they ask and you will be able to improve your knowledge by yourself.

Meanwhile, do R&D in your spare time.

Title: How do I get into R&D?


答: assuming these questions are work related then I think the only thing you need to do is book your time appropriately. If you spend an hour helping someone on another project get a booking number out of them for that time, if they provide you with one you should have evidence that you are productive, if they can't provide one then you have justification to not spend your time helping them or to escalate it to management.</p>

Title: Saying "no" to people asking questions


答:
Answering seemingly stupid questions might well be a part of your job.

Suppose you are twice as good at programming as anyone else on the team. You get to the solution faster than anyone else, create fewer bugs than anyone else, create better documentation than anyone else. If that is the full gamut of your skills, you'll still be a lowly programmer in your employer's eyes. A very good programmer, but just a programmer.

Your value to your employer becomes a lot greater if you also have the ability to migrate those phenomenal skills to other members of the team. In your employer's eyes, having you spend all or most of your time helping and mentoring others might well be better for the company as a whole than having you spend your time programming.

Title: Saying "no" to people asking questions


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

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

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

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

答: I am no expert, but I think the Scrum Master should be the team advocate/facilitator.  The voice of the customer should have the customer's interests at heart.  The Scrum Master should be all about helping the team get what they need to have a successful sprint.</p>