问:
Confused about modifying the sprint backlog during a sprint
I've been reading a lot about scrum lately, and I've found what seem to me to be conflicting information about whether or not it's ok to change the sprint backlog during a sprint. The Wikipedia article on scrum says it's not ok, and various other articles say this as well.  Also my Software Development professor taught the same thing during an overview of scrum.

However, I read Scrum and XP from the Trenches and that describes a section for unplanned items on the taskboard. So then I looked up the Scrum Guide and it says that during the sprint "No changes are made that would affect the Sprint Goal" and in the discussion of the Sprint Goal "If the work turns out to be different than the
Development Team expected, then they collaborate with the Product Owner to negotiate the
scope of Sprint Backlog within the Sprint." It goes on to say in the discussion of the Sprint Backlog:

The Sprint Backlog is a plan with enough detail that changes in progress can be understood in
  the Daily Scrum. The Development Team modifies Sprint Backlog throughout the Sprint, and the
  Sprint Backlog emerges during the Sprint. This emergence occurs as the Development Team
  works through the plan and learns more about the work needed to achieve the Sprint Goal.

As new work is required, the Development Team adds it to the Sprint Backlog. As work is
  performed or completed, the estimated remaining work is updated. When elements of the plan
  are deemed unnecessary, they are removed. Only the Development Team can change its Sprint
  Backlog during a Sprint. The Sprint Backlog is a highly visible, real-time picture of the work that
  the Development Team plans to accomplish during the Sprint, and it belongs solely to the
  Development Team.

So at this point I'm altogether confused. Thinking about it, it makes more sense to me to take the second approach.  The individual, specific items in the backlog don't seem to me to be the most important thing, but rather the sprint goal, so not changing the sprint goal but being able to change the backlog makes sense. For instance if both the product owner and the team thought they were on the same page about a story, but as the sprint progressed they figured out there was a misunderstanding, it seems like it makes sense to change the tasks that make up that story accordingly.  Or if there was some story or task that was forgotten about, but is required to reach the sprint goal, I would think it would be best to add the story or task to the backlog during the sprint.

However, there are a lot of people who seem quite adamant that any change to the sprint backlog is not ok.  Am I misunderstanding that position somehow? Are those folks defining the sprint backlog differently somehow? My understanding of the sprint backlog is that it consists of both the stories and the tasks they're broken down into.

Anyway I would really appreciate input on this issue. I'm trying to figure out both what the idealistic scrum approach is to changing the sprint backlog during a sprint, and whether people who use scrum successfully for development allow changing the sprint backlog during a sprint.

答:
First of I would not have hard rules about it; the whole point of scrum is to allow you to adapt to the situation. So you should be able to modify the sprint backlog during the sprint if you absolutely must (like you forgot something critical).

But saying this modification to the sprint backlog during the sprint should be resisted. The whole point of the sprint being short is that new work can be added to the next sprint (after it has been correctly prioritized) without affecting the overall project timeline (multiple sprints).

But if the work is critical for one of the tasks in this sprint you have two options.

Add new item to the sprint.

BUT remove an equivalently sized item from the sprint.

Drop the item that was badly planned from this sprint (so you can properly plan it in the next sprint).

Adding in an alternative (of appropriate size) from the top of the product backlog (which should have be in priority order from your sprint planning meeting).

Or when all sprint items are finished allow dev's to pick up slack from the product backlog.

So I am in the camp that you should probably not modify the sprint backlog. But you have to take into account the situation there may be exceptional circumstance. In most cases I would go with options 2 and let devs pick up the slack with tasks from the backlog.

Then in the next planning meeting the new task will be appropriately analysed and added to the sprint (as appropriate).

Remember the sprint is short and just the mark of the next drop not the end of the development cycle. The product owner would have to be very desperate for a feature that they could not wait for the end of the next sprint.


问:
What was the historical impact of Ariane 5's Flight 501?
The disintegration of the Ariane 5 rocket 37 seconds after launch on her maiden voyage (Flight 501) is commonly referred to as one of the most expensive software bugs in history1:

It took the European Space Agency 10 years and $7 billion to produce Ariane 5, a giant rocket capable of hurling a pair of three-ton satellites into orbit with each launch and intended to give Europe overwhelming supremacy in the commercial space business.

All it took to explode that rocket less than a minute into its maiden voyage last June, scattering fiery rubble across the mangrove swamps of French Guiana, was a small computer program trying to stuff a 64-bit number into a 16-bit space.

One bug, one crash. Of all the careless lines of code recorded in the annals of computer science, this one may stand as the most devastatingly efficient. From interviews with rocketry experts and an analysis prepared for the space agency, a clear path from an arithmetic error to total destruction emerges.

What major changes did Flight's 501 failure and the subsequent investigations inspire to the research of safety critical systems and software testing?

I'm not looking for an explanation of the bug itself, but for an explanation of the historical impact of the bug, in terms of research that were inspired from or were directly related to the investigation(s) of the failure. For example this paper concludes:

We have used static analysis to:

check the initialization of variables,

provide the exhaustive list of potential data access conflicts for shared variables,

exhaustively list the potential run time errors from the Ada semantics.

To our knowledge this is the first time boolean-based and non boolean-based static analysis techniques are used to validate industrial programs.

Similarly, this paper(pdf) notes:

Abstract interpretation based static program analyses have been used for the
static analysis of the embedded ADA software of the Ariane 5 launcher and
the ARD. The static program analyser aims at the automatic detection of
the deﬁniteness , potentiality, impossibility or inaccessibility of run-time errors
such as scalar and ﬂoating-point overﬂows, array index errors, divisions by zero
and related arithmetic exceptions, uninitialized variables, data races on shared
data structures, etc. The analyzer was able to automatically discover the Ariane
501 ﬂight error. The static analysis of embedded safety critical software (such
as avionic software) is very promising.

I would love a thorough explanation of the impact this single event had on software testing approaches and tools.

1 The $7 billion figure possibly refers to the total cost of the Ariane 5 project, Wikipedia reports that the failure resulted in a loss of more than $370 million. Still a quite expensive failure but nowhere near the $7 billion figure.

答:
It was mostly a reuse problem and management problem and not a coding one. From my recollections (I'm problably getting some things wrong) of the report.

one subsystem had been designed for Ariane IV. Trajectories of Ariane IV could not result in the overflow and it was then purposely decided that if it occured, it was an hardware problem and shutting down the subsystem and going to the spare was the right thing to do.

for Ariane V, it was decided to reuse that subsystem and not to review the assumptions and the code but rely on testing.

further it was decided to drop full testing.

Different flight parameters of Ariane V made the overflow occurs. Shut down the primary. Shut down the spare. Autodestruction.

Additional things I remember:

the subsystem at the time of overflow was no more useful. One could argue that its failure shouldn't have triggered the autodestruction. (On the other hand, the added complexity could itself be a source of problems).

there was debug data sent to a bus when it shouldn't. I don't remember the specific.

ContentLicense: CC BY-SA 3.0


问:
Scrum Board for a distributed team
I am looking for recommendations on a digital Scrum Board which can be shared over the internet. I imagine something like a big tablet on which you can draw and which remote users can access, too.

I dislike Scrum software because I think one major benefit of a Scrum Board is its physical presence. It should be hard to ignore.

The best solution would be two big tablets on which you can draw and which can be synchronized.

Has anyone got product recommendations for something like this? Or would you rather use a software?

Kind regards,
Falcon

答: Check out Trello (trello.com) from Fog Creek Software. It's a kanban style board with live updates and can be used by multiple people. It's power is its simplicity. The tool doesn't get in the way so you can actually use it without getting mired down in process.</p>

Title: Scrum Board for a distributed team


答:
It depends on your situations. If some information is missed out during planning, and then later you figure out that you need to modify or add some points to a few stories, then I think it's fine. But, yes, if the scope of a feature changes completely, then thats an extreme situation, and needs to be handled differently.

But of course, during the planning, it is assumed, that everyone clearly knows and discusses about each of the features that they would be working on. If the discussions and planning is good, then in almost all the cases you don't really need any modifications.

Title: Confused about modifying the sprint backlog during a sprint

Body:
I've been reading a lot about scrum lately, and I've found what seem to me to be conflicting information about whether or not it's ok to change the sprint backlog during a sprint. The Wikipedia article on scrum says it's not ok, and various other articles say this as well.  Also my Software Development professor taught the same thing during an overview of scrum.

However, I read Scrum and XP from the Trenches and that describes a section for unplanned items on the taskboard. So then I looked up the Scrum Guide and it says that during the sprint "No changes are made that would affect the Sprint Goal" and in the discussion of the Sprint Goal "If the work turns out to be different than the
Development Team expected, then they collaborate with the Product Owner to negotiate the
scope of Sprint Backlog within the Sprint." It goes on to say in the discussion of the Sprint Backlog:

The Sprint Backlog is a plan with enough detail that changes in progress can be understood in
  the Daily Scrum. The Development Team modifies Sprint Backlog throughout the Sprint, and the
  Sprint Backlog emerges during the Sprint. This emergence occurs as the Development Team
  works through the plan and learns more about the work needed to achieve the Sprint Goal.

As new work is required, the Development Team adds it to the Sprint Backlog. As work is
  performed or completed, the estimated remaining work is updated. When elements of the plan
  are deemed unnecessary, they are removed. Only the Development Team can change its Sprint
  Backlog during a Sprint. The Sprint Backlog is a highly visible, real-time picture of the work that
  the Development Team plans to accomplish during the Sprint, and it belongs solely to the
  Development Team.

So at this point I'm altogether confused. Thinking about it, it makes more sense to me to take the second approach.  The individual, specific items in the backlog don't seem to me to be the most important thing, but rather the sprint goal, so not changing the sprint goal but being able to change the backlog makes sense. For instance if both the product owner and the team thought they were on the same page about a story, but as the sprint progressed they figured out there was a misunderstanding, it seems like it makes sense to change the tasks that make up that story accordingly.  Or if there was some story or task that was forgotten about, but is required to reach the sprint goal, I would think it would be best to add the story or task to the backlog during the sprint.

However, there are a lot of people who seem quite adamant that any change to the sprint backlog is not ok.  Am I misunderstanding that position somehow? Are those folks defining the sprint backlog differently somehow? My understanding of the sprint backlog is that it consists of both the stories and the tasks they're broken down into.

Anyway I would really appreciate input on this issue. I'm trying to figure out both what the idealistic scrum approach is to changing the sprint backlog during a sprint, and whether people who use scrum successfully for development allow changing the sprint backlog during a sprint.


问:
Who was the first software engineer?
It's fairly well known who the first programmer was but who was or were the first software engineer(s)? By software engineer I mean someone who uses formalized specifications and methods to deliver software not just a batch programming job. When was the term first used?</p>

答:
The first discussions of software engineering began in the mid-1950s, which places it around the same time as the SHARE user group previously mentioned in a now-deleted answer.

The widely accepted beginning to software engineering as a profession was at the NATO Science Committee conference in 1968 in Garmisch, Germany. The conference report (PDF) is often considered to be the very first definition of software engineering. A second conference, held in 1969 in Rome, Italy, was also sponsored by the NATO Science Committee and continued the work of the first (conference report PDF). You could define the attendees of this conference as the first software engineers.

However, there is some evidence that the first person to coin the term "software engineering" was Margaret Hamilton. She started to use the term at MIT during the early days of creating software for the Apollo missions.

Some of the earliest contributors to software engineering include:

Edsger W. Dijkstra, creator of structured programming (1960s) in addition to numerous contributions to mathematics and computer science

C.A.R. Hoare, creator or Hoare logic (1969) and Communicating Sequential Processes (1978) in addition to the creation of Quicksort

Winston W. Royce, author of the paper that formally described the Waterfall model and how it was inappropriate for effectively building large-scale software systems (1970)

David Parnas, credited with creating information hiding (1972) as well as a strong promoter of professionalism and ethics in software engineering

Fred Brooks, author of The Mythical Man-Month (1975) and other essays about software project management

Michael A. Jackson, creator of Jackson Structured Programming (1970s) and Jackson System Development (1980s)

Edward Yourdon, worked on the structured analysis techniques (1970s) and the Yourdon/Whitehead (1980s) and Coad/Yourdon (1990s) object-oriented analysis/design methodologies

Victor Basili, author of numerous reports and papers on the software development process and often attributed to starting empirical software engineering, specifically the goal/question/metric approach, the Quality Improvement Paradigm, and the Experience Factory while working at NASA's Software Engineering Laboratory from the mid 1970s through early 2000s

Barry Boehm, creator of COCOMO (1981), the Spiral Model (1986) COCOMO II (2000), the Spiral Model, and author of numerous papers and books about software development process, software metrics, and software cost models (most notably Software Engineering Economics, 1981)

Searching for "father of software engineering" tends to turn up many different names, since there were many people doing both academic research, analysis of software projects, and applied software engineering work at universities and companies around the world. However, David Parnas (professionalism/ethics), Fred Brooks (software project management), Barry Boehm (metrics and cost), and Victor Basili (empirical software engineering) tend to come up pretty frequently in their respective fields.

Something else to consider is that software engineering is a team activity. Many of the people that I named above were leaders of teams or organizations, their work was supported by any number of people "in the trenches" who might never get credit for being a part of a project or research effort that today is viewed as the beginning of software engineering.

Title: Who was the first software engineer?


问:
Why was ASCII needed?
With an encoding such as EBCDIC being in existence already (and being 8 bit to boot), what was the need to invent yet another encoding and a 7 bit one at that?

Why was ASCII invented and what problems with EBCDIC did supposed to solve?

答:
Development of ASCII started earlier than what you think (see for instance Eric Fischer's The Evolution of Character Codes, 1874-1968) and IBM 360 - for which EBCDIC was developed -- should have used ASCII if its development had not been so slow (see http://www.bobbemer.com/P-BIT.HTM)

See also C. E. Mackenzie, Coded Character Sets, History and Development, ser. The systems programming series. Addison-Wesley, 1980. which describes the development of ASCII, EBCDIC and some other character sets with rationale for some of the assignations (things about chain printers and punched cards are fascinatingly obsolete but still have influence on what we use).

Title: Why was ASCII needed?


问:
What is the proper way to do REST?
Everybody nowadays does SOA, even if some don't actually understand what is all about. So they do it wrong. Using that as an analogy I know what REST is (or at least I think I do) and want to do some of it. But I want to do it right.

So my question is what's the proper way to do REST?

答:
Well, there are a lot of ways to learn how to build a RESTful web application and no, there isn't a unique right way. RESTful is not a standard but it uses a set of standards (HTTP, URI, Mime Type, ...).

Start with this: How I Explained REST to my wife

Then, proceed with this: RESTful Web Services Cookbook

And then put your entire effort to develop web applications because the best way to learn is doing experiments and you can learn so much from your mistakes ;)

Don't worry if your first web apps won't be completely RESTful: you will find the way to do it!

So, quoting Obi-Wan Kenobi, "may the force be with you!" ;)

EDIT

Ok, let me be more specific.
You wanna make some RESTful webapp, huh? Well, as I said there are many ways to do it but this is the main guideline.

Definition

REST (Representational State Transfer) is a software architecture's style for distributed system (like WWW).
It is not a standard but it uses a set of standards: HTTP, AJAX, HTML, URI, Mime Type, etc.
We are talking about representation of a resource, not about a resource itself. Taken from 'How I explained REST to my wife':

Wife: A web page is a resource?

Ryan: Kind of. A web page is a representation of a resource. Resources are just concepts.

Architecture's Constraints

Client-Server: client and server are separated by the Uniform Interface (described below).

Stateless: server-client communication is done without saving a particular client state on the server.

Cachable: the client might have a cache of responses of requests already made.

Layered System: the client doesn't know if it's directly connected with an end-server or if the communication is done through intermediates.

Uniform Interface

Resources' Identification: each resource has to be identified by a URI.

Protocol: in order to get in communication client and server, a protocol has to be done before. Each request might have the right MIME Type (application/xml, text/html, application/rdf+xml, etc.), the right headers and the right HTTP method (see CRUD description below).

CRUD

Ok, we saw that to identify resources we can use URI, but we need something else for the actions (add, modify, delete, etc): a great welcome to CRUD (Create, Read, Update and Delete).

Create {HTTP: POST} {SQL: INSERT} => create a new resource

Read {HTTP: GET} {SQL: SELECT} => get a resource

Update {HTTP: PUT} {SQL: UPDATE} => modify a resource

Delete {HTTP: DELETE} {SQL: DELETE} => delete a resource

Now, concerning PUT and DELETE, some tech problems could appear (you'll get them with HTML form): often developers bypass this problem using POST for each 'PUT' and 'DELETE' request. Officially, you have to use PUT and DELETE. By the way, do what you want. My experience pushes me to use POST and GET every time.

--- Next part should be used but it isn't a REST's bond: it concerns Linked Data ---

URI

Abstract URI from technical details! Say goodbye to URI as follows:

```<code>http://www.example.com/index.php?query=search&id=9823&date=08272012
</code>```

Re-design URI! Take the link above and change it as follows:

```<code>http://www.example.com/search/2012/08/27/9823
</code>```

That's much better, huh?
It could be done by:

server application: a root file that routes each request.

server web: .htaccess file plus rewrite rules

client application: HTML5 history object or fragments (also Twitter uses fragments: http://www.twitter.com/#!/__wilky__)

Another thing: use different URI to represent different resources:

http://www.example.com/about (that's the resource)

http://www.example.com/about.html (that's the HTML representation of the resource)

http://www.example.com/about.rdf (that's the RDF representation of the resource)

Pay attention: about.html and about.rdf are not files! They could be the result of an XSLT transformation!

Content Negotiation

If you've reached this point, congratulations! Probably, you're ready to get more abstract concepts because we're entering in the Semantic Web technical details ;)
Well, when your client wants a resource, it typically makes the following request:

```<code>GET http://www.example.com/about
Accept: application/rdf+xml
</code>```

But the server won't respond with the about.rdf because it has a different URI (http://www.example.com/about.rdf).
So, let's have a look to the 303 pattern!
Server will return this:

```<code>303 See Other
Location: http://www.example.com/about.rdf
</code>```

And the client will follow the link returned as follows:

```<code>GET http://www.example.com/about.rdf
Accept: application/rdf+xml
</code>```

Finally, the server will return the resource requested:

```<code>200 OK
about.rdf
</code>```

Don't worry: your client application won't do anything of this!
The 303 pattern must be done by the server application and your browser will do the rest ;)

Conclusion

Often the theory is far, far away from the practice.
Yeah, now you know how to design and develop a RESTful application but the guideline above is just a hint.
You will find your best way to build web applications and probably it won't be the same as theory wants. Don't give it a damn :D!

Bibliography

RESTful Web Services, Sameer Tyagi

REST APIs must be hypertext-driven, Roy Thomas Fielding

RESTful Web services: The basics, Alex Rodriguez

Webber REST Workflow

Title: What is the proper way to do REST?

Body:
Well, there are a lot of ways to learn how to build a RESTful web application and no, there isn't a unique right way. RESTful is not a standard but it uses a set of standards (HTTP, URI, Mime Type, ...).

Start with this: How I Explained REST to my wife

Then, proceed with this: RESTful Web Services Cookbook

And then put your entire effort to develop web applications because the best way to learn is doing experiments and you can learn so much from your mistakes ;)

Don't worry if your first web apps won't be completely RESTful: you will find the way to do it!

So, quoting Obi-Wan Kenobi, "may the force be with you!" ;)

EDIT

Ok, let me be more specific.
You wanna make some RESTful webapp, huh? Well, as I said there are many ways to do it but this is the main guideline.

Definition

REST (Representational State Transfer) is a software architecture's style for distributed system (like WWW).
It is not a standard but it uses a set of standards: HTTP, AJAX, HTML, URI, Mime Type, etc.
We are talking about representation of a resource, not about a resource itself. Taken from 'How I explained REST to my wife':

Wife: A web page is a resource?

Ryan: Kind of. A web page is a representation of a resource. Resources are just concepts.

Architecture's Constraints

Client-Server: client and server are separated by the Uniform Interface (described below).

Stateless: server-client communication is done without saving a particular client state on the server.

Cachable: the client might have a cache of responses of requests already made.

Layered System: the client doesn't know if it's directly connected with an end-server or if the communication is done through intermediates.

Uniform Interface

Resources' Identification: each resource has to be identified by a URI.

Protocol: in order to get in communication client and server, a protocol has to be done before. Each request might have the right MIME Type (application/xml, text/html, application/rdf+xml, etc.), the right headers and the right HTTP method (see CRUD description below).

CRUD

Ok, we saw that to identify resources we can use URI, but we need something else for the actions (add, modify, delete, etc): a great welcome to CRUD (Create, Read, Update and Delete).

Create {HTTP: POST} {SQL: INSERT} => create a new resource

Read {HTTP: GET} {SQL: SELECT} => get a resource

Update {HTTP: PUT} {SQL: UPDATE} => modify a resource

Delete {HTTP: DELETE} {SQL: DELETE} => delete a resource

Now, concerning PUT and DELETE, some tech problems could appear (you'll get them with HTML form): often developers bypass this problem using POST for each 'PUT' and 'DELETE' request. Officially, you have to use PUT and DELETE. By the way, do what you want. My experience pushes me to use POST and GET every time.

--- Next part should be used but it isn't a REST's bond: it concerns Linked Data ---

URI

Abstract URI from technical details! Say goodbye to URI as follows:

http://www.example.com/index.php?query=search&id=9823&date=08272012

Re-design URI! Take the link above and change it as follows:

http://www.example.com/search/2012/08/27/9823

That's much better, huh?
It could be done by:

server application: a root file that routes each request.

server web: .htaccess file plus rewrite rules

client application: HTML5 history object or fragments (also Twitter uses fragments: http://www.twitter.com/#!/__wilky__)

Another thing: use different URI to represent different resources:

http://www.example.com/about (that's the resource)

http://www.example.com/about.html (that's the HTML representation of the resource)

http://www.example.com/about.rdf (that's the RDF representation of the resource)

Pay attention: about.html and about.rdf are not files! They could be the result of an XSLT transformation!

Content Negotiation

If you've reached this point, congratulations! Probably, you're ready to get more abstract concepts because we're entering in the Semantic Web technical details ;)
Well, when your client wants a resource, it typically makes the following request:

GET http://www.example.com/about
Accept: application/rdf+xml

But the server won't respond with the about.rdf because it has a different URI (http://www.example.com/about.rdf).
So, let's have a look to the 303 pattern!
Server will return this:

303 See Other
Location: http://www.example.com/about.rdf

And the client will follow the link returned as follows:

GET http://www.example.com/about.rdf
Accept: application/rdf+xml

Finally, the server will return the resource requested:

200 OK
about.rdf

Don't worry: your client application won't do anything of this!
The 303 pattern must be done by the server application and your browser will do the rest ;)

Conclusion

Often the theory is far, far away from the practice.
Yeah, now you know how to design and develop a RESTful application but the guideline above is just a hint.
You will find your best way to build web applications and probably it won't be the same as theory wants. Don't give it a damn :D!

Bibliography

RESTful Web Services, Sameer Tyagi

REST APIs must be hypertext-driven, Roy Thomas Fielding

RESTful Web services: The basics, Alex Rodriguez

Webber REST Workflow

ContentLicense: CC BY-SA 4.0


问:
Using a DSN database connection is a bad practice?
During all my professional lifetime that I have been programming in Windows enviroments, I advised my friends and coworkers to not use a DSN database connection in their applications, based on my own personal conclusions, but I really haven't seen any evidence of them.

I know that using a DSN connection via ODBC data source, implies that this connection will use an ODBC driver. I know by some documentation that ODBC is an language-agnostic, OS-agnotic API to connect to databases, everything that carries this level of flexibility comes with some downpoints (could be possible that some specific functionability can't be used with ODBC) or could be that the performance could be lower than using a more direct API (OLEDB or other).

I know that using a DSN-less connection has some problems by itself like securely storing the access information to the database server/file ( can be solved with some kind of encrypter on the data), or unexpected changes in the name of provider used in the connection drivers (Specific case of old informix drivers).

Is this correct, or I'm missunderstanding something?

答:
As KenK stated, an absolute "good" or "bad" is a tough call. One potential negative of using a DSN connection is that if changes need to be made it can be difficult to update all clients. Another is if developers need to switch servers for testing, it can be difficult to do so, particularly in corporate environments which are increasingly locking down developer access to control panel commands.
It may be easier and better to use a configuration file, which developers could be granted explicit permission to change locally on their development boxes, and could be updated as part of the network login script for regular users if changes need to be made.
There are other options as well. But it really depends on your specific needs.</p>


答:
One reason is because EBCDIC wasn't a good standard, at least depending on your purpose. For example, the letters aren't in two (upper and lower case) contiguous blocks - there are extra codes between the EBCDIC letter codes, some of them used for other valid characters. The ~ is between r and s, for example. This makes sorting a bit more difficult.

Another is precisely because ASCII is a 7 bit code. Saving one bit per character was worthwhile at the time, and even six-bit character codes weren't uncommon. Even when 8 bits were used per character, the eighth was often a parity bit and not part of the character code.

Title: Why was ASCII needed?

Body:
With an encoding such as EBCDIC being in existence already (and being 8 bit to boot), what was the need to invent yet another encoding and a 7 bit one at that?

Why was ASCII invented and what problems with EBCDIC did supposed to solve?


问:
Dependency injection: How to sell it
Let it be known that I am a big fan of dependency injection (DI) and automated testing. I could talk all day about it.

Background

Recently, our team just got this big project that is to built from scratch. It is a strategic application with complex business requirements. Of course, I wanted it to be nice and clean, which for me meant: maintainable and testable. So I wanted to use DI.

Resistance

The problem was in our team, DI is taboo. It has been brought up a few times, but the gods do not approve. But that did not discourage me.

My Move

This may sound weird but third-party libraries are usually not approved by our architect team (think: "thou shalt not speak of Unity, Ninject, NHibernate, Moq or NUnit, lest I cut your finger"). So instead of using an established DI container, I wrote an extremely simple container. It basically wired up all your dependencies on startup, injects any dependencies (constructor/property) and disposed any disposable objects at the end of the web request. It was extremely lightweight and just did what we needed. And then I asked them to review it.

The Response

Well, to make it short. I was met with heavy resistance. The main argument was, "We don't need to add this layer of complexity to an already complex project". Also, "It's not like we will be plugging in different implementations of components". And "We want to keep it simple, if possible just stuff everything into one assembly. DI is an uneeded complexity with no benefit".

Finally, My Question

How would you handle my situation? I am not good in presenting my ideas, and I would like to know how people would present their argument.

Of course, I am assuming that like me, you prefer to use DI. If you don't agree, please do say why so I can see the other side of the coin. It would be really interesting to see the point of view of someone who disagrees.

Update

Thank you for everyone's answers. It really puts things into perspective. It's nice enough to have another set of eyes to give you feedback, fifteen is really awesome! This are really great answers and helped me see the issue from different sides, but I can only choose one answer, so I will just pick the top voted one. Thanks everyone for taking the time to answer.

I have decided that it is probably not the best time to implement DI, and we are not ready for it. Instead, I will concentrate my efforts on making the design testable and attempt to present automated unit testing. I am aware that writing tests is additional overhead and if ever it is decided that the additional overhead is not worth it, personally I would still see it as a win situation since the design is still testable. And if ever testing or DI is a choice in future, the design can easily handle it.

答:
Since you asked, I'll take the side of your team against DI.

The case against Dependency Injection

There is a rule I call "Conservation of Complexity" that is analogous to the rule in physics called "Conservation of Energy."  It states that no amount of engineering can reduce the total complexity of an optimal solution to a problem, all it can do is shift that complexity around.  Apple's products are not less complex than Microsoft's, they simply move complexity from the user space into the engineering space.  (It is a flawed analogy, though.  While you cannot create energy, engineers have a nasty habit of creating complexity at every turn. In fact, a lot of programmers seem to enjoy adding complexity and using magic, which is by definition complexity that the programmer does not fully understand. This excess complexity can be reduced.)  Usually what looks like reducing complexity is simply shifting complexity somewhere else, usually to a library.

Similarly, DI does not reduce the complexity of linking up client objects with server objects.  What it does is take it out of Java and move it into XML.  That's good in that it centralizes everything into one (or a few) XML file(s) where it is easy to see everything that is going on and where it is possible to change things without recompiling the code. On the other hand, that's bad because the XML files are not Java and therefore are not available for Java tooling.  You cannot debug them in the debugger, you cannot use static analysis to trace through their call hierarchy, and so on. In particular, bugs in the DI framework become extremely difficult to detect, identify, and fix.

It is therefore much harder to prove a program to be correct when using DI.  Lots of people argue that programs using DI are easier to test, but program testing can never prove the absence of bugs. (Note that the linked paper is around 40 years old and so has some arcane references and cites some out-of-date practices, but many of the basic statements still hold true. In particular, that P <= p^n, where P is the probability that the system is free of bugs, p is the probability that a system component is free of bugs, and n is the number of components.  Of course, this equation is oversimplified, but it points to an important truth.)  The NASDAQ crash during the Facebook IPO is a recent example, where they claimed they had spent 1,000 hours testing the code and still did not uncover the bugs that caused the crash. 1,000 hours is half a person-year, so it's not like they were skimping on the testing.

True, hardly anyone ever undertakes (let alone completes) the task of formally proving any code is correct, but even weak attempts at proof beat out most testing regimes for finding bugs. Strong attempts at proof, for example L4.verified, invariably uncover a large quantity of bugs that testing did not and probably would never uncover unless the tester already knew the exact nature of the bug.  Anything that makes the code harder to verify by inspection can be seen as reducing the chance that bugs will be detected, even if it increases the ability to test.

Furthermore DI is not required for testing.  I rarely use it for that purpose, as I prefer to test the system against the real software in the system rather than some alternative testing version.  Everything I change in test is (or might as well be) stored in properties files that direct the program to resources in the test environment rather than production. I'd much rather spend time setting up a test database server with a copy of the production database than spend time coding up a mock database, because this way I will be able to track problems with production data (character encoding issues are just one example) and system integration bugs as well as bugs in the rest of the code.

Dependency Injection is also not required for Dependency Inversion.  You can easily use static factory methods to implement Dependency Inversion.  That is, in fact, how it was done in the 1990's.

In truth, although I've been using DI for a decade, the only advantages it provides that I find persuasive are the ability to configure third party libraries to use other third party libraries (e.g. set up Spring to use Hibernate and both to use Log4J) and the enabling of IoC via proxies. If you're not using third party libraries and not using IoC, then there's not much point to it and it does indeed add unwarranted complexity.

Title: Dependency injection: How to sell it


问:
Which things instantly ring alarm bells when looking at code?
I attended a software craftsmanship event a couple of weeks ago and one of the comments made was "I'm sure we all recognize bad code when we see it" and everyone nodded sagely without further discussion.

This sort of thing always worries me as there's that truism that everyone thinks they're an above average driver. Although I think I can recognize bad code I'd love to learn more about what other people consider to be code smells as it's rarely discussed in detail on people's blogs and only in a handful of books. In particular I think it'd be interesting to hear about anything that's a code smell in one language but not another.

I'll start off with an easy one:

Code in source control that has a high proportion of commented out
  code - why is it there? was it meant
  to be deleted? is it a half finished
  piece of work? maybe it shouldn't have
  been commented out and was only done
  when someone was testing something
  out? Personally I find this sort of
  thing really annoying even if it's just the odd line here and there, but when you see large blocks interspersed with the rest of the code it's totally unacceptable. It's
  also usually an indication that the rest of
  the code is likely to be of dubious
  quality as well.

答:
Bizarre indentation style.

There's a couple of very popular styles, and people will take that debate to the grave. But sometimes I see someone using a really rare, or even a home-grown indentation style.  This is a sign that they have probably not been coding with anyone other than themselves.

ContentLicense: CC BY-SA 2.5


问:
Can coding style cause or influence memory fragmentation?
As the title states, I'd like to know if coding style can cause or influence memory fragmentation in a native application, specifically one written using C++. If it does, I'd like to know how.

An example of what I mean by coding style is using std::string to represent strings (even static strings) and perform operations on them instead of using the C Library (such as strcmp, strlen, and so on) which can work both on dynamic strings and static strings (the latter point is beneficial since it does not require an additional allocation to access string functions, which is not the case with std::string).

A "forward-looking" attitude I have with C++ is to not use the CRT, since to do so would, in a way, be a step backwards. However, such a style results in more dynamic allocations, and especially for a long living application like a server, this causes some speculation that memory fragmentation might become a problem.

答:
The question and the supporting text don't match up.

Your supporting text is talking about comparing two libraries' memory usage, which can be tested fairly directly and is orthogonal to coding style. Just wrap up the C string operators in a thin C++-style object and you can work with them the same with little-to-any memory impact, for instance.

The question title implies difference in actual style, such as allocating/destroying objects as needed versus using an object pool, or constructing strings with imperative loops of logic and concatenation intertwined versus building up an array of strings imperatively and then constructing the final string all at once.

The answer to both, however, is the same: yes, they can influence memory fragmentation -- the underlying libraries work in different ways so they probably affect the memory in different ways, and your usage of the libraries can also impact memory fragmentation, and the "proper" style probably depends on the library that you're using.

C-style string manipulation can be very light on memory and better controlled for fragmentation issues, but you will pepper your executable with variables to keep track of the state of your output string as you assemble it, and if you don't put a lot of effort into it, you probably won't beat std::string's code for common use-cases. Of course, if you have no idea how std::string works behind-the-scenes, you could also make it do something stupid, but that's for you to decide on how much you want to learn the internals of your tools and how much it actually impacts what you're trying to accomplish.


答:
If you find yourself having to "sell" a principle to your team, then you're probably already several miles down the wrong path.

Nobody wants to do extra work, so if what you're trying to sell them looks to them like extra work, then you're not going to convince them by Repeated Invocation of Superior Argument. They need to know that you're showing them a way to reduce their workload, not increase it.

DI is often seen as extra complexity now with the promise of potential reduced complexity later, which has value, but not so much to someone who's trying to reduce their upfront workload. And in many cases, DI is just another layer of YAGNI. And the cost of this complexity is not zero, it's actually pretty high for a team that isn't used to this type of pattern. And that's real dollars being shoveled into a bucket that may never yield any benefit.

Put it in its place

Your best bet is to use DI where's it's glaringly useful, rather than just where it's common. For example, many apps use DI to select and configure databases. And if your app ships with a database layer then that's a tempting place to put it. But if your app ships with a built-in user-invisible database which is otherwise tightly integrated into the code, then the chances of needing to replace the DB at runtime approach zero. And selling DI by saying, "look, we can easily do this thing that we will never, ever, ever want to do," is likely to get you on the "this guy has bad ideas" list with your boss.

But say instead you have debugging output that normally gets IFDEF'ed out in release. And every time a user has a problem, your support team has to send them a debug build just so that they can get the log output. You can use DI here to allow the customer to switch between log drivers -- LogConsole for developers, LogNull for customers, and LogNetwork for customers with problems. One unified build, runtime configurable.

Then you don't even have to call it DI, instead it's just called "Mel's really good idea" and you're now on the good-ideas list instead of the bad one. People will see how well the pattern works, and start using it where it makes sense in their code.

When you properly sell an idea, people won't know that you convinced them of anything.

Title: Dependency injection: How to sell it

Body:
Let it be known that I am a big fan of dependency injection (DI) and automated testing. I could talk all day about it.

Background

Recently, our team just got this big project that is to built from scratch. It is a strategic application with complex business requirements. Of course, I wanted it to be nice and clean, which for me meant: maintainable and testable. So I wanted to use DI.

Resistance

The problem was in our team, DI is taboo. It has been brought up a few times, but the gods do not approve. But that did not discourage me.

My Move

This may sound weird but third-party libraries are usually not approved by our architect team (think: "thou shalt not speak of Unity, Ninject, NHibernate, Moq or NUnit, lest I cut your finger"). So instead of using an established DI container, I wrote an extremely simple container. It basically wired up all your dependencies on startup, injects any dependencies (constructor/property) and disposed any disposable objects at the end of the web request. It was extremely lightweight and just did what we needed. And then I asked them to review it.

The Response

Well, to make it short. I was met with heavy resistance. The main argument was, "We don't need to add this layer of complexity to an already complex project". Also, "It's not like we will be plugging in different implementations of components". And "We want to keep it simple, if possible just stuff everything into one assembly. DI is an uneeded complexity with no benefit".

Finally, My Question

How would you handle my situation? I am not good in presenting my ideas, and I would like to know how people would present their argument.

Of course, I am assuming that like me, you prefer to use DI. If you don't agree, please do say why so I can see the other side of the coin. It would be really interesting to see the point of view of someone who disagrees.

Update

Thank you for everyone's answers. It really puts things into perspective. It's nice enough to have another set of eyes to give you feedback, fifteen is really awesome! This are really great answers and helped me see the issue from different sides, but I can only choose one answer, so I will just pick the top voted one. Thanks everyone for taking the time to answer.

I have decided that it is probably not the best time to implement DI, and we are not ready for it. Instead, I will concentrate my efforts on making the design testable and attempt to present automated unit testing. I am aware that writing tests is additional overhead and if ever it is decided that the additional overhead is not worth it, personally I would still see it as a win situation since the design is still testable. And if ever testing or DI is a choice in future, the design can easily handle it.


答:
It's pretty unlikely. Fragmentation, as far as I am aware, is not a significant issue in modern memory allocators.

Also, you can simply roll a custom allocator that uses an arena or pool to handle memory.

Of course, fragmentation is a complete non-issue with C strings, as your program will probably crash almost immediately at launch thanks to a missed NULL terminator, and exhibit plenty of security vulnerabilities and other fun things, all of which would be more important than a little fragmentation.

Title: Can coding style cause or influence memory fragmentation?

Body:
As the title states, I'd like to know if coding style can cause or influence memory fragmentation in a native application, specifically one written using C++. If it does, I'd like to know how.

An example of what I mean by coding style is using std::string to represent strings (even static strings) and perform operations on them instead of using the C Library (such as strcmp, strlen, and so on) which can work both on dynamic strings and static strings (the latter point is beneficial since it does not require an additional allocation to access string functions, which is not the case with std::string).

A "forward-looking" attitude I have with C++ is to not use the CRT, since to do so would, in a way, be a step backwards. However, such a style results in more dynamic allocations, and especially for a long living application like a server, this causes some speculation that memory fragmentation might become a problem.


问:
Software Optimization vs. Hardware Optimization - what has the bigger impact?
I was wondering how software optimization and hardware optimization compare when it comes to the impact they have on speed and performance gains of computers.

I have heard that improving software efficiency and algorithms over the years has made huge performance gains. Obviously both are extremely important, but what has made the bigger impact in the last 10, 20 or 30 years?

And how do hardware changes affect the software changes? How much of software optimization is a direct result of hardware improvements and how much is independent of the hardware?

To be clear, I am asking about software optimizations at the level of compilers and operating systems. Obviously using better high level-algorithms will result in the largest speed ups (think: quick-sort vs. bubble-sort), but this question is about the underlying reason why computers are faster today, in general.

答:
The bigger increase in performance definitely comes from hardware.

In terms of software, one of the biggest changes in the past 30 years is that we don't write nearly as much low level code as we used to.  For example, software now relies on automatic compiler optimizations as opposed to hand written assembly, and makes extensive use of existing frameworks and patterns which have matured in the past few decades.  On the other hand, software has become increasingly complex, and there have been corresponding performance hits.

However, hardware capabilities have improved mostly in accordance to Moore’s Law, and CPU speeds and memory bandwidth have increased hundreds of times over the past 30 years.  Manufacturing processes have improved, allowing components to become smaller and faster because more transistors can be packed together.  One of the biggest things which has sped up computers is memory access and usage of caching.  CPU cache sizes are now bigger than total RAM used to be, and low level programs have shifted to make better use of this.  Also, when 64 bit CPUs became commonplace, a corresponding instruction set (i.e. x86-64, the use of which might still qualify as “software”) was required to take proper advantage of this.  In that way, it is a combination of improvements in hardware, that are taken better advantage of by shifts in software design.

In short, the biggest incremental strides in performance come from hardware – however changes to software are often required to make optimal use of new hardware.  Either one doesn’t really work without the other!


答:
Technically speaking, it was more a case of "software rot".  The flight control software was recycled from the earlier Ariane 4 rocket, a sensible move given how expensive it is to develop software, especially when it's mission critical software which must be tested and verified to far more rigorous standards than most commercial software needs to be.

Unfortunately, nobody bothered testing what effect the change in operating environment would have, or if they did they didn't do said testing to a sufficiently thorough standard.

The software was built to expect certain parameters to never exceed certain values (thrust, acceleration, fuel consumption rates, vibration levels, etc).  In normal flight on an Ariane 4 this wasn't a problem because those parameters would never reach invalid values without something already being spectacularly wrong.  The Ariane 5, however, is much more powerful and ranges that would seem to be silly on the 4 could quite easily happen on the 5.

I'm not sure what parameter it was that went out of range (it might have been acceleration, I'll have to check), but when it did, the software was unable to cope and suffered an arithmetic overflow for which there had been insufficient error checking and recovery code implemented.  The guidance computer started sending garbage to the engine nozzle gimbals, which in turn started pointing the engine nozzle pretty much randomly.  The rocket started to tumble and break up, and the automatic self-destruct system detected the rocket was now in an unsafe irrecoverable attitude and finished the job.

To be honest, this incident probably didn't teach any new lessons, as the kind of problems have been unearthed before in all manner of systems, and there are already strategies in place to deal with finding and fixing errors.  What the incident did do was ram home the point that being lax in following those strategies can have enormous consequences, in this case millions of dollars of destroyed hardware, some extremely pissed off customers and an ugly dent in the reputation of Arianespace.

This particular case was especially glaring because a shortcut taken to save money ended up costing a huge amount, both in terms of money and lost reputation.  If the software had been tested just as robustly in an Ariane 5 simulated environment as it had been when it was originally developed for Ariane 4, the error surely would have come to light long before the software was installed in launch hardware and put in command of an actual flight.  Additionally, if a software developer had deliberately thrown some nonsense input into the software then the error might have even been caught in the Ariane 4 era, as it would have highlighted the fact that the error recovery that was in place was inadequate.

So in short, it didn't really teach new lessons, but it rammed home the dangers of not remembering old ones.  It also demonstrated that the environment within which a software system operates is every bit as important as the software itself.  Just because the software is verifiably correct for environment X doesn't mean it's fit for purpose in the similar but distinct environment Y.  Finally it highlighted how important it is for mission critical software to be robust enough to deal with circumstances that shouldn't have happened.

Contrast flight 501 with Apollo 11 and its computer problems.  Whilst the LGC software suffered from a serious glitch during the landing, it was designed to be extremely robust and was able to remain in an operational state in spite of the software alarms that were triggered, without putting any astronauts in danger and still being able to complete its mission.

Title: What was the historical impact of Ariane 5's Flight 501?

Body:
The disintegration of the Ariane 5 rocket 37 seconds after launch on her maiden voyage (Flight 501) is commonly referred to as one of the most expensive software bugs in history1:

It took the European Space Agency 10 years and $7 billion to produce Ariane 5, a giant rocket capable of hurling a pair of three-ton satellites into orbit with each launch and intended to give Europe overwhelming supremacy in the commercial space business.

All it took to explode that rocket less than a minute into its maiden voyage last June, scattering fiery rubble across the mangrove swamps of French Guiana, was a small computer program trying to stuff a 64-bit number into a 16-bit space.

One bug, one crash. Of all the careless lines of code recorded in the annals of computer science, this one may stand as the most devastatingly efficient. From interviews with rocketry experts and an analysis prepared for the space agency, a clear path from an arithmetic error to total destruction emerges.

What major changes did Flight's 501 failure and the subsequent investigations inspire to the research of safety critical systems and software testing?

I'm not looking for an explanation of the bug itself, but for an explanation of the historical impact of the bug, in terms of research that were inspired from or were directly related to the investigation(s) of the failure. For example this paper concludes:

We have used static analysis to:

check the initialization of variables,

provide the exhaustive list of potential data access conflicts for shared variables,

exhaustively list the potential run time errors from the Ada semantics.

To our knowledge this is the first time boolean-based and non boolean-based static analysis techniques are used to validate industrial programs.

Similarly, this paper(pdf) notes:

Abstract interpretation based static program analyses have been used for the
static analysis of the embedded ADA software of the Ariane 5 launcher and
the ARD. The static program analyser aims at the automatic detection of
the deﬁniteness , potentiality, impossibility or inaccessibility of run-time errors
such as scalar and ﬂoating-point overﬂows, array index errors, divisions by zero
and related arithmetic exceptions, uninitialized variables, data races on shared
data structures, etc. The analyzer was able to automatically discover the Ariane
501 ﬂight error. The static analysis of embedded safety critical software (such
as avionic software) is very promising.

I would love a thorough explanation of the impact this single event had on software testing approaches and tools.

1 The $7 billion figure possibly refers to the total cost of the Ariane 5 project, Wikipedia reports that the failure resulted in a loss of more than $370 million. Still a quite expensive failure but nowhere near the $7 billion figure.


答:
Sure, coding style can impact memory fragmentation since coding style will change your allocation/deallocation patterns which are the largest impact on fragmentation.

That said, using C++ vs C strings isn't a coding style. Further, different coding styles (especially in C++) exist to decrease complexity, increase readability, increase testability, increase robustness, increase correctness, or in C++'s case protect you from all of its landmines. All of which are far and away more important than memory fragmentation.


答:
a REST bible book or something....

No bible book necessary; I had the same exact questions, and learned everything I needed or wanted to know about REST by reading these three articles:

A Beginner's Introduction to HTTP and REST from Net Tuts+

RESTful Web services: The basics from IBM developerWorks

RESTful HTTP in practice from InfoQ

But I want to do it right.

As you'll read in the articles above, the key is to think of the accessible pieces of your application as "resources" that can be created, retrieved, updated, or deleted using the existing HTTP "verbs": GET, PUT, POST, DELETE.

Also, know the difference between PUT and POST, and when to use them.  GET, PUT, AND DELETE should be idempotent transactions, POST should not.

Also, make proper use of the HTTP status codes when communicating back to the client.

Title: What is the proper way to do REST?

Body:
Everybody nowadays does SOA, even if some don't actually understand what is all about. So they do it wrong. Using that as an analogy I know what REST is (or at least I think I do) and want to do some of it. But I want to do it right.

So my question is what's the proper way to do REST?


问:
WCF Service in an N-tier Application
Is it recommended to use a WCF Service Library in developing an N-Tier Windows Application? Also is it better to use the VS wizards to create the DataTables and DataSets? And if so should I add all of my tables to 1 dataset or have a dataset for each table? This is all new to me and I want to learn it the right way.</p>

答:
Yes but not with datasets or datatables. I would personally create a Library of Data Transfer Objects (DTO) comprised of primitive types, rather than (I assume) ado.net datatables. The reasoning is that datatables and datasets can be rather laborious to consume by non .net clients.

Secondly, you have a wide range of transport protocols with WCF and can with switch between tcp/ip or http as the demands of your service consumers alters.

I would read up on Juval Lowy's though from the iDesign.net site or books to get a better handle on things

Title: WCF Service in an N-tier Application


答: As others have mentioned, it caused the industry in general to re-examine the concept of re-use, and place it in a larger frame of reference whereby components are not evaluated in isolation but in the context of the whole system.  This significantly reduces the attractiveness of re-use, since even if a component can be re-used without changes, it still has to be analyzed with a new set of assumptions.  Another corollary is that backup hardware running the same software is not nearly as attractive, since most modern hardware is orders of magnitude more reliable than modern software.  I have heard that some defense contracts require two separate software systems developed by different teams using different technologies working from the same specification to verify proper implementation.</p>


答:
If hardware gives a speedup ratio of 2x, then that makes everything 2x faster than before.

If a new compiler optimization gives a speedup ratio of 2x, then that also makes everything 2x faster than before.

Together these will make things 4x faster than before.

Before that cheers you up, there's a very old rule: Nature Abhors a Vacuum.
If there's spare room on RAM, somebody will fill it up.
If there's spare room on disk, somebody will fill it up.
If there are spare cycles on your CPU, somebody will use them up.

Don't think so? Find that old discarded laptop with the 500mhz processor and 3gb disk and try to install some new software on it.

Programmers (including me) tend to write code that uses up the available cycles, no matter how many the hard-working engineers give us, and not always for more functionality.

Title: Software Optimization vs. Hardware Optimization - what has the bigger impact?

Body:
I was wondering how software optimization and hardware optimization compare when it comes to the impact they have on speed and performance gains of computers.

I have heard that improving software efficiency and algorithms over the years has made huge performance gains. Obviously both are extremely important, but what has made the bigger impact in the last 10, 20 or 30 years?

And how do hardware changes affect the software changes? How much of software optimization is a direct result of hardware improvements and how much is independent of the hardware?

To be clear, I am asking about software optimizations at the level of compilers and operating systems. Obviously using better high level-algorithms will result in the largest speed ups (think: quick-sort vs. bubble-sort), but this question is about the underlying reason why computers are faster today, in general.


问:
Is it a good idea to use CouchDB?
Is it a good idea to use CouchDB for a web application that is going to be platform agnostic (from tablet to PC):

The app is a big form which I need to be able to modify at will.

I also need to scan the results to retrieve the data to send some file
to help the client.

I need to be able to upload the results to a master server.

I want to mainly use the app offline and online at will.

The data is questions with answers and comments linked to them. At the end a percentage is generated for the user and depending on the result, a call to another application will be made to "send" information to the user depending on its results.

The application needs to be offline because we don't know if the user is connected to the internet at the time they answer the questions. The data needs to be the same on all platforms (replication is a given).

I cannot rely on the browser even if the app is going to be built with HTML5, CSS and JavaScript. Is it possible with CouchDB and is it a too big mandate for only one person?

If there are not enough details, ask and I will explain more thoroughly.

EDIT:

After all your answers here is what i have concluded.

I am gonna use SQLite and sync it with our sql databases.

NoSQL is not made for the kind of app i am working on.

Using what you know is sometimes the way to go

If you dont know how to use the technology and intend to use it for a huge project your coding alone. dont.

答:
No

The choice of database depends largely on the nature of the data and how its being used.  But you leave that information completely out of your question, and for some reason include the type of hardware the web client would run on (which is largely irrelevant, as Frustrated points out).  I'm interpreting that as meaning you are very new to programming, or at least any sort of database work.  As such, I'd recommend against CouchDB in favor of starting off with an SQL based database such as MySQL, where there'd be many more resources for you to learn from.  There's nothing wrong with CoutchDB - I just think you'd have a better time getting up to speed on databases in general by first starting with a more widely supported database.

Title: Is it a good idea to use CouchDB?


问:
What is the most complicated data structure you have used in a practical situation?
The germ for this question came up from a discussion I was having with couple of fellow developers from the industry.

Turns out that in a lot of places project managers are wary about complex data structures, and generally insist on whatever exists out-of-the-box from standard library/packages. The general idea seems to be like use a combination of whats already available unless performance is seriously impeded. This helps keeping the code base simple, which to the non-diplomatic would mean "we have high attrition, and newer ones we hire may not be that good".

So no bloom filter or skip-lists or splay trees for you CS junkies. So here's the question (again): Whats the most complicated data structure you did or used in office?

Helps get a sense of how good/sophisticated real world software are.

答:
Does a priority queue count?  That comes up in just about every real-time application I've written.  It became part of the standard Java library only recently (Java 1.5).

Other than that, I can't think of anything complicated that I really wanted that I haven't been able to pull out of a library.  I wouldn't let that stop me, but I would question why I needed a data structure too exotic for the libraries to include.  I would definitely look for an existing open-source implementation of a trie or a bloom filter or a skip list before I tried writing one myself.

In general I agree with your manager that the cost of building and maintaining a custom data structure too esoteric for there to be no library version is likely to outweigh any performance benefit derived from it.  I'd want you to show, via profiling, that the plain library structures are causing a significant performance penalty before I'd let you go ahead and optimize them with something fancy.  Because as a general rule, it's cheaper to buy processor cycles than engineering cycles.


答: I'd say Herman Hollerith pretty much had "formalized specifications and methods" down in his design for a census tabulating machine back in 1889. His specs are pretty typical for engineer specs from that era. While there's a lot of hardware involved, you can take the software portion of his specs and write a decent tabulation program using modern tools.</p>

Title: Who was the first software engineer?

Body: It's fairly well known who the first programmer was but who was or were the first software engineer(s)? By software engineer I mean someone who uses formalized specifications and methods to deliver software not just a batch programming job. When was the term first used?</p>


问:
Testing thread safety
Say you have a function f that is or contains a critical section.  How would you unit test that only one thread can run it at once, that it doesn't have race conditions, and that it doesn't cause a deadlock, etc...?

答: TDD is useless in multi-threaded scenarios. You don't test thread safety, you prove it, or it counter-proves you, painfully...</p>

Title: Testing thread safety


问:
Was classical BASIC ever used for commercial software development, and if so, how were limitations overcome?
Many of us, including me, started their programming life with programs written on home computers, something like

```<code>10 PRINT "ENTER RADIUS"
20 INPUT R
30 PRINT "CIRCUMFERENCE="; 2 * R * PI
40 PRINT "AGAIN?"
50 INPUT A$
60 IF A$="Y" THEN GOTO 10
70 END
</code>```

Of course, the line-number based BASIC was prone for creating spagetti code, also because most BASIC dialects missed structural statements like WHILE, doing everything but the FOR-loop with IF, GOTO and GOSUB. I'm talking about BASIC dialects before 1991, when QBASIC and Visual Basic appeared.

While BASIC dialects may have promoted bad style amongst aspiring programmers, were there larger commercial projects created in such a BASIC dialect? If so, how did they manage to live with and workaround the obvious shortcomings?

By "serious", I mean:

Not a game (I know some commercial games were written in BASIC, for example, Pimania)

Not freeware

Not trivial, that is, reasonably large (say: at least 1500 LOC)

Sold to several customers (not an in-house development)

"Mission critical" is a plus

答:
In the early 1980s the U.S. Air Force bought a bunch of Cromemco S100 bus computers for use by flying squadrons as a flight planning tool.

The flight planning software was developed using BASIC by Air Force pilots and navigators at the Tactical Air Warfare Center, located at Eglin AFB, Florida.

As far as working around the "the obvious shortcomings" of BASIC, we really didn't know any better. Just giving physical access to a computer to an aircrew seemed like an incredible leap of technology at the time.


答:
Is it recommended to use a WCF Service Library in developing an N-Tier Windows Application?

WCF is a good way to access databases through fire walls. However if your application is an application used by users in the same office where there is a common LAN, I don't think the complexity would be justified. This is especially true if the database is owned and controlled only by this one application.

Also is it better to use the VS wizards to create the DataTables and DataSets?

In many cases, you need to taylor the data passed between the tiers or layers. I would suggest that you look into Entity Framework or another ORM to take care of this for you. Also suggestion by @Ourjamie is good.

should I add all of my tables to 1 dataset or have a dataset for each table?
  As a rule you need to optimize the data moved between tears/layer. Some times you don't need the features of a dataset (like tracking changes), so you don't use what you don't need. Your choice of a data structure will also be affected by the bind mechanism on the client and how you plan to notify the data layer of data changes. It is easier to use datasets but not always popular.

I suggest you assess your real need for an N-tier architecture (if N>2). Also, you may want to consider Microsoft RIA Services that may be easier for you than WCF. One last word, sometimes the skills of the team drives technology. Make sure your team is good enough in these technologies before commuting deadlines.

Title: WCF Service in an N-tier Application

Body: Is it recommended to use a WCF Service Library in developing an N-Tier Windows Application? Also is it better to use the VS wizards to create the DataTables and DataSets? And if so should I add all of my tables to 1 dataset or have a dataset for each table? This is all new to me and I want to learn it the right way.</p>


问:
How should I implement an unsubscribe feature for text messages?
On many e-mail subscription lists, the is a link at the bottom that says something to the effect of:

You are subscribed to our e-mail list as you@example.com. To unsubscribe, click here

What is the best way (and is there a way?) to emulate this when sending out mass text messages through SMS gateway?

答:
Something like

Reply NO to unsubscribe

Then you can receive responses, extract the source phone numbers, and remove the numbers from the mass-sending list.

Most phones have a 'Reply to this SMS' function, and typing NO should not be excessively taxing.

You don't need a fancy unique number found in un-subscription URLs, since you have the source number in every incoming SMS.


问:
How should code in version control be stored?
How should code in version control be stored?

Developer friendly? so that programmer can quickly take the latest and able to run from his editor without doing many changes? (like config files pointing to dev DB..etc)

or

Should it be production friendly? source should be in a manner which is easy to deploy on production environment and when developer takes the latest, he should perform changes as per his development needs.

答: Definitely developer friendly, with scripts to automate changes for QA & production.</p>


答: Peachtree Software's entire accounting line (accounts receivable, payable, etc.) were all written (and still might be, for all I know) in BASIC.  When the IBM PC was first rolled out I spent many a long evening debugging and fixing their code for customers that bought an IBM Personal Computer and the Peachtree packages to do the books for their small business.</p>

Title: Was classical BASIC ever used for commercial software development, and if so, how were limitations overcome?

Body:
Many of us, including me, started their programming life with programs written on home computers, something like

```<code>10 PRINT "ENTER RADIUS"
20 INPUT R
30 PRINT "CIRCUMFERENCE="; 2 * R * PI
40 PRINT "AGAIN?"
50 INPUT A$
60 IF A$="Y" THEN GOTO 10
70 END
</code>```

Of course, the line-number based BASIC was prone for creating spagetti code, also because most BASIC dialects missed structural statements like WHILE, doing everything but the FOR-loop with IF, GOTO and GOSUB. I'm talking about BASIC dialects before 1991, when QBASIC and Visual Basic appeared.

While BASIC dialects may have promoted bad style amongst aspiring programmers, were there larger commercial projects created in such a BASIC dialect? If so, how did they manage to live with and workaround the obvious shortcomings?

By "serious", I mean:

Not a game (I know some commercial games were written in BASIC, for example, Pimania)

Not freeware

Not trivial, that is, reasonably large (say: at least 1500 LOC)

Sold to several customers (not an in-house development)

"Mission critical" is a plus


答:
My first job was in 1981 programming Apple IIs in Basic at a Price Waterhouse (Pre Coopers) office in their management consultancy in Belfast, N. Ireland. A team of two/three of us  developed and installed systems in clients including a bookshop and a slaughterhouse. It was a financial modelling system, effectively a very complex Visicalc spreadsheet (50 sheets, 3,000 variables) turned into a large Basic program. It took two days running on an Apple II system with 4 disk drives to process a week's throughput at the slaughterhouse. A bit quicker than their manual system that had taken two man weeks for each week.

We then moved onto Act Sirius machines, again programming in Basic (the Microsoft 8KB Basic) which were installed in clients.

The Basic had line numbers but there was a toolkit that could renumber programs. As I was fresh out of Uni where I had learnt Pascal, I tried to write in as structured style as possible (as much as you can in Basic), but Gotos and Gosubs were of course used.

I later programmed in 1983 on Dec Rainbow which used CBasic, a clunky compiled basic.


问:
How do you handle / what do you charge for documentation, training, warranty, changes in scope etc…
I am working with a client right now that wants me to sign a contact with a warranty for a year for no additional charge. As well as any reasonable changes he wants during the contract that are outside of the guidelines for no additional charge while not affecting deadlines. And lastly documentation and training for all staff for no additional charge.

Red flags are going everywhere in this contract and I wanted to hear from professionals how you guys handle / what you charge for documentation, training, warranty, changes in scope etc...

答:
Can you provide all those things with no additional work? The customer seems to think so.

Other reasonable interpretations are that the customer doesn't think those things add much value (in which case it shouldn't be a big deal to drop them from the contract) or the customer is trying to get something for nothing.

Try: "we strive to provide excellent service and excellent value, but we hope you'll understand that we can't work for free." If that doesn't work, try the door.


问:
Are Django forms violating MVC?
I just started working with Django coming from years of Spring MVC and the forms implementation strikes as being slightly crazy. If you're not familiar, Django forms starts with a form model class that defines your fields. Spring similarly starts with a form-backing object. But where Spring provides a taglib for binding form elements to the backing object within your JSP, Django has form widgets tied directly to the model. There are default widgets where you can add style attributes to your fields to apply CSS or define completely custom widgets as new classes. It all goes in your python code. That seems nuts to me. First, you are putting information about your view directly in your model and secondly you are binding your model to a specific view. Am I missing something?

EDIT: Some example code as requested.

Django:

```<code># Class defines the data associated with this form
class CommentForm(forms.Form):
    # name is CharField and the argument tells Django to use a <input type="text">
    # and add the CSS class "special" as an attribute. The kind of thing that should
    # go in a template
    name = forms.CharField(
                widget=forms.TextInput(attrs={'class':'special'}))
    url = forms.URLField()
    # Again, comment is <input type="text" size="40" /> even though input box size
    # is a visual design constraint and not tied to the data model
    comment = forms.CharField(
               widget=forms.TextInput(attrs={'size':'40'}))
</code>```

Spring MVC:

```<code>public class User {
    // Form class in this case is a POJO, passed to the template in the controller
    private String firstName;
    private String lastName;
    get/setWhatever() {}
}

<!-- JSP code references an instance of type User with custom tags -->
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!-- "user" is the name assigned to a User instance -->
<form:form commandName="user">
      <table>
          <tr>
              <td>First Name:</td>
              <!-- "path" attribute sets the name field and binds to object on backend -->
              <td><form:input path="firstName" class="special" /></td>
          </tr>
          <tr>
              <td>Last Name:</td>
              <td><form:input path="lastName" size="40" /></td>
          </tr>
          <tr>
              <td colspan="2">
                  <input type="submit" value="Save Changes" />
              </td>
          </tr>
      </table>
  </form:form>
</code>```

答:
I'm answering this old question because the other answers seem to avoid the specific issue mentioned.

Django forms allow you to easily write little code and create a form with sane defaults.  Any amount of customization very quickly leads to "more code" and "more work" and somewhat nullifies the primary benefit of the form system

Template libraries like django-widget-tweaks make customizing forms much easier.  Hopefully field customizations like this will eventually be easy with a vanilla Django installation.

Your example with django-widget-tweaks:

```<code>{% load widget_tweaks %}
<form>
  <table>
      <tr>
          <td>Name:</td>
          <td>{% render_field form.name class="special" %}</td>
      </tr>
      <tr>
          <td>Comment:</td>
          <td>{% render_field form.comment size="40" %}</td>
      </tr>
      <tr>
          <td colspan="2">
              <input type="submit" value="Save Changes" />
          </td>
      </tr>
  </table>
</code>```

Title: Are Django forms violating MVC?

Body:
I'm answering this old question because the other answers seem to avoid the specific issue mentioned.

Django forms allow you to easily write little code and create a form with sane defaults.  Any amount of customization very quickly leads to "more code" and "more work" and somewhat nullifies the primary benefit of the form system

Template libraries like django-widget-tweaks make customizing forms much easier.  Hopefully field customizations like this will eventually be easy with a vanilla Django installation.

Your example with django-widget-tweaks:

{% load widget_tweaks %}
<form>
  <table>
      <tr>
          <td>Name:</td>
          <td>{% render_field form.name class="special" %}</td>
      </tr>
      <tr>
          <td>Comment:</td>
          <td>{% render_field form.comment size="40" %}</td>
      </tr>
      <tr>
          <td colspan="2">
              <input type="submit" value="Save Changes" />
          </td>
      </tr>
  </table>


答:
Why not to have a branch (depending of what version control you use - I use Git) for the deployable code and other for the developer ready version? This sounds much better and isn't that hard to setup.

You can work and commit your changes and then merge them on the deployable version.

Body:
How should code in version control be stored?

Developer friendly? so that programmer can quickly take the latest and able to run from his editor without doing many changes? (like config files pointing to dev DB..etc)

or

Should it be production friendly? source should be in a manner which is easy to deploy on production environment and when developer takes the latest, he should perform changes as per his development needs.


答:
Why not to have the necessary data for the questions and answers stored on the device with sqlite and sync with a main web server with something you can handle?

It could be CouchDB, MongoDB, SQL Server, MySQL Server or any other solution. It doesn't really matter what would be the server technology, as far as the client can sync its data and the data persists on the device.

A "One stone two birds" solution doesn't mean the better one at all times and can kill your development time and requirements easy.

Title: Is it a good idea to use CouchDB?

Body:
Is it a good idea to use CouchDB for a web application that is going to be platform agnostic (from tablet to PC):

The app is a big form which I need to be able to modify at will.

I also need to scan the results to retrieve the data to send some file
to help the client.

I need to be able to upload the results to a master server.

I want to mainly use the app offline and online at will.

The data is questions with answers and comments linked to them. At the end a percentage is generated for the user and depending on the result, a call to another application will be made to "send" information to the user depending on its results.

The application needs to be offline because we don't know if the user is connected to the internet at the time they answer the questions. The data needs to be the same on all platforms (replication is a given).

I cannot rely on the browser even if the app is going to be built with HTML5, CSS and JavaScript. Is it possible with CouchDB and is it a too big mandate for only one person?

If there are not enough details, ask and I will explain more thoroughly.

EDIT:

After all your answers here is what i have concluded.

I am gonna use SQLite and sync it with our sql databases.

NoSQL is not made for the kind of app i am working on.

Using what you know is sometimes the way to go

If you dont know how to use the technology and intend to use it for a huge project your coding alone. dont.


答:
Sure. Before the Altair/MITS/SWTPC/Kim/Sinclair/Pet/RadioScrap/OSI/Apple things happened, there was a delightful little machine known as the IBM 5100. It had BASIC in ROM, a big cassette tape drive (or two), 8 KB of memory. a 24 line screen, and a printer, all for a measly USD 10,000 -- an order of magnitude cheaper than your typical mini. Originally built for scientists (APL in ROM was also an option), but then a few accounting types discovered it, and started a craze: every small business wanted one. With custom software, of course. The 5110 followed that, with the tape drives replaced by 8" floppies.

Any commercial software?  Galoons.

Can you say general ledger, payroll, accounts payable, accounts receivable, inventory control, and invoicing?  I have been there, done that -- in BASIC.  Utility bills, new and used car inventory, garbage truck pickup and beverage delivery scheduling? Yup -- BASIC. Want to track iron ore from mines onto trains onto ships... BASIC. Everything that wasn't raised floor was likely getting done in BASIC. Commercially, I mean. (Because RPG II doesn't count ;-).

How did one work around the limitations?

Well, the first thing you did was send the customer back to IBM for more memory, Because who could write anything serious in 8 KB? You simply had to have 16. And two tape drives, if possible, because automata theory aside, merge sorting on a single tape is, well, a tad slow.

Oh, sorry - you meant the limitations of BASIC.

Well, you had to manage your resources pretty carefully -- things like line numbers -- because you didn't want to run out of those; real pain in the behind to have to renumber a whole section, and type it all back in, without accidentally losing a line or two of code.

Nah - just kidding. We didn't actually have that problem until micro---er, home computers showed up, with a BASIC interpreter that couldn't do renumbering by itself.

We also used modularity - where you called a new program, ran it till it quit and returned back to the calling program. A gosub on steroids (because you got more memory to use), but way slower (because it took a while for the machine to find the program on the tape, and load it in, and then rewind and find the original program and load that back...). A lot like a fork and exec, but without the fork, only better because the whole memory space was shared.

Rigorous use of conventions also helped -- you know, like "you MUST always target a GOSUB at a comment line that says what this routine does, and you SHOULD do the same for a GOTO when possible. Stuff like that. Oh, and structured programming, a little later -- "by convention" again.

Some even went a little to the extreme: OAOO, YAGNI, TSTTCPW, pairing, refactor mercilessly, that sort of stuff.  Not by those names, of course. (See also: Ecclesiastes ;-)

The glory days.


答: I once used a weighted path length tree for a specialized cache.  That was fun.  Also wrote my own heap management routines for a malloc() replacement, but lots of people have done that.

Title: What is the most complicated data structure you have used in a practical situation?

Body:
The germ for this question came up from a discussion I was having with couple of fellow developers from the industry.

Turns out that in a lot of places project managers are wary about complex data structures, and generally insist on whatever exists out-of-the-box from standard library/packages. The general idea seems to be like use a combination of whats already available unless performance is seriously impeded. This helps keeping the code base simple, which to the non-diplomatic would mean "we have high attrition, and newer ones we hire may not be that good".

So no bloom filter or skip-lists or splay trees for you CS junkies. So here's the question (again): Whats the most complicated data structure you did or used in office?

Helps get a sense of how good/sophisticated real world software are.


答:
CouchDB has been running on iOS ( iPhone and iPad ) for a while now. An app using it was even accepted to the AppStore. There is a version for Android as well. That said, your question points to a lack of fundamental comprehension of database theory, I would not start off with CouchDB if I was you.

Google "CouchDB Mobile iOS Android" and you will find what you need, but I still don't recommend it.

SQLite would be a much lower barrier to entry ( Erlang can be difficult to build and install on these devices because of all its dependencies ) and SQLite is much better documented on all devices.

Title: Is it a good idea to use CouchDB?


问:
Who was the first software engineer?
It's fairly well known who the first programmer was but who was or were the first software engineer(s)? By software engineer I mean someone who uses formalized specifications and methods to deliver software not just a batch programming job. When was the term first used?</p>

答:
I would argue that there isn't a first software engineer because I don't think that Software development is an engineering discipline to begin with.

The American Engineers' Council for Professional Development (ECPD, the predecessor of ABET) has defined "engineering" as:

The creative application of scientific principles to design or develop
  structures, machines, apparatus, or manufacturing processes, or works
  utilizing them singly or in combination; or to construct or operate
  the same with full cognizance of their design; or to forecast their
  behavior under specific operating conditions; all as respects an
  intended function, economics of operation and safety to life and
  property.

The bold part of the quote above is where is my emphasis.

Engineers work with materials that follow rules of physics which are deterministic, there are not any materials in software development, and software, especially concurrent software is not deterministic by nature.

Material based engineering can prove the behaviors of a design under any conditions because those conditions are finite because of the laws of physics.

Even with critical systems software that run nuclear power plants, medical equipment and other control systems, there is no way to prove that the absence of bugs in a system because the behavior of the inputs of a system are not finite and thus the behavior of the system is not deterministic.

Here is a recent editorial piece that kind of makes the point that Software Engineers don't exist because they can't be defined.

Title: Who was the first software engineer?


答:
I'm all for lowering friction so that it's easier to get the job done, but you also need to take the failure modes into account.

If the source repository version is always configured for production use, what's the outcome of a developer failing to reconfigure before running the system? A developer running code against production.

Regardless of whether there are other hurdles in the way of the developer making random changes to production, building in a failure mode that encourages it to happen seems dangerous.

I suggest that the default values included in committed code should always be safe. Check the production configuration files into source control too, if you like - I almost always do - but keep them somewhere "not live".

Title: How should code in version control be stored?


问:
Should we avoid object creation in Java?
I was told by a colleague that in Java object creation is the most expensive operation you could perform. So I can only conclude to create as few objects as possible.

This seems somewhat to defeat the purpose of object oriented programming. If we aren't creating objects then we are just writing one long class C style, for optimization?

答:
As people have said object creation is not a big cost in Java (but I bet bigger than most simple operations like adding, etc) and you shouldn't avoid it too much.

That said it still a cost, and sometimes you may find yourself trying to scrap as many object as possible. But only after profiling has shown that this is a problem.

Here is a great presentation on the topic: https://www.cs.virginia.edu/kim/publicity/pldi09tutorials/memory-efficient-java-tutorial.pdf


答:
Absolutely yes.

Long long ago, I worked for a company that sold many million of dollars of systems, mainly to the auto dealer industry.  These systems ran BASIC software on customized 16-bit HP 21MX minicomputer derivatives (before the era of successful 16-bit microprocessors).  This was a medium size company with dozens of Basic programmers.  They used an old fashioned BASIC dialect which required line numbers and only allowed 286 possible variable names, and yet the solutions provided all the business accounting and inventory (etc.) for medium sized businesses.  The R&D group also wrote assemblers, compilers and even hardware emulators in Basic to help bootstrap development of their next generation hardware.

When attempting to explain what I thought were the benefits of more modern programming and hardware design methodologies to one old timer, he told me that good designers properly partitioned, modularized and structured the solutions to their problems, even if direct expression of such was not built into the language or tools, whereas, he noted, bad designers can produce un-debuggable garbage no matter what "fancy" fashionable development paradigm they work inside.


答:
Fact is,  most of the new car dealers in the U.S. today use BASIC programs to quote you financing options and to create those long settlement statements you get when you buy a car.  The programs are written in archaic minicomputer versions of BASIC running under emulation on modern hardware.  There are web UIs grafted on,  but its BASIC talking to a tty underneath.

Around 1980,  universal life insurance became an instant fad in the life insurance business.  Every company wanted to sell it right away,  and it required that account values be computed for each policy every month using a very complicated combination of interest and actuarial mumbo-jumbo.  As big projects in data-processing departments would take about a year back then,  many companies went into production with as many Apples, PCs, and/or Tandy TRS-80s as needed doing the more complicated version of what had been on mainframes for about 20 years.  Virtually all of these were programmed in BASIC. Mostly the BASIC used short-precision floating point,  so millions of customers' pennies got lost in the rounding.

JPL had a version of BASIC it used extensively back about 35 years ago, too.  It was called MBASIC, with the M standing for management,  but it was used, among other things,  to program spacecraft.


问:
Python flavor of regular expressions - related to which?
So my copy of the classic book, Mastering Regular Expressions, just arrived, and I'm scanning through it. The cover (third edition) says, "for Perl, PHP, Java, .NET, Ruby, and More!" Well, it does have a full chapter for each of Perl, PHP, Java, and .NET - but no chapter on Ruby, or, more importantly to me, on Python.

Although the index lists a few points of Python's differences (such as how it handles newlines), there's not even a table of them, much less an entire chapter.

Which of the four covered languages, is Python's regex engine most similar to? More importantly, how similar, and what are the major differences?

Note - I don't mean how regexes are used in Python (versus, say Perl) - I know and use the re module. I'm only interested in the syntax differences of the actual regexes.

答: This site has a table comparing regex features for a wide range of languages and platforms (make sure to scroll to the bottom). There's also a page specific to Python, with more info about the re module (though, for a more complete regex library in Python, you should also look at the newer regex module).


问:
Effective way to gain practical knowledge
I am currently nearing the end of my first year of my CS degree and have been disappointed with the lack of coding I have been asked to do (one unit).

I am basically looking for an effective way to gain practical knowledge but am unsure where to look for experience from a near beginner's perspective.

答:
There's a few things you can do.

Look at sites like Project Euler. They have sample problems for your to tackle. This will help you feel more comfortable around code.

Think about some small programs that you can write yourself and practice.

Apply for internships at local software development shops. This will probably be the best way to get real-life development experience with plenty of experienced people to help you out. However getting an internship without any experience can be tough...


问:
optimizing webapp workflow
I have a debug and a live server running a LAMP setup with some python scripts. By now I'm working with eclipse and Expandrive (via SSH) on the debug server. Whenever I want to release new code on the live server, I copy and paste the code via windows explorer from debugdrive to livedrive.

I think this environment really sucks, what are good alternatives?

答:
Keep all of your artifacts in version control, for example git or mercurial. Work on building a simple and repeatable process for releasing your software. Initially the process should be manual while you try different things, but eventually you should script it. For an interpreted language the deployment might be as simple as pulling an update from version control. Try to use the same process regardless of which environment you deploy to.

I'm a big proponent of working locally whenever possible. Having a full stack on your laptop or desktop isolates you from work that other people are doing. In your case, it also allows you to try deploying code to your test server before you have to do it in production.

Title: optimizing webapp workflow