答:
Make them do the merges and deal with support.  Again maybe you are not in a position to to do this, but if you find yourself being the one to troubleshoot a problem from a previous commit politely send it over the fence and say.  I can't tell what you did because there are no commit comments, you made these changes you need to figure it out.

Also for merging branches.  Not sure if that falls on you or not, but that is one area I found comments useful.

Again, not in your boat, but when I managed a software team I told them if they made good commit comments I would use those in liou of a weekly status report.  Got excellent commits after that one and it was easier for me to keep track of what was going on as the manager as well.

Title: How do I convince my fellow devs to WANT to add comments to source code commits?

Body:
I know that Subversion (what we're using at work) can be configured to require comments on commits, however I'm not in a position of power to simply turn this on.  I know that my reason for commenting my commits is because it is useful, if only as a memory-jogger, to quickly understand the reason behind the commit.  However, this doesn't seem to be enough to combat the two responses I always get:

It takes too long and I just want to get my changes into the repo.

It's easy enough to just look at the diffs.

I even show them the value of simply putting in a JIRA issue ID and how it automatically gets tied to the issue, but still no dice with them.

Worst of all, the person who can make the call is in the same camp: doesn't want to bother and is fine with looking at diffs.

I know it's the right thing to do, but how can I make them see the light?  Even if I can't convince my fellow devs, how can I convince management that it's the right thing to do for the business?


问:
How to Properly Google for C
The problem with trying to use Google to find tutorials or answers for the C programming language is that C is not an expressive enough name to narrow down the searches. Even coupled with keywords like "Programming" and/or "Language" yields results mostly for C++, C#, and Objective-C.

Is there a way to more effectively search for specific C resources using Google?

答: I haven't used this extensively but try using the ANSI standard that you are looking for. So if you want to use C89 then google "C89". You will get some stuff that isn't related to C but so far I didn't see a single C# or C++ tutorial. You can also do that with C99.</p>

ContentLicense: CC BY-SA 3.0

Title: How to Properly Google for C


问:
How do I convince my fellow devs to WANT to add comments to source code commits?
I know that Subversion (what we're using at work) can be configured to require comments on commits, however I'm not in a position of power to simply turn this on.  I know that my reason for commenting my commits is because it is useful, if only as a memory-jogger, to quickly understand the reason behind the commit.  However, this doesn't seem to be enough to combat the two responses I always get:

It takes too long and I just want to get my changes into the repo.

It's easy enough to just look at the diffs.

I even show them the value of simply putting in a JIRA issue ID and how it automatically gets tied to the issue, but still no dice with them.

Worst of all, the person who can make the call is in the same camp: doesn't want to bother and is fine with looking at diffs.

I know it's the right thing to do, but how can I make them see the light?  Even if I can't convince my fellow devs, how can I convince management that it's the right thing to do for the business?

答:
I guess one way to convince them would be to actually experience the pain that you are feeling.

For instance, let's say they are working on the following problem: They have a bug that, somehow appeared when another bug fix for the same code (oh the irony) was implemented. To be able to look this up from just searching through the commit messages would be great (and thus find out who wrote it).

Another way would be to explain to them that the commit message could be useful to give a hint as to why something was implemented in a certain way. Even if the commit message just says "feature X", you still can get a clue who implemented it, so you know who to talk to.


答:
We need check-in comments for the same reason we need line breaks and spacing in our code.  To make things easier to track down, understand read and comprehend.

Sometimes you need to diff compare, but often you do not.  Forcing devs to diff compare when all they needed was to read 2-3 sentences is a total waste of time.  I wonder why they don't see the value of developer time.


答:
However, this doesn't seem to be enough to combat the two responses I
  always get:

It takes too long and I just want to get my changes into the repo.

It's easy enough to just look at the diffs.

Have you tried throwing down a challenge to your fellow developers so that they get some other benefit from putting in comments?  One could look at this from either of a couple different angles:

Upping their game - This can be the trickier perspective to take but the idea here would be that they do this for some period of time and get used to the idea so that the habit is it would take longer to go the other way.  Another point here is how much scrutiny would the comments get?  If you are wanting a short story in the comment I could understand their point.

Subsidizing a change - This is where you'd have some kind of contest as a way to have the initial buy-in to try this out or offer some other kind of incentive to have the change be done for a while.

Something else to consider is how well do you know what your fellow developers are managing where you work?  If they are trying to get 10 things done yesterday then I could understand that they may not want to change what they see as something that already works.  Are you trying to tell them, "No, this doesn't work?"  If so, then I can see how they may be a bit defensive or combative on this.  If you are trying to tell them, "While this may work, there is an alternative that may be better..." then you may have a chance.  Having a "Holier than thou" attitude here isn't going to help you, IMO.


答:
Good commit comments are like any good documentation, a cache for your slow and defunct brain or a cache of the result of any lengthy debugging/problem analysis/investigation.

E.g. whenever you spend time figuring something out, like debugging, analyzing logs or whatever, your findings and results are precious. Of course most tasks can be repeated, but it may take time. So you should always document your results.

Still, documentation takes time and sometimes it is felt as not necessary, like "we only had to do this once, so why write it down". That's ok, but as soon as you do the same thing a second time because you didn't document the results the first time, then it is of course clever to document the results.

So if your colleagues feel it is too much work to add commit comments, e.g at least point to the Jira case/Ticket that they were solving, well, then they might be motivated by the pressure of constantly responding to questions regarding the reason for each changeset.

In my opinion, documentation should be produced as a function of information being requested. For example, mail correspondence is a pretty good documentation system. Questions receive answers that can be later retrieved, that's how mailing lists and forums work in practice as knowledge bases.

Unfortunately, where I work, mail is being automatically deleted after 3 months, so it doesn't always work in practice.


问:
Should we adopt an agile methodology when rewriting an existing application from scratch?
I work for a small product based company. We are about to re-write our existing product from scratch. We are planing to adopt Agile methodology for our development. Now my question is as we have all the requirements even before start of project (as we are re-writing the existing product), is it worth to dive into Agile world? Isn't agile more useful when you don't have all the requirement upfront and you get your requirement in phases?

Secondly, let's say if we jump into Agile, whats the best practice to design database? Let's say in our first iteration we just create a login system (user can login, logout etc). Do we just need to create Users table without worrying about other tables? And other tables would be evolved as our product would progress?

答:
Secondly, let's say if we jump into Agile, whats the best practice to design database?  Let's say in our first iteration we just create a login system (user can login, logout etc). Do we just need to create Users table without worrying about other tables? And other tables would be evolved as our product would progress?

Be careful about overdoing this approach. It can be like building a house and trying to finish one bathroom completely while the foundation is still setting. Odds are you'll have to completely redo significant portions of your work if your application's foundation, the database and underlying object model, aren't mature or stable enough to support the structure.

Also, remember that saying you're using Agile/Scrum doesn't excuse you from using good software engineering practices like proper unit testing and solid database and object design. When Agile is misapplied it can easily fall into a code and fix death spiral project that can be very painful or even impossible to recover from.

OwnerDisplayName: TK Lee


问:
Are ASP.NET MVC automated code good enough to be used in real live applications
I have been trying to get my hands dirty with ASP.NET MVC which looks pretty good (I am not certain, but some users say that even StackOverflow and other StackExchange websites made use of it). The tutorial I am following is from asp.net, named MVC Music Store. It's a pretty fast paced tutorial and a good one too. The question that bother's me while going through the various tutorials available on this site including the MVC Music Store is the automated code used for developing them.

Like, this tutorial makes use of Entity Framework 4, which supports a development paradigm called code-first. You add an Entity class inheriting from Entity Framework database context , add two lines of code and it will handle our create, read, update, and delete operations for us.

```<code>public class MusicStoreEntities : DbContext
{
    public DbSet<Album> Albums { get; set; }
    public DbSet<Genre> Genres { get; set; }
}
</code>```

Similarly, when I used the Scaffolding feature while adding a controller, like following :

It does a hell amount of work on its own :

It creates the new StoreManagerController with a local Entity Framework variable

It adds a StoreManager folder to the project’s Views folder

It adds Create.cshtml, Delete.cshtml, Details.cshtml, Edit.cshtml, and Index.cshtml view, strongly typed to the Album class.

As you can see, the developer's life made a hell lot easier with this automation but the question remains is whether or not this automatic code is good enough for production development ? Does anybody use(Does SO) use them. Is there any downside associated with these codes or one should be encouraged to use them ?

答:
When you want to work with ASP.NET MVC Scaffolding, you should consider these items:

The HTML tags are defined in scaffolding

The id and class attributes are defined already

The HTML tag nesting (like putting a
 tag inside a
 tag) is defined already

The HTML helpers are used by default

Because of these reasons, every time I used ASP.NET MVC Scaffolding in real applications, I found myself almost changing it all and replacing it with customized code (including nesting levels, HTML tags, id and class attributes for design and JavaScript  purposes), using my own helpers, etc.

In other words, I was fund of scaffolding (or code-generation in general), but in real-world examples, I personally found them more time and energy consuming than writing from scratch.

One may argue that, you can create your customized scaffolding. Yeah, that's correct, and that was what we wanted to do as an alternative tool. Even Pluralsight has a good video on this topic. But unfortunately, we found ourselves implementing customized scaffolding instead of concentrating on the main business. This of course was not desirable for our team, and because each and almost every page of our application had a kind of different architecture, developers agreed to create the structure manually.

So, my answer, based on our team's productivity and above-mentioned reasons, is:

No, It's not good enough for real-world applications, and it actually slows you down.

Body:
When you want to work with ASP.NET MVC Scaffolding, you should consider these items:

The HTML tags are defined in scaffolding

The id and class attributes are defined already

The HTML tag nesting (like putting a <p> tag inside a <div> tag) is defined already

The HTML helpers are used by default

Because of these reasons, every time I used ASP.NET MVC Scaffolding in real applications, I found myself almost changing it all and replacing it with customized code (including nesting levels, HTML tags, id and class attributes for design and JavaScript  purposes), using my own helpers, etc.

In other words, I was fund of scaffolding (or code-generation in general), but in real-world examples, I personally found them more time and energy consuming than writing from scratch.

One may argue that, you can create your customized scaffolding. Yeah, that's correct, and that was what we wanted to do as an alternative tool. Even Pluralsight has a good video on this topic. But unfortunately, we found ourselves implementing customized scaffolding instead of concentrating on the main business. This of course was not desirable for our team, and because each and almost every page of our application had a kind of different architecture, developers agreed to create the structure manually.

So, my answer, based on our team's productivity and above-mentioned reasons, is:

No, It's not good enough for real-world applications, and it actually slows you down.


答:
Agile is all about more productivity and flexibility. Why are you rewriting your applications? Reasons could be:

Changing the platform (from Windows to Linux for example)

Changing the language (e.g. from ASP.NET to PHP)

Refactoring amount is so high, that makes the re-writing a cost-saving option

Business has changed a lot, so, you're actually creating a new application (a new song, based on the same theme, if you wish)

In any of these reasons, you won't deliver your product overnight, and of course it'll take time.

Having a product backlog is only one of the items agile recommends. What you say about knowing the whole business means that you already have lot's of PBIs in your product backlog.

But isn't it better that you deliver parts of your new product at the end of every sprint? Won't it make you more agile and responsive to changes. For example, imagine that you're trying to make the new application beautiful. Isn't it just bad to know after 10 months that your new design is not acceptable? Won't it be a good practice if you're told after 2-3 weeks about that?

My answer to your question is:

Agile development definitely has many things to offer, even for re-written applications.

Title: Should we adopt an agile methodology when rewriting an existing application from scratch?

Body:
I work for a small product based company. We are about to re-write our existing product from scratch. We are planing to adopt Agile methodology for our development. Now my question is as we have all the requirements even before start of project (as we are re-writing the existing product), is it worth to dive into Agile world? Isn't agile more useful when you don't have all the requirement upfront and you get your requirement in phases?

Secondly, let's say if we jump into Agile, whats the best practice to design database? Let's say in our first iteration we just create a login system (user can login, logout etc). Do we just need to create Users table without worrying about other tables? And other tables would be evolved as our product would progress?


答:
There's a reason it's called Scaffolding. It's just there to reduce boilerplate code.

Here's what Webster says about the real life version:

Scaffolding: 1. A temporary structure on the outside of a building,
made of wooden planks and metal poles, used by workers while building,
repairing, or cleaning the building.

It's called scaffolding because it's not the real application.  It's just a framework to help you minimize boilerplate code.  Here's how to use the MVC scaffolding properly:

My app will be close to the scaffolding - Then generate the scaffolding and modify the code to how you see fit.

My app is nowhere near what the scaffolding provides and most controllers are very different - Sometimes it's so off the beaten path of a CRUD app that you need to take matters into your own hands.  Just create a new controller and start coding.  No harm done there.

My app is nowhere near the scaffolding, but each view and controller is very repeatable. - MVC scaffolding templates are very customizable, so much in fact that you can create your own!  MVC uses T4 templates that are completely customizable, so if your company has particular coding standards you adhere to, or you want to include some extra boilerplate code inside the template, you can include those and have MVC generate those inside the controllers/views.

Title: Are ASP.NET MVC automated code good enough to be used in real live applications

Body:
I have been trying to get my hands dirty with ASP.NET MVC which looks pretty good (I am not certain, but some users say that even StackOverflow and other StackExchange websites made use of it). The tutorial I am following is from asp.net, named MVC Music Store. It's a pretty fast paced tutorial and a good one too. The question that bother's me while going through the various tutorials available on this site including the MVC Music Store is the automated code used for developing them.

Like, this tutorial makes use of Entity Framework 4, which supports a development paradigm called code-first. You add an Entity class inheriting from Entity Framework database context , add two lines of code and it will handle our create, read, update, and delete operations for us.

```<code>public class MusicStoreEntities : DbContext
{
    public DbSet<Album> Albums { get; set; }
    public DbSet<Genre> Genres { get; set; }
}
</code>```

Similarly, when I used the Scaffolding feature while adding a controller, like following :

It does a hell amount of work on its own :

It creates the new StoreManagerController with a local Entity Framework variable

It adds a StoreManager folder to the project’s Views folder

It adds Create.cshtml, Delete.cshtml, Details.cshtml, Edit.cshtml, and Index.cshtml view, strongly typed to the Album class.

As you can see, the developer's life made a hell lot easier with this automation but the question remains is whether or not this automatic code is good enough for production development ? Does anybody use(Does SO) use them. Is there any downside associated with these codes or one should be encouraged to use them ?

ContentLicense: CC BY-SA 4.0


答:
After you have convinced them that it is important to comment your commits, you can create a script that forces comments on commits, otherwise it will fail. You can even specify a minimum of characters to ensure its a meaningful comment. This will help them "remember".

However, it is important they understand the Why as @Kevin said, or else they'll just add anyt random comment.


答:
They quick answer is, yes, the code is good enough, but chances are you won't use it. The code is as good or even better as, for instance the way any other MVC framework like RoR or Django handle code generation.

The long answer is that in any real business application, you'll probably want to leave MVC3.NET for what it is good for, the presentation layer. You'll want to keep your EF data acces and your business logic on a separate library and just reference it on your MVC project.

This will go inline with separation of concerns and the real MVC pattern in order to keep your presentation layer code agnostic and your business code reusable.

EDIT: The why, for me, is what I mentioned before, working with the "true" MVC pattern and separation of concerns... The generated code from the MVC3 framework is tightly coupled with the presentation layer. If you later want to change your presentation or add a desktop interface, you can't reuse the same business logic. It's all about loosely coupled code.


问:
Why does microsoft's own included MVC3 template not follow fat models, skinny controllers?
From Microsoft's own built in template for MVC3

The model is extremely skinny, having basically no code.

Model

```<code>public class RegisterModel
{
    [Required]
    [Display(Name = "User name")]
    public string UserName { get; set; }

    [Required]
    [DataType(DataType.EmailAddress)]
    [Display(Name = "Email address")]
    public string Email { get; set; }

    [Required]
    [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
    [DataType(DataType.Password)]
    [Display(Name = "Password")]
    public string Password { get; set; }

    [DataType(DataType.Password)]
    [Display(Name = "Confirm password")]
    [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
    public string ConfirmPassword { get; set; }
}
</code>```

While the Controller on the other hand seems to be fat, doing more that simple routing...

Controller

```<code>[HttpPost]
[AllowAnonymous]
public ActionResult Register(RegisterModel model)
{
    if (ModelState.IsValid)
    {
        // Attempt to register the user
        MembershipCreateStatus createStatus;
        Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus);

        if (createStatus == MembershipCreateStatus.Success)
        {
            FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
            return RedirectToAction("Index", "Home");
        }
        else
        {
            ModelState.AddModelError("", ErrorCodeToString(createStatus));
        }
    }

    // If we got this far, something failed, redisplay form
    return View(model);
}
</code>```

答: I'm curious how you think the controller could be put on a diet?  I honestly can't see anything there that could move to the model without violating SRP.</p>


问:
When is a version control commit too large?
I've heard in several places "Don't make large commits" but I've never actually understood whats a "large" commit. Is it large if you work on a bunch of files even if there related? How many parts of a project should you be working on at once?

To me, I have trouble trying to make "small commits" since I forget or create something that creates something else that creates something else. You then end up with stuff like this:

```
Made custom outgoing queue

Bot
-New field msgQueue which is nothing more than a SingleThreadExecutor
-sendMsg blocks until message is sent, and adds wait between when messages get
sent
-adminExist calls updated (see controller)
-Removed calles to sendMessage

Controller
-New field msgWait denotes time to wait between messages
-Starting of service plugins moved to reloadPlugins
-adminExists moved from Server because of Global admins. Checks at the channel,
server, and global level

Admin
-New methods getServer and getChannel that get the appropiate object Admin
belongs to

BotEvent
-toString() also show's extra and extra1

Channel
-channel field renamed to name
-Fixed typo in channel(int)

Server
-Moved adminExists to Controller

PluginExecutor
-Minor testing added, will be removed later

JS Plugins
-Updated to framework changes
-Replaced InstanceTracker.getController() with Controller.instance
-VLC talk now in own file

Various NB project updates and changes

---

Affected files
Modify  /trunk/Quackbot-Core/dist/Quackbot-Core.jar
Modify  /trunk/Quackbot-Core/dist/README.TXT
Modify  /trunk/Quackbot-Core/nbproject/private/private.properties
Modify  /trunk/Quackbot-Core/nbproject/private/private.xml
Modify  /trunk/Quackbot-Core/src/Quackbot/Bot.java
Modify  /trunk/Quackbot-Core/src/Quackbot/Controller.java
Modify  /trunk/Quackbot-Core/src/Quackbot/PluginExecutor.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/Admin.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/BotEvent.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/Channel.java
Modify  /trunk/Quackbot-Core/src/Quackbot/info/Server.java
Modify  /trunk/Quackbot-GUI/dist/Quackbot-GUI.jar
Modify  /trunk/Quackbot-GUI/dist/README.TXT
Modify  /trunk/Quackbot-GUI/dist/lib/Quackbot-Core.jar
Modify  /trunk/Quackbot-GUI/nbproject/private/private.properties
Modify  /trunk/Quackbot-GUI/nbproject/private/private.xml
Modify  /trunk/Quackbot-GUI/src/Quackbot/GUI.java
Modify  /trunk/Quackbot-GUI/src/Quackbot/log/ControlAppender.java
Delete  /trunk/Quackbot-GUI/src/Quackbot/log/WriteOutput.java
Modify  /trunk/Quackbot-Impl/dist/Quackbot-Impl.jar
Modify  /trunk/Quackbot-Impl/dist/README.TXT
Modify  /trunk/Quackbot-Impl/dist/lib/Quackbot-Core.jar
Modify  /trunk/Quackbot-Impl/dist/lib/Quackbot-GUI.jar
Modify  /trunk/Quackbot-Impl/dist/lib/Quackbot-Plugins.jar
Modify  /trunk/Quackbot-Impl/lib/javarebel.stats
Add /trunk/Quackbot-Impl/lib/jrebel.info
Modify  /trunk/Quackbot-Impl/nbproject/private/private.properties
Modify  /trunk/Quackbot-Impl/nbproject/private/private.xml
Modify  /trunk/Quackbot-Impl/nbproject/project.properties
Modify  /trunk/Quackbot-Impl/plugins/CMDs/Admin/reload.js
Add /trunk/Quackbot-Impl/plugins/CMDs/Operator/hostBan
Modify  /trunk/Quackbot-Impl/plugins/CMDs/Operator/mute.js
Modify  /trunk/Quackbot-Impl/plugins/CMDs/lyokofreak/curPlaying.js
Modify  /trunk/Quackbot-Impl/plugins/CMDs/lyokofreak/lfautomode.js
Modify  /trunk/Quackbot-Impl/plugins/listeners/onJoin.js
Modify  /trunk/Quackbot-Impl/plugins/listeners/onQuit.js
Modify  /trunk/Quackbot-Impl/plugins/testCase.js
Add /trunk/Quackbot-Impl/plugins/utils/whatsPlaying.js
Modify  /trunk/Quackbot-Impl/src/Quackbot/impl/SandBox.java
Add /trunk/Quackbot-Impl/vlc_http
Add /trunk/Quackbot-Impl/vlc_http/current.html
Modify  /trunk/Quackbot-Plugins/dist/Quackbot-Plugins.jar
Modify  /trunk/Quackbot-Plugins/dist/README.TXT
Modify  /trunk/Quackbot-Plugins/dist/lib/Quackbot-Core.jar
Modify  /trunk/Quackbot-Plugins/nbproject/private/private.properties
Modify  /trunk/Quackbot-Plugins/nbproject/private/private.xml
Modify  /trunk/Quackbot-Plugins/src/Quackbot/plugins/JSPlugin.java
Add /trunk/Quackbot-Plugins/vlc_http
Add /trunk/global-lib/jrebel.jar
```

Yea....

So for questions:

What are some factors for when a commit becomes too large (non-obvious stuff)?

How can you prevent such commits? Please give specifics

What about when your in semi-early stages of development when things are moving quickly? Are huge commits still okay?

答: The large the commit, the more likely you'll break the build and get paid out by the rest of your team. I try commit changes twice a day. Just before lunch and before I go home. So @ 12pm and 4:30pm I try get everything working and ready to commit. I find this practice works for me. </p>

ContentLicense: CC BY-SA 2.5


答: I've found the scaffolded pages more than adequate for the in-house admin side, to get to market quicker.  It may not meet the full needs of the users, but it's enough so that I can focus on the public-facing side.  Once that is done, I can come back and make their admin pages prettier / more functional.</p>


答:
This has to be one of the most bizarre questions I've heard.  People spend hours or even days fixing something and an extra 2 seconds to type in a commit message is too long?!  I have to say I would worry about working with such short-sighted people.  They are obviously not using their tools to even close to their full potential.

Here's an example from a code review I was involved in last week.  Our version control software doesn't preserve history across merges, so for older changes you have to find the exact branch it was made in, otherwise the commit message just shows something like "merged from branch Y."  Branch Y might show "merged from branch Z," and a branch a few levels of nesting deeper actually has the real commit message.

A new employee didn't know how to track down the history correctly, which means he was essentially working with just the diffs.  He saw some commented out code related to the bug he was tracking down.  When he uncommented the code, his bug went away.  He assumed someone had commented out the code during debugging and mistakenly checked it in.

That didn't feel right to a couple of us during the code review, so I tracked down the real commit message and found there was a valid reason for removing that code a year ago.  The new employee was able to fix his code to fix the newly discovered bug without reintroducing the old one.

There are better ways to avoid introducing those kinds of regressions, like thorough unit tests, but somehow I don't see people who can't bother with a 2-second commit message "wasting" time on unit testing.


问:
Tutoring students who are struggling with the basics in C++
I am tutoring a few students who are having significant trouble learning the basics of their first programming language: C++. I have known many excellent and bright students who have failed or dropped their first CS course. Everyone I am tutoring gives a similar account of his or her experience in class: the instructor moves along too quickly, nothing in the lectures make any sense, et al. Prior to this CS class, most of these struggling students had not expressed any interest in computers as anything more than word processors, web browsers, or some other form of entertainment. The computer is a blackbox that works, so why mess with it?

My best guess is that they are having trouble connecting the abstractions of computer science with familiar concepts. That is to say, these student might know how to learn math, biology, or physics, but those techniques are not working when it come to programming.

Does anyone have any suggestions or advice?  The students I am helping do not deserve to fail this class. It is clear that the instructor is not taking into account the learning style of these students. That is to say, the instructor is failing not his students.

答:
You said "these student might know how to learn math, biology, or physics, but those techniques are not working when it come to programming".

There is a reason for this, programming requires something those other discipline don't necessarily require: creativity and ... fantasy. The capability to "imagine things at work".
I personally found such a requirement is more present (of course , with all the due exceptions) form people coming from technical school (electronics and electromechanics in particular: they have to "imagine electric flows and how they control each other", since they cannot see them!) than from "pure science" (where everything looks like turning around math).

For this last cases, the "visual cognition" must be helped.
It is important not just to focus on notion and text (the type -> compile -> look the errors cannot work if you are not able to "read" the errors) but to provide a way to visualize things, either at design time (by simulating what goes on the machine: be prepared with a white-board and  set of colored post-it) and at execution time.

For this last part to be successful, essential notion of operating systems and "how programs runs into a machine" (and what that machine in fact is) must be given. And a nd not intimidating IDE must be given. I normally a "customized Code-Blocks" with many things removed to "don't distract". The notion of project made of sources to generate objects to be linked with library must be given BEFORE starting to talk about a language.

The C++ traditional hello world requires an entry point and an output device. Student must be already familiar with it.
The success of this kind of courses depends on the very first days. You need to stimulate a visualization of what happens inside a computer to let them understanding what programming is.

The rest is syntax (science) and abstraction (fantasy)


答:
I usually convince people through:

dialectic with good supporting reasons

leading by example

attrition

If I wanted our team to do something bad enough I would keep pestering until I get my way.  I try to pester during those times where I can point out that we could have saved time/money had we already been doing X.

Additional good reasons for commit comments:

Generating ChangeLog automatically from the comments.

Audit trail for bug fixes, feature additions.  This is useful both in and outside the team.

Make commit mail more useful.

Stop me from asking developer what commit X does (after almost every commit).


答:
I had exactly the same problem here, so I added a pre-commit hook to Subversion so it wouldn't accept any commits that didn't start with User Story number (some basic pattern matching for an expected format).

There's nothing stopping them entering 000-0000, but once only a disruptive idiot is going to make up a number when they've a perfectly acceptable number there.

I did this after spending days trying to find which builds a set of user stories went into.   Yes it was to deal with a process failure else where, but it's still incredibly valuable information to track.


答:
Computer programming is often one of the first courses where the cognitive skill of synthesis is required for a passing grade.  That skill is very difficult to impart to someone else.  You can explain all the components they have available to them and how they work.  You can give a multitude of examples of how other people have used synthesis to combine those components into a more useful whole, but there's only so much you can do without something "clicking" in the student's mind.

In my experience it's the skill of synthesis that most often eludes people who don't "get" programming.  They have a perfect understanding of the parts, like variables, functions, and loops, but they ask questions like, "I understand why it works, but how did you know you needed to put a loop there?"  You just plain have to practice until you get it.

Title: Tutoring students who are struggling with the basics in C++

Body:
I am tutoring a few students who are having significant trouble learning the basics of their first programming language: C++. I have known many excellent and bright students who have failed or dropped their first CS course. Everyone I am tutoring gives a similar account of his or her experience in class: the instructor moves along too quickly, nothing in the lectures make any sense, et al. Prior to this CS class, most of these struggling students had not expressed any interest in computers as anything more than word processors, web browsers, or some other form of entertainment. The computer is a blackbox that works, so why mess with it?

My best guess is that they are having trouble connecting the abstractions of computer science with familiar concepts. That is to say, these student might know how to learn math, biology, or physics, but those techniques are not working when it come to programming.

Does anyone have any suggestions or advice?  The students I am helping do not deserve to fail this class. It is clear that the instructor is not taking into account the learning style of these students. That is to say, the instructor is failing not his students.


答:
is it worth to dive into Agile world?

Maybe.  Trying anything new can be risky, especially if it's new to everyone.  I personally find Agile to be useful when done right.

Isn't agile more useful when you don't have all the requirement upfront and you get your requirement in phases??

It may be useful in helping to drive requirements if you don't yet have them.  However, that doesn't mean it's utility is limited to only driving requirements.

whats the best practice to design database?

Iteratively.  Use database migrations.

Suggestions

If you do want to do Agile that's great.  I would try and get someone who has done it before to help you through the process.

People often ignore the refactoring step when they first try Agile. Do NOT.  It will kill the project.

Think in vertical slices (features) instead of layers.  Implement vertical slices so you have a working system after the first feature card is done. Once it's working, keep it working and just add with each feature card.


答:
To misquote Aaron Hillegass, remind them that they're not stupid, it's just hard. Programming is difficult to train your mind to, it's a whole other way of thinking, and whilst they might be struggling with the basics they're probably quite aware they are and it'll be making them fairly despondent. </p>

<p>I say this as someone who failed his first year CS course as well, I'd programmed a lot before and got all the concepts (VB, yeah baby) but C++ just wouldn't click for me. I ended up going back to the very basics and working it from there, then it clicked, but if someone had said "You're not an idiot, this is just hard" it'd have made my life easier. </p>

Body:
To misquote Aaron Hillegass, remind them that they're not stupid, it's just hard. Programming is difficult to train your mind to, it's a whole other way of thinking, and whilst they might be struggling with the basics they're probably quite aware they are and it'll be making them fairly despondent.

I say this as someone who failed his first year CS course as well, I'd programmed a lot before and got all the concepts (VB, yeah baby) but C++ just wouldn't click for me. I ended up going back to the very basics and working it from there, then it clicked, but if someone had said "You're not an idiot, this is just hard" it'd have made my life easier.


问:
Do speakers get paid for tech talks?
I'm curious if speakers (bloggers, google employees like Matt Cutts) get paid for speaking at conferences. If they do, how much? If they don't, or they get paid so little that it's as though they don't, why do it? What are the attractions beyond money that lead a developer into public speaking?</p>

答:
Depends on the conference, the speaker, and how badly you're wanted. 99% of the conferences I've spoken at have given free admission to speakers. Some have paid my travel and lodging, but not always.

Sadly, I'm seeing more and more conferences where, if you really want a speaking slot, your best bet is to become a sponsor -- aka "pay to play." For some reason, these also seem to also be some of the priciest conferences to attend. Consequently, when deciding which sessions I'm going to attend at conferences, I tend to cross off any that feature sponsored speakers, as they rarely say anything that isn't marketing-speak.

OwnerDisplayName: FluffyCoder

Title: Do speakers get paid for tech talks?


答:
Check you SVN logs for something obscure made 6 month ago.

Ask some questions about this thing without telling when it's been done

???

Profit


答:
Set a good example. Make your own commit messages a shining example of usefulness. Include references to whatever other systems your team uses for managing stories and defects. Put a brief statement summarizing the change, and a good explanation of why the change is necessary and not something else in every submission.

Whenever the lack of a decent commit message causes you extra work, throw a question to the submitter. Be persistent with this (but not a jerk).

If it's not overstepping your role, write a script that sends a daily changelog using the commit messages. This will lend credibility to your argument that useful messages have a benefit beyond browsing through revisions. This might also help get management on your side, since they'll see day-by-day what's happening.

Identify your allies. Hopefully there's at least one other individual who agrees with you (perhaps by silently not disagreeing). Find that person or those people and convince them further so that you aren't standing alone.

When the opportunity to mention how decent commit messages have saved you time (or poor messages have cost you time) presents itself, seize it.

Don't be afraid to be the squeaky wheel. Fighting other peoples' bad habits is often a war of attrition.


答:
Do you have code reviews?  One thing that may help is to institute a rule that any commit or merge must be looked at and approved by another developer.  Then if you are the reviewer, you would have to ask the developer making the commit to explain to you what he did. Once he does, you should ask him to type into the comment what he had just told you.  Often when one cannot coherently explain the changes one made, it means that those changes should not have been made in the first place.

I have to say though, how can people object to something as obviously useful as commit comments?  It does not take long at all, and it is a time well spent. Writing a comment forces you to think about what it is you have just done. It may even cause you to look at the diffs to make sure you indeed have done what you think you have done, and that you have not done anything stupid.

When you do not write the comments, you are being sloppy and undisciplined. And if you insist that you should not be required to write the comments, then you are being willfully negligent.


问:
How is IETF different from W3C?
I've been following these organizations (institutes, entities, whatever) for near 3 months now, and both of them claim that they're trying to make the Internet a better place. They're creating documents under the name of RFC (for IETF) and Recommendation (for W3C) to guide others.

Yet another organization called WHATWG has started another path to develop web, and another community is in action under the title of Internet Society.

I don't know, why many organizations? I mean, can't they simply get merged? Are they really different? How?

答:
IETF works on Internet protocols, particularly at OSI layer 3 and 4.

As you may or may not know, the Internet comprises more than the WWW, which is simply an application-layer protocol. The W3C works on WWW specifications.

Title: How is IETF different from W3C?


答:
This is a process change item:  Have a manager assign code developed by "x" to "Y" for quality assurance checks on the code alone, including QA of comments.

In my own organization developers are not allowed to perform final QA of their own code and check it in, this has to be done by another developer.   Part of the QA Check is comments, so no comments, no check in.    We do a lot of contract work where our "art" is actually someone else' contractual intellectual property, so others need to be able to understand and leverage our code.   Also, there are times when projects come back to us after a long hiatus and we need to be able to pick up code 18-24 months later and understand the why, where and how we arrived at the code artifact in front of us.  This provides a self-serving motivation to write commit comments.


问:
How important is multithreading in the current software industry?
I have close to 3 years experience writing web applications in Java using MVC frameworks (like struts). I have never written multithreaded code till now though I have written code for major retail chains.

I get a few questions on multithreading during interviews and I answer them usually (mostly simple questions). This left me wondering how important is Multithreading in the current industry scenario ?

答:
Since we may need to contact many external applications, there may be some background process should occur where the external system interaction takes more time and end user can't wait till the process is done. so Multithreading is important..

we are using in our app, we first try to contact external system if it is down then we save the request in Database and span a thread to finish the process in backgound. May required in Batch operations too.


问:
Can I create a desktop Python GUI application and run it as a web app?
I'm working on a project where multiple (several hundred perhaps) users will need to run an application remotely.  We thought that running a web app would be the best course of action to go.  (Note: when I say web app I mean a program where a user can type in a URL that will then allow the user to run the application we're working on remotely without any installations or limited installations to the browser they're using)

My problem is not knowing where to start in creating a web app. The way that I see it (and correct me if I'm wrong), there are two types of web apps out there.    A Rich Internet Application which:

has many of the characteristics of desktop application software, typically delivered either by way of a site-specific browser, via a browser plug-in, independent sandboxes, extensive use of Javascript, or virtual machines.

wiki

or a 'regular' web app similar to gmail.  I'm very familiar with Python and desktop GUI development using wxPython.  Is it possible to write a program in Python, and then run it as a webapp?

If so, How?

答: Start learning Django, a web framework which is Python-based. It still requires a web-server to run on, but you may be able to re-use some of the code. You probably won't be able to re-use any existing wxPython GUI code, that will have to be translated into HTML/CSS.


问:
What should I be using to store data in a legacy web development project?
I'm currently working on a project that uses a Webserver running in Windows CE 6.0. Since this server only supports classic ASP (i.e, no PHP, ASP.NET, etc.)/ I plan to use XML as the database.

Is this the best approach, or there is an easier way to do this, taking in consideration that I'm used to work in C and not high level languages?

答:
I think XML is just fine if your database isn't going to scale much. Though there are some points you might consider :

XML has no indexing mechanism, if you want to search by several criteria or join different data you can't.

XML data is mainly plain text, it can be tampered with easier than a database.

XML does not provide aggregate functions like SQL - So you will need to code aggregate functions, etc.

XML has no concurrency management, you work with a file not a row.

User security and user rights need to be secured - This is usually handled via database or Windows integrated security.

Most report generators require a data source that is either CSV or a database (of course you can build a datatable or similar using XML and pass that to the report generator as an object, this depends on your selected tool).

Databases offer simple and generally quick backup.

You can add/remove columns from database with relative ease.

Database offer consistency checks and constraints as well as transcriptional processing allowing you to rollback in case of errors.

Databases offer stored procedure that allows you to encapsulation server logic within them

Using a database, you can allow your user to enter dynamic sql queries instead of programming every possible report.


答: Have you looked into SQLite? It is an embedded SQL database engine with pretty good performance, and it gives you the power of SQL (there are some advanced features it doesn't have, check their website for details), which might make it easier and faster to access your data than reading and processing DOM objects. I believe it's also written in C so integration shouldn't be a serious problem.</p>

Title: What should I be using to store data in a legacy web development project?

Body:
I'm currently working on a project that uses a Webserver running in Windows CE 6.0. Since this server only supports classic ASP (i.e, no PHP, ASP.NET, etc.)/ I plan to use XML as the database.

Is this the best approach, or there is an easier way to do this, taking in consideration that I'm used to work in C and not high level languages?


答:
How do you make them want to add good comments?

From a experience with a colleague I just had. At the end of a project we had to write a summary document of all the changes made throughout the project. Not having made good commit notes my colleague found this task rather time consuming, and has now switched to making quite lengthy comments with each commit.

So - the takeaway - one solution could be to have developers write summary documents at the end of the project that detail what changes were made to what files, what files were added/removed and why.


问:
"Gödel, Escher, Bach" still valid today?
I have just completed a course on computability and logic which was an interesting course. The lecturer recommend a few books on his slides, which include "Gödel, Escher, Bach". I can see the book is quite famous, and looks very interesting. But I have a few questions to ask regarding its content.

Is the content still valid today? I guess most theoretical stuff doesn't change over night, but are there any major points which no longer hold today that I should be aware of?

I assume we actually HAVE made some progress in the last 30 years or so. Can any of you recommend a book on the subject which includes this progress (logic, AI, computability)?

Another question: Do I have to know about Escher and Bach?

答:
If you like listening to Bach, you will like reading the book.

The books by Daniel Dennett contain quite some challenging views on algorithms and life


答:
If you are working with Python and need to do something on the web, then Django Framework is the first thing you should get to know. It will get you speed up into the process of developing an Internet application.

From there on, you build on any web service you like to have on your server. As far the UI is concerned, you will work with HTML. Javascripts, flash, AJAX are supplementary for achieving an interactive and responsive API.

You can visit Django Tutorial to start and see how things work on the web using Python and HTML.

Title: Can I create a desktop Python GUI application and run it as a web app?

Body:
I'm working on a project where multiple (several hundred perhaps) users will need to run an application remotely.  We thought that running a web app would be the best course of action to go.  (Note: when I say web app I mean a program where a user can type in a URL that will then allow the user to run the application we're working on remotely without any installations or limited installations to the browser they're using)

My problem is not knowing where to start in creating a web app. The way that I see it (and correct me if I'm wrong), there are two types of web apps out there.    A Rich Internet Application which:

has many of the characteristics of desktop application software, typically delivered either by way of a site-specific browser, via a browser plug-in, independent sandboxes, extensive use of Javascript, or virtual machines.

wiki

or a 'regular' web app similar to gmail.  I'm very familiar with Python and desktop GUI development using wxPython.  Is it possible to write a program in Python, and then run it as a webapp?

If so, How?


答:
The only case I know of where you can write something as if you are writing a desktop app and have it also be able to run as either a desktop or web app is when using Pyjamas.  From their web site:

"Pyjamas is a Rich Internet Application (RIA) Development Platform for
  both Web and Desktop...It contains a Python-to-Javascript compiler, an
  AJAX framework and a Widget Set API."

However, I don't know how far along and usable the project is yet.  It's a great idea in any case.

There are some cases in which people have made a desktop app that is meant to be used through the web.  One is Dabo Springboard.  The idea is you would have your users install the "client" once, and then all interactions, updates, data handling, etc, would be done via the internet.  So you get the advantages of a web app with the GUI advantages of a desktop app.  Plus, for your purposes, Dabo is a wrapper for wxPython.


问:
How many lines per class is too many in Java?
In your experience, what is a useful rule of thumb for how many lines of code are too many for one class in Java?

To be clear, I know that number of lines is not even close to the real standard to use for what should be in a particular class and what shouldn't.  Classes should be designed according to proper OOP philosophies (encapsulation, etc.) in mind.  That said, a rule of thumb could provide a useful starting point for refactoring considerations (i.e. "Hmmm, this class has >n lines of code; it's probably unreadable and doing a lousy job of encapsulation, so I might want to see if it should be refactored at some point").

On the flip side, perhaps have you encountered examples of very large classes that still obeyed OOP design well and were readable and maintainable despite their length?

Here's a related, non-duplicate question about lines per function.

答:
Try using a better metric.

One example is the ABC Metric. It is more a measure of how much work is being done by the code than how much code there is.


问:
Couple of questions about sprint in scrum methodology
Its a general title for the question but I have a couple of questions for the Sprint in a SCRUM methodology.

What happens if a HOTFIX comes in the middle of a sprint. e.g - The website crashes or some part of the site that hasnt been worked on for quite some time crashes (like creditcard authorize or webservices etc). How do you incorporate that in the current Sprint(s)?

How to tackle bugs at the end of a Sprint. I know we can have Defect tracking sprint but should I plan for that at beginning? Or do I put that sprint back in the product backlog and start planning that from the next sprint planning.

How to decide how many sprints are required?

thank you for your help

答:
Derrk,

1) All sprints can be halted at any time in reaction to things like the critical operational defects you mentioned. The reality is, no software development methodology would force you to ignore critical issues like an operational defect.  If it did, it would never be implemented.

2) You can do this a couple of ways.  As you mentioned, a defect-tracking sprint is one way of doing things. The reality is that under SCRUM you should always have a tester embedded into your team. Their responsibility is to create tests for each item on your work backlog. As items are completed, they should be immediately tested by your tester.

Now, in a modern agile environment this is usually done by your continuous integration environment. But normally, those environments don't do integration testing that well, which is where your tester comes in.  AGain, remember, SCRUM teams are cross-functional, meaning they should include not only developers but also testers, CM, Requirements managers, etc.  So, testing and defect tracking/correction will take place throughout your normal development sprints.

The testing sprint at the end of your development will be to validate the developed system works properly, prepare it for operational acceptance testing, deploy it into a operational test environment, excersize your system and then deployit into an operational environment.

3) Your Product Owner will be the one who determines that, and they will determine this by working with the customer as they prioritize thier product backlog.  In reality, some business wonk will have signed the team up to deliver some sort of functionality by some fluid date range.  The Product Owner will work with the customer to determine the degree to which that functionality should be implemented and exactly what should be included in each Sprint.

Of course, the Scrum Master and the development team will determine what they can actually develop during each Sprint and communicate this to the Product Owner.  If the team provides feedback to the Product Owner that will result in a slip from the imposed time-line, it is the Product Owner's job to work with the customer to reprioritize the product backlog to take this into account.

OwnerDisplayName: derrk

OwnerDisplayName: Mike Van


答:
IETF focuses on packet/line/terminal/telnet based protocols.

W3C adresses SGML/HTML/XML inspired stuff.

You may also be interested in IEEE, an organization that instead loves communications on  the physical layer. (with frequencies/tensions/radio-waves and all that oscilloscoping stuff)

Title: How is IETF different from W3C?

Body:
I've been following these organizations (institutes, entities, whatever) for near 3 months now, and both of them claim that they're trying to make the Internet a better place. They're creating documents under the name of RFC (for IETF) and Recommendation (for W3C) to guide others.

Yet another organization called WHATWG has started another path to develop web, and another community is in action under the title of Internet Society.

I don't know, why many organizations? I mean, can't they simply get merged? Are they really different? How?


答:
In exceptional circumstances, sprints could be changed around to handle a major shift like a big production issue or if the company really wants some feature in ASAP that wasn't in the backlog previously.  There are at least a couple of ways to handle this.  First, there is the substitution of taking in the fix and moving out whatever the lowest priority committed item was in the sprint as there isn't room anymore for this.  The other option is to cancel the rest of the sprint, plan a new sprint at this point and adjust future plans accordingly.

How critical are the bugs to the Product Owner?  The Product Owner is the one setting the priority of items in the backlog and has a duty to make sure the backlog is up to date when the team plans their next sprint.  There can also be cases where bugs are handled as part of a story if we are talking about bugs found while the sprint is happening compared to new issues found when a demonstration of functionality is done that could also be seen as bugs at the end of a Sprint.

How many for what?  Realistically, there can be the never ending project as there will usually be new features, bugs found and other things to do so that one could just keep a team permanently assigned to that area.  At the same time, any initial estimate on a number of sprints isn't likely to be accurate down the road when it may become clear just how much additional work is needed to finish what was originally asked.

Title: Couple of questions about sprint in scrum methodology

Body:
Its a general title for the question but I have a couple of questions for the Sprint in a SCRUM methodology.

What happens if a HOTFIX comes in the middle of a sprint. e.g - The website crashes or some part of the site that hasnt been worked on for quite some time crashes (like creditcard authorize or webservices etc). How do you incorporate that in the current Sprint(s)?

How to tackle bugs at the end of a Sprint. I know we can have Defect tracking sprint but should I plan for that at beginning? Or do I put that sprint back in the product backlog and start planning that from the next sprint planning.

How to decide how many sprints are required?

thank you for your help


问:
How often do you use Formal UML?
I used ad-hoc MUML (made-up modeling language) to design and explain system fairly frequently.  It looks similar to UML and tends to be pretty well understood.

However, I've had a professor or two that harped on the use of strict, formal UML, as close to the spec as possible.  I always suspected that strict UML wasn't really as common as they claimed.  So, how 'bout it- how often do you actually draw out complete diagrams that use all the proper line endings, multiplicity, member type symbols, etc?

答:
Never.

Heck, it's been years since I last created any UML. Line diagrams on whiteboards and scraps of paper don't count.

In fact, we just removed the sole UML question from the guide we use during interviews, because none of us really cared about the answers.

Title: How often do you use Formal UML?


答:
XML is a text based file format, which is no more a database than a CSV file or any other text based file format.

Your question is like asking asking if JPEG makes for a good image editor. JPEG is a file format just like XML is a structured file format, neither provide any executable functionality.

Use a real database, there are plenty of suitable embedded databases that offer real database functionality. SQLite or BerkleyDB make for good alteratives in a constrained embedded model based on C.


问:
Why should I use interfaces if the implementation will mostly stay the same?

Possible Duplicate:

  Why are interfaces useful?

In our company we have a service oriented architecture in our asp.net application. We use interfaces for every crap class. Its a huge overhead. The service classes, dataprovider classes etc... they all use interfaces but practically we could also go without those interfaces and just use the class type.

So why should we do it that complicated and lose lots of productivity?

答:
I believe that having an interface for every class is cargo cult programming.

You need interfaces/abstract classes when you are going to change/swap implementations. They are also the easy answer for mocking dependencies in unit testing.


答:
What you are describing is an anti-pattern. An anti-pattern is a pattern that is usually over applied to every situation even when it is in appropriate.

Someone probably read an article that espoused this anti-pattern for some niche area, and didn't comprehend the narrow application and applies it everywhere. This happens a lot with "senior" developers that are just "tenured" and not actually senior in knowledge, or managers that are just technical enough to be dangerous. Possibly someone from a C++ background that missing the tedious declaration/definition paradigm.

See also "hammer pattern", when all you know is a hammer, everything looks like nail.

This is based on my 20 years of experience seeing this exact same thing dozens of times.

Title: Why should I use interfaces if the implementation will mostly stay the same?

Body:
Possible Duplicate:

  Why are interfaces useful?

In our company we have a service oriented architecture in our asp.net application. We use interfaces for every crap class. Its a huge overhead. The service classes, dataprovider classes etc... they all use interfaces but practically we could also go without those interfaces and just use the class type.

So why should we do it that complicated and lose lots of productivity?


问:
Unit testing newbie team needs to unit test
I'm working with a new team that has historically not done ANY unit testing.  My goal is for the team to eventually employ TDD (Test Driven Development) as their natural process.  But since TDD is such a radical mind shift for a non-unit testing team I thought I would just start off with writing unit tests after coding.

Has anyone been in a similar situation?  What's an effective way to get a team to be comfortable with TDD when they've not done any unit testing?  Does it make sense to do this in a couple of steps?  Or should we dive right in and face all the growing pains at once??

EDIT

Just for clarification, there is no one on the team (other than myself) who has ANY unit testing exposure/experience.  And we are planning on using the unit testing functionality built into Visual Studio.

答:
Just a small thing to add, visualize the process. Make the continous integration run tests automatically and check for code coverage. List the most complete tested modules on some startpage that everyone can see.
That should get the team competition going.  </p>


答:
... there are two types of web apps out there. A Rich Internet Application and a regular Web App similar to Gmail ...

Sorry but that's wrong! Web Application and Rich Internet Application are one and the same thing.

Make it simple...

A Website is a set of pages (static or dynamic) and is fairly simple to build and maintain.

A more complex and feature rich manifestation of the same website which includes technologies/paradigms/practices that evolved in the last 5 years is what they call a Web Application.

Technologies: JavaScript, REST, Social Web, APIs, improved standards, NoSQL, Clouds, etc.

Paradigms: Ajax, perceived responsiveness, UX, mashups, etc.

Practices: accessibility, multiple devices, etc.

So, Gmail is NOT the regular thing, it is one of THE most successful Web Applications (or RIA if you will).

Next, to answer you original question...

Creating a Desktop-cum-Web application is a non-trivial task. Of course it can be done. Look at gTalk -- it's both Desktop and Web App.

You need to identify the common and disparate components of your system and then architecture it accordingly. You may need a complex MVC setup also. You'll also have to carefully plan your deployment and maintenance strategy. More importantly you'll need an upgrade mechanism that
works for both Desktop and Web versions of your App.

I am not trying to scare you off -- but realize that what you want is NOT simple.

Now if you don't have any idea where to start for the Web App part, then (in my humble opinion), you should first master Python Web Application programming and then approach this thing. As you already do GUI apps, it won't be long before you'll start feeling confident about this system and you'll have all the knowledge and context to answer this question yourself.


答:
First, interfaces are usually easier dependencies to fill/mock when doing unit testing, because there default behavior is... nothing, so you can be sure you're testing classes in isolation.

Second, when you do need to create a custom mock, you don't need to do anything fancy, you just write a class that inherits the interface.  This makes supplying dependencies to your classes easier when testing, and sometimes the mock implementation is the 2nd implementation you're looking for.

Third, if you're just writing a class, right click=>extract interface every time, you're not interpreting the "I" in "SOLID" correctly.  Interface segregation implies that interfaces are designed for the CLIENT of the interface, not to match the implementation.  There is an important difference in that the former will typically yield more loosely coupled design.  It is a very fine line sometimes, but worth keeping an eye on.

Of course, if you're not interested in unit testing, and not interested in SOLID, maintainable, testable code, then yeah... interfaces might not have much practical value to you unless you have multiple implementations at run time.


答: You should treat emergency hotfixes like any other unexpected interruption in a sprint, e.g. someone being off ill. Make the fix, and then continue the sprint as normal. Your velocity will be lower for that sprint, but that's ok as it should disappear when averaged out over the long term. Of course, it may turn out that you typically lose a day of every sprint making 'hot fixes' so your average velocity will drop, but again this is ok, as it will allow for better estimation of milestones.


问:
What factors can make mid-project join successful?
It's not entirely uncommon in IT that programmers are added to an existing project somewhere in the middle, or closer to finish.

Unfortunately, I've seen that people quickly get disillusioned and leave the job.

So, is there an actual problem? If there is a problem, is there some research in or are there best practices for avoiding this mid-project-join syndrome?

Is this common in industry?

答:
You must be illusioned before you can become disillusioned.

If you join a project at any point during development, make sure that you have a clear understanding of the task and your role in it. If you have realistic expectations of the project and the project has realistic expectations of you, you're more likely to remain happy with each other.


答:
One major problem is organizational knowledge. People who have been involved with a project from the beginning are privy to the reasoning behind design decisions, politics that might be minefields, undocumented foibles of the software, and so on. It only takes stepping on one landmine that you had no way of knowing about to make you consider pulling up stakes and moving on, especially when there is no understanding from management that the organizational knowledge problem exists (thus resulting in the new guy feeling that he's being blamed for something in which he had no role).

Rigorous, consistent documentation practices can make this a smaller hurdle. For example, if a new hire is filling a support role, make sure that he has the resources needed to actually answer questions competently rather than simply expecting that he'll be able to deduce the solution from training materials. ("Joe Oldguy, Client X just called asking about problem Y.  What the heck is going on?" "Oh, Client X has a kink in their process. They have to A, B, and C before they D. This is different from everyone else. A step must have gone wrong in {A, B, C}.")

Title: What factors can make mid-project join successful?

Body:
It's not entirely uncommon in IT that programmers are added to an existing project somewhere in the middle, or closer to finish.

Unfortunately, I've seen that people quickly get disillusioned and leave the job.

So, is there an actual problem? If there is a problem, is there some research in or are there best practices for avoiding this mid-project-join syndrome?

Is this common in industry?


问:
How do I convince my fellow devs to WANT to add comments to source code commits?
I know that Subversion (what we're using at work) can be configured to require comments on commits, however I'm not in a position of power to simply turn this on.  I know that my reason for commenting my commits is because it is useful, if only as a memory-jogger, to quickly understand the reason behind the commit.  However, this doesn't seem to be enough to combat the two responses I always get:

It takes too long and I just want to get my changes into the repo.

It's easy enough to just look at the diffs.

I even show them the value of simply putting in a JIRA issue ID and how it automatically gets tied to the issue, but still no dice with them.

Worst of all, the person who can make the call is in the same camp: doesn't want to bother and is fine with looking at diffs.

I know it's the right thing to do, but how can I make them see the light?  Even if I can't convince my fellow devs, how can I convince management that it's the right thing to do for the business?

答: Tell them its the only way to have a chance at maintaining your procedural mess of 50,000 line methods, then consider writing better, more explicit code in the future so you don't have to deal with a bunch of pointless comments bloating your code base.</p>


答:
I think attitude is the first thing. There have been a lot of decisions made already in the project that you didn't have a chance to give input to. Likely you will disagree with some or even most of them. The last stages of a project is not usually the best time to revisit decisions made months ago and that a lot of the code depends on, so pick your battles carefully. You don't want to make enemies from day one. This is similar to coming in on a legacy project, when you come in late in the game. You don't understand everything about why they made the choices they made, so wait a bit, get some credibility from your own competence and then start suggesting changes in order of importance. Don't do it days before a critical deadline either.

Document problems you found with the approach so you can prove the issue in the next project that you are on from the start.  Often having details about what turned out to be a mistake makes it easier to sell a different way later on.

Next big problem is getting up to speed fast enough to be of use.  Especially towards the end of a project, people just don't have time to help you get up to speed.

So spend the first couple of days building a list of questions as you look through the code and then talk to a senior developer (or team lead if the person is technical) about your questions in one swoop rather than bother them continually for several days. You will have to ask some things immdeiately of course, you can't look through the code if you don't know where to find it. But try to be somewhat independent  in figuring things out.

They will likely assign you to a specific area to work in, make it your business to read the requirements (if you have a requirements document) and look at the code in that area first. Once you think you understand it or know you are stuck in understanding it, then go talk to someone about it. Confirm that your understanding is correct and ask your questions. But above all don't ask the questions in such a way that makes the person feel as if you regard their code as garbage even if (maybe even espeically if) you do.  If something feels off to you, ask why they did something not "how could you have done that?" Try to understand their thinking and decision making processes not just their code.

If coming in at the end of a project is discouraging (and let's face it they wouldn't be hiring near the end if they didn't have problems) keep in mind that you will be there for the beginning of the next project and have a chance to have more input. Your job, career-wise, is to do a good enough job on what they assign you to gain credibility for the being a significant player in the decision making process on the next project.  So do your best to be a team player, to meet deadlines and to provide working code that plays well with what has already been finished.  Now is the time to impress them with your abilty to get things done. You can impress them with your brilliance later.


答:
My experience of engineers joining a software project during development is that the later you are in an iteration (or heaven forbid if you are near the end of the implementation phase of a waterfall model project) the harder it is for an engineer to integrate with the team and the project itself. When you start any work there will usually be a 'ramp-up' period. If you are familiar with the work because you have done it before, can draw parallels, or were instrumental in the requirements and design phase, you will 'ramp-up' quicker. Otherwise, it can take some time.

The later in an iteration/project you are, generally the higher the pressure. Your project might be overspent or late, or both. You might be under intense pressure to resolve defects, or implement features, and the project plan hasn't accounted for 'ramp-up'. This is common. While you should be loaded at 80% on a plan so that holidays, sickness, etc. can be accounted for - my experience is that this is naive at best.

It is common in industry for mid-project joins to be difficult. It generally means you just have to knuckle down and put the hours in to get up to speed. Leverage whatever help you can from existing members of the team and do  your best. Throwing engineers at a project without planning it (i.e. having them join mid way through without any allocated 'ramp-up') is usually a sign that all is not well on that project.


答:
Seek forgiveness, not permission.

While harsh, I did just this.  I had a 50/50 split between people supporting and people opposing, most of who were the same level as me in the group.  The arguments were "I can't be bothered" and "What is the point?".  (Both indicating apathy and laziness, not genuine concerns).

I added pre-commit hook that simply measured the length of the string and gave a slightly humorous message before rejecting it.  I put my name in the message so responsibility for "this outrage" was clear.  Of course, "the opposition" could easily remove it, but digging into the scripts would take more effort than adding one more comment!

For a week I got messages added like ** (expletive deleted) or kjhfkwhkfjhw.  After that, basic messages started appearing.

A year on and the sceptics use meanful comments and actually admit how short-sighted they were.  I could never have got consensus, but I certainly got forgivenes and perhaps credibility.  It works, people use it.

If you wanted to be more congenial (or feel that you would get in trouble), ask for permission to add a commit hook for a trial period.  Say that if people don't like it in 2 weeks or 4 weeks, you will take it out.  Chances are, they will lose interest...or grow to like it.


问:
Scheduling dependent tasks in a scrum sprint
I'm on a project right now that is using the scrum methodology with 2 week sprints.  Here's what our team looks like:

1 business analyst

1 tester

1 user experience designer

2 developers (1 for the UI and 1 for the back-end processes)

1 project manager

In a single sprint, we'll have 1 product backlog item (PBI) to design the UI for a page, another PBI to write the .Net code for the page, and 1 PBI to test the page.

How should these 3 product backlog items be scheduled so that they all get completed by the end of the sprint?  Since they are all dependent on each other and require at least 3 members of the team to work together, it seems to me like they each need deadlines in order for them to get done in time.

The scrum master keeps saying that they don't need deadlines because the cross-functional team will take care of it.  This hasn't worked in 10+ sprints, though.

Shouldn't the project manager be aware of this critical path and monitor its progress?

答:
How should these 3 product backlog items be scheduled so that they all get completed by the end of the sprint?

Daily conversation.  It's called a "stand up".  Everyone attends.  Every day.

Since they are all dependent on each other and require at least 3 members of the team to work together, it seems to me like they each need deadlines in order for them to get done in time.

They don't need "deadlines".  They need an ongoing conversation.  Every day.  It's called a "stand up".  Everyone attends.  Every day.

The scrum master keeps saying that they don't need deadlines because the cross-functional team will take care of it.

Correct.

This hasn't worked in 10+ sprints, though.

Wow.  You people are obstinate.  Do you actively hate each other?  Or are people simply refusing to attend the daily stand-up?


问:
Why do we study Java at university?
Java is often found in academia. What is the reason behind that? </p>

答:
Many of the answers given above are good ones, but they leave something out.

Java is a multiplatform language.  One student can use his Mac, another her PC, and another her student Unix account.  The same code will do the same thing.  Think how much easier that is for both the teacher and the school's IT department to support.

This was the real importance of Java when it came out.  The joke was "Code once, debug everywhere", but it really does take hardware and operating systems out of the equation.

Title: Why do we study Java at university?


问:
What's your favourite quote about programming?
What's your favourite quote about programming?

One quote per answer, and please check for duplicates before posting!

答:
It's not about programming per se, but by a famous programmer:

The best way to predict the future is to invent it.

  — Alan Kay

Which is usually a good thing to remind myself to get moving and do things.

LastEditorDisplayName: Roger Pate


答:
Propose this to management behind closed doors:

The worst case scenario happens: All the senior level developers walk out the door.

As the company scrambles to fill empty developer seats, the management team is tasked with communicating the system's state to the client.

Ask them what they think would make their job easier in reconstructing the history of the app:

Reading plain English commits that clearly describe the changing state of the system?

Or would they prefer to look at code differences and figure it out themselves?


问:
Collective term for shaking device and using accelerometer of a device
Does anyone know what the collective term for shaking a device to achieve something or using the accelerometer of a device to do something is? Is it haptic technology?</p>

答:
I would say semantically Kinetic would be a better term than Haptic.

ki·net·ic
adjective /kəˈnetik/

Of, relating to, or resulting from motion

(of a work of art) Depending on movement for its effect

For semantics questions like this english.stackexchange.com is very valuable.

The iPhone 4 for example has 2 accelerometers and 1 gyroscope, all of which rely on motion ( kinetic action ) and nothing to do with touch ( haptic ).


问:
Erlang or 'x'.. Is it worth it (vs. Python w/ GIL)?
So, I've finally gotten myself to a point where I'm comfortable enough with Python (using Pyramid as my framework of choice) to undertake a rather large personal project. As it's a personal project, I have the luxury of taking my time having absolutely no deadlines other than self-imposed ones.

I love learning new frameworks, languages, etc. so if given a reason, I don't mind pushing back on development for a month or so while learning a new language and framework (takes longer when you're doing it on your own time ;)).

I recently learned about CPython's GIL (Global Interpreter Lock), which raised my eyebrow a bit. If I understand it correctly, this means that if I have a Queue in my web app and have threads that complete jobs in the queue, then the code is locked until the thread for that request is complete, meaning that any subsequent request is locked while the previous thread is executing.

Question:

Has anyone in "real world" applications found this to be a problem? Is it worthwhile to learn a language that supports real concurrency out of the box, such as Erlang? I'm most interested in any benchmarks that anyone has done in real world apps and whether or not anyone has seen any real noticeable issues with the GIL.

答:
The lock doesn't prevent you switching between threads. It prevents multiple threads from running at the same time. This only has an effect for multiple cores. Python's threads do not take advantage of multiple cores. Really, that is the only difference.

To reiterate, the code is not locked while the request is executed. The requests will happen side-by-side as the computer switches between threads. This will function exactly the same as any other language running a single-core machine. Only if you have multiple cores will you see a difference.

This is probably not a concern for a web application. Your web application will spend most of its time waiting for the network connection. The amount of time spent doing CPU heavy work is so small you won't notice. The bottleneck will still be at the network so the fact that you couldn't take advantage of multiple cores was not really a big deal.

If you really do need to make use of multiple cores python has a multiprocessing module. This allows you to control seperate processes which will allow you to execute using multiple cores. It works somewhat differently then a threading module, but I find it easier to work with.

My own experience is that I created a little library that uses python, network communication, and multiple processes to distribute python work over a cluster of computers. It works great. I'm able to easily distribute work (as long as it can be split up easily) across a collection of computers. So basically, nothing in python prevents working with this sort of thing.


问:
Is microoptimization worth it in mobile devices?
Usually microoptimization is considered not worth it with the following explanation: it might speed up the program by less that one percent, but noone cares of that minor boost - that's just too little of a change to be noticed.

Furthermore, there might be some event handler that fires one thousand times per second and exits very fast - before it is fired again. Noone cares how fast it is - making it faster can't be noted, because it already "as fast as can be observed".

However in mobile devices energy consumption is an important factor. The same event handler optimized to run ten percent faster will lead to less energy consumed and that's longer battery life and a longer operating device.

How accurate is the latter judgement about mobile devices? Are there any real life examples that confirm or disprove it?

答:
i'm familiar with optimization. i see other people's programs with a different set of eyes -- here's my take:

Usually microoptimization is considered not worth it with the following explanation: it might speed up the program by less that one percent, but noone cares of that minor boost - that's just too little of a change to be noticed.

the funny thing is, one such change leads to 99%. ten such changes make the program noticably faster. for many engineers, changes to their approach of writing a program can make a program execute several times faster. simply being aware of efficiency and writing that way can make your program several times faster without much additional work. such gains are not micro-optimizations, imo.

note: i am never suggesting contextually corner-cutting optimizations in this discussion.

Furthermore, there might be some event handler that fires one thousand times per second and exits very fast - before it is fired again. Noone cares how fast it is - making it faster can't be noted, because it already "as fast as can be observed".

and it's likely already doing more work than necessary since 1kHz is far higher than many cases require. what is this event handler's source, and what are its effects? if it is simply updating the UI and events may be collected and coalesced, then 1kHz dispatch is certainly overkill (far more than 1% - more like 25x). for a system which has mulitple sources and is transmitted in serial, then 1kHz may not be fast enough (e.g. MIDI).

However in mobile devices energy consumption is an important factor. The same event handler optimized to run ten percent faster will lead to less energy consumed and that's longer battery life and a longer operating device. How accurate is the latter judgement about mobile devices? Are there any real life examples that confirm or disprove it?

based on the programs i have seen, there are not very many people considering (or concerned with) such optimizations, even though changing your approach to writing programs can yield incredible gains (>10x or much faster). many that i have seen (in the app development side) just write then take a top down or "hail mary" approach when (/if) performance issues catch up with them. similarly, many will not even take the time to profile until such an occurence. by then, the noise of so many compound inefficencies makes it very difficult to get useful information from a profiler. examples of the hail mary approach would be optimizing the wrong areas (with or without looking for problem areas), or just throwing more cores at problem areas; this happens rather than fixing existing inefficiencies.

for the typical existing program (among the mobile programs i have seen), optimization was not a high concern when it is written. so "yes" they are (in the typical case) worth the time, provided it is in the budget and a priority. in that case, those ten changes which make the program noticably faster can likely be performed in a few hours, and less than a day.

"write lazily and profile in retrospect" as the only action to improve a program is a terrible idea: taking the time to learn how to write an efficient program (as it is written, not by taping it together at the end) is the superior approach (imo); use the right algorithms, forbid wasteful copying, allocations, calculations (+many, many other categories). of course, analyzing performance in retrospect has its merits, but if you write the program to be efficient from the outset you will have a whole new level of efficiency because you learn a lot and consider and evaluate execution from multiple perspectives.

the other thing is that programs should (often) be written for reuse, a poorly written program will introduce changes which may break clients' programs when the inefficiencies are removed (or just remain inefficient to avoid breaking existing programs).

one great benefit of considering it when you write is that you have a very clear idea of how the program will operate (although not a complete picture), you can use this information to aid in the design of the interfaces and how it stores its data. the truth is, an engineer can implement something which is several (e.g. >10x) times faster than the standard "one size fits all" solutions provided with the OS.

finally, it's also worth it beyond mobile devices. there are lot of inefficient programs out there, written with the mindset that hardware will be faster in two years (frequent rationale, even for programs written today!). while that's not incorrect, it's over-optimistic. as well, parallelization has purpose but it is  the wrong "default solution" for many programs. many of these existing programs can be best improved by first removing the existing inefficiencies.

so... there are typically a ton of those 1%, 2%, 7% (and much worse) cases in the real world. correcting them or (more importantly) not writing/exposing them in the first place can provide great benefits. many of those cases can be easily located and corrected (provided the engineer has some experience with this). it can, however, really be a pain to correct and re-test after the fact. if a program is to optimal, it will ideally be written that way from the outset.

as an end user, it's irritating to continuously wait for slow programs and to throw twice the hardware at problems created by slow/inefficient programs: Q: "what are you going to do now that you have twice the cores and twice the memory?" A: "regain the responsiveness and productivity i had before i upgraded my software -- that's about it". quite inconsiderate of the developer (imho).


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

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

For example:

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

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

For example:

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

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

I want to listen your opinion.

Am I wrong?

答:
Comments are a waste of time. Programmers read source code; any non-coder user-facing documentation should be geared towards exactly that: the user, not the coder reading the code. We as coders aspire to such lofty notions as SRP yet violate it continuously with policies like "comment every method according to this template."

Instead, write the code such that it documents itself. Explanations as to the why belong wherever your general user-facing documentation resides.

OwnerDisplayName: sunglim


答:
I have run up against the GIL in server side programming in almost every instance where I need something to scale to millions of concurrent users on multiple core machines.

Python is great for command line tools and things that don't need true concurrency to extract every last bit of performance from a given piece of hardware.

But for things that really need to squeeze everything out of something like a Sun T2000, you don't want to write anything in Python, it will be a operational maintenance nightmare running 32 separate processes and trying to management them all.

I abandoned Twisted in favor of Erlang a few years ago, Python just doesn't cut it in the large scale concurrency space. The transparent distributed nature of Erlang means it scales horizontally as well as vertically.

Title: Erlang or 'x'.. Is it worth it (vs. Python w/ GIL)?

Body:
So, I've finally gotten myself to a point where I'm comfortable enough with Python (using Pyramid as my framework of choice) to undertake a rather large personal project. As it's a personal project, I have the luxury of taking my time having absolutely no deadlines other than self-imposed ones.

I love learning new frameworks, languages, etc. so if given a reason, I don't mind pushing back on development for a month or so while learning a new language and framework (takes longer when you're doing it on your own time ;)).

I recently learned about CPython's GIL (Global Interpreter Lock), which raised my eyebrow a bit. If I understand it correctly, this means that if I have a Queue in my web app and have threads that complete jobs in the queue, then the code is locked until the thread for that request is complete, meaning that any subsequent request is locked while the previous thread is executing.

Question:

Has anyone in "real world" applications found this to be a problem? Is it worthwhile to learn a language that supports real concurrency out of the box, such as Erlang? I'm most interested in any benchmarks that anyone has done in real world apps and whether or not anyone has seen any real noticeable issues with the GIL.


问:
Supporting multitenancy
What are the typical challenges that arise when converting a single-tenant app into a multitenant app? Security and data isolation strike me as the most significant. What are some others?

I'm one of the architects for a fairly significant automation effort, and historically it's just been our company using it. We want to make it possible for others to use it as well. Every time we talk about "making it multitenant", the conversation revolves around keeping users with one tenant away from the data that another tenant owns, and making sure that users with one tenant can't (either intentionally or inadvertently) create impacts in another tenant's environments. What I'm wondering is whether security/data isolation are really the only major concerns here, or whether there are some other major concerns that we're just not thinking about.

答:
Besides siloing of data, you may run into problems with

Availability - with a single tenant, they can only DoS themselves, but even when data is properly siloed, a tenant can still exhaust resources.

Logging - all log messages assumed a single tenant.  Unless you silo logs per tenant, your log messages may become less useful.

Concurrency - single tenant apps may run under moderate load, or high contention for a few locks may effectively serialize certain operations.  If locks are multiplied per-tenant, you may start to see interleaving of operations that did not happen before.  Race conditions that were very unlikely to ever manifest, may now be likely to manifest.

New sources of resource contention - where before you might have n sockets and m filehandles, now multiply that per-tenant.

Configurability/backwards compatibility tradeoffs - where before you can obsolete a component as you roll out a replacement, you may now have one tenant demanding a component, and one tenant demanding that the old component it replaces stay around indefinitely.

Subpoena target - currently you are a subpoena target for problems related to your company.  With multiple-tenants, you might have to respond to subpoena requests even when you are not a party to the legal action.

Some of these assume that you're running all tenants in the same address space (machine or cluster).  If each tenant is running your software on their hardware, you can moot some of the above and add:

Difficulties accessing machines to debug.

Support requests for older versions.

Requests to allow third-party contractors to configure.

Less control over the hardware it runs on.

Less control over patch/update cycle of the OS it runs on.

Title: Supporting multitenancy


答:
The switch from C to Java happened at the wrong time.

Somewhere around 2000. I was in the last C class at my university.

C++ had too many features not to confuse a novice. (And it still does. And plans to add some.)

.NET wasn't mature enough and was even more expensive than today.

Objective C was old and Apple's usage of it was flying below the radar (there was no iPhone around)

Title: Why do we study Java at university?

Body: Java is often found in academia. What is the reason behind that? </p>


问:
How do I structure a larger Flask application?
I have a relatively simple web application that is written in Python using the Flask microframework. I've really enjoyed Flask's ease of use, however, as the app has grown larger it has started to become unwieldy having all of my actions (and utility functions) in a single file. My views.py is about 700 lines of code and I'd really like to break things out into more discrete units. How should I restructure my code?</p>

答:
There are multiple ways to structure your application:

The easiest is just to stick to the functions and move them to different files.  For as long as you make sure they are imported when the application starts that's perfectly okay.

Use Blueprints to assign the views to “categories”.  For instance backend, auth, profile, etc.  Blueprints have the advantage that they can in theory be attached to multiple applications and are also a great way to implement application factories.

Use the underlying Werkzeug URL map and register functions on there on a central URL map.

For all these topics there are entries in the pattern section of the Flask documentation.