问:
Is running an executable as a child process the same as linking a library?
I'm planning on running an executable as a child process in my program (e.g. using Ruby's popen or C's exec() family of functions). However, the executable I'm planning on running is licensed through the GPL.

The GPL, as I understand it, requires that all linked code to GPL licensed code needs to also be GPL.

But there's also an "arm's length" exception, discussed in the FAQ:

However, in many cases you can distribute the GPL-covered software alongside your proprietary system. To do this validly, you must make sure that the free and non-free programs communicate at arms length, that they are not combined in a way that would make them effectively a single program.

Would runnning an executable as a child process be part of this exception, or would it still be considered "linking" for the purposes of the license?

If it is considered "linking", how does it differ from running program, like Nmap, from the a command line?

答:
I think this quote from the section on plugins might lead you in the right direction.

If the program uses fork and exec to invoke plug-ins, then the
  plug-ins are separate programs, so the license for the main program
  makes no requirements for them. So you can use the GPL for a plug-in,
  and there are no special requirements.


问:
How to tell if a license is compatible with your program?
I'm using a code sample from MSDN in my project. Accompanying the sample is this license:

http://pastebin.com/K46NYf69

I've modified the code sample slightly to better suit my needs and I now want to release my program as open source. However, I'm not sure which licenses are compatible with this license because I cannot find it on Google. The license claims it is a Microsoft Permissive License but I can only find Microsoft Public License.

Also, I'm not completely sure what this license allows. Can I modify the sample? Can I package it in my project under another license like the GPL or the Apache/BSD license?

Thanks for reading.

答:
Unfortunatelly, you can't. Not with certanty.

That is a job for the people in nice suits. If you have access to a legal department of some sort, ask them. They should be able to offer (at least) a sound advice on the subject.

ContentLicense: CC BY-SA 3.0


问:
Is there a canonical book on x86 assembly?
There are lots of books on assembly. However, they usually deal with ISAs about which I don't care, such as MIPS or ARM. I don't deal with these architectures; there's no reason for me to try to learn them.

But x86 assembly books seem... nonexistent.

Let's say for example I'm trying to build a toy compiler generating Windows Portable Executable files.

Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on x86 assembly? What about that book makes it special?

答: I used Assembly Language for x86 Processors as a textbook when I was in college and found it very easy to understand. I have the older fourth edition and compared it to the sixth edition and didn't notice much change, so you could probably pick up an older copy cheap. People complain about his use of his own library for I/O, but he tells you how to do it the "hard" way in latter chapters.</p>

ContentLicense: CC BY-SA 4.0


答:
Read The License:

(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution.

That tells me that any open-source derivative must be under MSPL as well.

Title: How to tell if a license is compatible with your program?

Body:
I'm using a code sample from MSDN in my project. Accompanying the sample is this license:

http://pastebin.com/K46NYf69

I've modified the code sample slightly to better suit my needs and I now want to release my program as open source. However, I'm not sure which licenses are compatible with this license because I cannot find it on Google. The license claims it is a Microsoft Permissive License but I can only find Microsoft Public License.

Also, I'm not completely sure what this license allows. Can I modify the sample? Can I package it in my project under another license like the GPL or the Apache/BSD license?

Thanks for reading.


问:
Is it essential to learn algorithms to be a real programmer?
I'm a PHP programmer, and until now I have not needed to learn algorithms...

Now I'm start learning Python (a real programming language), because I need to use matplotlib. Does it make sense to start by reading a Python algorithm book and then learn matplotlib and numpy or should I jump to matplotlib and numpy?

Best Regards,

答:
Ok - I know this is not exactly what you meant, but you allready know (how to do) algorithms. Depending on your definition you can take every progamm as a example for an algorithm.

So don't fear. It's usefull to know the basic algorithms, it's more usefull to know the basic data-structures but it's even better to know the design-"patterns". Afterall the basic algorithms and data-structures will be implemented in your framework of choice but the patterns will most likely not...


答:
This is generally considered to be okay, as long as the child process is a sensible program in its own right.

Ultimately, the question is, is the owner of the GPL'd code going to sue you, and can he convince a judge that the processes are "combined in a way that would make them effectively a single program." If the child process is a tool that can be used on its own, and you are invoking that tool, you should be fine.

Title: Is running an executable as a child process the same as linking a library?

Body:
I'm planning on running an executable as a child process in my program (e.g. using Ruby's popen or C's exec() family of functions). However, the executable I'm planning on running is licensed through the GPL.

The GPL, as I understand it, requires that all linked code to GPL licensed code needs to also be GPL.

But there's also an "arm's length" exception, discussed in the FAQ:

However, in many cases you can distribute the GPL-covered software alongside your proprietary system. To do this validly, you must make sure that the free and non-free programs communicate at arms length, that they are not combined in a way that would make them effectively a single program.

Would runnning an executable as a child process be part of this exception, or would it still be considered "linking" for the purposes of the license?

If it is considered "linking", how does it differ from running program, like Nmap, from the a command line?


问:
What is the proper way to create requirements documents?
Right now my supervisor is creating requirements documentation / specs for me using bugtracking software.  This seems like a terrible idea to me, all the requirements are on these little tickets and I have to click around on this dumb webform to get at the requirements.  What is a sane software solution for requirements / software specs?

To be clear, I am building this large software component with quite a few features and these features are being set forth in this bugtracking software.

答: I used once http://www.pivotaltracker.com/ but in my current company we're using .doc as core specification source and Lighthouse as combined features wishlist & issue tracking. For me it's hard to make other people in the team start using any other tools when they are so much used to Word. </p>

ContentLicense: CC BY-SA 2.5


答:
It's OSI-certified so it's good in relinquishing copyright, but it makes many statements about patents, and distribution of patent liability in case of a patent shitstorm. They have huge concerns about that.

GPL, instead (since v3, IIRC) waivers redistributors from patent fees also in the case of a patent apocalypse.

If there was no (D) paragraph you could have redistributed with a different license with some added patent note, but to redact that you would have needed a lawyer expert in U.S. patent law, so no real good.

Consider adopting the MS-PL for a while until fed up to the point of a complete rewrite of the incriminated code. Yes, also complete rewrites present problems, but maybe you won't ever have to front them.


问:
Using Fonts in your Applications
When writing applications for software, specifically mobile devices, will there be a problem with using any specific type of fonts (copyright/patent issues)?

If so, how can we avoid this possible problems?

Will it then make a difference if the app was a paid version or a free version?

答:
The situation varies per jurisdiction. The font file itself (the binary .ttf, .otf, or whatever format it's in) is generally copyrightable pretty much everywhere in the world, and if you (digitally) convert it to a different format, you are creating a derived work, which is also covered by the original copyright.

The font design itself, however, is a slightly different story. In some jurisdictions, font designs are not considered works of art and are thus not subject to copyright; in others, they are. So if you make a font from scratch that looks like, say, Adobe Garamond, but isn't derived from the actual Adobe Garamond, you may or may not be subject to copyright claims.

And then there's trademarks, another form of intellectual property protection. Again, some jurisdictions allow trademarking entire fonts, others allow trademarking individual glyphs (which gets pretty damn expensive for entire unicode fonts), yet others disallow it altogether.

The safest (and probably wisest) thing to do is to obey the license that comes with the fonts you're using, use a free font (fontsquirrel is full of them), or not embed any fonts yourself.

Title: Using Fonts in your Applications


问:
How do I appropriately license my open-source project?
I have just recently completed my first open source project and while it is mostly a tool I still want to release it as open source considering it is C# so if someone wanted to they could decompile it. Also, I'm not looking to sell it.

I was researching licensing but the wording is a bit over my head. Mostly I'm just looking for a license that recognizes me as the creator and does not allow anyone else to put their name on it and "steal it." I'm most likely going to use either google code or sourcefourge to host the project and ideally I could have a donation button. I'm not sure if or which software licenses would prevent that sort of thing?

Also, I'm not really sure how licenses and copyrights "work." Do I just choose a license and paste it at the top of every source file? Should I include my name as well? Do I also put the licenses in the project's root directory? How does one obtain a copyright? It seems like most people just stick it on their stuff. Is there an actual process to obtaining one?

As for software licenses I've looked at so far, it seems like Apache 2.0 or MIT/BSD is what I'm looking for but I'm not exactly sure. Basically I just don't want anyone to steal my program and put their name on it. Other than that I'm fine with people looking at the source code, modifying it, or taking pieces from it, as long as they credit me.

答:
Eric S. Raymond's "Art Of Unix Programming" has an entire chapter devoted to the various open source licenses; this part is a nice overview that should give you enough information to make an educated choice.

Personally, I prefer BSD or MIT licenses; they're about as liberal as you can be, and don't suffer from being viral like GPL.

OwnerDisplayName: James


问:
How to turn truth table into smallest possible if / else block
How can I take a truth table and turn it into a compacted if block?

For instance, let's say I have this truth table where A and B are conditions and x, y and z are possible actions:

```<code>A B | x y z
-------------
0 0 | 0 0 1
0 1 | 0 0 1
1 0 | 0 1 0
1 1 | 1 0 0
</code>```

This could transform into below if block:

if(A)
{
    if(B)
    {
        do(x)
    }
    else
    {
        do(y)
    }
}
else
{
    do(z)
}
```

This is an easy sample, but I frequently have several conditions that combined in different ways should produce different outputs and it gets hard to figure out the most compacted and elegant way to represent their logic in an if block.

答:
In C#.NET, you can use a Dictionary Class to get the result without any IF ELSE as follows - The nice thing about this is:

It is readable

New keys will be unique (otherwise, you get an error)

Sequence does not matter

Easy to add or remove entries

If you don't have an equivalent of Dictionary Class, you can do the same in a binary look-up/search function.

//A B | x y z
//-------------
//0 0 | 0 0 1
//0 1 | 0 0 1
//1 0 | 0 1 0
//1 1 | 1 0 0
// Create a Dictionary object and populate it
Dictionary<string, string> _decisionTable = new Dictionary<string, string>() {
    { "0,0", "0,0,1" },
    { "0,1", "0,0,1" },
    { "1,0", "0,1,0" },
    { "1,1", "1,0,0"}
};

//usage example: Find the values of X,Y,Z for A=1,B=0
Console.WriteLine(_decisionTable["1,0"]);
Console.Read();
```


答:
What you want is a Rete algorithm. This automatically combs a set of rules and prioritizes them into a tree the way you describe.

There are a number of commercial "rules engine" systems that do this on the very large scale (millions of rules) where execution speed is essential.

Title: How to turn truth table into smallest possible if / else block

Body:
How can I take a truth table and turn it into a compacted if block?

For instance, let's say I have this truth table where A and B are conditions and x, y and z are possible actions:

```<code>A B | x y z
-------------
0 0 | 0 0 1
0 1 | 0 0 1
1 0 | 0 1 0
1 1 | 1 0 0
</code>```

This could transform into below if block:

if(A)
{
    if(B)
    {
        do(x)
    }
    else
    {
        do(y)
    }
}
else
{
    do(z)
}
```

This is an easy sample, but I frequently have several conditions that combined in different ways should produce different outputs and it gets hard to figure out the most compacted and elegant way to represent their logic in an if block.


问:
Example of Terms of Services for Agile contracting?
In my experience as a freelance developper, I've had some difficulties with clients, whom insist on getting an estimate over flimsy requirements. They then expect me to deal with requirements changes, sometimes late in the project, and stick to that estimate.

Since I've never come up myself with some T.O.S. tailored for this situation, I ended up bound by a contract of a more general nature, which inevitably became unsasatisfactory...

Legal lingo not being my forte, I've been lookin for some publicly released T.O.S. to try to remedy this situation. Ideally these would be from an agile shop, under a licensing scheme allowing derivatives. This would help me lay out the contractual groundwork for a sane customer relationship, especially when dealing with changes.

答:
Agile Team & Fixed Price Contract: http://www.infoq.com/articles/agile-team-fixed-price-contract

Fixed price contracts are evil - this is what can often be heard from agilists. On the other hand those contracts are reality which many agile teams have to face. But what if we try to tame it instead of fighting against it? How can a company execute this kind of contract using agile practices to achieve better results with lower risk? This article will try to answer those questions.


问:
Is there a GPL-compatible software license for libraries which allows static linking, but requires redistribution of library source code?
I'm looking for an existing library license which satisfies the following conditions:

GPL-compatible

Can be statically linked with closed-source programs

Binary modifications of the library, including cases where the library is statically linked with another project, must be accompanied by the library source code

Licenses which are close but not quite what I need:

LPGL - does not allow static linking with non-free software*

Eclipse Public License - not GPL-compatible due to a patent clause

GPL linking exception - does not require source code redistribution

*: The LGPL allows static linking with some specific technical conditions - specifically, it must be possible to make modifications or use newer versions of the library, and to do that one would need to make available the object files and build scripts for the non-free components. Generally speaking, this is technically difficult and sometimes impossible (in the case of e.g. templates or inlined functions), and very often (as is my case) the underlying reasons for which static linking is required conflict with these LGPL requirements. For this reason, LGPL is unsuitable for my use case, and frankly I've yet to see a project which used static linking with an LGPL library in this manner, considering all the associated technical and legal (templates/macros/inlining) problems.

答:
You can use your own licence, or simply add an exception to the LGPL to allow static linking - as in the wxWidgets licence

wxWidgets is currently licensed under the "wxWindows Licence" pending approval of the "wxWidgets Licence" which will be identical apart from the name.

The wxWindows Licence is essentially the L-GPL (Library General Public Licence), with an exception stating that derived works in binary form may be distributed on the user's own terms. This is a solution that satisfies those who wish to produce GPL'ed software using wxWidgets, and also those producing proprietary software.

wxWidgets is Certified Open Source Software Participants in the discussion that led to this decision include the folk from Abisource, Robert Roebling, Julian Smart, Markus Fleck, Karsten Ballueder, and some advice from Richard Stallman. Richard has confirmed that the new licence is compatible with GPL'ed applications. However, there are no significant restrictions on proprietary applications.

The wxWindows Licence has been approved by the Open Source Initiative, and you can find the licence on their site here...


答:
Apache v2 satisfies all your conditions: Apache License v2.0 and GPL Compatibility

The Free Software Foundation considers the Apache License, Version 2.0 to be a free software license, compatible with version 3 of the GPL. The Software Freedom Law Center provides practical advice for developers about including permissively licensed source.

Apache 2 software can therefore be included in GPLv3 projects, because the GPLv3 license accepts our software into GPLv3 works. However, GPLv3 software cannot be included in Apache projects. The licenses are incompatible in one direction only, and it is a result of ASF's licensing philosophy and the GPLv3 authors' interpretation of copyright law.

This licensing incompatibility applies only when some Apache project software becomes a derivative work of some GPLv3 software, because then the Apache software would have to be distributed under GPLv3. This would be incompatible with ASF's requirement that all Apache software must be distributed under the Apache License 2.0.

We avoid GPLv3 software because merely linking to it is considered by the GPLv3 authors to create a derivative work. We want to honor their license. Unless GPLv3 licensors relax this interpretation of their own license regarding linking, our licensing philosophies are fundamentally incompatible. This is an identical issue for both GPLv2 and GPLv3.

Despite our best efforts, the FSF has never considered the Apache License to be compatible with GPL version 2, citing the patent termination and indemnification provisions as restrictions not present in the older GPL license. The Apache Software Foundation believes that you should always try to obey the constraints expressed by the copyright holder when redistributing their work...

Title: Is there a GPL-compatible software license for libraries which allows static linking, but requires redistribution of library source code?

Body:
I'm looking for an existing library license which satisfies the following conditions:

GPL-compatible

Can be statically linked with closed-source programs

Binary modifications of the library, including cases where the library is statically linked with another project, must be accompanied by the library source code

Licenses which are close but not quite what I need:

LPGL - does not allow static linking with non-free software*

Eclipse Public License - not GPL-compatible due to a patent clause

GPL linking exception - does not require source code redistribution

*: The LGPL allows static linking with some specific technical conditions - specifically, it must be possible to make modifications or use newer versions of the library, and to do that one would need to make available the object files and build scripts for the non-free components. Generally speaking, this is technically difficult and sometimes impossible (in the case of e.g. templates or inlined functions), and very often (as is my case) the underlying reasons for which static linking is required conflict with these LGPL requirements. For this reason, LGPL is unsuitable for my use case, and frankly I've yet to see a project which used static linking with an LGPL library in this manner, considering all the associated technical and legal (templates/macros/inlining) problems.


答:
The obvious place to go is Intel's website, where you can find programming and reference manuals for download that contain everything there is to know about the x86 architecture.

Here: Intel® 64 and IA-32 Architectures Software Developer's Manuals

Title: Is there a canonical book on x86 assembly?

Body:
There are lots of books on assembly. However, they usually deal with ISAs about which I don't care, such as MIPS or ARM. I don't deal with these architectures; there's no reason for me to try to learn them.

But x86 assembly books seem... nonexistent.

Let's say for example I'm trying to build a toy compiler generating Windows Portable Executable files.

Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on x86 assembly? What about that book makes it special?


问:
Should I be a good programmer immediately after college?

Possible Duplicate:

  I've graduated with a Computer Science degree but I don't feel like I'm even close to being an expert programmer

I recently graduated from university, and I have since then joined a development team where I am by far the least experienced developer with maybe with a couple work terms under my belt. Meanwhile, the rest of the team is rocking 5-10 years experience.

I was a very good student and a pretty good programmer when it came to bottled assignments and tests. I have worked on some projects with success, but now I'm working with a much bigger code-base, and the learning curve is much higher.

I was wondering how many other developers started out their careers in teams and left like they sucked. When does this change? How can I speed up the process? My seniors are helping me but I want to be great and show my value now.

答:
One of the things no one has mentioned is that the problems you are given to solve in school are deliberately dumbed down to make it easy to see how to use as specific technique you are being taught. You usually know what technique that you are supposed to use for that particular problem because it is the one you just covered in class. Whole semester projects are a little bette,r but still limited in scope and complexity compared to the real world.

Real life projects are messy and evolve over years (our software is over ten years old and has been changing continuously for that time) and are touched by many different people with many different skill levels. You may still be touching a 10-year old database version and cannot use any newer SQL techniques at all. You may be using a tool that was great 8 years ago, but that you didn't learn in school becasue it's been superceded by something else. But the company doesn't want to pay for months of development effort to totally replace it.

You are stuck in a world where time to develop is severly constrained by what the client will pay for and what the, sometimes (OK usuaully) artifical, deadlines are.

You may be constrained to use tools that the client specifically asked for. You may have vague requirements or ones that make little sense. You may be dealing with a very complex business domain that you know nothing about and thus can't even judge if the requirements make sense.

The real world problems are in no way comparable to the nice clean problems they give you in school. If you aren't confused and feeling out of place for most of the first year, I'd worry about you.


问:
Formal requirements analysis
I've been doing a Requirements Analysis module in my university. We've covered all kinds of formal requirements stuff, like UML, Use Case Diagrams, Sequence Diagrams and Contracts. I have to ask- are any of these things of any value whatsoever in the real world? The only Use Case Diagrams I've ever seen could be summed up in a vastly more succint and understandable way in plain English- or even code in a reasonable language of your choice- and the same goes for the other things I've mentioned.</p>

答:
School problems are over simplified for learning. So you can't make any value judgements based on them as to the utility in the real world. Next most people who do requirements Analysis are NOT programmers and certainly could not express the requirement in code.  Third, these are most useful when doing large complex projects, so the experience of people working on smaller things may indicate that they are less than useful where the experience of people working on space shuttle type projects might be different.

The last large project I worked on had an inital requirements document of over 800 pages (which grew to be much larger by the end) sometimes having a diagram makes it easier to understand the written word.  It also helps to keep people things in terms of the process that needs to be created and helps prevent silliness such as requiring the software to have an approval from a manager fo rthe budget expenditure for a project of more than $1 million but no requirement that tells you what to do do if he rejects the project. When you use a structured approach, you are more likely to see all the pieces I think.

Are these techniques appropriate for all projects always, no of course not.  Agile projects tend to take a less complex approach to begin with and these techniques might be perceived as time wasters. From what you wrote, I would suspect you are someone who is more comforatble with the agile approach and thus may not use these techniques or see them in the projects you work on. What is critical about learning them for you may be more the analytical thought process that goes into doing them rather than the actual diagrams themselves.

Title: Formal requirements analysis


问:
Post-Project Meeting a Waste of Time?
At my place of employment, we've had some serious growing pains.  We went from a development team of 3 to 10, and the company itself has grow 30% in the past year.  By most measurements, we're doing well.  Unfortunately, the quality of our software has suffered.

In a meeting today with my division's manager, I proposed a project team meeting a day or two after the product has launched.  We could discuss budget concerns, scope, what went wrong, and what went right.  Ideally, learning from our mistakes.  We build sites/apps for other people, so our time is either billable on non-billable.  A meeting like this would fall under the latter.

My manager shot it down almost immediately: "That time isn't billable.  It'll make us get behind on another project because we waste time at the end of that one talking about it."  I was so caught off guard by this logic that I didn't even bother fighting him on it.

So my question:  I see the value is post-project meetings, but he doesn't.  Is there documented proof of post-project meetings helping save time and money in the long (or short) run?  Intuitively I think it will/would, but he clearly is more worried about a small amount of un-billable time from the 5 people that would need to be there.

答:
Your manager doesn't understand the concept of Technical Debt.

Post-project meetings are an investment, not a cost.  That's how you have to sell them.  The purpose of any meeting is to exchange ideas about how to save money and fulfill the company's objectives over the long term.

Your manager is a manager because he deals with these long term objectives.  So in my view there are two possible truths: your manager wants all the control to himself, or your manager isn't doing his job.  If the company has a history and philosophy of doing things "the right way," and investing in its own success, consider taking the issue above your manager.

OwnerDisplayName: Jack Slingerland

Title: Post-Project Meeting a Waste of Time?


答:
This is essentially an after action review, which is particularly useful in a lot of different contexts, not just the military.

My own development cycle involves analyzing both what should be done in the next iteration or project and what could be done better in the previous project.  Even if a project is shelved for awhile, having a list of things to work on helps when it comes off the shelf (or backburner...) and is again an active project.  The next time I touch it, I don't have to spend as much time reviewing what I need to do.

In addition, by reviewing a project and finding the neat tricks that I or others have implemented, these are disseminated and the next project or next iteration is that much better.  (It might come as no surprise that I frequently think in terms of iterations.)

Title: Post-Project Meeting a Waste of Time?

Body:
At my place of employment, we've had some serious growing pains.  We went from a development team of 3 to 10, and the company itself has grow 30% in the past year.  By most measurements, we're doing well.  Unfortunately, the quality of our software has suffered.

In a meeting today with my division's manager, I proposed a project team meeting a day or two after the product has launched.  We could discuss budget concerns, scope, what went wrong, and what went right.  Ideally, learning from our mistakes.  We build sites/apps for other people, so our time is either billable on non-billable.  A meeting like this would fall under the latter.

My manager shot it down almost immediately: "That time isn't billable.  It'll make us get behind on another project because we waste time at the end of that one talking about it."  I was so caught off guard by this logic that I didn't even bother fighting him on it.

So my question:  I see the value is post-project meetings, but he doesn't.  Is there documented proof of post-project meetings helping save time and money in the long (or short) run?  Intuitively I think it will/would, but he clearly is more worried about a small amount of un-billable time from the 5 people that would need to be there.


答: The value of this is simple logic and inherently obvious. How can you improve on future projects if you never learn from your mistakes on your previous projects?</p>

Title: Post-Project Meeting a Waste of Time?


答:
Looking Back, Looking Ahead would be close to documented proof on the idea.  The Project Post-Mortem: A Valuable Tool for Continuous Improvement would be a blog post about it.

The Art Of The Post-Mortem has this point about the idea:

The origins of the Post-Mortem are with the military, who routinely
  use this kind of process to debrief people on the front lines.  But
  its management application is essential to any high performing,
  learning organization.

Title: Post-Project Meeting a Waste of Time?


答:
It may be that your manager is under budget pressure. That has to be a big concern when expanding from 3 to 10 developers in a short time. If that's the case, then it's probably a good idea to just skip the post-mortem meetings for now and suggest them again in a few months, when hopefully the immediate budget issues won't be so pressing.

One reason that quality may be suffering is that communication between 10 people is a much bigger problem than communication between 3 people: 3! << 10!. While you can probably muddle along as you are for a little while, you're going to eventually have to make some changes to foster better communication among the developers, and to make sure that the principles that the original 3 developers established get disseminated to the newer folks and updated to work well in your new larger group. Project post-mortem meetings are one way to do that; periodic code reviews are another. It wouldn't hurt to point out that post-mortem meetings are a critical part of quality improvement in industries from medicine to manufacturing.

It's hard to imagine that your manager believes that he can expand his development team simply by hiring additional people. There absolutely has to be some investments in training and team building; without that, your organization will collapse under its own weight. If you wait a little while, your organization may start to experience some concrete problems that are directly attributable to poor communication. At that point, your manager will probably say: "We've got to get everybody on the same page! Schedule a meeting with all the developers!" And if it seems to help, he'll probably say: "We should be doing this after every project!" ;-)

So, be patient, but be persistent.

Title: Post-Project Meeting a Waste of Time?


问:
Portable programming style
I'm a Python programmer that prefers to develop on Windows but still end up deploying to a Linux server.

I've just finished writing a little script: stuff that downloads files from a site, generates a sitemap, gzip it, pings the search engines and emails the response code.

Nowadays most GNU tools are available and compiled also for Windows and I sure do use Wget and Grep whenever I need to.

Until now I've always tried to implement the functionality I needed in Python (gzipping and opening urls require very few lines of code) but I found myself thinking if maybe I could write more resilient code if I didn't reinvent the wheel and just scripted everything in a bash script style where a big part of the functionality is delegated to an external process such as mail, wget, curl, etc and the other tools *nix makes generally available.

What is your take on this? When you target *nix do you glue tools together or you tend to implement all the functionality in your scripting language of choice?

答:
Depends on your intended audience.

If this is a general app then you may need to bundle these tools with it, make sure that they still work with changes and updates to windows and make sure they don't clash with any windows built-ins.  Git has to do this on Windows, it bundles a lot of the mingw tools

If the app is aimed at non-techncial users this may be easier since you can stick the tools in a local sub directory and not have to worry about them clashing with other cygwin/mingw/etc tools.

You should also be aware of security warnings, if a user runs your app and gets a message about wget (which they have never heard of) trying to breach the firewall they may get nervous!

Title: Portable programming style


答:
If you want to write a small script, well for god's sake write a small script. If you want to write a program (even if part of that program uses external programs), write a program. If you have a well-defined target platform, feel free to use its capabilities either way. And yes, reinventhing the wheel is bad either way (but you seem to have an overly libral definition of that term, see below).

That particular .py file is basically doing the same thing as a bunch of wget and tar calls? You'd bet hell will freeze over before the file is used on a non-unix server? Then write it like a shell script (or if your logic is simple enough, just write a shell script!). Things like that are simple enough to rewrite in the unlikely case they need to be made really portable; but until then, YAGNI.

Things are different for library code and general-purpose applications. If you can do it without adding a dependency on an external program, then do it. Every time you do that, you add portability and ease deployment (GNU coreutils may be available on windows, but who's going to package it for inclusion in your app? Or, worse, tell users to download these fifty programs?). And every ounce of that is sacred, it may save someone's day in the future (it may be yourself, someone else working on your project, or even the proverbial violent psychopath who knows where you live). Gluing together standard library modules in a few lines is not wheel reinvention. Rewriting the whole module is wheel reinvention. But even that may be acceptable as a necessary evil if the wheel you're reinventing only works natively on two platform, runs only through cygwin on a third and doesn't work at all on the fourth... but that's another topic, a topic that has been covered extensively in the past and will be debated even more in the future.

Title: Portable programming style

Body:
I'm a Python programmer that prefers to develop on Windows but still end up deploying to a Linux server.

I've just finished writing a little script: stuff that downloads files from a site, generates a sitemap, gzip it, pings the search engines and emails the response code.

Nowadays most GNU tools are available and compiled also for Windows and I sure do use Wget and Grep whenever I need to.

Until now I've always tried to implement the functionality I needed in Python (gzipping and opening urls require very few lines of code) but I found myself thinking if maybe I could write more resilient code if I didn't reinvent the wheel and just scripted everything in a bash script style where a big part of the functionality is delegated to an external process such as mail, wget, curl, etc and the other tools *nix makes generally available.

What is your take on this? When you target *nix do you glue tools together or you tend to implement all the functionality in your scripting language of choice?


答:
While not specifically documentation, review of process (during or after completion) is a major component of just about every standards-based quality control system I know of, CMMI and Lean 6 Sigma especially.

Maybe you could propose it as not an obligation, something that is done voluntarily over a lunch meeting or something?  Chances are good that quite a few of your development team will be eager to come and try new things... so if you can swing at least the first one, the results will speak for themselves.

Title: Post-Project Meeting a Waste of Time?


问:
Introducing "20% time" at a workplace
20% time it's the culture of an employer allowing it's employees to spend 20% of their time working on projects that they find interesting - it may be inventing a new app, or improving an existing process, etc. Some people may know this as skunk work, however that term may not mean anything (or something entirely different) to you.

There are many documented cases of great products being born out of 20%/skunk work at a company. It seems like a win/win situation; the company potentially gain a great new product or application, and the developer has the opportunity to flex his/her creative muscles and innovate.

I tried on numerous occasions to introduce some form of 20%/Skunk working at my previous employer with no success.

How can I better justify it to management? What's the "right" way to approach this kind of work arrangement?

答:
"Skunkworks" isn't the same as 20% time.  20% time is as you said -- time the developer chooses on his own what to work on.  Skunkworks is totally different.  A skunkworks project is a high-value, high-cost project worked on by a team (often a splinter team of gurus) that is not reported on to upper management, and the team decides on their own how the project should proceed without management direction.  These projects are often motivated by a tactical or business need to get something done, but there's no room in the budget for it.  If something has to get done, it gets done -- budgets be damned.

I managed a development team where I implemented 20% time.  Or tried to, anyway.  I had approval of my superiors, so that wasn't an issue.  The problem was that the team was too small and too specialized.  Whenever problems came up that needed immediate intervention, the 20% time was bumped.  This ended up happening very often.

I also found that some of my developer's found my lack of direction unsettling.  Even though I said "work on anything you want, so long as it's programming-related," they still had a hard time accepting the "anything" part.  They thought that some projects would be better than others, so they inevitably worked on low-level implementation requests in the main product, things like that.  I wanted them to branch out and grow, but instead they dug deeper in to their main expertise.

I would do it again, but I would expressly prohibit working on the main product and I might start them off with some ideas to choose from to get started.

Title: Introducing "20% time" at a workplace


答:
Requirements analysis is a process that uses tools like UML diagrams.

Diagrams facilitate communication and sometimes can be used to generate code (e.g. 1 and 2 below). They also aid in adding a visual layer to the solution that could some time help the end users and developers (e.g. 4, 5 below).

Use Case diagrams represent high level view of the interaction and don't replace the textual case description.

Some of the very important diagrams for showing requirements and design are:
1. Entity relationship diagrams
2. Class diagrams
3. Sequence diagrams
4. BPM - Business Process Models
5. Page Flow diagrams
6. Use Cases

Requirements analysis is a large subject and may use other diagrams as well.
The important thing is that you capture and communicate your knowledge about the system requirements to the developers and the end-users.

There are suite of tools that can validate some of the above diagrams (e.g. 1,2). Some tools can build a web applications automatically from (1 or 4).

Yes the diagrams are important and are used in some projects.

Title: Formal requirements analysis

Body: I've been doing a Requirements Analysis module in my university. We've covered all kinds of formal requirements stuff, like UML, Use Case Diagrams, Sequence Diagrams and Contracts. I have to ask- are any of these things of any value whatsoever in the real world? The only Use Case Diagrams I've ever seen could be summed up in a vastly more succint and understandable way in plain English- or even code in a reasonable language of your choice- and the same goes for the other things I've mentioned.</p>


答:
It's worse than that... after a few years in this job, you'll be feeling pretty good about what you've learned. But then you'll change jobs, and your new company (or maybe even new group within the same company) will do things differently, and you'll feel like you're right back at square one. There will be different code, different coding standards, different tools, and different processes, and after two days of that you'll wonder if you really learned anything at all at your last job. You'll get over that fish-out-of-water feeling more quickly this time, but it'll still take longer than you'd like.

There's an adaptation period every time you switch jobs. It gets shorter as you gain experience, but it's always there.

Title: Should I be a good programmer immediately after college?

Body:
Possible Duplicate:

  I've graduated with a Computer Science degree but I don't feel like I'm even close to being an expert programmer

I recently graduated from university, and I have since then joined a development team where I am by far the least experienced developer with maybe with a couple work terms under my belt. Meanwhile, the rest of the team is rocking 5-10 years experience.

I was a very good student and a pretty good programmer when it came to bottled assignments and tests. I have worked on some projects with success, but now I'm working with a much bigger code-base, and the learning curve is much higher.

I was wondering how many other developers started out their careers in teams and left like they sucked. When does this change? How can I speed up the process? My seniors are helping me but I want to be great and show my value now.


问:
Diagramming large and complex application code
I tried creating a flow chart of a function that I use in my program, but there are a lot of conditional statements in between every process and the diagrams are getting more confusing.

Is there a another language or markup other than flow charts that can be employed for large codebases with high complexity?

答:
If your code logic is complex because it has too many conditions, flow charts don't help.
The better approach is to use Pseudocode to describe your logic.
find details about Pseudocode here:
http://en.wikipedia.org/wiki/Pseudocode
also
http://149.144.20.200/subjects/PE/PEWeb/other_resources/pseudocode_guide.html

if you want to show table relationships, then you use Entity Relationship Diagrams, and if you want to show process dependencies you use BPM. Each diagram has a purpose and limitations.


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

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

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

答:
I found a lot of good arguments against, but one I did not see: ergonomics.

In former times, when all you had was string, int, bool and float, the characters sibf would have been sufficient. But with string + short, the problems begin. Use the whole name for the prefix, or str_name for string? (While names are almost always strings - aren't they?) What's with a Street class? Names get longer and longer, and even if you use CamelCase, it is hard to tell where the type-prefix ends and where the variable-name begins.

```<code> BorderLayout boderLayoutInnerPanel = new BorderLayout ();
 panelInner.addLayout (borderLayoutInnerPanel);
</code>```

Okay - you could use underlines, if you don't use them for something else already, or use CamelCase if you used underlines so long:

```<code> BorderLayout boderLayout_innerPanel = new BorderLayout ();
 panel_inner.addLayout (borderLayout_innerPanel);

 Border_layout boder_layoutInner_panel = new Border_layout ();
 panelInner.add_layout (border_layoutInner_panel);
</code>```

It's monstrous and if you do it consequently, you will have

```<code> for (int iI = 0; iI < iMax-1; ++iI)
     for (int iJ = iI; iJ < iMax; ++iMax)
          int iCount += foo (iI, iJ);
</code>```

Either you will end in using useless prefixes for trivial cases, like loop-variables or count. When did you recently use a short or a long for a counter? If you make exceptions, you will often loose time, thinking about needing a prefix or not.

If you have a lot of variables, they get normally grouped in an object browser which is part of your IDE. Now if 40% start with i_ for int, and 40% with s_ for string, and they are alphabetically sorted, it is hard to find the significant part of the name.

Body:
I found a lot of good arguments against, but one I did not see: ergonomics.

In former times, when all you had was string, int, bool and float, the characters sibf would have been sufficient. But with string + short, the problems begin. Use the whole name for the prefix, or str_name for string? (While names are almost always strings - aren't they?) What's with a Street class? Names get longer and longer, and even if you use CamelCase, it is hard to tell where the type-prefix ends and where the variable-name begins.

 BorderLayout boderLayoutInnerPanel = new BorderLayout ();
 panelInner.addLayout (borderLayoutInnerPanel);

Okay - you could use underlines, if you don't use them for something else already, or use CamelCase if you used underlines so long:

 BorderLayout boderLayout_innerPanel = new BorderLayout ();
 panel_inner.addLayout (borderLayout_innerPanel);

 Border_layout boder_layoutInner_panel = new Border_layout ();
 panelInner.add_layout (border_layoutInner_panel);

It's monstrous and if you do it consequently, you will have

 for (int iI = 0; iI < iMax-1; ++iI)
     for (int iJ = iI; iJ < iMax; ++iMax)
          int iCount += foo (iI, iJ);

Either you will end in using useless prefixes for trivial cases, like loop-variables or count. When did you recently use a short or a long for a counter? If you make exceptions, you will often loose time, thinking about needing a prefix or not.

If you have a lot of variables, they get normally grouped in an object browser which is part of your IDE. Now if 40% start with i_ for int, and 40% with s_ for string, and they are alphabetically sorted, it is hard to find the significant part of the name.


答:
Use nested layers of DFD

Generally the best way to tackle complexity in any software system is to simplify it.  One of the better ways that I have found to simpify diagramming complex software is to break it up into layers with differing granularity of concept.

http://www.motshegwa.com/hobbies/development/IFESS/s2c/dataflow.html

For Example

Diagram 1 has a very top down highest level overview of your system.  This almost doesn't have any real logic behind it more that it outlines how your highest level systems hang together.  If you wish to see how a particular system works you look at another diagram.

Diagram A goes into more detail about how System 1 works, however once again this is a high level overview and outlines how system 1 works conceptually, however actual logic is  referred to futher sub diagrams.

At the lowest granularity this is where the actual logic for the system comes into play and so like object inheritence in code (assuming you're using OOP/OOD) you have multiple levels of abstraction in your DFD as you do in your code and so the actual implementation details are delegated to your finest granularity of objects.

Cognitive complexity

However at each layer there should be rules regarding cognitive complexity.  Like code your diagrams should be able to be understood easily within 5 minutes or less.

Well designed code should also follow the above rules for cognitive complexity

Generally this is how your code should be layed out as well, well designed code should also be easily understood within 5 minutes or less.

Title: Diagramming large and complex application code

Body:
I tried creating a flow chart of a function that I use in my program, but there are a lot of conditional statements in between every process and the diagrams are getting more confusing.

Is there a another language or markup other than flow charts that can be employed for large codebases with high complexity?


答:
I'll buck the trend:  I agree with the manager.

I've found post-project reviews largely pointless because it's too late to do much of anything to correct the problems revealed.

What I would most highly recommend is periodic retrospectives done during the project.  Once or twice a month have the team talk about what went well, what didn't; what to do more, what to do less.  Do this during the project so that you can immediately apply the suggestions and see how well they work.

Title: Post-Project Meeting a Waste of Time?


答: If the flowchart for one function is so complex that it is difficult to understand, then the function is too complex.  Consider the Refactoring pattern called "Extract Method."  (It can be used on non-OO procedural functions too.)</p>


问:
I'm writing about language syntax. Is there a language out there in which parameters are placed inside method name?
in JavaScript:

function getTopCustomersOfTheYear(howManyCustomers, whichYear) {
   // Some code here.
}
getTopCustomersOfTheYear(50, 2010);
```

<p>in C#:</p>

<pre class="lang-cs prettyprint-override"><code>public List<Customer> GetTopCustomersOfTheYear(int howManyCustomers,
 int whichYear)
{
   // Some code here
}
List<Customer> customers = GetTopCustomersOfTheYear(50, 2010);
</code>```

in PHP:

public function getTopCustomersOfTheYear($howManyCustomers, $whichYear)
{
   // Some code here
}
$customers = getTopCustomersOfTheYear(50, 2010);
```

<p>Is there any language out there which support this syntax:</p>

<pre class="lang-c prettyprint-override"><code>function GetTop(x)CustomersOfTheYear(y)
{
    // Some code here
}
returnValue = GetTop(50)CustomersOfTheYear(2010);
</code>```

Isn't it more semantic, more readable form of writing a function?

Update: The reason I'm asking this question is that, I'm writing an article about a new syntax for a new language. However, I thought that having such syntax for declaring methods could be nicer and more friendly to developers and would decrease learning-curve of the language, because of being more closer to natural language. I just wanted to know if this feature has already been contemplated upon or not.

答:
Answer:  smalltalk

http://en.wikipedia.org/wiki/Smalltalk

'hello world' indexOf: $o startingAt: 6 is like Java's "hello world".indexOfStartingAt(o, 6)

Rectangle width: 100 height: 200 is like Java's new Rectangle(100, 200)

The syntax is... expression word1: parm1 word2: parm2 word3: parm3 ... The name of the method called is the concatenation of all the words.


答:
At a previous company that I worked for, we ran into this issue when delivering websites with lots of custom functionality. It sounds to me like you're suffering from client based scope-creep.

To handle this, we started aligning our own personal development benchmark with sample deliverable benchmarks to make sure that the client was satisfied with the way things were progressing. In addition, as Chris mentions in his post, contracts / T.O.S documents were written up and signed in person that explicitly stated what was included with each project and divided up into a per-benchmark basis. Each item was listed out with what it did and did not do, to the best of our abilities without being clairvoyant.

Be upfront about your charges and let them know what an initial estimate would be (which is your responsibility) but also give them the "additional rate", whether you determine it to be hourly or contract additions. When they start scope-creeping you, you can fall back to the initial contract which has that laid out and simply state your new estimate.

To summarize: All functionality described in contract, supply benchmark samples when applicable and get sign-offs on those too, be up front about additional rates for scope creep items.

Title: Example of Terms of Services for Agile contracting?

Body:
In my experience as a freelance developper, I've had some difficulties with clients, whom insist on getting an estimate over flimsy requirements. They then expect me to deal with requirements changes, sometimes late in the project, and stick to that estimate.

Since I've never come up myself with some T.O.S. tailored for this situation, I ended up bound by a contract of a more general nature, which inevitably became unsasatisfactory...

Legal lingo not being my forte, I've been lookin for some publicly released T.O.S. to try to remedy this situation. Ideally these would be from an agile shop, under a licensing scheme allowing derivatives. This would help me lay out the contractual groundwork for a sane customer relationship, especially when dealing with changes.


问:
Iterators versus 'cursors' in Java
In Java, most people expect that each call to Iterator.next() will return a distinct object.  This has led some of us to define an alternative model which we called a 'cursor'. (Note that others use the term 'cursor' to draw a different distinction.) The pattern of a cursor is:

```<code>class SomeCursor {
    boolean hasNext();
    void next();
    type1 getItem1();
    type2 getItem2();
 }
</code>```

In other words, it is perfectly clear that the same object evolves at each step in the iteration.

The problem on my hand right now is to also support situations, like web services, in which we absolutely do want distinct objects so that we can ship a collection of them around.

It pains me to imagine pairs of classes (a cursor and a bean) that have to be maintained in parallel, and I'm casting about for alternatives.

Here's one idea, and I wonder if anyone else out there has seen a better one.

You make an interface consisting of the 'get' methods for an object with all the items in it.

You define the cursor as implementing that interface and also hasNext & next.

You dynamically create the bean objects using one of the major dynamic code-gen libs on the fly to create a class with the obvious fields and get methods, plus set methods if needed to make something like JAX-B happy.

edit: for those who are not following, I recommend a read of
http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/analysis/TokenStream.html. Also compare with http://download.oracle.com/javase/6/docs/api/java/sql/ResultSet.html, which is an example of this 'cursor' approach.

Note in Lucene an API that iterates over a sequence of objects, allow the caller to specify whether to deliver the new data to a new object or the same old object each time.

Yes, it is possible to define an Iterator<T> that returns the same thing ever time, but we have concerns that people will use this as a gun to shoot their toes off. Thus the preference for the JDBC-ish pattern.

答:
It looks to me like you are mixing the concept of iterators with the concept of Java bean properties.

If you have an instance of a bean and you want to iterate through its properties, then there are a number of libraries that will help you do this, like the Apache commons BeanUtils, and Beanlib:

http://commons.apache.org/beanutils/

http://beanlib.sourceforge.net/

Title: Iterators versus 'cursors' in Java


答:
Scitools Understand are good at creating graphs regarding program dependencies (functions, subroutines and so on) for several main languages. I don't think they have flowcharts, but you can always divide your complex code into functions (which you should do to some point, nevertheless) and that should make it more maintainable.

What languages are you aiming at with this?


问:
How risky is it to use Coffeescript without knowing Javascript?
I'm a reasonably experienced programmer trying to learn web developement.  I'm trying to develop a client-side web application which uses svg or canvas for graphics.  I've decided I'd like to write the application code in Coffeescript.  I don't know either Javascript or Coffeescript.

How necessary knowing Javascript to Coffeescript web development?  Am I likely to hit some gnarly problem which requires me to understand Javascript?  Can I work happily with Javascript APIs from Coffeescript?

Edit:
I could easily learn the basics of Javascript in a week.  I'm more concerned that Javascript seems to have a lot of hidden sharp edges.  In the strangest language feature question on StackOverflow Javascript is one of the most common languages.  It has an unusual object and class model.  It has non-obvious name scoping rules.  I find it takes more than a week for me to really know a language.

I'm going to work on a small simple project to learn web development.  Would I be better off to use Javascript or Coffeescript?  I think in the long run I'll prefer Coffeescript but I'm willing to start with Javascript if that I'm going to need a thorough understanding of Javascript to use Coffeescript.

答:
I guess it wouldn't be absolutely necessary, but you'd hit roadblocks in the long-run if you don't.

You need to understand what's happening under the hood and what the CoffeeScript compiler transcribes to, as that's what the browsers (assuming we're talking about using CoffeeScript in a browser environment) will need to interpret. Which means it's also what you'll need to debug, especially considering CoffeeScript is fairly recent and we may still come across some rough edges and bugs in its transcription mechanism. Also, if not using any bespoke debugging tools for debugging, you'll need to jump through the generated JavaScript code to debug using Firebug or Chrome Dev Tools or your JS console of choice. In some cases you'll be able to see how the JS error relates directly to the source CoffeeScript statement. In others, as the transcription is non-trivial, it will be difficult to understand.

Take it this way: you can very well develop software in Java and C# without having ever done any low-level development. Yet you'd have a very bad time understanding what's happening and why you hit performance bottlenecks and memory issues if you have no clue and are unable to make an educated guess about what these languages' runtimes need to do for you in the background, and what part of the guesswork they may screw up because they simply cannot pull off miracles.

Additionally, if you learn JavaScript, you'll get to realize how incredibly more difficult it can than it originally seems, and you'll appreciate CoffeeScript for its terse and clean syntax even more :)


答:
Python has keyword parameters. Function definition example

```<code>def getTopCustomers(count,year):
...
</code>```

Function call example

```<code>x = getTopCustomers(year=1990, count=50)
</code>```

(I understand this is not be quite in the spirit of the original question, but if keyword parameters in lisp qualifies, so do this. In Smalltalk and Objective-C, however, the keywords between arguments are really part of the function name/lookup.)

Title: I'm writing about language syntax. Is there a language out there in which parameters are placed inside method name?

Body:
in JavaScript:

function getTopCustomersOfTheYear(howManyCustomers, whichYear) {
   // Some code here.
}
getTopCustomersOfTheYear(50, 2010);
```

<p>in C#:</p>

<pre class="lang-cs prettyprint-override"><code>public List<Customer> GetTopCustomersOfTheYear(int howManyCustomers,
 int whichYear)
{
   // Some code here
}
List<Customer> customers = GetTopCustomersOfTheYear(50, 2010);
</code>```

in PHP:

public function getTopCustomersOfTheYear($howManyCustomers, $whichYear)
{
   // Some code here
}
$customers = getTopCustomersOfTheYear(50, 2010);
```

<p>Is there any language out there which support this syntax:</p>

<pre class="lang-c prettyprint-override"><code>function GetTop(x)CustomersOfTheYear(y)
{
    // Some code here
}
returnValue = GetTop(50)CustomersOfTheYear(2010);
</code>```

Isn't it more semantic, more readable form of writing a function?

Update: The reason I'm asking this question is that, I'm writing an article about a new syntax for a new language. However, I thought that having such syntax for declaring methods could be nicer and more friendly to developers and would decrease learning-curve of the language, because of being more closer to natural language. I just wanted to know if this feature has already been contemplated upon or not.

Body:
Python has keyword parameters. Function definition example

def getTopCustomers(count,year):
...

Function call example

x = getTopCustomers(year=1990, count=50)

(I understand this is not be quite in the spirit of the original question, but if keyword parameters in lisp qualifies, so do this. In Smalltalk and Objective-C, however, the keywords between arguments are really part of the function name/lookup.)


答:
Yes. It isn't the end of the world if you don't, but yes.

Why? Well first, JavaScript is really easy to learn. It literally took me 4 days to learn it (well, most of it). Also, I believe it is more valuable than CoffeeScript. I really don't think you even need CoffeScript. But it is still a good tool.

Title: How risky is it to use Coffeescript without knowing Javascript?

Body:
I'm a reasonably experienced programmer trying to learn web developement.  I'm trying to develop a client-side web application which uses svg or canvas for graphics.  I've decided I'd like to write the application code in Coffeescript.  I don't know either Javascript or Coffeescript.

How necessary knowing Javascript to Coffeescript web development?  Am I likely to hit some gnarly problem which requires me to understand Javascript?  Can I work happily with Javascript APIs from Coffeescript?

Edit:
I could easily learn the basics of Javascript in a week.  I'm more concerned that Javascript seems to have a lot of hidden sharp edges.  In the strangest language feature question on StackOverflow Javascript is one of the most common languages.  It has an unusual object and class model.  It has non-obvious name scoping rules.  I find it takes more than a week for me to really know a language.

I'm going to work on a small simple project to learn web development.  Would I be better off to use Javascript or Coffeescript?  I think in the long run I'll prefer Coffeescript but I'm willing to start with Javascript if that I'm going to need a thorough understanding of Javascript to use Coffeescript.


答:
You ask:

Am I likely to hit some gnarly problem which requires me to understand Javascript?

I can say, unequivocally, yes. In general, if you are doing anything interesting, at some point you will at least need to understand what is going on in the levels below you. (Sometimes Google + cut + paste can save you, but you don't want to be that guy.)

Any "reasonably experienced programmer" then picking up a new language should not take you very long. JavaScript is a fairly simple language. Anything difficult about it comes from the environment it is executing in: namely, several different web browsers with different ideas how to do things.

A lot of the "how to" information you will find on the web will be written with JavaScript in mind, so you will probably have an easier time if you learn how to read JavaScript and translate it into the equivalent CoffeeScript.

Honestly, unless you deliberately try to remain ignorant, you will probably wind up learning JavaScript as a side effect of working in CoffeeScript. So just get started already.


问:
What techniques do you use when interviewing developers?
I realize there have been lots of discussions about this type of thing and they often devolve into dogma around whether you ask the "100 logical pirates" type of questions or whether you get them to write "fizz buzz".

I'm interested in what techniques and questions have been effective for you when interviewing potential developers for jobs.

One technique per answer so we can vote on them, please.

答:
Just give them some basic code to do on whiteboard - e.g. linked list implementation, sorting or something similar.

You can judge how comfortable are they with their language without help of compiler and you can judge their thought process (especially if they never implemented such thing - most of "new" programmers never did).


答:
Yes, these things have value in the real world.

You don't always use all of them, and you don't always polish them to perfection, but they are all useful tools to model the problem domain and be sure you're going to build the correct solution.

Each of these artifacts exists because they are better ways of documenting what's going on than plain text.  If plain English worked better, we'd use that.  (Where plain English works better, we use do use textual requirements!)

Don't be fooled by the simplicity of these things in the learning environment.  They can get quite complex in the real world.  Or, alternatively, sometimes they are not complex -- and thus become a simple way of conveying understanding.

Title: Formal requirements analysis


答: You can try to create sequence diagram (OO design) in order to make the message flow clear among different instances/components.</p>


问:
Should we use python 2.6 or 2.7 or 3.x?
The version of python which I am using is 2.6, and there is a 2.7 and 3.x. Usually I use python for some trivial program/snippet. I realize there are some major difference between 2.x and 3.x. I would really like to know, if I am going to make a bigger project with python, which version of python should I use?

Should I upgrade to 2.7, or go to 3.x or stay with 2.6?

The decision should be based on these terms:

Number of user in the internet as a community. More users mean more open-source package and help from them.

Functionality.

Support from official development team.

Compatibility for existing module/package.

Thanks!

答:
I would suggest Python 2.7 myself. It's the latest release in the Python 2.x series. Most of the Python modules are made to work with the Python 2.x. There is a movement to try and move to Python 3, but any of the Python 3 modules are written for both 2 and 3. Remember to not use old features which are not available in Python 3, so that you can just 2to3 your code to make it run on Python 3.

If you go with Python 3, you're one of the early adopters and you will likely have to tell others to download Python 3 (a lot of computers will just have Python 2). On the other hand, new features are only going to come to Python 3. Python 2 is permanently in maintenence. So I would not suggest still using Python 2 in 10 years.

If you want to keep an eye on Python packages and their compatibility with Python 3, you can keep an eye on this site: http://python3wos.appspot.com/

Title: Should we use python 2.6 or 2.7 or 3.x?


问:
Reuse Other Company's Content For Same Client
Here's the scenario: a client of mine (lets call them Company A) had a website built by someone else (let's call them Company B).  They then asked me (Company C) to configure a third party framework to look and feel exactly the same as what Company B built for them.

Would it be legitimate for me to use content (including images, CSS, and even HTML) from the site Company B built for Company A?

It's worth mentioning Company A's name is in the copyright notice in the footer of the site Company B made for Company A.

答: If Company A owns the copyright (this is usually the case in works-for-hire of this sort, and the copyright notice backs this up), then it's perfectly legitimate to use those assets in other projects for Company A.  Company A owns the rights to those assets, so can do what they like with them.</p>


问:
What is the typical Pythonic view on re-using python modules outside of their initial intent?
Short Question

Does it fly in the face of the Pythonic view to reuse / repurpose python modules for projects out side of their intent?

Background

Over the past several months I have been working on a project that uses the Python unittest module to run manual system tests.  Please see questions 1 2 and 3 for greater detail on my project and some of the hurdles I have had to overcome.

I would like to know, in general, if it acceptable to reuse modules for other purposes?  Most of the comments I have received have been along the lines of "this is not a unittest", or "you should write your own testrunner".  My push back on that, is if a module does 90% of what you need it to do with litte to no modification and contains additional (knowingly unneeded) functionality why on earth would you write your own module?

答:
Using the code for more than what the original authors intended is usually a good sign, in that the code provides useful tools.  As far as re-purposing modules "outside of their intent" is concerned, well... this is obviously subjective and depends to what extent.

Using raw I/O functions in imaplib to implement some unrelated socket-based communication protocol could be considered bad style (to say the least).  However, using the same imaplib library to implement some private variant of the IMAP protocol (unlikely to be the intended use) would be IMHO less of a problem.

It's totally understandable that you would find some convenient classes and methods in the unittest module to implement other types of tests.  However, the problem is often one of code readability.  To most Python developers, seeing the unittest module closely to the idiomatic recommended usage probably conveys the meaning of "this piece of code is a unit test".  In terms of "self-documenting code", this is a total failure in the sens that it is misleading for other developers.

Ideally, this would be a non-question.  The solution would be to refactor the unittest module so that code not specific to unit tests is moved to a test module or testbase module or some such thing.  However, you might find a lot of resistance in such an effort, for political and practical reasons.  It is, after all, a standard library module and can't be modified as easily as your own project.

Does it fly in the face of the Pythonic view to reuse / repurpose python modules for projects out side of their intent?

In general, I don't think this is "anti-Pythonic", although I think the fact that these comments have occured several times should mean something.

Maybe you can write some sort of systemtest module that imports the re-usable stuff from the unittest module.  It's a temporary solution that gives both code clarity and allows you to re-use the code directly.  Then, you can write a long comment in the systemtest module about how all the workarounds are actually better than writing your own test runner.

OwnerDisplayName: Adam Lewis

OwnerDisplayName: André Caron


答:
It depends.

If CoffeeScript abstracts JavaScript enough, so that you don't need to know it (like C# abstracting Intermediate Language), then yeah, you can do whatever you like to do in CoffeeScript without learning JavaScript.

But my experience tells me that no matter how much I try to flee from JavaScript, when it comes to client, I sometimes really need to get my hands dirty and write pure JavaScript.

Yeah, you're right. while JavaScript syntax is easy and you can learn it in a weak, but it takes you years to master.

IMHO, as I see CoffeeScript, it's not mature enough to wrap all JavaScript intricacies totally. So, I don't risk not learning or working directly with JavaScript.


问:
How do I appropriately license my open-source project?
I have just recently completed my first open source project and while it is mostly a tool I still want to release it as open source considering it is C# so if someone wanted to they could decompile it. Also, I'm not looking to sell it.

I was researching licensing but the wording is a bit over my head. Mostly I'm just looking for a license that recognizes me as the creator and does not allow anyone else to put their name on it and "steal it." I'm most likely going to use either google code or sourcefourge to host the project and ideally I could have a donation button. I'm not sure if or which software licenses would prevent that sort of thing?

Also, I'm not really sure how licenses and copyrights "work." Do I just choose a license and paste it at the top of every source file? Should I include my name as well? Do I also put the licenses in the project's root directory? How does one obtain a copyright? It seems like most people just stick it on their stuff. Is there an actual process to obtaining one?

As for software licenses I've looked at so far, it seems like Apache 2.0 or MIT/BSD is what I'm looking for but I'm not exactly sure. Basically I just don't want anyone to steal my program and put their name on it. Other than that I'm fine with people looking at the source code, modifying it, or taking pieces from it, as long as they credit me.

答:
The relationship between copyrights and licenses is often misunderstood, and knowing the difference can be helpful in understanding how the process of choosing a license may work.

The copyright holder of a piece of code, or any work that is created for that matter, is the only person or entity with the legal authority to license said work. It is also completely within the copyright holder's prerogative to license and re-license a piece of work many times over according to their needs. For example, I could give one person permission via the license to use the software but not copy it, and another person permission to do the opposite. Not a likely scenario, but still true nonetheless.

While there are no hard and fast rules governing what license generally is best for a given piece of software, here are the questions I like to ask myself about my code prior to licensing it:

What is the risk associated with a competitor taking code you release and using it to compete against you?

If the answer is high, then the conservative thing to do would be to use the GPL. The GPL would allow your competitor to take your code and compete against you, but he couldn't do so without also being required to share with you anything and everything they have done in the process. This would make it difficult therefore for either of you to compete primarily on a feature-by-feature basis.

How important is it that you get people to integrate and use your code inside their own systems?

If you are authoring a library for example, it is in everyone's best interest, even your own, for people to consolidate their efforts around a single code base. The eliminates duplicate effort and makes the library hopefully all the more useful and relevant in the developer community. The GPL is rarely a good choice for library components because of its viral nature. Link to or use a GPL library in your code, and your entire code base is supposed to also be licensed under the GPL. Most companies don't particularly care for this thereby decreasing the likelihood that a developer will begin using and contributing back to your library.

In this case, it is more advantageous to use a more copy left license, like Artistic, BSD or MIT. Or if you are already a big GPL fan, then consider using the LGPL, specifically designed for using with libraries.

Is there a convention that already exists as it relates to the language or framework you are using?

For example, jQuery plugins are almost always licensed under the MIT license, and Perl modules are almost always licensed "under the same terms as Perl itself," or in other words the Artistic license.

If a strong convention exists, follow suit. Don't be that person who bucks a popular trend just because you think you know better. Granted, you might know better, but I personally feel it is better to respects the norms and traditions of each community you participate in rather than trying to assert your own personal worldview vis-a-vis licenses.

My personal bias is for Artistic, BSD or MIT. The reason being largely has to do with maintaining my own personal rights regarding the license my code is distributed under.

Remember when I mentioned at the beginning that it is the copyright holder's exclusive legal authority to license a work? Well in the world of open source, the probability of having multiple copyright holders is high. Remember that feature you integrated from John Smith into your code? Doing so made John Smith a joint holder of your code's copyright. Which means, that if you ever wanted to relicense the code for some reason, then you would need to get John Smith's permission before doing so. The alternative is for John Smith a "contribution agreement" that would assign to you the copyright to his code.

As you can imagine, that kind of bureaucracy can be very annoying to people and might actually discourage their participation. Granted, choosing not to have all contributors assign the copyright of their GPLed contribution to you does not spell certain doom for your GPL project (look at WordPress for example, not to mention Linux itself). It really just all depends upon what your priorities are vis-a-vis protecting your code and your rights as it relates to that code.

The MIT, Artistic and BSD licenses avoid much of this bureaucracy, not by allowing you to re-designate the license without your contibutors' permission, but by preserving your right to redistribute their work along side any other code under any other license. It preserves their right to build proprietary, for profit components on top of your code base, allowing for a commercial ecosystem to evolve on your codebase - which is often very advantageous and the sign of a healthy project.

Bottom line, there is no right or wrong answer. And provided that you retain the sole copyright of the codebase, you are free to change the license whenever it suits you.


问:
Should a special version of a website be developed for tablet users?
Does the desktop browser version of a web site always suffice for the tablet version(assuming no flash)? or is it common for websites to have a special tablet version that is different from both desktop and phone?</p>

答: Tablets (and phones even worse) have smaller screens than do desktops. Text entry is also more difficult because of the clumsy on screen keyboards (which cover even more of the already cramped screen). So you have to carefully design the site to work well on a very limited amount of space and to require minimal text input (dropdown boxes, selection lists, etc. whereever possible).</p>


问:
What makes for "good style" in Java?
I had asked this question on Stackoverflow, and before it got booed off, I received the helpful suggestion from Péter Török that this might be a better place to post it.

I've been programming in Java for a few years. I've often discussed design decisions with colleagues on the basis of what constitutes 'good style'. Indeed, there are a number of StackOverflow questions/answers that discuss a design on the basis of whether something is 'good style'.

But what makes 'good style'? Like many things, I know it when I see it... but I wanted to have better idea than just my conscience saying that this design doesn't feel right.

What are the things you think about in order to produce good, well designed code?

(I acknowledge that this is somewhat subjective, as what is 'good style' will depend on the task at hand). (Also, I should add that I'm not interested in team styles - e.g. "we use indents of 2 spaces rather than 4"..., and I'm not interested in the Java code conventions.)

Edit: thanks for all the good answers/comments so far. I'm especially keen for answers that would help codify those things that make a programmer's conscience (and possibly stomach) wrench?

答:
Whilst appreciative of others' answers, I thought it only fair to share a few of the things I think about when trying to write good code:

what needs to know about this class/method/variable? i.e. where should this knowledge live?

how might this code affect the memory/performance of my application? (I acknowledge that 'premature optimisation is the root of all evil'; so I'm not suggesting spending lots of time optimising, but rather a consciousness whilst initially writing my code.)

is it clear (from the code, and code structures) what this does? (I try to follow the maxim: "Strive not to make it possible for people to understand, strive to make it impossible for people to misunderstand".)

Title: What makes for "good style" in Java?


答:
Look at fomalising the meeting. Many post-project meetings are talk-fiests and your manager is absolutely correct not to support them.

Invite you manage to the meeting (ask him to chair/moderate), circulate an agenda and have specific outcomes. As a manager, he can then see the value in the meeting.

We use, and I recommend de Bono's "6 Thinking Hats" review process (refer Wikipidia). The outcome is a few (2 or 3) action points that the meeting identifies as being the most important leason learnt. The first few times we has trouble getting out os the starting blocks, but once we got used to it, won't go back.

Not performing a post-project review dooms you to make the same mistakes you made in the previous project.

Title: Post-Project Meeting a Waste of Time?


问:
Is running an executable as a child process the same as linking a library?
I'm planning on running an executable as a child process in my program (e.g. using Ruby's popen or C's exec() family of functions). However, the executable I'm planning on running is licensed through the GPL.

The GPL, as I understand it, requires that all linked code to GPL licensed code needs to also be GPL.

But there's also an "arm's length" exception, discussed in the FAQ:

However, in many cases you can distribute the GPL-covered software alongside your proprietary system. To do this validly, you must make sure that the free and non-free programs communicate at arms length, that they are not combined in a way that would make them effectively a single program.

Would runnning an executable as a child process be part of this exception, or would it still be considered "linking" for the purposes of the license?

If it is considered "linking", how does it differ from running program, like Nmap, from the a command line?

答: Lets compare the strings "running an executable as a child process" and "linking a library". One starts with the letter "r" the other with the letter "l". Therefore it is not the same!</p>


答:
I really don't see the difference between what you have there and an of Iterator<T>. The fact that you want to recycle the underlying instance on each iteration is still legal, if ill advised.

Might be worth watching josh bloch's last puzzler presentation. one of the puzzles evoles around the EnumMap.entries() iterator recycling the same instance of Map.Entry for each entry, it certainly breaks the principle of least surprise.

Title: Iterators versus 'cursors' in Java

Body:
In Java, most people expect that each call to Iterator.next() will return a distinct object.  This has led some of us to define an alternative model which we called a 'cursor'. (Note that others use the term 'cursor' to draw a different distinction.) The pattern of a cursor is:

```<code>class SomeCursor {
    boolean hasNext();
    void next();
    type1 getItem1();
    type2 getItem2();
 }
</code>```

In other words, it is perfectly clear that the same object evolves at each step in the iteration.

The problem on my hand right now is to also support situations, like web services, in which we absolutely do want distinct objects so that we can ship a collection of them around.

It pains me to imagine pairs of classes (a cursor and a bean) that have to be maintained in parallel, and I'm casting about for alternatives.

Here's one idea, and I wonder if anyone else out there has seen a better one.

You make an interface consisting of the 'get' methods for an object with all the items in it.

You define the cursor as implementing that interface and also hasNext & next.

You dynamically create the bean objects using one of the major dynamic code-gen libs on the fly to create a class with the obvious fields and get methods, plus set methods if needed to make something like JAX-B happy.

edit: for those who are not following, I recommend a read of
http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/analysis/TokenStream.html. Also compare with http://download.oracle.com/javase/6/docs/api/java/sql/ResultSet.html, which is an example of this 'cursor' approach.

Note in Lucene an API that iterates over a sequence of objects, allow the caller to specify whether to deliver the new data to a new object or the same old object each time.

Yes, it is possible to define an Iterator<T> that returns the same thing ever time, but we have concerns that people will use this as a gun to shoot their toes off. Thus the preference for the JDBC-ish pattern.


答:
Forgive me if I'm not quite grasping what you're after, but it does seem as if you're conflating the concepts of Iterator and Factory/Builder.

Let me just lay out some thoughts here.

The Iterator pattern works well for a homogenous collection of objects that you want to hand out through a common interface. For example, you have a collection of Strings and you want them dealt out in a particular order so you use a Comparator (behind the scenes) and your consuming code only has to call next() a few times to achieve it's objective.

The Factory pattern creates an instance of an Object according to a given specification - sometimes provided as arguments, sometimes inferred. The Builder pattern is similar but is usually geared towards completing a single step along the way to the completion of an instance of a composite collection of Objects.

It seems from your code example that you want a mechanism that allows you to create an instance of an Object (of varying type) in response to a given number of calls. Perhaps a sequence like this:

```<code>next() -> getType1() -> String with "Hello"
next() -> getType2() -> Integer with 4
next() -> getTypeN() -> some function applied -> some type returned
</code>```

and so on.

If this is what you're after, then this approach violates the Principle of Least Surprise. As a developer if an object is being quietly mutated behind the scenes, I'd like to know about it since I want to know the threading and performance issues that could arise.

Since the problem you appear to face is one of maintaining a collection of objects between stateless web calls you're probably better off using a simple List and provide the index to the current entry as part of the response to the client. When the client requests the contents of the List simply hand it to JAXB to marshal it into XML/JSON (it'll use an Iterator).

This approach keeps your code simple, and therefore prevents developers after you looking at the code and saying WTF?

Title: Iterators versus 'cursors' in Java

Body:
Forgive me if I'm not quite grasping what you're after, but it does seem as if you're conflating the concepts of Iterator and Factory/Builder.

Let me just lay out some thoughts here.

The Iterator pattern works well for a homogenous collection of objects that you want to hand out through a common interface. For example, you have a collection of Strings and you want them dealt out in a particular order so you use a Comparator (behind the scenes) and your consuming code only has to call next() a few times to achieve it's objective.

The Factory pattern creates an instance of an Object according to a given specification - sometimes provided as arguments, sometimes inferred. The Builder pattern is similar but is usually geared towards completing a single step along the way to the completion of an instance of a composite collection of Objects.

It seems from your code example that you want a mechanism that allows you to create an instance of an Object (of varying type) in response to a given number of calls. Perhaps a sequence like this:

next() -> getType1() -> String with "Hello"
next() -> getType2() -> Integer with 4
next() -> getTypeN() -> some function applied -> some type returned

and so on.

If this is what you're after, then this approach violates the Principle of Least Surprise. As a developer if an object is being quietly mutated behind the scenes, I'd like to know about it since I want to know the threading and performance issues that could arise.

Since the problem you appear to face is one of maintaining a collection of objects between stateless web calls you're probably better off using a simple List and provide the index to the current entry as part of the response to the client. When the client requests the contents of the List simply hand it to JAXB to marshal it into XML/JSON (it'll use an Iterator).

This approach keeps your code simple, and therefore prevents developers after you looking at the code and saying WTF?


答:
LICENSE.txt << "Please credit me if you reuse, don't sell it under your own name, don't pretend you're me".

Simple. Unless it's a fairly heavy project I wouldn't worry too much about licensing terms, don't get me wrong a lot of the licenses are really useful (BSD & MIT ones are great) but for most projects a simple license files outlining peoples rights is fine. You own the copyright to the product, it's your direct work, a license is just so people know what they can and can't do with it and as with many things in programming, simplicity is king.

Title: How do I appropriately license my open-source project?

Body:
I have just recently completed my first open source project and while it is mostly a tool I still want to release it as open source considering it is C# so if someone wanted to they could decompile it. Also, I'm not looking to sell it.

I was researching licensing but the wording is a bit over my head. Mostly I'm just looking for a license that recognizes me as the creator and does not allow anyone else to put their name on it and "steal it." I'm most likely going to use either google code or sourcefourge to host the project and ideally I could have a donation button. I'm not sure if or which software licenses would prevent that sort of thing?

Also, I'm not really sure how licenses and copyrights "work." Do I just choose a license and paste it at the top of every source file? Should I include my name as well? Do I also put the licenses in the project's root directory? How does one obtain a copyright? It seems like most people just stick it on their stuff. Is there an actual process to obtaining one?

As for software licenses I've looked at so far, it seems like Apache 2.0 or MIT/BSD is what I'm looking for but I'm not exactly sure. Basically I just don't want anyone to steal my program and put their name on it. Other than that I'm fine with people looking at the source code, modifying it, or taking pieces from it, as long as they credit me.


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

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

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

Reasons to remove it:

Less code, less bugs

Less code is easier for others to digest

It's still under source control

Reasons to keep it:

Can be used as reference

It may be useful sometime

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

答:
Most of your reasons to keep it are utterly irrelevant, put simply. If the code isn't used, throw it away- any benefit involved in keeping it can be trivially derived from source control. At most, leave a comment saying which revision to find it in.

Quite simply, the sooner you cut the code, the sooner you don't have to waste time maintaining it, compiling it, and testing it. Those advantages massively outweigh the trivial benefits that you have outlined, all of which can be derived from source control anyway.

Title: Should I remove unreferenced code?


答:
All of the reasons to remove it stand.

Reasons to keep it:

Can be used as reference

It may be useful sometime

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

All of these reasons to keep it will be managed by source control. Remove it from the live code and you will be able to retrieve it if/when it's needed.

Title: Should I remove unreferenced code?

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

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

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

Reasons to remove it:

Less code, less bugs

Less code is easier for others to digest

It's still under source control

Reasons to keep it:

Can be used as reference

It may be useful sometime

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


答:
Unreferenced code is the same as keeping those batteries that are kinda, sorta flat just in case you need them one day for a torch.

As long as you're using some kind of version control I'd say trash it out of the live code and use the versioning history in case it turns out to be useful.

Title: Should I remove unreferenced code?


问:
What is a "powerful" language?
I have often seen people fighting over that their favorite language is more "powerful" than others. When it comes to describing a programming language, I can understand what an object oriented language is or what a dynamic language is, but I still can't figure out what exactly a "powerful" language is. What are your thoughts?</p>

答:
The most Powerful programming language is the one that solves the following linear programming problem:

Maximize

  Rapidity of development

+ Ease of reading code

+ Ease of debugging

+ Succinctness/brevity of expression

+ Ease of learning/teaching

-  CPU usage

-  Memory requirements

Subject To

It must be Turing Complete.

It must be multi-paradigmatic: functional, object-oriented, logic programming, constraint programming, concurrency, distributed computing, etc.

It must be versatile, allowing the creation of command-line interfaces, component libraries, servers, GUIs, and web applications.

It must be portable, i.e., easy to port and maintain in a cross-platform setting.

It must be adaptable, i.e., open to change and able to evolve as new hardware (quantum chips), new paradigms, and other innovations in technology occur.

It must encourage the development of libraries (like CPAN, CTAN, and CRAN).

It must be free and open source.

(And yes, I know, I already posted a completely contradictory answer. That's because I'm a dialectcian.)

Title: What is a "powerful" language?


问:
What are the algorithms behind low pause GC?
Some languages, for exemple java, introduced a low pause GC.

Those GC can do most of the work without pausing the whole world. This is obviously a quite hard problem because it require to analyze the memory when thread are modifying it, resulting in data that can be used in the begining of the process and not anymore when it finishes, or data that appears to be garbages but because the reference was moved in memory and never appeared where the GC was looking.

So basically, what is the algorithm(s) behind that ?

Research papers or really technical article's link would be considered as valid answer, as this topic is really technical.

答:
So basically, what is the algorithm(s) behind that?

It's basically a mark and sweep algorithm which "just" runs concurrently in a separate thread.

As for the research papers on that subject:

Very Concurrent Mark and Sweep Garbage Collection without Fine-Grain
Synchronization

Concurrent mark-sweep garbabe collector (contains links to two
papers, one listed below)

Implementing an On-the-fly Garbage Collector for Java

Portable, Unobtrusive Garbage Collection for Multiprocessor Systems (Doligez Leroy, Powerpoint Presentation)

On-the-fly garbage collection: An Exercise in
Cooperation (by  Edsger Wybe Djikstra)