答:
Is it a bad sign?  I think it's a warning that's worth looking into, but I also think it's bound to happen.

When people submit any kind of feedback to me, I try to filter it into three buckets:

Bugs

Feature Requests

Mis-communication

Bugs

Bugs are when something obviously doesn't work the way you would expect, nor the way the user would expect.  Like, it asked me for my name, I entered "Scott", hit enter, and it said, "Hi Joe!"

Feature Requests

This is like "I know we never talked about this, but can the program infer from my mouse gestures that I'm left-handed and move the OK button to the left side of the screen?"  This is when the current behaviour matches both your and the user's expectations, but they want to change the expectation.

Mis-communication

This is when you would expect one outcome from a scenario, but the user expects a different outcome.  Sometimes this becomes a feature request, if they just haven't communicated their expectations, but they thought they did.  Sometimes this becomes a bug if your expectation is proven to be wrong.

However, many times you have knowledge that the user doesn't have.  What if they said, "On this screen, I can add a record for myself twice with the same first and last name!  That's obviously a bug!"  Your response might be, "There are lots of people in the world with the same first and last name, so we don't require that combination to be unique.  We have a cleanup task that runs at night and emails a Possible Duplicates Report to customer service when it thinks it detects a duplicate with a similar name and address, and asks them to check it manually."

So you should read every bug report, but most complex systems are going to have bug reports that are really just feature requests, or possibly a mis-communication of the requirements.  Not understanding the underlying complexity of the real world is probably the biggest source of these issues.

Title: Are By-Design "Bugs" a Bad Sign?


问:
How and when do you scale Azure instances?
When dealing with Azure instances that are under-performing, how do you decide when to scale the instances? Do you scale horizontally by adding more instances or vertically by making the existing instances more powerful?</p>

答:
It depends on a lot of things (It'd be pretty hard to compare the two, but I'm sure someone who has enough time could find the real answer).  However, all things being equal as far as total throughput of the two separate VS the combined, the extra instance option will give you some nice benefits:

Theoretically, it gives you a higher chance that your application won't go down, since if you add resources to the same machine you have less total instances.  The more instances, the higher the availability and less chance all of your instances will be down at once.

Separate instances gives you the opportunity to distribute geographically, which will increase response time to requests that are close to it.

ContentLicense: CC BY-SA 3.0


问:
Difference between free and open software?

Possible Duplicate:

  Open Source but not Free Software (or vice versa)

I recently was at talk were Stallman was the keynote speaker, and he stated he hated the term open software, because it was geared to confuse people.

Now, I have since then read on to understand his stance, but I am unable to draw a line where free software becomes open source, and which licenses can be considered in each group.

For example I know that GPL, LGPL are free software licenses, but they are also open source licenses as well.

Is there a pure open source license? like MIT license? or is it all shades of grey.

Can a line be drawn?

Thanks!

答:
I strongly suggest you read http://www.fsf.org/about/, this explains the philosophy behind free software.

Open source simply means that the source code is available, technically, free software is open source; yet open source software does not have to be free.

And no I do not think there is a "pure open source" license. Open source meaning only having source available, has nothing to do with licensing.


问:
How to get better at testing your own code
I am a relatively new software developer, and one of the things I think I should improve is my ability to test my own code. Whenever I develop a new functionality, I find it really difficult to follow all the possible paths so I can find bugs. I tend to follow the path where everything works. I know this is a well known issue that programmers have, but we don't have testers at my current employer and my colleagues seem to be pretty good at this.

At my organization, we do neither test-driven development nor unit testing. It would help me a lot but it's not likely that this will change.

What do you guys think I could do in order to overcome this? What approach do you use when testing your own code?

答:
I think you want to work on two fronts. One is political, getting your organization to adopt testing at some level (with the hope that over time they will adopt more). Talk to QA engineers outside your workplace. Find lists of QA books. Poke around relevant wikipedia articles. Familiarize yourself with QA principles and practices. Learning this stuff will prepare you to make the most convincing case you can in your organization. Good QA departments do exist and they do add considerable value to their organizations.

As an individual developer, adopt strategies to use in your own work. Use TDD yourself by co-developing code and tests. Keep tests clear and well maintained. If asked why you're doing this, you can say you are preventing regressions and it keeps your thought process better organized (both of which will be true). There is an art to writing testable code, learn it. Be a good example for your fellow developers.

Partly I'm preaching to myself here, because I do way less of this stuff than I know I should.


问:
Basic features for a basic language? DSL suggestions?
I've finally begun to understand the complexity behind creating an interpreter and a compiler. I've built several versions of TinyBasic, 1964 (Dartmouth) Basic, and my own expansions on those languages before getting to this point. The most recent project is one I call Open Source Basic... because I could think of no other features of the language that would interest people. To be able to open up the source of the language and understand how some complex things are done (how scanning, parsing, interpreting, and compiling are done)

Open Source Basic is first interpreted into a stack based language. That stack based language is then interpreted and executed immediately or turned into a CLR executable.

My questions all boil down to this:

What are the basic features/constructs of a Basic-based language? I have these basic constructs already: Assignments, Expressions, Variables, some functions (Random, ToUpper, ToLower), Looping (for and do-while/until), If (block and single-line) Else decisions, console based input (Input) and output (Print), and sub-routines (with no parameters, yet).

When I'm 'done' adding the basic constructs onto my language - how should I branch out? Into what domain(s)? In other words, what direction(s) should my open source basic language take once I've got all the generic constructs working?

Thank you for your time,

Dominick

答:
Definitely a noble endeavor, but I think that you've got your priorities reversed.

Your first concern should be the "domain" problems that your language is targeted to address. That's why it is called a "Domain Specific Language" in the first place. A DSL is tolerable only when it is small, simple and very narrowly focused to solve particular set of problems like a knife through butter.

After you've identified the domain and how your language will work in the domain, you can lay down specific constructs or features.

Finally, it might be helpful to consider whether you want an internal or external DSL.


问:
How to handle technological "Dogmatism"
I left a job (to relocate to another country) where I programmed in Javascript and Haskell (some python) most of the time. I really liked it because people were objective, positive, mathematical, and yet got a bunch of stuff done. This was a truly professional shop.

Now I work at an Agile/XP shop. While this is good and all I feel that maybe we are unprofessional when it comes to the selection of technologies and libraries. I feel that our approach to writing software is a bit immature and unstructured. I am trying to read the books I have been offered and they seem to encourage this style (ugh). A lot of times we just pick libs off of git hub and use it without any type of review.

I get forced to work with someone all the time even if it's a small task for one person. There seems to be a little "fast" rule for everything even if the rule can be broken by a trivial counter example (one time I made the mistake of giving that counter example and I was verbally attacked). Is this normal here in the states? How do I handle this dogmatism?

答: You certainly cannot judge an entire culture according to the workings of a single development shop. Your shop is your shop. There are probably many like it. Many that are "worse" and many that may be "better". If you're not comfortable with the fit, move on. The dogma seems quite serious and it's doubtful that you can change it or adjust to it. Still, give Joel's Getting Things Done When You're Only a Grunt a read. You might find some useful survival strategies.</p>

OwnerDisplayName: Snog Fermenti

Title: How to handle technological "Dogmatism"


问:
Web application development security best practices
I am looking for the current, state of the art, coding standards for web development (mostly PHP). Since I do not want to reinvent the wheel I would like to reuse libraries written by people much clever than I am.

I know about OWASP which is a wonderful source of best practices and brilliant information. Their web site is however quite unorganized when it comes to libraries.

On the one hand there is OWASP ESAPI with pointers to libraries.

On the other hand there is OWASP AntiSamy, which also has libraries. It in turn points to HTMLPurifier or the MS Anti-XSS library.

I did not find any links between these different solutions.

Is there currently a consensus on the most recommendable libraries to use in order to mitigate the major security risks?

Thank you

答:
(Hey, I know that Bruce Ediger character! ;)
Seriously, you did not mention what exactly you were looking for, but ESAPI is not a "coding style", but rather a library of various security controls. There is an 'ESAPI for PHP'. OTOH, AntiSamy only exists for Java and .NET, so if you are looking for something to help defend against XSS in PHP, ESAPI should get the nod.

However, Bruce is correct...to a degree. Unless you are doing a green-field approach on some brand new project, static or dynamic analysis is a definite plus, especially if you are working on a large code base. These tools will have you identify places within your code where you need to insert the ESAPI's security controls.

Finally, you might find this book useful (note: I have not read it at all, but based on its title and TOC, it would seem to fit the bill):
Pro PHP Security: From Application Security Principles to the Implementation of XSS Defenses, Second Edition by Chris Snyder, Thomas Myer and Michael Southwell. It's published by Apress. I'll let you look it up on your favorite online bookstore, etc.


答:
Don't generalize.

It's obvious that your current shop is one of those misguided ones which think they are doing Agile - but they're not - and are going to end up with an unmanageable codebase. "Pulling code off github without review", "verbally attacked", "forced to work with someone" are all danger signals. Of course, you might be magnifying things a bit because of the culture shock, but maybe you should look for a new place to work at.

Title: How to handle technological "Dogmatism"

Body:
I left a job (to relocate to another country) where I programmed in Javascript and Haskell (some python) most of the time. I really liked it because people were objective, positive, mathematical, and yet got a bunch of stuff done. This was a truly professional shop.

Now I work at an Agile/XP shop. While this is good and all I feel that maybe we are unprofessional when it comes to the selection of technologies and libraries. I feel that our approach to writing software is a bit immature and unstructured. I am trying to read the books I have been offered and they seem to encourage this style (ugh). A lot of times we just pick libs off of git hub and use it without any type of review.

I get forced to work with someone all the time even if it's a small task for one person. There seems to be a little "fast" rule for everything even if the rule can be broken by a trivial counter example (one time I made the mistake of giving that counter example and I was verbally attacked). Is this normal here in the states? How do I handle this dogmatism?


问:
PHP, structural or OOP based language?
I would like to discuss why is PHP called a structural language? what are the OO concepts that cannot be implemented using PHP?</p>

答:
I wrote an article which might help to clarify this issue!

There is a big dilemma and misunderstanding between programmers
  regarding the object orientation of PHP. I have read a lot of forums
  and books on this subject, and I’d like to clarify it once and for
  all.

Before actually providing my opinion, let me be really clear in
  something; I like PHP, I am PHP Certified, and I use it every day for
  Optimum7, a pretty innovative company that I work for as Senior
  Programmer, and if this would help… “I always program in php thinking
  in objects”. I can’t do it differently after programming for more than
  9 years in C#.Net, where “everything is an object”. But once again,
  PHP is not Object Oriented!

Let’s make an analogy to clarify this.
  We can all run, right? But, we are not all “made” for running. The
  fact that we have the ability to run does not mean we are made for
  that specific action. Carl Lewis (the fastest runner in his day) was
  made to run from the beginning; he trained for it; he sacrificed
  everything to achieve at the highest level. We all know him as “the
  runner”. He was made for it and he developed it to the max!   What
  about Technical Considerations?

It is said that in order for a
  programming language to be Object Oriented, it needs to support at
  least these three basic concepts: Encapsulation, Inheritance and
  Polymorphism. However, PHP doesn’t exactly contain a ‘full’ complement
  of these three things, so these words don’t exactly apply to PHP like
  they do to other languages like C# for instance.

Here are just 3 of
  the thousands of reasons that clearly illustrate that PHP is not
  Object Oriented;

1)      It does not support casting of objects from
  one class to another.

  2)      It was not developed to be Object
  Oriented i.e. thousands of functions do not belong to any object.

  3)
  “A new PHP” Project (Zend Framework) was created to make PHP, Object
  Oriented.

Object Oriented Programming is more than a commercial
  phrase; it is a syntax or API Application Programming. It is a manner
  of thinking about the problem in a more productive model. As Tom
  Archer said: “In a truly Object Oriented language, every entity is
  expressed through the concept of objects. The objects are the main and
  unique idea behind the concept of Object Oriented”… As I say: Not
  everything that appears is!

Carl Lewis was made for running, not swimming.  PHP supports objects
  but was not designed to be object-oriented.

OwnerDisplayName: Awais Qarni

Title: PHP, structural or OOP based language?


问:
What is the reason for creating the symbols ∞ on the client side?
Take a look at this link: https://math.stackexchange.com/questions/60766/what-is-the-result-of-infinity-minus-infinity

What is the reason for transforming the symbols ∞ on the client side?

Because if someone disable javascript, this is what they see:

So right now I'm pondering what may be the reasons for that decision (I was thinking there are bound to be some advantage otherwise the decision wouldn't have been done).

答:
A few possible reasons:

The JavaScript library for this already existed, so it required little development time to deploy, as no major changes were required in their code base.

It saves processing time on the server from not having to generate the images.

It saves bandwidth, as the LaTeX code is much more compact than the rendered images.

It avoids frequent round-trips to the server while editing a post, allowing for a smoother user experience. (The LaTeX is rendered live in the preview.)


问:
Are By-Design "Bugs" a Bad Sign?
Is it a bad sign if users submit bug reports for things that are by design?

Does it typically mean that the application is confusing or unclear, or should I just chalk it up to a one-off user mistake unless specifically stated?

(I don't actually have any such reports.  This is a purely hypothetical question about whether or not the existence of by-design "bugs" is a bad thing.)

答: There are two kinds of bugs:  the functionality doesn't match the programmer's intentions, or the functionality doesn't match the requirements.  Programmers have a tendency to focus on the former to the detriment of the latter.  To put it simply, if your users are reporting a lot of "by-design bugs," your requirements aren't what you think they are.</p>

Title: Are By-Design "Bugs" a Bad Sign?


答:
By-design bugs in my experience means that your use cases don't fit your real users. Try reading about using real users for your use cases ( just giving them names and a thumbnail description does wonders for the quality of use cases.)

When prominent OS vendors say "this behaviour is by design" they generally had ease of implementation or commercial advantage in mind. If that's not you, try to find out your users real skill-set and relationship to your software. Do they use it all day ?  For fun ? Once a week because it replaced the TPS forms ?

Title: Are By-Design "Bugs" a Bad Sign?

Body:
Is it a bad sign if users submit bug reports for things that are by design?

Does it typically mean that the application is confusing or unclear, or should I just chalk it up to a one-off user mistake unless specifically stated?

(I don't actually have any such reports.  This is a purely hypothetical question about whether or not the existence of by-design "bugs" is a bad thing.)


问:
Does Microsoft have a free version of Visual Studio?
Not a trial, but a truly free version that they offer users to download....

I was wondering in case I somehow missed the option on their website. Any version of Visual Studio will do.

If not, are there any open-source alternatives (that have similar functionality, or possibly degraded equivalent) of Visual Studio? I am running on Windows 7 if that makes any difference...

答:
Visual Studio Express is a set of freeware integrated development environments (IDE) developed by Microsoft that are lightweight versions of the Microsoft Visual Studio product line.

A comparison is available here.

If you are a student you may want to take a look at DreamSpark.


问:
What are the major differences when moving from console-based to GUI-based programming?
I started, like many others, with console-based (as in terminal, not Playstation) programming. But sooner or later, one needs to touch upon GUI-based programming, whether you want to or not. This transition holds many changes in how you need to think about the frontend (and possibly also the backend).

So, what are the major differences when moving from console-based programming to GUI-based programming?

答: For me it would be getting used to event-driven programming. It can still apply to console-based software but I find its mostly used with GUI. Once you grasp it, its a very powerful tool.</p>

ContentLicense: CC BY-SA 2.5


答:
The Express versions

The free versions of Visual Studio are "degraded" version of their big brother, each dedicated to a specific task (or language for 2010 versions). "Degraded" because Express versions do not support the whole Visual Studio plugin ecosystem. They are great if you are on your own, or even within a small team of developers. They are freely available for 30 days and then require a free product key for ongoing use after 30 days (it takes only a few seconds to get the key, no big deal).

Both 2010 and 2012 versions are still available and nearly all compatible with Windows 7. The lone exception being Visual Studio 2012 for Windows 8 which is technically installable on Windows 7, but requires considerable human effort to be able to build Win 8 apps.

Depending on what app you want to write, here is how to choose:

Windows Store (Win 8 and Win RT) apps:

Visual Studio 2012 Express for Windows 8

Desktop Windows/Console apps:

Visual Studio 2012 Express for Windows Desktop (Silverlight and XNA too)

Visual C++ 2010 Express (no WPF support, but COM+ support)

Visual C# 2010 Express

Visual Basic 2010 Express

Web apps (ASP.NET, MVC 3/4):

Visual Studio Express 2012 for Web

Visual Web Developer 2010 Express

Windows Phone (Silverlight 3/4, XNA) apps:

7.5/8 apps: Visual Studio Express 2012 for Windows Phone

7/7.5 apps: Visual Studio 2010 Express for Windows Phone

The full trial version

Note also that you can install trial versions of the Visual Studio 2012. If you are on your own it's overkill to try the "Ultimate" or "Premium" version. They all have a 90-day trial limit, which is pretty good I think to get a good feel about it, or even to conclude a small-sized project.

The "Professional" version contains everything you need to build apps for everything mentioned above, plus other types of apps more related to a "business" environment such as Sharepoint, Office, or Biztalk for example.

Title: Does Microsoft have a free version of Visual Studio?

Body:
Not a trial, but a truly free version that they offer users to download....

I was wondering in case I somehow missed the option on their website. Any version of Visual Studio will do.

If not, are there any open-source alternatives (that have similar functionality, or possibly degraded equivalent) of Visual Studio? I am running on Windows 7 if that makes any difference...


答: For open source, there are a couple like SharpDevelop and MonoDevelop.</p>


答: The UI should follow The Principle of Least Astonishment - repeated bug reports on a feature that works as designed are an indication that this principle has not been adhered to correctly.</p>

Title: Are By-Design "Bugs" a Bad Sign?


问:
Java: would you use an EnumSet in this case?
I have this weird scenario in which some Java property is used to build and HQL query, and the type of the field is Boolean, i.e. it is boxed. I wondered why because I don't really like to think of booleans as having three possible values, true, false, and null. I recently found out the null value actually has semantics in this system. The semantics are: true means "only unviewed", false means "only viewed", and null means "all". So, if null, the field is ignored when building the HQL query, so that the end result contains both unviewed and viewed results.

In my opinion this is a case where an enum should be used. Something like this:

```<code>enum ViewStatus {
  VIEWED, UNVIEWED;
}
</code>```

My dilemma now is what to use for the third case that should represent the union of these two constants? The two options are:

Introduce a third enum constant, ALL.

```<code>enum ViewStatus {
  VIEWED, UNVIEWED, ALL;
}
</code>```

Use an EnumSet.

EnumSet pretty much exists specifically for this purpose, but... it seems like just two much overhead. Especially when reading the values in the part of the code that builds the HQL.

So, what are your thoughts? Shall I go with a third enum constant and refactor to EnumSet when need arises?

Thanks!

Update

I'll go for an EnumSet because I want to introduce methods on that enum that wouldn't make sense to be called on ALL. For example ViewStatus.isViewed().

答:
In this situation I use this pattern :

```<code>public class ViewStatusTest {
    <strong>public final static class ViewStatus {
        public static final ViewStatus FALSE = new ViewStatus();
        public static final ViewStatus TRUE = new ViewStatus();
        public static final ViewStatus ALL = new ViewStatus();
        private ViewStatus() {
        }
    }</strong><br>
    /** @param args */
    public static void main(final String[] args) {
        final ViewStatus vs =  ViewStatus.TRUE;
        if(ViewStatus.FALSE == vs) {
            System.out.println("FALSE");
        } else if(ViewStatus.TRUE == vs) {
            System.out.println("TRUE");
        } else {
            System.out.println("ALL");
        }
    }
}```

It is optimised because it test on internal address (not to necessary to load object and look inside).

In hope it will be usefull for HQL.

Best regards

Body:
In this situation I use this pattern :

public class ViewStatusTest {
    public final static class ViewStatus {
        public static final ViewStatus FALSE = new ViewStatus();
        public static final ViewStatus TRUE = new ViewStatus();
        public static final ViewStatus ALL = new ViewStatus();
        private ViewStatus() {
        }
    }

    /** @param args */
    public static void main(final String[] args) {
        final ViewStatus vs =  ViewStatus.TRUE;
        if(ViewStatus.FALSE == vs) {
            System.out.println("FALSE");
        } else if(ViewStatus.TRUE == vs) {
            System.out.println("TRUE");
        } else {
            System.out.println("ALL");
        }
    }
}

It is optimised because it test on internal address (not to necessary to load object and look inside).

In hope it will be usefull for HQL.

Best regards


答:
I believe its a bad sign mainly due to the fact that the design is not generic and users requirement is not fully understood/analyzed.

I see two catogories of design,
- Design by accident.
- Design by intention.

Design by accident leads to such issues frequently and cannot sustain.

Title: Are By-Design "Bugs" a Bad Sign?


答:
I rather avoid things like

```<code>ViewStatus viewStatus;
</code>```

since it introduces a new class without giving you anything in return when compared to

```<code>boolean isViewed;
</code>```

But that's a matter of personal taste.

By setting the reference to null you can have a third value, which is not really good, since you can get an unexpected NPEsomewhere; null is just no "first class value".

EnumSet pretty much exists specifically for this purpose, but... it seems like just two much overhead. Especially when reading the values in the part of the code that builds the HQL.

The overhead of an EnumSet is reasonable, it caches the class and an array of all values, and uses a long for storing the data (as long as the enum is small enought). Its equals method is quite fast, but obviously slower than reference comparison. You mentioned using HQL, so most probably the runtime will be dominated by the database access, so IMHO you're needless and premature optimization.

The mutability of the EnumSet may be a problem sometimes, but there's ImmutableEnumSet in guava.

I'll go for an EnumSet because I want to introduce methods on that enum that wouldn't make sense to be called on ALL. For example ViewStatus.isViewed().

I don't think you stated all your alternatives right. You can have both

```<code>enum ViewStatus {VIEWED, UNVIEWED}
</code>```

and

```<code>enum ViewStatuses {VIEWED, UNVIEWED, ALL}
</code>```

where the second is an replacement for the EnumSet. That said, I agree with your decision.

Title: Java: would you use an EnumSet in this case?

Body:
I have this weird scenario in which some Java property is used to build and HQL query, and the type of the field is Boolean, i.e. it is boxed. I wondered why because I don't really like to think of booleans as having three possible values, true, false, and null. I recently found out the null value actually has semantics in this system. The semantics are: true means "only unviewed", false means "only viewed", and null means "all". So, if null, the field is ignored when building the HQL query, so that the end result contains both unviewed and viewed results.

In my opinion this is a case where an enum should be used. Something like this:

```<code>enum ViewStatus {
  VIEWED, UNVIEWED;
}
</code>```

My dilemma now is what to use for the third case that should represent the union of these two constants? The two options are:

Introduce a third enum constant, ALL.

```<code>enum ViewStatus {
  VIEWED, UNVIEWED, ALL;
}
</code>```

Use an EnumSet.

EnumSet pretty much exists specifically for this purpose, but... it seems like just two much overhead. Especially when reading the values in the part of the code that builds the HQL.

So, what are your thoughts? Shall I go with a third enum constant and refactor to EnumSet when need arises?

Thanks!

Update

I'll go for an EnumSet because I want to introduce methods on that enum that wouldn't make sense to be called on ALL. For example ViewStatus.isViewed().

Body:
I rather avoid things like

ViewStatus viewStatus;

since it introduces a new class without giving you anything in return when compared to

boolean isViewed;

But that's a matter of personal taste.

By setting the reference to null you can have a third value, which is not really good, since you can get an unexpected NPEsomewhere; null is just no "first class value".

EnumSet pretty much exists specifically for this purpose, but... it seems like just two much overhead. Especially when reading the values in the part of the code that builds the HQL.

The overhead of an EnumSet is reasonable, it caches the class and an array of all values, and uses a long for storing the data (as long as the enum is small enought). Its equals method is quite fast, but obviously slower than reference comparison. You mentioned using HQL, so most probably the runtime will be dominated by the database access, so IMHO you're needless and premature optimization.

The mutability of the EnumSet may be a problem sometimes, but there's ImmutableEnumSet in guava.

I'll go for an EnumSet because I want to introduce methods on that enum that wouldn't make sense to be called on ALL. For example ViewStatus.isViewed().

I don't think you stated all your alternatives right. You can have both

enum ViewStatus {VIEWED, UNVIEWED}

and

enum ViewStatuses {VIEWED, UNVIEWED, ALL}

where the second is an replacement for the EnumSet. That said, I agree with your decision.


问:
What is a good intro to cloud-computing architecture?
Awhile ago I tried reading about Google App Engine, from its site and from the Wikipedia article. What I realized was that not only did I not understand what it did, I didn't even know what problem it was solving.

I am a competent programmer in a variety of languages, but I have little experience with large frameworks. Is there a book/site that explains cloud computing in a way similar to how "Programming with POSIX Threads" explains threading, ie identifying specific problems and the mechanics of how they are solved, from a programmer's perspective?

I tend to be a low-level bits-bytes-and-memory-addresses sort of person, so abstract explanations of the architecture tend to give me a giddy and uneasy feeling. I suppose cloud computing can't be understood at the byte-level, but the lower down it is the better I'll understand it.

答:
Your question is not about Architecture, you need to understand what cloud computing is. Since you mentioned about Google Appengine, I answer the question from web application developer point of view.

What does cloud mean for a web application developer:
A web application developer can use the infrastructure provided by companies like Amazon, Google as a service. Like electricity you pay only for what you use. If you ever had to administer a set of web servers yourself you will be able to see the "problem". The problem of maintaining a set of webservers and scaling is solved by these service providers.

A simple analogy to explain cloud computing is electricity. You don't generate electricity for your home needs, instead you pay for your use. It reduces lot of overhead and allows you to do what you want to do. Similarly in cloud computing you pay only for the computing power you use.

Key players in cloud computing market are

Amazon - Amazon webservices

Google - Google Appengine

Microsoft - Windows Azure

For me concept of cloud computing is not new, its an age old concept. Its just that marketed as cloud computing.


问:
What is the most compatible, widely used production language to export knowledge and skills gained from Haskell?
I like Haskell, plain and simple. While Haskell is used in production software, it's not especially widely deployed from what I've seen. What is the most similar and still widely used language in regards to production projects so that I might have a snowball's chance of using something similarly awesome in industry?

Also is the same language from the first part available on large numbers of platforms? If not, what is the best alternative that has wide platform deployment? I'd like a single language to put on my to-do list rather than a massive swarm or family. Hard evidence would be a plus.

答:
If you like Haskell, but have to make code for the JVM, frege may be interesting to you. It is designed to be as close as possible to Haskell 2010, yet generates Java code.

Of course, frege itself is nothing like  "widely used production language" (it's just recently published), but Java is certainly.


答: Consideration for the flow of control on the UI and validation of user input become very important.</p>

Title: What are the major differences when moving from console-based to GUI-based programming?

Body:
I started, like many others, with console-based (as in terminal, not Playstation) programming. But sooner or later, one needs to touch upon GUI-based programming, whether you want to or not. This transition holds many changes in how you need to think about the frontend (and possibly also the backend).

So, what are the major differences when moving from console-based programming to GUI-based programming?


问:
Where to Start When Making a Web Application on Your Own
I've been assigned an in-house web application that is basically an Employee and Project Management System.

I'm getting confused as to where I should really start with this assignment (I mean I'm my own development manager and I really don't have experience with making a project alone) and I'm hoping that you guys could share your experiences when you were given an assignment/project to build by yourself.

Thanks

答:
Start by getting some requirements down. Refine those requirements. Once you're happy with them, you can start putting together some preliminary design documents. Revise those documents. Write some prototypes. Revise those prototypes. Get down some more requirements for the next piece, and so on and so forth.

Essentially, I'm suggesting working in an agile manner with yourself as the client.


答:
It depends on what you already know and how much time you have.

That said, I'm a system programmer and wanted to build a website for some services, something related to twitter. After a few researches, and knowing that I had very basic knowledge of Python, I got interest in Django.

I bought some books to know Python better and read one to the middle before starting to play with Django. With a friend (coming from C#/ASP.Net) we built the basis of our website in 1 week.

So I guess that using Django (and its very complete documentation) would be a good solution for you if you can use Python.

I suggest Django mainly because it's complete, easy and written in an easy to understand but still powerful language. You'll get faster to the point with such tool.

Title: Where to Start When Making a Web Application on Your Own

Body:
I've been assigned an in-house web application that is basically an Employee and Project Management System.

I'm getting confused as to where I should really start with this assignment (I mean I'm my own development manager and I really don't have experience with making a project alone) and I'm hoping that you guys could share your experiences when you were given an assignment/project to build by yourself.

Thanks


答:
You need to ask yourself some questions about the project first to better understand what and how will be realized.

Here are some key points you should consider. These are only suggestions, or points you may want to take into consideration or not. Everyone has a different way of doing things, just think about it.

By NO WAY this is a complete list!

1) Gather info

Ask as much details about the project as possible. Both to your contractors, and to the people who will actually use it. Try to understand what are the expectations about this application and what it will be used for.

2) Understand what the project should be able to do when finished

You may want a detailed analysis about your project before actually thinking how to build it.

What are the functionalities it must have?

What kind of commands and data the users expect to see and use?

How should the application being structured?

You can make sketchs using paper and pen, post-it, or using some software to help you keeping tracks of your ideas and thinking.

3) Choose the right tools for the kind of application you need to make.

There are many programming languages, databases, server typologies, frameworks, etc. out there. You have to choose the right tools for the job, based on what you actually need to develop, and what you feel most comfortable with.

Sometimes you cannot choose any of this, but if you can, choose them well.

4) Start making some prototypes of the user interface.

Again, you can use paper or software or both or what you think it's the most useful tool. Just start to have an idea of how the application will look like, where to put the functionalities you need, the commands, where to display the data, etc.

This will give you a better idea if what you thought before is ok or if you need to change something (back to point 2).

5) Start to prototype some code functions.

You may want to be sure you are actually able to do what you are going to do before you are already halfway on your coding and understand (too late) that you went the wrong way.

Start coding the key-functionalities of your application and test them to see if they work as expected.

Perhaps the programming language you choose is not so well-suited for the kind of task?

Or your skill with that particular language/framework are not so good and you feel you could do it better or faster using other tools?

6) Show your contractors your prototype, both the UI and the basic functionalities.

You only prototyped a basic UI skeleton and application functionalities so far. But it's already enough for other people to see if this is what they expect or not.

Gather as much feedback as possible, understand what's wrong and what's work ok. If something is not working as expected you will have to rethink about it and change your project accordingly.

7) Start coding the application in detail.

Now you can start implementing all the code and UI details.

The order in which you develop the application is up to you, and varies depending on the application.

Just focus on one small piece of the application at a time, divide the project into small pieces.

I won't go more far than this since the question was only about starting the project, but I think you have some good points to think about.


问:
How can my multinational transition from one development platform to another?
I am working in IT department of a big, international company. We are developing different Intranet applications for the business (Complaints, Rebates, Service Desk etc). Now we decided to migrate from PHP platform to .NET (integration with MS CRM Dynamics, Exchange and MS Office be among many reasons). As there are about 20 different applications the business is using on current, PHP platform, we will have to come up with the best way to move them all to the new platform. I don't want to go into details how to convert the code etc, as while we do migrate we want to improve all of these applications.

So we came up with 2 main ways of moving these apps:

Support just one platform. What would it mean? Create homepage and literally migrate all apps as they are to .NET (without improving them while we do that). After New intranet is running we would start rebuilding migrated applications and improving them. That would save us developing intranet in .NET while having to support PHP platform.

Support both platforms for some time. That would mean building just a homepage and 1 or 2 new applications (which do not exist on our PHP platform). Making these available to the users but not taking off the PHP platform (we would incorporate menus and links to make it easier for users to move between apps on PHP page and the new one). Then we would start rewriting the PHP applications while improving them.

Now I am not sure what would be better, on one hand (option 1) we will potentially make everything easier for users by not forcing them to use two different platforms at the same time. Although they won't see any improvement of having the new platform, apart from everything looking nicer, the functionality of applications on the new platform will be the same for some time. Also I think we would add ourselves (IT dep) more work as esentially we would write every app twice.

On the other hand in option two (2) users would have worse experience as two platforms look different, but they would realise the benefits of the new platform as new applications are beeing moved.

Has any of you came across something like that? What would you choose? Or maybe there is even different, better way to those I have presented? I would like to know what do you think and how would you approach that.

答:
You have a third option:-

Migrate the php code to your windows server and ISS (the same one as you plan to run .NET on!)

You can then add new applications in .NET (and slowly convert some older ones to .NET) while presenting your users with what looks like a single system.

OwnerDisplayName: Daniel Gruszczyk


答:
Stallman's beef with the term "open source" primarily seems to be that it focuses solely on methodology without also carrying along the ethical stance of the FSF.  Given this, my conclusion is that:

Open Source Software is a development model in which the source code is made available to users and they are allowed to examine and modify it for their own purposes.  Redistribution is generally allowed, although there may be restrictions upon doing so.

Free Software is an ethical position which provides a reason for using an Open Source development model.  Adherents of the Free Software ethos will not, as a rule, place restrictions on the redistribution of their Open Source code, with the exception of preventing others from making closed versions of it.

(Incidentally, I once posited this distinction on a mailing list frequented by Stallman.  It was one of the few posts using the term "Open Source" which didn't raise any objections from him, although he didn't endorse it either.)

Title: Difference between free and open software?

Body:
Possible Duplicate:

  Open Source but not Free Software (or vice versa)

I recently was at talk were Stallman was the keynote speaker, and he stated he hated the term open software, because it was geared to confuse people.

Now, I have since then read on to understand his stance, but I am unable to draw a line where free software becomes open source, and which licenses can be considered in each group.

For example I know that GPL, LGPL are free software licenses, but they are also open source licenses as well.

Is there a pure open source license? like MIT license? or is it all shades of grey.

Can a line be drawn?

Thanks!


答:
My advice:

Adapt one of the agile software development methodologies (scrum works just fine).

A software development methodology is exactly what you're searching for. It shows the path from the very first day of an infant software, born now, till it gets developed and used and pushed out of the usage because of getting old. It covers topics like:

Who should define requirements

How to break down user stories into small, managable work items, commonly known as tasks

What to deliver in each planning

How to manage time and plan for everyday work

How to merge R&D into actual development, so that no one will overwhelm the other

and many more items.


问:
Google is good or bad for programmer?
Recently I was being interviewed by a company and faced one question. The interviewer asked me a question and at that time I didn't know the answer but if I had been asked about just 4 months ago, I could have answered it.

The question was from new language that I learned just 4 months ago. But I just get overview of the language and just get started working on that. Whenever I face difficultly, I google it. That means we do not have to memorize the whole programming language book! So in that situation I felt that Google screwed my job!

Not talking subjectively, Is it good to google all the time?

答:
It depends on the question(s) posed.

For example, "What is the argument order and return type of function Something::xyzzy() in PHP?" is a useful thing to search for on the web - although I do remember syntax for the common functions, I don't expect to recall the syntax of every language construct ever.

On the other hand, "How to build family tree using javascript,jquery,PHP.?" (Real Question™) is something you never want to answer with "I'll ask Google" (or StackOverflow, for that matter) - the issue is not likely to exist in a complete, answered state out there on the Web.

In other words, the WWW is a useful reference for things you'd otherwise need to memorize, but not for things where thinking is required.

Title: Google is good or bad for programmer?


问:
Wiki-like tool for writing specifications and documentation
I am looking for a wiki or wiki-like system for writing and managing specification and documentation for a software project.

I know there are lots of wiki-implementations available, but are there some that are especially well-suited for this kind of task?

Actually it doesn't have to be a wiki, just a system that makes it easy to write and navigate specs and documentation, and which support change tracing.

答:
For Microsoft platform, TFS (Team Foundation Server) integration with SharePoint is just what you're searching for. By creating a new team-project, you can choose a template encompassing almost every aspect of software development process. It gives you a portal in which you can define team members, assign their roles and security permissions, upload, share, and edit documents and specifications related to your project, and doing lots of other cool things with it.

For other platforms, I think you can use something like GitHub (though, I'm not sure about it).


问:
If you learned formal methods for software, how useful have you found it?
If you have been trained in the use of formal methods (FM) for programming:

How useful have you found it?

What did your FM training involve (e.g. a course, a book)?

What FM tools do you use?

What advantages in speed/quality has it given you compared to not using FM?

What kind of software do you create with FM?

And if you don't directly use FM now, was it at least worth learning??

I'm curious to hear as many experiences/opinions on FM as can be found in this community; I'm starting to read up on it and want to know more.

Background

Programming and software development/engineering are some of the newest human skills/professions on Earth, so not surprisingly, the field is immature — that shows in our field's main output, as code that is typically late and error-prone.  Industry immaturity is also shown by the wide margin (at least 10:1) in productivity between average and top coders.  Such dismal facts are well covered in the literature, and introduced by books like Steve McConnell's Code Complete.

The use of formal methods (FM) has been proposed by major figures in software/CS (e.g. the late E. Dijkstra) to address (one of) the root causes of errors: the lack of mathematical rigour in programming.  Dijkstra, for instance, advocated for students developing a program and its proof together.

FM seems to be much more prevalent in CS curricula in Europe compared to the US.  But in the past few years, new "lightweight" FM approaches and tools like Alloy have attracted some attention.  Still, FM is far from common usage in industry, and I'm hoping for some feedback here on why.

Update

As of now (10/14/2010), of the 6 answers below, no one has clearly argued for the usage of FM in "real world" work.  I'm really curious if someone can and will; or perhaps FM really does illustrate the divide between academia (FM is the future!) and industry (FM is mostly useless).

答: I took a graduate course in formal program analysis, where we focused on operational semantics.  I did my final paper on the seL4 effort, reviewing the formal methods they used. My primary take-away in terms of practicality was that it's of marginal value. Not only do you have to write the program, you have to write the proof. Wow. Two sources of bugs. Not just one. Further, there was an enormous amount of restrictions placed on the actual code. It's very hard to formally describe a physical computer, including I/O.


问:
Store images in the database, or in files with a database link?
Is it appropriate to store the image files in the database? Or it would be better to store only the path of the file in the database, while keeping the file itself on the server?

Are there any other methods for doing this right?

答:
If you are going to have a massive number of images, storing them in a database might remove problems with running out of inodes at the file system level.

However this problem would best be solved by using a more appropriate filesystem and whatever measures are advised with that filesystem on organisation.

Otherwise, storing images in a database is a complete waste of resources. Store the path as you said.


答:
I strongly advise you to store the images in the filesystem and not in the database.

Storing images in the database has several disadvantages:

The database might grow unexpectedly large. Sometimes space is an issue. For
example with SQLServer express you have a 4GB limit.

Data migrations can become a pain, for example if you switch from
SQLServer to Oracle

Queries can become very slow and you'll have a high database load

Interoperability with other applications is better if the images are on the filesystem and other applications use a different database. You can also access them directly and do not need database tools.

Worse performance in general

You'll probably have to create temporary files when retrieving the images from the database anyway. That's unnecessary.

These disadvantages far outweigh the cost of keeping the paths to the images stored in the database synchronized with the filesystem. There're only few special cases in which it's better to store the images in the database.

Title: Store images in the database, or in files with a database link?

Body:
Is it appropriate to store the image files in the database? Or it would be better to store only the path of the file in the database, while keeping the file itself on the server?

Are there any other methods for doing this right?


答:
We're using LaTeX and SVN. Since LaTeX documents are just text files, it plays well with version control, unlike some binary or partially-binary formats.

You get all the advantages (and disadvantages, admittedly) of version control you're used to from using it with your code.

LaTeX takes a little setting up (to define your own styles/class), but once you've done so it's very good - you can concentrate solely on the content rather than its presentation (rather than being tempted to constantly tweak as you are with WYSIWYG), yet still get a slick, professional-looking PDF document at the end.

Title: Wiki-like tool for writing specifications and documentation

Body:
I am looking for a wiki or wiki-like system for writing and managing specification and documentation for a software project.

I know there are lots of wiki-implementations available, but are there some that are especially well-suited for this kind of task?

Actually it doesn't have to be a wiki, just a system that makes it easy to write and navigate specs and documentation, and which support change tracing.


问:
how could I interview for a C# position if I master Java

Possible Duplicate:

  Interviewing a developer who's skilled in a language you don't know

I must interview people for a C# position we have. I work on the java side of the project, and master it quite well. When I interview for java position, I ask some technical-questions/programming-problems so I can make sure the candidate has solid skills, not just '5 years experience'.

But I don't know C# at all. I could look for some questions online (and their answers), but if I ask them these questions, I might not be able to see clearly if their response is right or wrong, maybe they have a point in some way etc. Also I won't be able to follow up in any side discussion etc.

So what I am basically asking is if someone with java/C# knowledge can think of questions that:

are deep enough to show the guy is solid

I (with java knowledge but zero C#) can discern their reply is good/reasonable/well thought or not.

答: Simple, give him/her a terminal and tell him/her to do some stuff. Check how much he/she looks up syntax to get an idea of linguistic familiarity. Then have him explain his/her code to you, line by line. Think of it as less a programming exercise and more of a communications exercise. You can weed out other candidates beforehand with questions about data structures and the like.</p>

OwnerDisplayName: raticulin


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

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

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

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

答:
There is a misconception in the typical developer community that a Ph.D is only required if you want to "teach". Its probably a hang up from the old days when most PhDs used to go into academia, but nowadays many PhDs (specially the engineering/Computer science grads) go into industry either conducting research at labs or doing challenging development work at top companies such as Intel, Oracle, Google, Microsoft, etc.

Especially in the US, with the advent of technology transfer/research idea spin-offs from academia to startups, there is now a strong connection between research conducted at universities and start-ups...Stanford, MIT, Florida, CMU, and others are the popular examples, and no one needs reminding that Google was a research project as well.

Doing a PhD is a personal decision, but it gives you deep insights into certain areas, and enforces a level of dedication and perseverance to battle through tough odds and criticism...incidentally, skills which are also required by start-ups. I am not saying that its not possible to be successful without a Phd..just like self-learned programmers who can code well without going to college, there are many examples of programmers with only a Bsc. or MSc. who have learned advanced tech/CS concepts and have been successful at the best companies around the world.

Overall I think this is a big topic of discussion, but a PhD nowadays is not just for teaching..


答: In any language knowing the library is an indicator of real experience. These .NET gems here should give you an idea how to word some interesting questions.</p>

Title: how could I interview for a C# position if I master Java

Body:
Possible Duplicate:

  Interviewing a developer who's skilled in a language you don't know

I must interview people for a C# position we have. I work on the java side of the project, and master it quite well. When I interview for java position, I ask some technical-questions/programming-problems so I can make sure the candidate has solid skills, not just '5 years experience'.

But I don't know C# at all. I could look for some questions online (and their answers), but if I ask them these questions, I might not be able to see clearly if their response is right or wrong, maybe they have a point in some way etc. Also I won't be able to follow up in any side discussion etc.

So what I am basically asking is if someone with java/C# knowledge can think of questions that:

are deep enough to show the guy is solid

I (with java knowledge but zero C#) can discern their reply is good/reasonable/well thought or not.


答:
This is one of the biggest reasons why I created Dev++, though I have not been able to spend much time on it lately.

Sign-up and take the c# tests yourself... if you want, I can make you a 'recruiters' account which would allow you to invite other people to take tests, then once they pass them, you can see their code.

As a Java developer, you'll be able to read their code and assess their c# knowledge 100 times better than stupid multiple-choice tests elsewhere on the internet.

(Did you catch my disdain for multiple-choice questions?)

EDIT: Here's the list of C# tests by the way: http://www.devplusplus.com/Tests/CSharp


问:
Learning potentially unrelated materials on company's dime, is it acceptable?
I am facing a similar problem as the OP of this question where my environment is good, but I feel like my learning is stagnating and I don't have the ability/resources to change positions/quit my job at this time nor am I sure I would want to if I did have the ability to.

The day before yesterday, I was assigned to help fix a problem with an ASP.NET website (which I normally don't work with)  that the customer was having and I needed to look up how to implement something. It only took me a couple of minutes to fix the problem and after that I ended up spending about four hours reading more about ASP.NET and implementing some of the exercises from the book. Then I spent another hour reading about networking and configuring routers which may be used when we need to change something in our lab, however, it is highly unlikely I would be the one to do it since we have a person dedicated to that task.

Today I took off work just so I could learn more about configuring networks and to practice on my home network.

Should I be billing the company for the time learning more about ASP.NET even though it is not a common part of my job or should I be charging like 1/2 rate? Is there a certain number of hours that you feel is acceptable to charge the company for time learning something or self-improvement?

答:
If your company hasn't explicitly asked for it, you can't charge a single dime. If you want to be paid for self-improvement, then go and talk to your boss first. He might grant you the time to do so or even pay learning materials/lectures for you.

You simply can't sell services the customer's didn't ask for just because you like it.

However, the self-improvement might pay out once your boss needs the kind of knowledge that you've learned in your free-time. It could lead to a promotion or maybe you'll receive a bonus. If, one day, your boss requires such knowledge, you can even ask for a bonus. As hiring someone or consuming external people will most likely be more expensive, he'll gladly pay.


答:
A good programmer is a good programmer and you should be able to identify that regardless of language differences. A person who understands data structures, object orientation, testing approaches and the fundamentals of the craft of programming will have little trouble with a different languages. A person who claims to understand a language in depth but can't talk intelligibly regarding these topics is a weak candidate.

Even if they have less platform knowledge a good programmer will know that is what they need and have little problem acquiring it. Identify that someone is a good programmer and you have a solid starting point.

You could also potentially use your own knowledge as an asset- many people you interview will have a basic knowledge of Java as well so asking comparative language questions can be informative in those cases.


问:
What are QUICK interview questions for the Microsoft stack development jobs?
I'm looking for your best "quick answer" technical interview questions. We are a 100% Microsoft shop and do the majority of our development on the ASP.NET web stack in C# and have a custom SOA framework also written in C#. We use a combination of Web Forms, MVC, Web Services, WCF, Entity Framework, SQL Server, TSQL, jQuery, LINQ, and TFS in a SCRUM environment. We are currently on .NET 3.5 with a very near transition to .NET 4.0.

Our interviewing process includes a 55 minute interview with two technical people (usually an architect and a senior developer). The two interviewers have to share the time for questions.

That isn't enough time for very many true programming problems so I'm looking for more good questions that have quick, yet meaningful, answers.

We are mainly interviewing for Senior Dev positions right now but may interview for some Juniors in the future.

Please help?

EDITED FOR CLARIFICATION:
The should not necessarily be specific to the MS stack. I just don't want questions that are specific to OTHER technology stacks like Ruby or Java.

答:
I realize this question is a bit old... but for future users who may stumble upon this, if you are looking to prescreen for TSQL skills (which saves TONS of time as you can prescreen hundreds of applicants before they even come in the door), then I would recommend you have them take the TSQL tests on Dev++

http://www.devplusplus.com/Tests/TSQL


问:
Why can't I edit an SVN commit message?
I'm using SVN. Sometimes I miss something when I write a commit message. But once it's been committed, it cannot be reverted, and even I can't edit the message. Why they didn't put the edit function in it? </p>

答:
According to the SVN FAQ, you can if the repository administrator has enabled it or if you have local administrative access to the repository.

However, doing this is probably a bad idea. You are, in effect, changing history. One of the points of version control is to maintain a history and audit trail for the project. Allowing arbitrary changes to the history defeats the audit trail. Instead, I would recommend that you perform smaller commits, writing concise yet explicit commit messages, and improving your personal workflow to prevent these errors.

Title: Why can't I edit an SVN commit message?


答:
The answer really depends on if your a contract worker or permanent employee.

If you are permanent then yes definately charge them. You are reading up on material relevant to your job and increasing your skill set. Make sure nothing is underhand though, either explicitly state on your timeshare or let your manager know what your doing.

If you are a contractor then dont charge them anything. Since your skill set isn't exclusively theirs its wrong to make them pay to increase it.

Title: Learning potentially unrelated materials on company's dime, is it acceptable?

Body:
I am facing a similar problem as the OP of this question where my environment is good, but I feel like my learning is stagnating and I don't have the ability/resources to change positions/quit my job at this time nor am I sure I would want to if I did have the ability to.

The day before yesterday, I was assigned to help fix a problem with an ASP.NET website (which I normally don't work with)  that the customer was having and I needed to look up how to implement something. It only took me a couple of minutes to fix the problem and after that I ended up spending about four hours reading more about ASP.NET and implementing some of the exercises from the book. Then I spent another hour reading about networking and configuring routers which may be used when we need to change something in our lab, however, it is highly unlikely I would be the one to do it since we have a person dedicated to that task.

Today I took off work just so I could learn more about configuring networks and to practice on my home network.

Should I be billing the company for the time learning more about ASP.NET even though it is not a common part of my job or should I be charging like 1/2 rate? Is there a certain number of hours that you feel is acceptable to charge the company for time learning something or self-improvement?


答:
I think if the company has to hire a C# programmer, and in the offer it is stated as a requirement, then an experienced C# programmer should do the interview.

Otherwise, as Java programmer, you are going to be able to identify good OO design qualities, and general programming skills. Still you could use a test previously made by another C# programmer to help you in the evaluation.


答: Get him to send in some code examples. If you know java then you should be able to read C#. You can then see how he codes and how good at OO programming he is.


答:
Essentially you have to have admin rights (directly or indirectly) to the repository to
  do this. You can either configure the repository to allow all users to do this, or you
  can modify the log message directly on the server.

Check the SVN FAQ here.

Log messages are kept in the repository as properties attached to
    each revision. By default, the log message property (svn:log) cannot
    be edited once it is committed. That is because changes to revision
    properties (of which svn:log is one) cause the property's previous
    value to be permanently discarded, and Subversion tries to prevent you
    from doing this accidentally. However, there are a couple of ways to
    get Subversion to change a revision property.

The first way is for the repository administrator to enable
    revision property modifications. This is done by creating a hook
    called "pre-revprop-change" (see this section in the Subversion book
    for more details about how to do this). The "pre-revprop-change" hook
    has access to the old log message before it is changed, so it can
    preserve it in some way (for example, by sending an email). Once
    revision property modifications are enabled, you can change a
    revision's log message by passing the --revprop switch to svn propedit
    or svn propset, like either one of these:

```<code>$svn propedit -r N --revprop svn:log URL
$svn propset -r N --revprop svn:log "new log message" URL
</code>```

where N is the revision number whose log message you wish to
    change, and URL is the location of the repository. If you run this
    command from within a working copy, you can leave off the URL.

The second way of changing a log message is to use svnadmin
    setlog. This must be done by referring to the repository's location on
    the filesystem. You cannot modify a remote repository using this
    command.

```<code>$ svnadmin setlog REPOS_PATH -r N FILE
</code>```

where REPOS_PATH is the repository location, N is the revision
    number whose log message you wish to change, and FILE is a file
    containing the new log message. If the "pre-revprop-change" hook is
    not in place (or you want to bypass the hook script for some reason),
    you can also use the --bypass-hooks option. However, if you decide to
    use this option, be very careful. You may be bypassing such things as
    email notifications of the change, or backup systems that keep track
    of revision properties.

Answer from Kamil Kisiel in response to a similar question on Stack Overflow.

Title: Why can't I edit an SVN commit message?

Body: I'm using SVN. Sometimes I miss something when I write a commit message. But once it's been committed, it cannot be reverted, and even I can't edit the message. Why they didn't put the edit function in it? </p>

Body:
Essentially you have to have admin rights (directly or indirectly) to the repository to
  do this. You can either configure the repository to allow all users to do this, or you
  can modify the log message directly on the server.

Check the SVN FAQ here.

Log messages are kept in the repository as properties attached to
    each revision. By default, the log message property (svn:log) cannot
    be edited once it is committed. That is because changes to revision
    properties (of which svn:log is one) cause the property's previous
    value to be permanently discarded, and Subversion tries to prevent you
    from doing this accidentally. However, there are a couple of ways to
    get Subversion to change a revision property.

The first way is for the repository administrator to enable
    revision property modifications. This is done by creating a hook
    called "pre-revprop-change" (see this section in the Subversion book
    for more details about how to do this). The "pre-revprop-change" hook
    has access to the old log message before it is changed, so it can
    preserve it in some way (for example, by sending an email). Once
    revision property modifications are enabled, you can change a
    revision's log message by passing the --revprop switch to svn propedit
    or svn propset, like either one of these:

$svn propedit -r N --revprop svn:log URL
$svn propset -r N --revprop svn:log "new log message" URL

where N is the revision number whose log message you wish to
    change, and URL is the location of the repository. If you run this
    command from within a working copy, you can leave off the URL.

The second way of changing a log message is to use svnadmin
    setlog. This must be done by referring to the repository's location on
    the filesystem. You cannot modify a remote repository using this
    command.

$ svnadmin setlog REPOS_PATH -r N FILE

where REPOS_PATH is the repository location, N is the revision
    number whose log message you wish to change, and FILE is a file
    containing the new log message. If the "pre-revprop-change" hook is
    not in place (or you want to bypass the hook script for some reason),
    you can also use the --bypass-hooks option. However, if you decide to
    use this option, be very careful. You may be bypassing such things as
    email notifications of the change, or backup systems that keep track
    of revision properties.

Answer from Kamil Kisiel in response to a similar question on Stack Overflow.


答:
Because it's a centralized version control system - As soon as you commit a change (and your commit message is by convention bound to the commit), everybody who has read access to the repository can see that information. It is a bad idea to change information after it has been disseminated, because people end up with a different opinion of "reality."

Distributed version control systems like Git alleviate this problem by making sure that the act of making information available to others is atomic and without any additional information like commit messages. But the same principle applies here: You are discouraged from changing things locally which you have already made available to others.

Title: Why can't I edit an SVN commit message?


问:
c# interview with a programming task

Possible Duplicate:

  How to prepare yourself for programming interview questions?

I am going for c#-sql server job and I was looking for some link where I could download some questions and answers to have look at.Googling I have found many but because there is no download you have to click and navigate for each question and answer which makes the process very intense.

Do you know a link where I can download some good c#/sql server questions?

Also I am told I will be given a programming task.

I have no idea what that might be. I hope is not some silly math algorithm that I know I will fail or some bubble sort stuff that I have never used in my c# programming life.

Any ideas or examples people have been asked?
Or is there a place where managers go to get this stuff?

It's not a case of cheating but I find some questions not really pratical in the real world.

typical silly question for a c# in my view is

What's the difference between a stack vs heap?
Now tell me whether as a c# programmer you are really bothered about the stack and heap.

If you do some unboxing the compiler will tell you have an error.etc..

Why they keep asking that question.Even the agency the other day asked me that question.

thanks a lot for any suggestions

答: Stack vs. heap is not a "silly" question. A .NET developer who does not know the difference is suspicious, at least. A wise programmer will be able to use this knowledge quite efficiently: detecting that some small objects won't survive after the end of the current region, allocating them on stack may increase performance significantly. Any decent .NET developer have to know what the boxing is and what's the difference between value and object types.</p>

Title: c# interview with a programming task


答:
It could be just me, but you cannot evaluate someone's C# knowledge without knowing C#.

You can measure his programming skills, analytical skills, logical skills, testability, object oriented design and everything that is common between C# and Java and everything that is general to programming (and yes all of these are very important), but you cannot evaluate whether he knows C# well or not, leave alone whether he has good practical experience.

Now, I do agree that programming is an art, and you can programming languages any day and all you need is the right approach and the programmer's mindset. But more practically, is your company ready to spend (at least time) for his learning C#? Do you want him "up and programming" from day one? If so, better find someone who knows C# to interview for C#. If you have some time, you can get anyone with a good programmer's mind and let him/her learn.


答:
IMO it's not only acceptable, it should be encouraged.  A major red flag at any organization (for me, at the least) is the concept of "There is always something to do" because this indicates poor project planning and little or no direction; there should always be "downtime" for software developers (typically after a major release or patch) where there is no real pressure or high-priority tasks and the team can wind down and spend the day learning/sandboxing.  This downtime should be frequent enough so people are constantly learning (either individually or with "brown bag" lunch meetings, training, and the like) instead of always being given "busywork" to make sure that they are always working on some task.

That said, if you have important things to do you shouldn't go off researching things just because - that's not professional behavior.  But, I am a firm believer that a good company, that cares about it's developers, will make sure there is appropriate downtime for the dev team to just "chill out" and experiment; as stated above a company that doesn't do this or, worse, actively discourages/punishes it (sadly I have seen this commonly, where developers will be reprimanded and/or written up for "researching things instead of coding"), isn't a company any good developer wants to work for.

As to the notion of charging them, I don't quite understand because if you are an employee, you are already being paid a salary (more than likely) so the four hours you spend learning something new, if done at work, is already accounted for.  If you're a contractor/consultant I wouldn't bill them unless it was something that was done as part of pre-project research (which this situation doesn't sound like, anyways).


答:
Technically, C# is more of a superset of Java (if you neglect a few syntactic differences).

C# has quite an impressive amount of features Java omits by design. Most important ones would be:

first order functions, especially lambda expressions, but also delegates

expression trees

LINQ (a very powerful tool, if used appropriately)

handling covariance and contravariance of type parameters with in and out

That being said, very few of these features are leveraged in every day code. That's because they are relatively new and relatively hard to understand. Of those things, the only one you will probably a commonly used on a daily basis are LINQ and delegates, data querying and event driven programming being the most important application respectively.

Frankly, in C# there are just characteristic idioms to solve some problems. And there are reasons why those idioms are in place. You want a C# programmer to write C# code, not Java code in C#.

It is not unlikely, that if you ask a C# programmer to show you his code masterpiece, he will show you a piece of code, that has these new features crawling all over the place. And you will really have a hard time understanding the code or judging whether the use of those features was appropriate or actually obfuscates a simple problem by convoluted constructs.

If you really want to live up to this challenge, you need to do your homework.

What you want to do is to hire brilliant people and you want to pass judgement on their skills. You should therefor have as much insight as possible. If not for actually finding the best candidate, then as a sign of respect towards their work and expertise.

Hiring is a critical process. If you can't provide the necessary C# expertise yourself, I suggest you hire someone you can trust, to get a good assessment for C#-specific skills and focus on examining all the non-programming aspects of software development.


问:
Agile methods and Databases at the start of the project
New to agile and I'm not sure how to start. The idea is to create small parts of the project in sprints. However the project I'm working of requires a database and the database must be almost functional to do anything with the project.

So how do Agile projects handle this, do you start by creating the database?

How would you do so, for example if using Scrum how would you do the user stories and test the db.

Would you rather do parts of the db in a story that also requires code.

Say you have a story that is "As a user you must be able to register..." you would create the user table in the database as a part of this story?

How can agile help you design the database?

答:
Yes you will build database incrementally by adding required tables and columns as they are required by the story. You usually don't need the whole database when you start your first story - for example "As a user you must be able to register ..." most probably requires single table with exactly defined set of columns. </p>

<p>If you have a story which really requires the whole database the story is Epic - it is simply too big and must be divided. </p>

Body:
Yes you will build database incrementally by adding required tables and columns as they are required by the story. You usually don't need the whole database when you start your first story - for example "As a user you must be able to register ..." most probably requires single table with exactly defined set of columns.

If you have a story which really requires the whole database the story is Epic - it is simply too big and must be divided.


答:
Personally, I really like Tiddly Wiki.

It has a pretty complete wiki syntax, is a self contained single html file and works well with a variety of web browsers without the need for a server.

It even has an extensible plugin architecture which allows you to add plugins to do all sorts of interesting things like encrypting tiddlers or adding footnotes.


答:
typical silly question for a c# in my view is

What's the difference between a stack vs heap? Now tell me whether as
  a c# programmer you are really bothered about the stack and heap.

You must be thinking of the stack and the heap, the two memory structures directly supported by most modern computer architectures. As a programmer, you absolutely should know that stack and heap are two types of data structures, just as you should know what a binary tree, b-tree, linked list, array, and associative array, etc. are. You should also have at least some idea of how to implement all of these, the major benefits they provide, and which is appropriate for a given situation.

You don't need to download a list of interview problems. You need to read a good book on algorithms and data structures.

Title: c# interview with a programming task

Body:
Possible Duplicate:

  How to prepare yourself for programming interview questions?

I am going for c#-sql server job and I was looking for some link where I could download some questions and answers to have look at.Googling I have found many but because there is no download you have to click and navigate for each question and answer which makes the process very intense.

Do you know a link where I can download some good c#/sql server questions?

Also I am told I will be given a programming task.

I have no idea what that might be. I hope is not some silly math algorithm that I know I will fail or some bubble sort stuff that I have never used in my c# programming life.

Any ideas or examples people have been asked?
Or is there a place where managers go to get this stuff?

It's not a case of cheating but I find some questions not really pratical in the real world.

typical silly question for a c# in my view is

What's the difference between a stack vs heap?
Now tell me whether as a c# programmer you are really bothered about the stack and heap.

If you do some unboxing the compiler will tell you have an error.etc..

Why they keep asking that question.Even the agency the other day asked me that question.

thanks a lot for any suggestions


答:
A functional alternative is Erlang. While it is a very concurrent language the sequential subset is a pure functional language with many of the properties of functional languages, for example closures, immutable data and pattern matching. It runs on many platforms including linux, various unixes, windows and macosx. There is now even an implementation on the JVM, erjang. It can easily communicate and co-exist with other languages, this is how it is often used.

Check out the main site.

Title: What is the most compatible, widely used production language to export knowledge and skills gained from Haskell?

Body:
I like Haskell, plain and simple. While Haskell is used in production software, it's not especially widely deployed from what I've seen. What is the most similar and still widely used language in regards to production projects so that I might have a snowball's chance of using something similarly awesome in industry?

Also is the same language from the first part available on large numbers of platforms? If not, what is the best alternative that has wide platform deployment? I'd like a single language to put on my to-do list rather than a massive swarm or family. Hard evidence would be a plus.


答:
the database must be almost functional to do anything with the project.

Largely false.

So how do Agile projects handle this, do you start by creating the database?

An empty database, yes.  Then add tables as required to finish a sprint.

how would you do the user stories and test the db?

What are you asking?  Agile has nothing to do with database design.

You write the story.

You design a solution.

You create tables and code.

You test the code.

Would you rather do parts of the db in a story that also requires code?

What other choice is there?  Do all the DB first?  That's impossible.

"As a user you must be able to register..." you would create the user table in the database as a part of this story?

First, that's a useless story, since there's no value in registering.  That's merely a technical hurdle that users are forced to pass through.

Second, you'd create just enough tables to implement the story.

How can agile help you design the database?

What are you asking?

Agile is project management.  It doesn't help with any design.

It merely helps you break a big job into small pieces.

Title: Agile methods and Databases at the start of the project

Body:
New to agile and I'm not sure how to start. The idea is to create small parts of the project in sprints. However the project I'm working of requires a database and the database must be almost functional to do anything with the project.

So how do Agile projects handle this, do you start by creating the database?

How would you do so, for example if using Scrum how would you do the user stories and test the db.

Would you rather do parts of the db in a story that also requires code.

Say you have a story that is "As a user you must be able to register..." you would create the user table in the database as a part of this story?

How can agile help you design the database?


问:
Using an Apt Repository for Paid Software Updates
I'm trying to determine a way to distribute software updates for a hosted/on-site web application that may have weekly and/or monthly updates. I don't want the customers who use the on-site product to have to worry about updating it manually I just want it to download and install automatically ala Google Chrome. I'm planning on providing an OVF file with Ubuntu and the software installed and configured.

My first thought on how to distributed software is to create six Apt repositories/channels (not sure which would be better at this point) that will be accessed through SSH using keys so if a customer doesn't renew their subscription we can disable their account:

Beta - Used internally on test data to check the package for major defects.

Internal - Used internally on live data to check the package for defects (dog fooding stage).

External 1 - Deployed to 1% of our user base (randomly selected) to check for defects.

External 9 - Deployed to 9% of our user base (randomly selected) to check for defects.

External 90 - Deployed to the remaining 90% of users.

Hosted - Deployed to the hosted environment.

It will take a sign off at each stage to move into the next repository in case problems are reported.

My questions to the community are:

Has anyone tried something like this before?

Can anyone see a downside to this type of a procedure?

Is there a better way?

答:
Take a look at the Sparkle framework for OS X, it does a very similar thing to the Chrome update mechanism but provides user feedback so they can skip the update or do it later. I've had applications update on me and change functionality that I needed as was, always best to at least ask the user. </p>

<p>I like the apt idea though, makes sense to do it that way, it's simple and really, really well tested at this point. </p>

Body:
Take a look at the Sparkle framework for OS X, it does a very similar thing to the Chrome update mechanism but provides user feedback so they can skip the update or do it later. I've had applications update on me and change functionality that I needed as was, always best to at least ask the user.

I like the apt idea though, makes sense to do it that way, it's simple and really, really well tested at this point.


问:
Are By-Design "Bugs" a Bad Sign?
Is it a bad sign if users submit bug reports for things that are by design?

Does it typically mean that the application is confusing or unclear, or should I just chalk it up to a one-off user mistake unless specifically stated?

(I don't actually have any such reports.  This is a purely hypothetical question about whether or not the existence of by-design "bugs" is a bad thing.)

答:
I'd like to add to maple_shaft's answer about users' "ignorance". You also have to keep in mind that 90% of the users will only care about their own experience and way to use the system. They don't care about other users, why should they? It's our job as designers/developers to take in input from all the different kinds of users and make something that fits everyone as good as possible. Most of the times you can't make a solution optimal for everyone.

But of course you need to read and evaluate feedback from your users! They are, after all, those who use your creation!

Title: Are By-Design "Bugs" a Bad Sign?


答:
Research on SQL Server 2005 and the NTFS file system (Microsoft) to compare CRUD performance: To BLOB or not to BLOB. This study was also done in a web application. You listed another database (MySQL) and I'll assume you're not using Windows Server for your PHP site, so it would be interesting if someone has done a similar study on different technologies.

Turns out that it depends on the size of the files. SQL Server favors (2x better) blobs of 256K or less and the file system favors files of 1MB+. File systems in this study handle fragmentation better than the database, so if you are constantly updating these files or this system grows over time, fragmentation is going to be a bigger factor which the file system will do a better job.

You need to determine how responsible your site is for maintaining these files. If you're buidling a site for insurance claims agents to upload photos of an accident, you better have transaction control and make sure those files are on the server. Good databases do this for you, so as the developer, you have added pressure.

Replication, backup, disaster recovery, fragmentation, remaining disk capacity, and performance over time should be considered during design. This is just one study on the previous version of SQL Server and like other database manufacturers, I'm guessing handling large files and binaries is a major competitive arena.


答:
New to agile and I'm not sure how to start.

After reading your post I think you're misunderstanding it and you should start with reading what agile really means and tries to accomplish.

The idea is to create small parts of the project in sprints.

Close, but not close enough. The idea is to deliver working software at the end of each sprint (one part of the system can fit into one sprint, or not). The database can be seen as working software if and only if the database is what you deliver to the customer.

However the project I'm working of requires a database and the database must be almost functional to do anything with the project.

Why does it have to be almost functional? Does every feature of the system use the entire or most of the content of the database? Because if it doesn't, there's no point in designing the whole database beforehand.

So how do Agile projects handle this, do you start by creating the database?

Agile doesn't handle database or system design. It tells you how to manage your project. With that in mind, you start by identifying all the features of the system and put them in the product backlog. Then you, along with the product owner, assign priorities to the features in the backlog. After you've done that you start taking features from the backlog and create sprints (usually 2 to 4 weeks long). When a sprint is over you should have a new working feature in the system that can be delivered to the customer.

How would you do so, for example if using Scrum how would you do the user stories and test the db.

I might be wrong, but there's no point in testing the database. You can test the code that updates the database. Of course, you can test your programmable part of the database but that can be achieved by testing the code that calls it.

Would you rather do parts of the db in a story that also requires code.

Yes.

Agile is by no means a silver bullet to project management and can spell disaster when not applied correctly. Try to spend some time reading about it (you can find plenty of resources here or on stackoverflow), maybe find someone that has already done agile and can help you to get up to speed.


答: Well firstly follow an incremental approach.Select a module define its requirements, chalk out the functionality, target a functional area and then comes the modeling, db design, algos, codes and finally test it and repeat the process.</p>


答:
Your question screams of the AgileFall development anti-pattern.

What is it?  It is usually an organization that traditionally developed software in a Waterfall method, but then because they realize it isn't working, they struggle internally to adopt Agile techniques.  The resulting "fail-gasm" usually occurs because true Agile DEMANDS a fundamental organizational shakeup from the way that many established Waterfall shops are structured.  And of course they will tend to stay structured that way as a lot of powerful and tenured people feel they need to inject themselves into the process when Agile shows how useless those people REALLY are to software development.

You need to escape this notion that somehow you start from the bottom, design and build your database, and then move onto the middle tier and never have to touch your database again.  This is the wrong way to do it in Agile.

Start at the domain model for a user story, and work your way up to the database, and DOWN to the middle-tier and presentation.


答:
The users submitting the bug requests were generally not consulted on the design so it is not surprising that they see things as bugs that were deliberate design decisions. To  a user anything that doesn't work as expected is a bug.

I have found the problem is often a sign that the BA or PM only got requirements from managers not actual users. What managers expect of the system is often vastly different from what the people entering the data actually need. I was taught to collect data directly from the actual users, but most BAs I have run into lately only talk to managers (and generally relatively senior managers at that).

Title: Are By-Design "Bugs" a Bad Sign?

Body:
Is it a bad sign if users submit bug reports for things that are by design?

Does it typically mean that the application is confusing or unclear, or should I just chalk it up to a one-off user mistake unless specifically stated?

(I don't actually have any such reports.  This is a purely hypothetical question about whether or not the existence of by-design "bugs" is a bad thing.)


问:
Where to start fixing a complex bug?
I'm trying to solve a complex bug in our codebase , but the problem seems to be coming from a lot of places to the point that i dont know what to change first .

do you have any procedure or guidelines todo in such a situation  ?

答:
Don't start by making changes, start by reproducing the bug in unit tests. After that change the code so that the unit test passes instead of fails.

Sounds like you have multiple bugs, not just one, start at the lowest level, identify specific bugs, write failing unit tests and fix.

Title: Where to start fixing a complex bug?


答:
First, analyze the problem. Don't start making changes until you understand the codebase. Start by reading the design documentation (class, sequence, and communication diagrams would be a good start) and in code comments. Use logging (that's what TRACE and DEBUG level logging is for), a debugger to step through code and watch variables as they change. This is also a good time to make notes if the design documentation and/or in-code comments are wrong - fix them for future developers.

Second, once you understand the codebase, come up with test cases to identify the problem and confirm that you've fixed this. There might be unit tests, system tests, and acceptance tests associated with the problem that need to be created or revised. You're going to want to make sure that you have fixed the defect, that your fixes don't introduce other defects, and that this defect doesn't appear again as the result of a regression.

Finally, you can fix the defect. Run your tests to confirm, and if any documentation is affected, either update it or file a defect against the documentation so that any changes you made are reflected for the user or future developers.

Title: Where to start fixing a complex bug?

Body:
I'm trying to solve a complex bug in our codebase , but the problem seems to be coming from a lot of places to the point that i dont know what to change first .

do you have any procedure or guidelines todo in such a situation  ?


答:
the problem seems to be coming from a lot of places

Fortunately, this is probably false. Bugs can be caused by all sorts of different things, but when you see a bug cropping up all over the place, you can bet that the instances of that bug all lead back to one place. This place could be some corrupted data in a SQL table, a funky setting in a config file, or a piece of bad application logic that a lot of components touch. It could also be a million other things, but the key is always to figure out what the different instances of the bug have in common. Tools can be a huge help. Use a SQL profiler for data heavy stuff. I recently had to fix a proprietary system that had close to 15,000 stored procedures. One of them went haywire during an update that conflicted with some of the modifications I had made to the system. Without a SQL profiler, this fix would have been more or less impossible. If you rule out a data issue, your number one goal is to find that line of code where the bug is created. With a good trace log, a debugger, and some common sense, you can track down just about any bug.

Title: Where to start fixing a complex bug?