问:
Constraints while designing the Java generics
Java generics look quite different from those available in Scala, although both were designed by Martin Odersky. From my point of view, the design of generics in Java is worse, for instance:

there is no possibility to specify variance

one can get around the previous limitation by using wildcards, but this means the burden of specifying variance goes on the caller instead of the library designer

one cannot use a type constructor in generics

What were the constraints in Java that forced Odersky to design this mechanism for generics instead of the more flexible one he devised for Scala? Was he just savvier a few years later or there were actual limitations due to Java?

答:
As @FrustratedWithFormsDesigner noted, backwards compatibility was the single biggest constraint. And the resolution they chose was to keep backward compatibility by using type erasure, i.e. removing all generic type information during compilation. This means a List<String> and a List<Integer> will become the same type at runtime (and the same as a pre-Java5 List). And it has a lot of negative consequences, including most of what you listed above.

Update

The constraints set by this are much tighter than one may naively think:

What we require is that the same client code works with both the legacy and generic versions of a library. This means that the supplier and clients of a library can make completely independent choices about when to move from legacy to generic code. This is a much stronger requirement than backward compatibility; it is called migration compatibility or platform compatibility.

Java implements generics via erasure, which ensures that legacy and generic versions usually generate identical class files, save for some auxiliary information about types. It is possible to replace a legacy class file by a generic class file without changing, or even recompiling, any client code; this is called binary compatibility.

(Java Generics and Collections, Chapter 5)

Binary compatibility is not always automatically guaranteed; section 8.4 of the same book details some cases where binary compatibility may break during genericizing legacy interfaces even if all general rules have been followed.

Another aspect of backward compatibility is adherence to a type system where not everything is an object. So in Java primitive types are out of scope for generics just as for collections, and you have boxing/unboxing to complicate life (whereas in Scala everything is an object).

A third legacy in Java is native arrays which just don't fit with generics:

arrays are always reifiable types whereas generic types are not;

arrays can store primitive types whereas (generic) collections can not;

array subtyping is covariant, whereas generic subtyping is invariant;

as a consequence, arrays are less type safe than generics, and one can argue that they should be declared obsolete in favour of generic collections and not used in new code.

All this means a lot more rules to adhere to, thus corner cases and compromises to make, limiting the power and simplicity of Java generics.

Several such decisions can be seen in retrospect as wrong, but there is no way back anymore, thus no possibility to fix them without breaking backward compatibility, which - rightly or not - has become a sort of holy cow in Java over the years. I conjecture that the story of Java generics most probably brought a lot of experience and food for thought for its own designers as well, and these experiences were surely reused during the design of Scala.


问:
Acceptable memory usage as a function of input size
I know that if a computation takes linear or linearithmic time based on the size of the input, that's good, and if it takes quadratic time, then that's not so good. </p>

<p>However, what about memory usage?  Suppose a program takes a file as input and does something with that file.  Is it okay for the memory usage to be linear in the size of the file or should it be constant? </p>

答:
If you're reading a file, it's pretty hard to it to be a constant. In general, these rules aren't so strict. If your data is always really small, having quadratic (+) computation/memory usage isn't really that bad. If it's good enough for your situation, it's fast enough to not need refactoring.

In general though, you want polynomial time computation/memory because anything above that gets way too slow with even relatively small inputs.

ContentLicense: CC BY-SA 3.0


答:
If memory usage increase is linear then there's always the possibiliy of running out of memory, if the input is very very large. Then you have to code around that either by swapping some pieces of data to disc (though you might be able to rely on the operating system to do this for you, but either way it will slow down processing time), or changing the way you process data. What you really have to ask is:

Is it likely that my input will be so large that the amount of memory necessary to process it will exceed the available memory?

There might be a way to calculate this before you begin processing, it probably depends on the specific problem you're working on.

...or buy more memory. ;)

Title: Acceptable memory usage as a function of input size

Body:
I know that if a computation takes linear or linearithmic time based on the size of the input, that's good, and if it takes quadratic time, then that's not so good. </p>

<p>However, what about memory usage?  Suppose a program takes a file as input and does something with that file.  Is it okay for the memory usage to be linear in the size of the file or should it be constant? </p>


问:
Do server-side sessions violate REST?
According to Roy Fielding (one of the principle authors of the HTTP specification) in his seminal thesis Architectural Styles when discussing REST, he mentions:

[E]ach request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server.

By "stored context" he's referring to application state e.g. what the page number for the next page is vs. resource state e.g. any data store, image etc. - which is arguably the whole point of REST.

Is it fair to say that most attempts at pure rest (hereby defined as an implementation that conforms to the above thesis) must fail due to their reliance on storing session data on the server (persistent or otherwise)?

The concept of a session is common - in particular to Web developers - but is it RESTful according to the above definition?

答:
Sessions are basically used to add state to stateless, RESTful applications. So formally, this makes your RESTful application stateful, however having the server keep state makes your life a little easier, since you don't have to pass all the data back and forth on each request/response.

Sessions, and more generally state, lets you avoid this, and this has some positive benefits in performance (less data transfered) and security (less data available to tamper with).

So while it officially violates part of the definition of REST, it's so useful that it's rare to see RESTful applications that don't use state via sessions.

Title: Do server-side sessions violate REST?


答:
Probably depends on what you mean by "session data". Is that a precise term?

Secure communication between two parties often involves the server to generate (and store) a time-limited "access token" which the client has to supply with each request as a manner of authorization. This access token already is what I'd call "session data" - it is stored server-side, time-limited and related to one client (usually his permissions).

I'd be very surprised if this kind of operation was labeled as non-RESTful. OAuth is an example.

I'm not a specialist and I'm not very confident here; I'm just sharing my insights hoping they prove helpful.

Title: Do server-side sessions violate REST?

Body:
According to Roy Fielding (one of the principle authors of the HTTP specification) in his seminal thesis Architectural Styles when discussing REST, he mentions:

[E]ach request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server.

By "stored context" he's referring to application state e.g. what the page number for the next page is vs. resource state e.g. any data store, image etc. - which is arguably the whole point of REST.

Is it fair to say that most attempts at pure rest (hereby defined as an implementation that conforms to the above thesis) must fail due to their reliance on storing session data on the server (persistent or otherwise)?

The concept of a session is common - in particular to Web developers - but is it RESTful according to the above definition?


答:
I would say yes, session state does make a RESTful app non-RESTful. Trivial example, my sister subscribes to the Wall Street Journal. On a regular basis she will be reading something behind the paywall and decide to send a link (via her own email client, not via WSJ) to a friend who does not have a WSJ account. Click, send, fail. Clearly my sister's experience at that URL is different from her friend's.

Related, but not strictly on-topic: I am in the early design phase of a application designed to support significant research efforts on the net (called quests (think: bookmarks on steroids and LSD)) . The owner of the quest wants to share a particular view of his/her data with someone else, but this view requires a combination of UI state (e.g. which visualizations of what data are showing in which panes) along with appropriate permissions to access the UI and the data displayed. There's a lot of stored-state required for the recipient to get the intended view.

My current solution is to store all of the UI/ACL/whatever info necessary for the view in a separate object and return the URL (probably a UUID) for that object. I believe that accessing the view object could be considered RESTful in the sense that everyone in possession of it gets the same info/experience.

Title: Do server-side sessions violate REST?


答: The most important point of REST is that an URI to a ressource always points to the same ressource. So users can pass around a reference to this ressource and everyone sees the same. This is called Representational State Transfer (REST). If the server keeps state and delivers a different ressource for the same URI, I would say this is not pure REST anymore.</p>

Title: Do server-side sessions violate REST?


答:
Do server-side sessions violate REST?

They definitely do! When you implement REST, there must be no server-side session, otherwise you have a hybrid RPC/REST solution.

The client must send to a RESTful service all the context necessary to service the request, including the information necessary to authenticate the client, each time a new request is made. The server is free to cache information to make servicing subsequent requests faster, but the cached information must not amount to a server-side session. In other words, the request itself must contain enough information to be processed even in the absence of the cached state.

Title: Do server-side sessions violate REST?


问:
Good Practices of writing release notes
At the delivery of every version of software we have to write a release note.
For example, here are some of the terms I add when I write a release note:

Release Date

Bug Solved

Is that enough, or is there anything else?

答: The most important thing about release notes is to be aware that every additional sentence loses another 10% of the readers.  So you must strictly prioritize what your current users need to know about the release.</p>

Title: Good Practices of writing release notes


问:
Should Equality be commutative within a Class Hierachy?
It is easy to define the Equals operation in ways that are not commutative.  When providing equality against other types, there are obviously situations (in most languages) were equality not being commutative is unavoidable.  However, within one's own inheritance hierarchy where the root base class defines an equality member, a programmer has more control.

Thus you can create situations where

```<code>(A = B) ≠ (B = A), where A and B both derive from base class T
</code>```

Substituting the = with the appropriate variation for a given language. (.Equals(_), ==, etc.)

That seems wrong to me, however, I recognize I may be biased by background in Mathematics.  I have not been in programming long enough to know what is standard/accepted/preferred practice when programming.

Do most programmers just accept .Equals(_)may not be commutative and code defensibly.  Do they expect commutativity and get annoyed if it is not.  In short, when working in a class hierarchy, should effort me made to ensure Equality is commutative?

答:
I've never seen = defined as "is-a".  = means "is equal to", not "is derived from," even in type hierarchies, and "is derived from" is generally implemented with a different operator or function.  Where have you seen it implemented the way you describe?  Because that's counter-intuitive and just weird.

Most programmers would not accept that idea of "equality".  They would call that "compatibility" or "inheritance hierarchy" or something similar that more correctly describes what's going on, but equality is expected to mean "identical," not "compatible."  So yes, it is expected to be commutative.


答:
I think commutativity in a class hierachy should be ensured, otherwise this would violate the Liskov substitution principle (LSP) which says

Let q(x) be a property provable about objects x of type T. Then q(y) should be
  provable for objects y of type S where S is a subtype of T.

So if you expect Equality (A == B) and you insert a subtype of B, called C for which the Equality does not hold (A != C) you would cause a violation. Maybe (C == A), but people that use your classes might not expect this behaviour.

For example, I want to use your classes in my program:

```<code>public boolean isEqual(B x, B y) {
   return x.equals(y);
}
</code>```

Say I have two instances, x is of type B and y the subtype B'. How can you or I guarantee that I insert the objects in the right order to the method? That would result in a lot of additional control structures. And If I did not expect this behaviour, it would be difficult to debug.

Title: Should Equality be commutative within a Class Hierachy?

Body:
It is easy to define the Equals operation in ways that are not commutative.  When providing equality against other types, there are obviously situations (in most languages) were equality not being commutative is unavoidable.  However, within one's own inheritance hierarchy where the root base class defines an equality member, a programmer has more control.

Thus you can create situations where

```<code>(A = B) ≠ (B = A), where A and B both derive from base class T
</code>```

Substituting the = with the appropriate variation for a given language. (.Equals(_), ==, etc.)

That seems wrong to me, however, I recognize I may be biased by background in Mathematics.  I have not been in programming long enough to know what is standard/accepted/preferred practice when programming.

Do most programmers just accept .Equals(_)may not be commutative and code defensibly.  Do they expect commutativity and get annoyed if it is not.  In short, when working in a class hierarchy, should effort me made to ensure Equality is commutative?

Body:
I think commutativity in a class hierachy should be ensured, otherwise this would violate the Liskov substitution principle (LSP) which says

Let q(x) be a property provable about objects x of type T. Then q(y) should be
  provable for objects y of type S where S is a subtype of T.

So if you expect Equality (A == B) and you insert a subtype of B, called C for which the Equality does not hold (A != C) you would cause a violation. Maybe (C == A), but people that use your classes might not expect this behaviour.

For example, I want to use your classes in my program:

public boolean isEqual(B x, B y) {
   return x.equals(y);
}

Say I have two instances, x is of type B and y the subtype B'. How can you or I guarantee that I insert the objects in the right order to the method? That would result in a lot of additional control structures. And If I did not expect this behaviour, it would be difficult to debug.


问:
Time tracking and payment registration architecture
Тitle might be a little bit incorrect. :) Anyway, I'm building a software where employees input time they worked per day (work hours) and employer "pays" for this time. "Payment" is done outside this system, so employer just "confirms" (checkbox or something like this) which work hours are paid.

So the question is - what is the best way (both UI and data storage wise) to implement this?
At the moment I have this idea:

Employee selects week and manually (with some Javascript helpers, like "fill the same time for all days") inputs work hours in every day of the week. Employer confirms payment the same way employee inputs data (selects week, confirms each day). Data is saved in DB as unix timestamp (one day per table row).

Problem is 14 inputs (7 days * ("hours from" + "hours to" input), yet this approach seems kinda easy to implement.

Maybe I'm overlooking something and this can be done differently and better? Maybe someone has any example of already working software?

答:
You said yet this approach seems kinda easy to implement, which leads me to ask: Why make things complicated?  Code to the business requirements of your application.

How you treat the data in the database should be independent of the input view for the employees.

Create a common object to go between the UI and the DB interface. As your data storage requirements change, you can update the database accordingly without having to alter the view since the UI and the DB interface still speak in the same common object.  Likewise for the UI - it can change independent of the DB now.

Your initial DB structure will probably mirror the common object, which is okay.

You won't really know the "best" solution to your scenario until you start building it and making it work.  It sounds like you have some ideas for coding it up.  If your ideas appear to meet your requirements then start with that and adjust the design as necessary.


答:
It would depend on how == is defined...

If it is defined only once at the root of the hierarchy then I would expect it to work when comparing any two objects that are of different types but derived from that same root.

If it is (re)defined in subtypes, then I would only trust == to work if the objects are of the exact same type, not just being derived from the same parent.

I don't think I've ever seen (A = B) ≠ (B = A), but if I did I'd probably be annoyed.


答:
Non-symmetric1 equals breaks the contract of the operation, spelled out clearly in the documentation (I'm quoting from the Java's documentation, but it remains essentially the same in other languages)

The equals method implements an equivalence relation on non-null object references:

It is reflexive: for any non-null reference value x, x.equals(x) should return true.

It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.

It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.

For any non-null reference value x, x.equals(null) should return false.

These are mathematical properties a relation must have in order to be called an equality relation. A relation can be defined without any of these properties2, but fundamentally it is not an equality relation, and it is dangerous to use it in the context where the equality relation is implied.

1 The right term in the context of equality is "symmetric", not "commutative".

2 For example, it is very tempting to define equality of floats as "two numbers with the absolute difference less than a small epsilon"; that's a very bad idea, because it breaks transitivity.


问:
How to justify technology choice to customer?
When freelancing / contracting a customer will typically specify functional requirements, acceptance criteria, etc, and the implementation details are in the developer's hands.

As a developer your technology choice is a balancing act between what you are most familiar with, technologically what the right tool appears to be, ease of finding coders with this skill and their expense, and a few other factors.

I'm in a situation where I have evaluated my options and selected a somewhat obscure open source technology that I believe will get me there faster, easier, and be more maintanable in the long term. It's different, but I think that that is what the requirements call for.

The customer has inquired about what I'm going to use to build the solution, and now they are concerned because they've never heard of it before. The reasons for my choice are mostly technical, whereas the customer isn't (but they know some buzzwords!). Explaining these technical reasons will not be easy, and I am not sure if that is the right way to approach this situation anyway.

And that's my question: what is the right way to approach this situation so as to cause the least amount of headache for everyone involved?

答: As a rule of thumb, technology should be employed strictly as a means, not an end. You will always run into situations where the customer wants to have a say, regardless of  their expertise or lack thereof. This is especially true in graphic design where everyone can suddenly become an art critic. Your job is to educate the customer about the decision you made and the associated trade offs. If your decision process is completely transparent and everyone is on the same page, then you can proceed with confidence. It may be the case that the customer is truly stuck on the buzzwords, in which case they may simply not be the right customer, because they if they are unreasonable in one regard there is nothing to say they won't be in another. Alternatively, the customer could have appropriate reasons for using a specific technology, in which case it becomes a requirement of the project. Overall, open and transparent communication is key.</p>


答:
technology that I believe will get me there faster, easier, and be more maintanable in the long term

That's how you justify it. If they don't trust you to make that evaluation then they are entitled to make it themselves. But, unless it's too late, make it clear that this affects your estimates because your estimates are based on your ability to choose the best technology for the job.

They might even decide that they're happy to take a financial hit now for the flexibility of being able to replace you with another developer later. Or, in fact, for any other reason that makes sense to them. They are entitled to make that choice. Remember that your priorities (speed, simplicity and maintenance) may not match theirs, and ultimately it's their money.

Title: How to justify technology choice to customer?

Body:
When freelancing / contracting a customer will typically specify functional requirements, acceptance criteria, etc, and the implementation details are in the developer's hands.

As a developer your technology choice is a balancing act between what you are most familiar with, technologically what the right tool appears to be, ease of finding coders with this skill and their expense, and a few other factors.

I'm in a situation where I have evaluated my options and selected a somewhat obscure open source technology that I believe will get me there faster, easier, and be more maintanable in the long term. It's different, but I think that that is what the requirements call for.

The customer has inquired about what I'm going to use to build the solution, and now they are concerned because they've never heard of it before. The reasons for my choice are mostly technical, whereas the customer isn't (but they know some buzzwords!). Explaining these technical reasons will not be easy, and I am not sure if that is the right way to approach this situation anyway.

And that's my question: what is the right way to approach this situation so as to cause the least amount of headache for everyone involved?


答:
technology that I believe will get me there faster, easier, and be more maintainable in the long term

That justification will not make your proposal winner.
Your proposal should meet their business requirements and be cost effective, flexible and maintainable.

What business are looking to get is; a user friendly and informative UI with robust functionality at the back-end. Thus, the customer care more about how good application will appeal to eye and make their business easier to manage.

Thus, stating that X technology will solve their business problem and it will be fast to implement will fell short with the expectations. However, convincing customer that previous convoluted menu navigation will be replaced with intuitive UI and flexible back-end engine that allow easier customization of services will be BIG selling point to accept your proposal.


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

答:
An interview is a two-way process - you need to want to work for them as well as them wanting to hire you.

Before you apply to a company (or an agency applies on your behalf), you'd do some research on the company to find out more about them - who they are, what their products are, what market(s) they operate in (including major competitors).

During the interview process (telephone, physical, etc), you'll also be able to assimilate information about their procedures/workflow/methodologies, the tool chains used, working environment plus any other useful info that wasn't on their website.

If, by the end of the interview, there's some important-to-you items they haven't answered in other discussions, this is the time to ask.

Don't end the interview with unfinished questions - some of them may be deal breakers to you - e.g. working hours > 50/week.

Here's a checklist, in no particular order:

Programming Language(s), Environments/Platforms

Tools used - IDEs, Compilers, Build System, Version Control

Testing strategy - unit, automated, human

Deployment strategy

Work ethic - hours, rewards system

Working environment - noise, daylight, air quality, space

Physical location - transportation, parking, lunchtime options

Non-salary package items - hours-per-week, dental, healthcare, gym, drinks, other perks.

Career opportunities within the company

ContentLicense: CC BY-SA 2.5


问:
How can I reformat my condition to make it better?
I have a condition

```<code>if(exists && !isDirectory || !exists)
{}
</code>```

how can I modify it, so that it may be more understandable.

答:
As a process, I suggest building a truth table:

```<code>e = exists
d = isDirectory

e | d | (e && !d) || !e
--+---+----------------
0 | 0 | 1
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
</code>```

This matches the NAND operation, which is simply:

```<code>!(exists && isDirectory)
</code>```

If you don't remember all your logic gates, wikipedia has a nice reference with the truth tables to boot.

@Christoffer Hammarström brought up an important point about the state of isDirectory being tied to the state of exists. Assuming that they refer to the same reference, and that it's not possible to have a state where the reference doesn't exist and is a directory, the truth table can be written as follows:

```<code>e | d | (e && !d) || !e
--+---+----------------
0 | 0 | 1
0 | 1 | n/a
1 | 0 | 1
1 | 1 | 0
</code>```

The n/a is used to represent a state that doesn't matter. Acceptable reductions could result in either 1 or 0 for states resulting in n/a.

With this in mind, !(exists && isDirectory) is still a valid reduction, resulting in a 1 for !e && d.

However, !isDirectory would be a much simpler reduction, resulting in 0 for !e && d.

Body:
As a process, I suggest building a truth table:

e = exists
d = isDirectory

e | d | (e && !d) || !e
--+---+----------------
0 | 0 | 1
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0

This matches the NAND operation, which is simply:

!(exists && isDirectory)

If you don't remember all your logic gates, wikipedia has a nice reference with the truth tables to boot.

@Christoffer Hammarström brought up an important point about the state of isDirectory being tied to the state of exists. Assuming that they refer to the same reference, and that it's not possible to have a state where the reference doesn't exist and is a directory, the truth table can be written as follows:

e | d | (e && !d) || !e
--+---+----------------
0 | 0 | 1
0 | 1 | n/a
1 | 0 | 1
1 | 1 | 0

The n/a is used to represent a state that doesn't matter. Acceptable reductions could result in either 1 or 0 for states resulting in n/a.

With this in mind, !(exists && isDirectory) is still a valid reduction, resulting in a 1 for !e && d.

However, !isDirectory would be a much simpler reduction, resulting in 0 for !e && d.


答: What Fielding meant by that statement is that the application server hosting the REST API does not associate ambient state with a request by some sort of behind the scenes mechanism. Consider the difference between an application server and a database server. The REST constraint is that the application server should be stateless. However, the application server can delegate requests for resource state to the database server based on information which is part of the request, such as a user/password combination in the Authorization header or the Uri itself. After all, REST is based on the client/server model.

Title: Do server-side sessions violate REST?


问:
Basics of ERP for dummies
A situation has arisen where (if I don't scream and run away) I will be involved in an ERP system. This project will be using OpenERP specifically. My background is entirely science/engineering/music/games/art/whatever. I've never set foot in the realm of business systems or anything describable with the word "enterprise".

What is a good introduction to the whole ERP concept, OpenERP and business systems in general suitable for those with flat zero experience in that world?

The ideal intro would explain, from no assumptions, what the main ideas are, terminology, they style of work and thinking of people in that world, and maybe some concrete suggestions how one can tinker around with a copy of OpenERP to gain basic familiarity.

答:
ERP systems are designed to be the backbone of an Enterprise's technology infrastructure. The idea being that it can provide the basics of everything involved in running a business (HR, Accounting, Inventory Management, Project Management, etc.) so that all the business has to do is focus on what makes their business different.

There are a number of books that walk you through the basics of enterprise systems (in a software agnostic way). Understanding the core concepts will provide you with a roadmap as you dive into the details of your chosen platform.

I'd recommend the Data Model Resource Book. Although it's ostensibly about database design, the resources in the book go beyond that and help you get a grasp on the deeper concepts that underly an ERPs more complex data model.

Title: Basics of ERP for dummies


问:
Should I still use a web application framework?
I'm about to make a simple web application with just image uploading and user management. I'm browsing through several web app frameworks I could use yet I'm still thinking if I should still make use of them or just make one from scratch for this specific application.

Any suggestions from experienced web app developers? Thanks!

答:
For pretty much every major language, there are already web frameworks that provide user management and can handle image uploading.  If you go with one of them, you immediately get all the benefits of the upstream community's work on security, performance, browser and web server interoperability, and more.  If you roll your own, then you'll be figuring out all of that yourself, plus rolling your own user management and image uploading, which it sounds like have very little to do with what you're actually trying to accomplish.

So by all means, yes, use a web framework, in pretty much whatever language you want, so you can focus on the part of your application that's unique, and not the part of your application that does what a thousand other websites already do.


答:
make a simple web application with just image uploading and user management

I would skip addition of any unnecessary framework to the implementation, just for the sake of having it. However, if there are good functional and security gains from using one, then i would double check that framework to make sure that it suits my project needs.

Basically, i would skip adding dependency of web-framework to my project if there are no gains/benefits from it. Adding layer of abstraction (some third-party framework) to the project potentially increases complexity and dependency matrix of your project. Thus keep it simple stupid and don't over engineer it.

However, there are some type of functionality which is supported out of the box in natural in the web-framework of your primary programming language. Take C# as an example, ASP.NET MVC is a framework that naturally support user management, data validation, model-binding, routing, etc.... What is left is just configuring the functionality, and you are done!

Title: Should I still use a web application framework?

Body:
I'm about to make a simple web application with just image uploading and user management. I'm browsing through several web app frameworks I could use yet I'm still thinking if I should still make use of them or just make one from scratch for this specific application.

Any suggestions from experienced web app developers? Thanks!


答:
I would distinguish two main categories of procedures / approaches:

A procedure loads some data into main memory, performs some operation, and saves the result to the disk.

A procedure runs as a filter reading a data stream and producing a new data stream as output, which is saved on the fly. When the end of the input stream is reached, the procedure terminates.

In the first case (e.g. reading, editing, saving a document), memory usage can be linear (or even quadratic or more) in the size of the input data: the largest size for the input data will be determined by the amount of available memory. You can use this approach when your input data is small enough wrt the available memory.

In the seconds case (e.g. filtering relevant information from a large log file) even a linear memory usage can be undesirable, since it is easy to run out of memory as soon as the input stream is large enough. For problems of category 2 I would only accept a solution that can run in constant (stack and heap) memory.

Whether your solution falls into category 1 or 2 can depend on the (expected) size of the data. Take for example sorting. If you need to sort 100 MB of strings you can just load the data into main memory and use an in-memory algorithm. On the other hand, if you need to sort 1 TB of data, you should rather consider an algorithm that uses constant main memory (like some implementations of merge sort).


答:
A programmer is generally more equipped to know what tool (tech) is best suited for the task at hand; however, despite this your justification should not come from a programmer perspective but from your client's perspective.

That said, you need to know a little about your client and what matters to them.  For example, you alluded to the fact that you chose a more obscure open source solution.  If the client highly prioritizes being able to bring on run-of-the-mill developers for future maintenance this may not be a good choice as it weighs against their priority.

No matter how well suited some technology is for the technical task at hand there are business concerns that may be more meaningful to the client.  Ultimately, laymen don't care about technical details, only ramifications.


问:
Concept of Address Space
I have searched the idea of address space that is The set of all legal addresses in memory for a given application. The address space represents the amount of memory available to a program. I am unable to find that how this concept is implemented? And how it works with operating system? Any help would be appreciated.

答:
An address can be represented by a non-negative integer number, so "address space" is a fancy way to describe a set of non-negative integers such that each integer represents a valid address in the memory available to your program.

In some cases, several address spaces can be available to your program: for example, when you are on a system that follows a Harvard architecture, your program has two address spaces - one for the code, and one for the data. In cases like that a non-negative integer is no longer sufficient to uniquely define a location in memory; you must also specify to which of the two address spaces that integer belongs.

The implementation of an address space is done in hardware: a number is mapped to a location in memory by dedicated piece of electronics that controls the interface between the CPU and the memory. Operating systems control this hardware by allocating blocks of physical memory to a running program's virtual address space.

Title: Concept of Address Space


答:
I think it's more a question of do you want to learn and use a framework on a continual basis.  All frameworks have pros and cons and some may be more suited to certain projects; however, you only have so much life and so you probably won't bother learning a new framework for each project you do.  If you're going to learn or use something, do it because you plan on using it  again and again so that you get a return on investment.

Ultimately, learning a framework may mean it takes you longer on this project, but over several projects you'll save time.  Choose whatever's most expedient based on whether you care more about the long or short term.


答:
I'm in roughly the same situation: Got trapped into the implementation of OpenERP with zero prior experience in management/accounting domains.

My advice: read the code.

Yes, it's big, and it's not the cleanest OSS out there; but it's quite readable.  Start with the OpenERP documentation, and when you think you understand what a small module does, start reading how does it do that.  After a while, it's easier to read the code than trying to find documentation.

good luck!

Title: Basics of ERP for dummies

Body:
A situation has arisen where (if I don't scream and run away) I will be involved in an ERP system. This project will be using OpenERP specifically. My background is entirely science/engineering/music/games/art/whatever. I've never set foot in the realm of business systems or anything describable with the word "enterprise".

What is a good introduction to the whole ERP concept, OpenERP and business systems in general suitable for those with flat zero experience in that world?

The ideal intro would explain, from no assumptions, what the main ideas are, terminology, they style of work and thinking of people in that world, and maybe some concrete suggestions how one can tinker around with a copy of OpenERP to gain basic familiarity.


答:
Going with frameworks is better thing to do, because you get some great things readily available. You have user management in your application, you might have role based access as well. Here you will be benefited from frameworks. You can use spring framework. Spring has it's security framework as well. You can manage authentication and authorization with the help of spring security.

You can have internationalization (i18n) also in your application. Frameworks help do things faster.

Using MVC frameworks makes it easy to write reusable code. It segregates you view technology, controllers and database access (dao )layer. So it is always easy to port any ORM framework in the backend by just replacing some code in DAO layer.

I love spring & struts.


问:
Do App Stores Have Exclusivity on Your Apps?
Let's say I write a mobile app and I want to sell it on all three:

Apple Market Place

Android Market Place

Windows Market Place

Will any of these market places tell me that it's not possible, that
in order to sell it I must only go through them and not through the
other ones?

p.s I know Angry Birds sells on all three. But how is that? I mean, don't books, for example, have exclusivity deals with their distributors?

答:
No.

Those are different Platforms, So they are Different APPs!!

I think even if you sell on the Android APP store you can still also list your app in the Amazon Android App store. Read the Terms of service to sure, as it can change any moment.


答:
It depends on the application domain is the only correct answer.

Frameworks give the pro's of

already battle tested code

will get updates

feature rich

and a community to help.

saves on time!

Ultimately that means there is less work for you. There is no point re-inventing the wheel, if you can just take one off a shelf.

However I personally am always weary of frameworks:

often filled with cruft, or overly complex abstractions and boiler plate

you can be writing your application for the framework, instead of writing an application that uses a framework

unwanted features are loaded, or worse, must be used

you don't get exactly what you want

There are plenty of examples out there of popular frameworks, which have all of the above issues.

What I would say, is that you should have a framework: either one off the shelf, or one you have built yourself. The advantage is that it forces you to modularize your code.


答:
In the interests of full disclosure, I work for Barnes & Noble. I do not own, nor do I plan to purchase stock of any of the companies I mention here.

You're confusing publishers and distributors. There are exclusivity deals with some games as well as some distributors functioning as publishers (Valve, Sony, Microsoft). However, in the case of books you have publishers like Random House or Simon & Schuster functioning as publishers who have exclusivity in most cases. There are cases where the hardcover and the paperback have different publishers, particularly if it's a reissue. The publisher-distributor combine in books is largely the purview of Barnes & Noble for paper books. B&N and Amazon both have ebook publishing programs.

So, while exclusivity is possible, it is not mandatory for the vast majority of apps.

Title: Do App Stores Have Exclusivity on Your Apps?

Body:
Let's say I write a mobile app and I want to sell it on all three:

Apple Market Place

Android Market Place

Windows Market Place

Will any of these market places tell me that it's not possible, that
in order to sell it I must only go through them and not through the
other ones?

p.s I know Angry Birds sells on all three. But how is that? I mean, don't books, for example, have exclusivity deals with their distributors?


问:
Why isn't functional language syntax more close to human language?
I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it...
I have one curiosity though, why is the syntax so cryptic (in lack of another word)?

Is there a reason why it isn't more expressive, more close to human language?

I understand that FP is good at modelling mathematical concepts and it borrowed some of it's concise means of expression, but still it's not math... it's a language.

答:
Imperative computer languages mostly aren't any closer to natural languages than, say, Haskell is.

However, some are designed to more closely resemble English:  Cobol and Hypercard, for example.  The lessons I would take from these examples are:

similarity to natural languages doesn't seem to yield direct improvements in usability

emulating natural languages directly can yield computer languages that are verbose and obscure

The Perl computer language was reportedly designed with some more subtle aspects of natural language in mind.  I would judge that Perl does better than Cobol or Hypercard on general usability, but people have differing opinions about Perl.


答:
What is a good introduction to the whole ERP concept, OpenERP and business systems in general suitable for those with flat zero experience in that world?

Start with Wiki page and then move toward the tutorial videos that are good source of information for start-up. There are some other source of information as well.

OpenERP tutorial

Magento module and the OpenERP extension

OpenERP Quick start

OpenERP sample module development

openerpvideos.com

In addition, start reading the code asap. Although, going through some introductory tutorials is good in the beginning, once started reading the code you will better understand the inner-workings within the framework.

Title: Basics of ERP for dummies


答:
You can use a truth table as pointed out. Second step could be a KV-map for minimizing the number of terms.

Using the laws of Boolean algebra is another approach:

A = exists

B = !isDirectory

!A = !exists

&& = *

|| = +

[Edit]

A simpler transform, because the operations AND and OR are mutually distributive :

exists && !isDirectory || !exists

= A*B + !A

= (A + !A) * (B + !A)

= 1*(B + !A)

= B + !A

[/Edit]

exists && !isDirectory || !exists

= A*B + !A

= A*B + !A*1 //Identity

= A*B + !A*(B+1) //Annihilator

= A*B + !A*B + !A //Distributivity and Identity

= B*(A + !A) + !A  //Distributivity

= B*1 + !A //Complementation 2

= B + !A //Identity

= !isDirectory || !exists

Or with double complement (!!x = x):

A*B + !A

= !!(A*B + !A)

= !(!(A*B)*A)

= !((!A + !B)*A)

= !(!A*A + !B*A)

= !(0 + !B*A)

= !(!B*A)

= B + !A

= !isDirectory || !exists

Title: How can I reformat my condition to make it better?

Body:
I have a condition

```<code>if(exists && !isDirectory || !exists)
{}
</code>```

how can I modify it, so that it may be more understandable.


问:
When to use identity comparison instead of equals?
I wonder why would anybody want to use identity comparison for fields in equals, like here (Java syntax):

```<code>class C {
    private A a;

    public boolean equals(Object other) {
        // standard boring prelude
        if (other==this) return true;
        if (other==null) return false;
        if (other.getClass() != this.getClass()) return false;
        C c = (C) other;

        // the relevant part
        if (c.a != this.a) return false;

        // more tests... and then
        return true;
    }

    // getter, setters, hashCode, ...
}
</code>```

Using == is a bit faster than equals and a bit shorter (due to no need for null tests), too, but in what cases (if any) you'd say it's really better to use == for fields inside equals?

答:
The == operator in Java checks for reference equality: it returns true if the pointers are the same. It does not check for contents equality.

Use the equals() method to compare object values.
The equals() method returns a boolean value.

The two operators that can be used with object references are comparing for equality (==) and inequality (!=). These operators compare two values to see if they refer to the same object. Although this comparison is very fast, it is often not what you want.
Usually you want to know if the objects have the same value, and not whether two objects are a reference to the same object. For example,

```<code>if (name == "My Test Value")   // Legal, but ALMOST SURELY WRONG
</code>```

This is true only if name is a reference to the same object that "My Test Value" refers to. This will be false if the String in name was read from input or computed (by putting strings together or taking the substring), even though name really does have exactly those characters in it.

Many classes (eg, String) define the equals() method to compare the values of objects.

Body:
The == operator in Java checks for reference equality: it returns true if the pointers are the same. It does not check for contents equality.

Use the equals() method to compare object values.
The equals() method returns a boolean value.

The two operators that can be used with object references are comparing for equality (==) and inequality (!=). These operators compare two values to see if they refer to the same object. Although this comparison is very fast, it is often not what you want.
Usually you want to know if the objects have the same value, and not whether two objects are a reference to the same object. For example,

if (name == "My Test Value")   // Legal, but ALMOST SURELY WRONG

This is true only if name is a reference to the same object that "My Test Value" refers to. This will be false if the String in name was read from input or computed (by putting strings together or taking the substring), even though name really does have exactly those characters in it.

Many classes (eg, String) define the equals() method to compare the values of objects.


答:
There are cases when checking for instance equality with == is necessary. For example, that is what you do in the implementation of equals to check if you are comparing an object to itself (a very important shortcut that also satisfies the reflexivity requirement of equals)

```<code>if (other==this) return true;
</code>```

The other case is when the system guarantees that there will be only one instance that is equal to any object of a particular class (and by necessity that is going to be the instance itself - again, due to reflexivity of equals). This is another common case illustrated by your code fragment:

```<code>if (other.getClass() != this.getClass())
</code>```

An equality of two java.lang.Class objects is equivalent to the equality of their references, because for each class that you define there is one, and only one, instance of java.lang.Class.

A third case where reference equality is desired is serialization: you need to keep track of object instances by tracking their references, even if they are logically equal, in order to be able to produce an isomorphic graph upon deserialization.

EDIT : Inside implementations of equals the use of == boils down to increasing performance: comparing an object to itself is a common case, especially when you use objects of the class as keys in a hash table, so it makes sense to optimize it.

Title: When to use identity comparison instead of equals?

Body:
I wonder why would anybody want to use identity comparison for fields in equals, like here (Java syntax):

```<code>class C {
    private A a;

    public boolean equals(Object other) {
        // standard boring prelude
        if (other==this) return true;
        if (other==null) return false;
        if (other.getClass() != this.getClass()) return false;
        C c = (C) other;

        // the relevant part
        if (c.a != this.a) return false;

        // more tests... and then
        return true;
    }

    // getter, setters, hashCode, ...
}
</code>```

Using == is a bit faster than equals and a bit shorter (due to no need for null tests), too, but in what cases (if any) you'd say it's really better to use == for fields inside equals?

Body:
There are cases when checking for instance equality with == is necessary. For example, that is what you do in the implementation of equals to check if you are comparing an object to itself (a very important shortcut that also satisfies the reflexivity requirement of equals)

if (other==this) return true;

The other case is when the system guarantees that there will be only one instance that is equal to any object of a particular class (and by necessity that is going to be the instance itself - again, due to reflexivity of equals). This is another common case illustrated by your code fragment:

if (other.getClass() != this.getClass())

An equality of two java.lang.Class objects is equivalent to the equality of their references, because for each class that you define there is one, and only one, instance of java.lang.Class.

A third case where reference equality is desired is serialization: you need to keep track of object instances by tracking their references, even if they are logically equal, in order to be able to produce an isomorphic graph upon deserialization.

EDIT : Inside implementations of equals the use of == boils down to increasing performance: comparing an object to itself is a common case, especially when you use objects of the class as keys in a hash table, so it makes sense to optimize it.


问:
Using WebStorm for Razor Syntax MVC
I am building a lot of client-side heavy SPA-like apps with VS2010 and MVC3/4.  VS2010 Javascript/HTML/CSS editing (mostly javascript) is interminably slow and sluggish.  I'd love to use something like JetBrains' WebStorm to edit my .CSHTML files (with embedded javascript, etc. because I am using RAzor to pop in URL names, etc.)

WebStorm seems to have all of the things I want.. better language recognition ("intellisense") and the ability to integrate additional outside libraries into this (I'm using Kendo), etc.

Is this possible?  How do you get WebStorm to recognize the @"" invoked Razor language inserts?

Any help or suggestions would be appreciated.

答:
Webstorm is pretty server side agnostic. I would think that JetBrain would be silly to enter the ASP.NET space with an IDE at this point. You can see their other offerings with IntelliJ and RubyMine, PhpStorm, PyCharm - all avoiding ASP.NET and MVC.

They've got Resharper too which is a great VS add on.

My advice, get a faster computer or even a solid state hard drive. Javascript completion on my machine isn't slow at all.

Are you following the rules for including other libraries? That's also supported in VS10 and 12...

Title: Using WebStorm for Razor Syntax MVC


问:
What's the opposite of cohesive?
I was talking with my architect about some concerns with a particular approach that may result in very low level of cohesion in a set of classes. However, I couldn't think of the word that represents a low level of cohesion.

I said something along the lines of "Obviously, we want cohesive classes not... uh ... not cohesive classes"

What's the correct word I should have used?

答:
According to Wikipedia,

Cohesion is an ordinal type of measurement and is usually expressed as “high cohesion” or “low cohesion” when being discussed.

So I think the phrase becomes "Obviously, we want highly cohesive classes, not classes with low cohesion".

Title: What's the opposite of cohesive?


答: Personally, I'd probably use "disjointed" to mean the opposite of "cohesive" if you were just looking for a conversational, qualitative description.</p>

Title: What's the opposite of cohesive?

Body:
I was talking with my architect about some concerns with a particular approach that may result in very low level of cohesion in a set of classes. However, I couldn't think of the word that represents a low level of cohesion.

I said something along the lines of "Obviously, we want cohesive classes not... uh ... not cohesive classes"

What's the correct word I should have used?


答:
I don't like to use "!" when there is more than one condition in the expression. I'll add lines of code to make it more readable.</p>

```<code>doesNotExist = !exists;
isFile = exists && !isDirecotry;
if (isFile || doesNotExist)
   {}
</code>```

Body:
I don't like to use "!" when there is more than one condition in the expression. I'll add lines of code to make it more readable.

doesNotExist = !exists;
isFile = exists && !isDirecotry;
if (isFile || doesNotExist)
   {}


问:
Do people in non-English-speaking countries code in English?
I've heard it said (by coworkers) that everyone "codes in English" regardless of where they're from. I find that difficult to believe, however I wouldn't be surprised if, for most programming languages, the supported character set is relatively narrow.

Have you ever worked in a country where English is not the primary language?

If so, what did their code look like?

答:
I am currently in the Netherlands, but coming from Russia originally. 11 years ago, many programmers in Russia didn't have a good command of English, hence the comments were often in Russian. Variable names and function methods were still in English, or what people thought was English, simply because corresponding Russian words tend to be long, and sometimes seem to obscure the sense. Now it's probably like everywhere: the more professional people are, the more the chance that their comments are in English.

In the Netherlands, I have seen Dutch comments and variable / method names in the company where the majority of the programmers were Dutch (such companies do exist:) ) But it was the only case.

By the way, the question 'Did you know the Latin alphabet until you came to the West' used to annoy me, until I have learned to laugh at it:)


答:
If you don't like "disjointed", I'd suggest "incoherent".  The exact antonym, "coherent", seems similar to the meaning of "cohesive" in the context of systems architecture.

I also like "incoherent" because it suggests a lack of coordination among disparate parts.

Title: What's the opposite of cohesive?


问:
Recent programming language for AI?
For a few decades the programming language of choice for AI was either Prolog or LISP, and a few more others that are not so well known. Most of them were designed before the 70's.

Changes happens a lot on many other domains specific languages, but in the AI domain it hadn't surfaced so much as in the web specific languages or scripting etc.

Are there recent programming languages that were intended to change the game in the AI and learn from the insufficiencies of former languages?

答:
The AI course I participated in online, taught at Stanford, recommended that Python be used for the homework. I believe Georgia Tech still uses LISP.

The fallacy here is "new" is "good". AI research is one of the oldest computing research disciplines. It keeps calving off subfields as people realize that techniques from it can be used elsewhere. Language Processing, Machine Learning, and Data Mining are all examples of "practical" applications that use a huge host of languages.

So it's less that the main field has changed than it has been refined into a massive array of related disciplines. It's much like saying "Scientific Computing" and expecting it to just mean solving Linear Equations.

The languages you've mentioned have evolved quite a lot on the last 20 or 30 years. Lisp spawned Common Lisp and Clojure. Prolog spawned Visual Prolog (it has objects...) and Mercury (take Haskell and Prolog, lock them in a room together...stand well away and get ready to run).

Given that AI research is more theoretic, it makes sense that it would focus on the theory (math) rather than the practicalities (languages).

All that being said, the biggest innovator of AI technologies I'd wager is Google. They tend to favor Python (and Go and Dart but that's beside the point). Thus I'd say Python is the "recent language of choice" but you could also use Haskell or OCaml or F# or C# or even Java.

Title: Recent programming language for AI?


答:
The language of choice for AI that i have used back years ago was Prolog, which has Visual Prolog version that came with IDE like in Delphi.

Prolog (and its GUI version Visual Prolog) is a general purpose logic programming language associated with artificial intelligence and computational linguistics.

However, recent trend shows that any OOP language like C#, Java, Python, Haskell, etc.. are becoming programmable for AI applications.

Title: Recent programming language for AI?

Body:
For a few decades the programming language of choice for AI was either Prolog or LISP, and a few more others that are not so well known. Most of them were designed before the 70's.

Changes happens a lot on many other domains specific languages, but in the AI domain it hadn't surfaced so much as in the web specific languages or scripting etc.

Are there recent programming languages that were intended to change the game in the AI and learn from the insufficiencies of former languages?


问:
How can I study C# from Stack Overflow
How can I study C# from Stack Overflow?

I have only the basics of the C# language with some simple exercises; now I want to go to the highest level C# through Stack Overflow, reading any questions tagged "c#". The questions are not ordered from easiest to hardest.

Do you have any idea on how to learn C# from Stack Overflow?

答: The best way to learn C# is to program in C#. This is true for any language. Just pick something and start implementing. Make a tic tac toe game, whatever.</p>

Title: How can I study C# from Stack Overflow


答:
I'd say it depends on what you mean by AI. Machine learning in general has seen some rapid evolution of tooling, so a number of algorithms for classification, clustering, and other forms of supervised and unsupervised learning, especially with probabilistic graphical models, have been implemented in Python, C#, Ruby, OCaml, and Java, just to name a few.

If you're doing large scale manipulation of data for building things like recommendation engines, collaborative filtering, or other types of unsupervised or supervised learning problems, you may want to take a look at Mahout. It's not really a "programming language" per se, but it's a set of tools for this kind of problem. You can write model code in Java, or other JVM languages like groovy (a dynamic, reasonably expressive language) or clojure (lisp-like).

I'm not sure why you'd consider Lisp dated; it's where most of the "new" language features in other languages (closures, etc.) originated from.

Of course, machine learning techniques have generally been moving toward probabilistic models than on the binary logic, decision-tree style approach that most early AI efforts started with, so it's possible to argue that machine learning is a branch or a diversion from the big tent of AI.

Title: Recent programming language for AI?


答:
However, I couldn't think of the word that represents a low level of cohesion.

People use terms like 'low-cohesion' or 'high-cohesion', although definition of either is arguable. Technically cohesion can be seen as (Wikipedia),

Coincidental cohesion (worst) - Coincidental cohesion is when parts of a module are grouped arbitrarily; the only relationship between the parts is that they have been grouped together (e.g. a “Utilities” class).

Logical cohesion: Logical cohesion is when parts of a module are grouped because they logically are categorized to do the same thing, even if they are different by nature (e.g. grouping all mouse and keyboard input handling routines).

Temporal cohesion: Temporal cohesion is when parts of a module are grouped by when they are processed - the parts are processed at a particular time in program execution (e.g. a function which is called after catching an exception which closes open files, creates an error log, and notifies the user).

Procedural cohesion: Procedural cohesion is when parts of a module are grouped because they always follow a certain sequence of execution (e.g. a function which checks file permissions and then opens the file).

Communicational cohesion: Communicational cohesion is when parts of a module are grouped because they operate on the same data (e.g. a module which operates on the same record of information).

Sequential cohesion: Sequential cohesion is when parts of a module are grouped because the output from one part is the input to another part like an assembly line (e.g. a function which reads data from a file and processes the data).

Functional cohesion (best): Functional cohesion is when parts of a module are grouped because they all contribute to a single well-defined task of the module (e.g. tokenizing a string of XML).

What's the opposite of cohesive?

I said something along the lines of "Obviously, we want cohesive classes not... uh ... not cohesive classes"

No opposite, i.e., no 'non-cohesive' or 'not-cohesive' etc.

Title: What's the opposite of cohesive?


问:
How to justify rewriting/revamping legacy software in a business case?
I work for a great little software company which makes good revenue from our main software package.  The problem for me is that it's almost unmaintainable.  It's written in Delphi 7 (has upgraded versions over time) and has been worked on by a lot of developers over the past 20 or so years.

The software lacks any meaningful architecture - there's no object orientation whatsoever, horrible amounts of cyclical dependencies and an over-reliance on global variables to name just a few things.  Another huge thing for me is Delphi 7 does NOT support 64-bit.

The problem here for me is that my management team don't care about technical things, they want to know why they should care.  Obviously that's expected, so what I'm asking here is for some guidance, or tales, or pitfalls about this kind of thing.

There's a few things I would love to include, namely for me, the length of time taken to debug/write a feature in "legacy" code, versus coherent, well structured OO code.  Does anyone know of any blog posts or the like where this is talked about?  For us in the company this is a huge reason.  Despite being decent developers we feel like writing a new feature is just piling more rubbish on top.  On top of that, even for me who has a decent level of understanding of the code, changing things is infuriating - a small change can have a ridiculous domino effect.

Anyone have any experiences they'd like to share?

答:
This graphic could help, it's a function of code base quality and business value of the application:

The chart pretends to be a guide on when a re-engineering of legacy software is justified and when it's not. For example, if the software has high business value and the quality of the code is poor, then a re-engineering is justified.


答:
Although I agree with Pankaj's answer for the most part, I must say that it helps going thru SO questions on a particular topic (say semaphores on Linux) just after I have read about it from a text book and written a few practice programs (before I solve a real work problem with it).

You will realize how exactly people are using the api's, different problem solving strategies, the 'right way' to do things, best practices and other data that will help you avoid a lot of mistakes and keep on the right track.

SO questions are all about real problems people face when they are trying to solve real world problems. So it is generally a great experience to read the challenges and issues people face. It is like you are looking at the problems very likely you will face yourself if you tried something similar.

However, since you are really looking to learn the language itself, you are best served with a text book. But be sure to search question on topics you study. More often than not you will find practical tit bits that are not there in text books.

Also, you will be able to fill gaps in your knowledge like 'hey, I didn't know that' or 'hey, that's another way to do that !' or 'hey I must try that !'

Happy coding !

Title: How can I study C# from Stack Overflow

Body:
How can I study C# from Stack Overflow?

I have only the basics of the C# language with some simple exercises; now I want to go to the highest level C# through Stack Overflow, reading any questions tagged "c#". The questions are not ordered from easiest to hardest.

Do you have any idea on how to learn C# from Stack Overflow?


答:
"Refractory" means

Obstinately resistant to authority or control.

Difficult to melt or work; resistant to heat (w.r.t. metal working)

If your classes are refractory, then they don't work smoothly together, and it is hard for maintainers to go in and make changes that span many classes.

This seems to be a decent antonym for the sense of "cohesive" that you're using : joined together in a well-functioning and orderly manner.

Title: What's the opposite of cohesive?


问:
Forking a GPL dual licensed software with business owned copyrights
After receiving some threats of the copyrights holder of a dual licensed software(GPL2 and commercial) to buy the commercial version for projects in production, I am thinking to make a fork.

In a case of GPL2 and commercially dual licensed with business owned copyrights software, is forking the GPL2 version an option?

Also, is forking a good way to deal with such cases?

Background information

The software is a web CMS released under 2 versions a GPL2 free open source edition and a commercial edition including technical support and extra functionality.

The problem is that now, basing their argumentation on the "distribution" definition of the GPL2, the company holding the copyrights argue that delivering the software and some extensions to a client is considered as a "distribution". And that such a "distribution" falls under the GPL2 obligation to release the custom made extension code.

Custom made extensions are mainly designs, templates and very specific functionality.

Basically they give me 3 choices:

Buying the commercial licensed edition for projects based on the GPL in production,

Deleting all the projects in production based on GPL2 version,

Releasing all the extensions as GPL2 code.

The first 2 options are nothing realistic for finished projects.

The third option could be fine, but as most of the extensions are very specific, cleaning the code to make it usable by other users means lot of works and also I am not sure the clients will appreciate to have their website designs and specific functionality released publicly.

The copyrights holding company even contacted some clients directly, giving them the "choice".

I know that this is a very corporate interpretation of GPL2, and a such action is nothing close to legal, but as an independent developer, I don't want to take the risk to get involved in some long and tiring legal procedures.

PS. This question was first asked on Stack Overflow where it felt out of the scope and closed, after reading the present site FAQ, discussing about software licensing seems fine.

答:
Usual disclaimer: Ask a lawyer etc.

By the GPL, you don't have to release source of your specific extensions to the public. All you have to do is to make it available to your customers, licensed under the GPL or a compatible license. Of course that means that your customers could decide to release it to the public, or do whatever else the GPL allows them, but they don't have to, either. Cleaning the code is not required by the GPL, and making is usable by other users is probably not even in your interest.


问:
Handling bugs, quirks, or annoyances in vendor-supplied headers
If the header file supplied by a vendor of something with whom one's code must interact is deficient in some way, in what cases is it better to:

Work around the header's deficiencies in the main code

Copy the header file to the local project and fix it

Fix the header file in the spot where it's stored as a vendor-supplied tool

Fix the header file in the central spot, but also make a local copy and try to always have the two match

Do something else

As an example, the header file supplied by ST Micro for the STM320LF series contains the lines:

```<code>typedef struct
{
  __IO uint32_t MODER;
  __IO uint16_t OTYPER;
  uint16_t RESERVED0;
  ....
  __IO uint16_t BSRRL; /* BSRR register is split to 2 * 16-bit fields BSRRL */
  __IO uint16_t BSRRH; /* BSRR register is split to 2 * 16-bit fields BSRRH */
  ....
} GPIO_TypeDef;
</code>```

In the hardware, and in the hardware documentation, BSRR is described as a single 32-bit register.  About 98% of the time one wants to write to BSRR, one will only be interested in writing the upper half or the lower half; it is thus convenient to be able to use BSSRH and BSSRL as a means of writing half the register.  On the other hand, there are occasions when it is necessary that the entire 32-bit register be written as a single atomic operation.  The "optimal" way to write it (setting aside white-spacing issues) would be:

```<code>typedef struct
{
  __IO uint32_t MODER;
  __IO uint16_t OTYPER;
  uint16_t RESERVED0;
  ....
  union // Allow BSRR access as 32-bit register or two 16-bit registers
  {
    __IO uint32_t BSRR; // 32-bit BSSR register as a whole
    struct { __IO uint16_t BSRRL, BSRRH; };// Two 16-bit parts
  };
  ....
} GPIO_TypeDef;
</code>```

If the struct were defined that way, code could use BSRR when necessary to write all 32 bits, or BSRRH/BSRRL when writing 16 bits.  Given that the header isn't that way, would better practice be to use the header as-is, but apply an icky typecast in the main code writing what would be idiomatically written as thePort->BSRR = 0x12345678; as *((uint32_t)&(thePort->BSSRH)) = 0x12345678;, or would be be better to use a patched header file?  If the latter, where should the patched file me stored and how should it be managed?

Edit

In this vendor's data file, I/O device registers are defined by using structure definitions like the above with macro definitions like #define GPIOB (*((struct GPIO_TypeDef*)GPIO_BASE + 0x100)).  Because GPIOA, GPIOB etc. are defined as macros rather than identifiers, any macro substitution of GPIO_TypeDef which goes into effect after the structure is defined would affect future uses of that type but also apply to GPIOA, GPIOB, etc.  Thus, my present inclination would be to define my own project-wide header file which #includes the vendor's file, and then defines my own structure and macro-substitutes my structure's name for the vendor's.  That would allow code to be written to use the registers in the normal idiomatic fashion while using the vendor-supplied definitions for just about everything else, and while providing a clear patch-point.

答:
I would refrain from changing vendors the headers, and work around limitations unless the workaround is being used too many times (more than once?). I now apply the following a guides.

In most cases its presumptuous to think I know better than the
vendor. (he says with only a slight hint of sarcasm)

Upgrading the tool chain later can be a problem - solvable with good revision control of the vendors code.

Code can no longer be simply documented as " Prerequisite : Install Product XYZ V1.2.3"

You code does not match vendors and others expectations - can be harder to discuss if needed - even discussions with other engineers very familiar with the vendors headers.

Where I have been in this situation, I have modified vendors headers and paid an expensive penalty later. I now tend to create my own header that wraps the vendors, leaving theirs as delivered. I have also on occasion send the improvements to the vendor for future releases.  All assumptions my code makes about the size and shape of the vendors data structures are verified at compile (or run time) using #error and asserts or other suitable means.

So in the above example, I would simply create "ImprovedGPIO_typeDef" with a

assert (sizeof (GPIO_typeDef) == sizeof(ImprovedGPIO_typedef) );


问:
How to have a maintainable and manageable Javascript code base
I am starting a new job soon as a frontend developer. The App I would be working on is 100% Javascript on the client side. all the server returns is an index page that loads all the Javascript files needed by the app.

Now here is the problem:

The whole of the application is built around having functions wrapped to different namespaces. And from what I see, a simple function like rendering the HTML of a page can be accomplished by having a call to 2 or more functions across different namespace...

My initial thought was "this does not feel like the perfect solution" and I can just envisage a lot of issues with maintaining the code and extending it down the line.

Now I would soon start working on taking the project forward and would like to have suggestions on good case practices when it comes to writing and managing a relatively large amount of javascript code.

答:
This is a very good question, and a common problem in advancing JavaScript architecture.

It sounds to me like you are describing the situation of "tight-coupling".

Once functions become objectified, the tendency is to reference these wonderful objects directly, from object to object, across namespaces even. Because it is easy right?

```<code>var Object1, Object2 = {};

Object1.somefunction = function(){
   //Tight Coupling!!
    Object2.functionCall();
}
</code>```

It is easy, but these seemingly innocent hard-references gang up, to make you sad when you have to remove or replace objects. That happens a lot in JavaScript, so understanding tight-coupling is key to making a JS codebase maintainable.

Here are some other thoughts:

1 - If your objects are not already communicating by - triggering and listening to events; they should be. This is the solution to hard references.

2 - Design Patterns. There are many challenges that have already been solved out there, the standardized reusable solutions - are Design Patterns.

Understanding where the patterns are helps you focus on what solutions may make sense. One pattern for communicating across objects is called Publisher/Subscriber, or PubSub.

3 - These things help with maintainability: MVC with a router, Templates - data binding, AJAX - through a Proxy or Delegate objects.

4 - Look for frameworks and libraries that solve the cross-browser problems for you. Don't re-invent the wheels you don't need to know more about. Depending on your environment, some may frameworks may become obvious choices.

5 - Think about enhancement and optimizations like build systems, minification, linting, tdd, etc.

6 - Also, most important of all: Module Loaders. Take a look at Require.js It is a very nice way to break JS into modules, and then load them all in an optimized way.

Hope that helps.

Body:
This is a very good question, and a common problem in advancing JavaScript architecture.

It sounds to me like you are describing the situation of "tight-coupling".

Once functions become objectified, the tendency is to reference these wonderful objects directly, from object to object, across namespaces even. Because it is easy right?

var Object1, Object2 = {};

Object1.somefunction = function(){
   //Tight Coupling!!
    Object2.functionCall();
}

It is easy, but these seemingly innocent hard-references gang up, to make you sad when you have to remove or replace objects. That happens a lot in JavaScript, so understanding tight-coupling is key to making a JS codebase maintainable.

Here are some other thoughts:

1 - If your objects are not already communicating by - triggering and listening to events; they should be. This is the solution to hard references.

2 - Design Patterns. There are many challenges that have already been solved out there, the standardized reusable solutions - are Design Patterns.

Understanding where the patterns are helps you focus on what solutions may make sense. One pattern for communicating across objects is called Publisher/Subscriber, or PubSub.

3 - These things help with maintainability: MVC with a router, Templates - data binding, AJAX - through a Proxy or Delegate objects.

4 - Look for frameworks and libraries that solve the cross-browser problems for you. Don't re-invent the wheels you don't need to know more about. Depending on your environment, some may frameworks may become obvious choices.

5 - Think about enhancement and optimizations like build systems, minification, linting, tdd, etc.

6 - Also, most important of all: Module Loaders. Take a look at Require.js It is a very nice way to break JS into modules, and then load them all in an optimized way.

Hope that helps.


问:
Web Page Execution Internals
My question is what is the subject area that covers web page execution/loading.

I am looking to purchase a book by subject area that covers when things execute or load in a web page, whether it's straight html, html and Javascript, or a PHP page.

Is that topic covered by a detailed html book, or should I expect to find information like that in a JavaScript of PHP book?

I understand that PHP and Perl execute on the server and that Javascript is client side, and I know there is a lot of on-line documentation describing , , , and so on. I'm just wondering what subject area a book would be in to cover all that, not a discussion of the best book or someone's favorite book, but the subject area.

答:
what is the subject area that covers web page execution/loading.

This is an excellent set of slides illustrating how to scrutinize every aspect of the web page execution and loading process.

Google, Chrome - DevTools.

Those tools are advancing rapidly.

While that is not a "subject area", there are many subject areas discussed, which may help you find what you are looking for.

Hope that helps.

Title: Web Page Execution Internals


问:
What are the best practices for rapid prototyping using exclusively HTML/CSS/JS
I'm developing a prototype of a web application. I want to only use HTML, CSS and Javascript. I prefer to use my text editor and not having to learn (or pay, for that matter) a new tool like Axure.

What would be, to your mind, the best practices? To me there are many qualities for a good prototype:

Quickly developed

Easy to improve

Fair fidelity as regards UX (this disqualifies tools like Omnigraffle or PowerPoint that are more dedicated to wireframing)

I trying to learn as quickly as possible, but I would like to know, based on your experience, on how you managed to be both quick and agile.

Reference:

http://www.boxesandarrows.com/view/prototyping-with

答:
*HOW TO RAPIDLY PROTOTYPE*

Some people are confused by this. Please bear with me, there are differing levels of  "velocity" when it comes to prototying, but there is only one that is the fastest - and it will always be the fastest, because it is closest to the level of interaction; and that is the browser.

How to rapidly prototype?

1 - Try to find all that there is to "Design-In-Browser"
     - Experts say that the best way to design front end is "to get to the code as fast as possible" - Chris Coyier.

2 - To be rapid means reuse.
     - Trick #1 to rapid prototyping is ~ "building components that can build onto the other component that you have already built."

Example:
     - This can be like Tabs proven in one page
     - Charts proven in another page
     - Then rich comboboxes proven in a third page

```<code> - In a fourth page, the three prior prototypes combine into a complex-component.

 Mixing - Components together, is key.
</code>```

3 - For pete's sake, if you are rapid prototyping - IT CAN BE SLOPPY. Please don't kid yourself that formatting code is going to be necessary. Rapid Prototypes are thowaway code, or evolving code, in either case this can be addressed or automated long after the prototype is reviewed. The point of the prototype is to determine architectural vitality. We are talking about Minimum Viable Product in most cases, so get working code on the page as fast as possible. This is just the Proof of Concept, not the proof in the pudding.

4 - I mentioned automation, A good IDE is really important - one with lots of hotkeys. "To rapidly prototype - your fingers need to be flying, not your mouse."
    - But there is more. Many IDE's will format your code for you. Many will lint while you work, finding errors as they are made, some can update your browser on save. Syntax highlighting. It is simple but effective.

Conclusion: Rapid Prototyping is a compilation of these type of best-practice traits. None of us are immediately rapid out of the gate: so it is an evolution process to pick up your speed. This is measured in Agile as velocity. You must think - how to go faster, then lean forward more.

**Incorporate every development optimization that you can over time.
**Build up libraries of prototyped widgets, technologies, and api graveyards.
**Then when the time comes, duplicate them, and mix them together - maintaining the originals while evolving something new.
**This is especially true for many JS frameworks.

Hope that helps.

Body:
*HOW TO RAPIDLY PROTOTYPE*

Some people are confused by this. Please bear with me, there are differing levels of  "velocity" when it comes to prototying, but there is only one that is the fastest - and it will always be the fastest, because it is closest to the level of interaction; and that is the browser.

How to rapidly prototype?

1 - Try to find all that there is to "Design-In-Browser"
     - Experts say that the best way to design front end is "to get to the code as fast as possible" - Chris Coyier.

2 - To be rapid means reuse.
     - Trick #1 to rapid prototyping is ~ "building components that can build onto the other component that you have already built."

Example:
     - This can be like Tabs proven in one page
     - Charts proven in another page
     - Then rich comboboxes proven in a third page

 - In a fourth page, the three prior prototypes combine into a complex-component.

 Mixing - Components together, is key.

3 - For pete's sake, if you are rapid prototyping - IT CAN BE SLOPPY. Please don't kid yourself that formatting code is going to be necessary. Rapid Prototypes are thowaway code, or evolving code, in either case this can be addressed or automated long after the prototype is reviewed. The point of the prototype is to determine architectural vitality. We are talking about Minimum Viable Product in most cases, so get working code on the page as fast as possible. This is just the Proof of Concept, not the proof in the pudding.

4 - I mentioned automation, A good IDE is really important - one with lots of hotkeys. "To rapidly prototype - your fingers need to be flying, not your mouse."
    - But there is more. Many IDE's will format your code for you. Many will lint while you work, finding errors as they are made, some can update your browser on save. Syntax highlighting. It is simple but effective.

Conclusion: Rapid Prototyping is a compilation of these type of best-practice traits. None of us are immediately rapid out of the gate: so it is an evolution process to pick up your speed. This is measured in Agile as velocity. You must think - how to go faster, then lean forward more.

**Incorporate every development optimization that you can over time.
**Build up libraries of prototyped widgets, technologies, and api graveyards.
**Then when the time comes, duplicate them, and mix them together - maintaining the originals while evolving something new.
**This is especially true for many JS frameworks.

Hope that helps.


问:
Steps to maintain a good bug database
Maintaining bug database is an important for every project. I am used to store the followings at bug database

Issue date time

Who is assigned to

Whether it has been solved or not

If solved then, solved date time

Is those enough to maintain a good bug database?

答:
A good bug database may have the followings

// Date Time Related

Issue date time of the bug

Expected fix/solve date time

If solved then, solved date time

// Assigned By + To

Assigned by (detected by)

Assigned To

// Bug behavior

Observed (buggy) behavior

Screen Shot (Is possible)

Complete steps to reproduce the bug

Expected behavior

// Priority

Priority of the bug

// Link, Status and Others

Link of related bugs

Status of the bug

Whether it has been solved or not

If solved then, how solved with explanation

EDIT: I also want to recommend

In what revision/branch was the bug discovered

In what revision/branch has the bug been fixed

EDIT: I like @jgauffin's comment

Wont fix, Not a bug, Duplicate, Solved

EDIT: A good bug database system also maintains

Responsibility assignment matrix

Title: Steps to maintain a good bug database


答:
There might be a number of custom fields that you may need to log, depending on the project needs. I came up with the following list that you may need to consider as well:

Issue DateTime of Bug/Defect

Description of the Bug - steps to re-create.

Environment where it found (Dev, QA, QC, Staging, Prod)

Screen-shot of the issue

Who logged it (detected by)

Whom is it assigned (assigned by)

Severity of the Bug (Low, Medium, High)

Expected resolution DateTime

State Triage (Proposed, In Progress, Resolved, Closed)

Bug is Closed DateTime - when a bug is resolved and closed

Assigned to be tested ( tested by )

Edit: Most of the common information that have value to be tracked are well-described in softwares like Bugzilla. Bugzilla is a Web-based general-purpose bugtracker and testing tool originally developed and used by the Mozilla project, and licensed under the Mozilla Public License- and is FREE. I would strongly advice take them as primary example and extend it upon your project needs.

Title: Steps to maintain a good bug database

Body:
Maintaining bug database is an important for every project. I am used to store the followings at bug database

Issue date time

Who is assigned to

Whether it has been solved or not

If solved then, solved date time

Is those enough to maintain a good bug database?


问:
Language Design: Are languages like Python and CoffeeScript really more comprehensible?
The "Verbally Readable !== Quicker Comprehension" argument on http://ryanflorence.com/2011/case-against-coffeescript/ is really potent and interesting. I and I'm sure others would be very interested in evidence arguing against this. There's clear evidence for this and I believe it. People naturally think in images, not words, so we should be designing languages that aren't similar to human language like English, French, whatever.

Being "readable" is quicker comprehension. Most articles on Wikipedia are not readable as they are long, boring, dry, sluggish and very very wordy. Because Wikipedia documents a ton of info, it is not especially helpful when compared to sites with more practical, useful and relevant info. Languages like Python and CoffeScript are "verbally readable" in that they are closer to English syntax. Having programmed firstly and mainly in Python, I'm not so sure this is really a good thing.

The second interesting argument is that CoffeeScript is an intermediator, a step between two ends, which may increase the chance of bugs.

While CoffeeScript has other practical benefits, this question specifically requests evidence showing support for the counter-case of language "readability"

答:
I think the Article has a point as far as JavaScript vs. CoffeScript is concerned.

I personally find JavaScript quite readable and I just do not see the point of sticking another layer of syntax on top.

I have similar experiences with Java/Groovy, Groovy is just great: highly expressive, cuts out a lot of useless tedious typing compared with Java, the "extras" like native SQL support are really worth having. BUT the last time I used it debugging was painful, you end up stepping through endless obscure internal Groovy classes before you get back to your own code.

Python on the other hand is a complete self supporting environment, it is it's own language and is not tacked on top of another language (although Python itself is written in C and has excellent integration with anything written in C or C++). It has its own debugger so for the most part you are debugging the python code you wrote.

The designers of Python obsess over the expressiveness of the language and consistency of syntax. Once you get the hang of it it is very readable. You genuinely write much less code in Python compared with using other languages to solve the same problem, and, well written Python code is clear and unambiguous.

The only downsides are that in common with most dynamic languages it does not play well with IDEs, and, all that lovely high level expressiveness is not interpreted into a lean mean execution.


答:
Most of the useful fields seem to have been covered already by other answers, but some that I find useful is:

In what revision/branch was the bug discovered.

In what revision/branch has it been fixed.

This is slightly more specific than at what date/time the bug was discovered/fixed.

If your software runs on several platforms (OS or hardware) you may also want a field that lists the platforms where the bug occurs.

But there's more to maintaining a bug database than what fields it should contain. You also need to consider how you use the base.

Try to keep the number of open/unresolved bugs as low as possible. This may seem obvious, but may be more difficult than expected, at least for larger projects. I often see people too afraid to close issues that are either non-reproducible or where lacking information is never provided by the original submitter of the issue. Also bugs that have been laying around forever and was last seen in ancient versions of the software should not be left laying around. This makes the database grow with issues that may or may not be real issues, and slows down development.

Title: Steps to maintain a good bug database


问:
What should and what shouldn't be in a header file?

What things should absolutely always/never be included in a header file?

Functions: what must go in the header file and what mustn't

Constants: Is it good practice to define lot of constants in a header file?

Any other good practices for C header files?

Example

I'm writing a parser for a documented industry standard format that has a lots of constants, is it a good practice to define them in a header file?

答:
Header file should have the following organization:

type and constant definitions

external object declarations

external function declarations

Header files should never contain object definitions, only type definitions and object declarations.

ContentLicense: CC BY-SA 4.0


答:
Robert C. Martin brings up the term "fragile design" in connection with SRP: The Single Responsibility Principle:

If a class has more then one responsibility, then the responsibilities
  become coupled. Changes to one responsibility may impair or inhibit
  the class’ ability to meet the others. This kind of coupling leads to
  fragile designs that break in unexpected ways when changed.

He defines fragility as:

Closely related to rigidity is fragility. Fragility is the tendency of
  the  software to break in many places every time it is changed. Often
  the breakage occurs in areas that have no conceptual relationship
  with the area that was changed. Such errors fill the hearts of
  managers with foreboding. Every time they authorize a fix, they fear
  that the software will break in some unexpected way.

As the fragility becomes worse, the probability of breakage increases with time,
  asymptotically approaching 1. Such software is impossible to maintain.
  Every fix  makes it worse, introducing more problems than are solved.

Such software causes managers and customers to suspect that the
  developers have lost  control of their software. Distrust reigns, and
  credibility is lost.

(Design Principles and Design Patterns)

The term "fragile" as a decription of a class occurs also in the fragile base class problem.

Title: What's the opposite of cohesive?


问:
Is Functional Programming possible in Java?
I was browsing through the Amazon.com Bookstore and I came across the book "Functional Programming for Java Developers".

I know some very basic Functional Programming and have been programming in Java for 3 years.

I would like to know is Functional Programming even possible in Java?

答: You're encouraged by the OpenJDK team to download their latest OpenJDK 8 binaries and play around with the new lambda expressions and the new functional idioms introduced in the Collections API (among others). You can program in a clear functional style. See "Functional programming in Java?" for a JDK8 Collections comparison with pre Java8 libs like Guava, FunctionalJava and LambdaJ.</p>


答:
You would often need to see the history of a bug _ it may be resolved, then reopened, then resolved again, etc. So, in addition to what has already been suggested, I'd advise you to have a separate table to keep track of the history of a bug each time it is (re)opened. The table would be in many-to-one relationship with the table of bugs and would likely have fields like:

Opened Date

Opened By

Resolved Date

Resolved By

Time Spent

How was resolved

etc.

You may also need a similar table to track to whom and when the bug was (re)assigned, especially if you work in a big team.

I also suggest you take a look at existing systems. IMHO Jira is one the best issue tracking systems. It has very rich features, and you could use some of those as a guide for your own system.

Title: Steps to maintain a good bug database


答: I find the argument about symbols and structure communicating more (and more quickly) than natural words quite compelling, but then my all-time favourite language is Scheme, so I would.</p>

Title: Language Design: Are languages like Python and CoffeeScript really more comprehensible?

Body:
The "Verbally Readable !== Quicker Comprehension" argument on http://ryanflorence.com/2011/case-against-coffeescript/ is really potent and interesting. I and I'm sure others would be very interested in evidence arguing against this. There's clear evidence for this and I believe it. People naturally think in images, not words, so we should be designing languages that aren't similar to human language like English, French, whatever.

Being "readable" is quicker comprehension. Most articles on Wikipedia are not readable as they are long, boring, dry, sluggish and very very wordy. Because Wikipedia documents a ton of info, it is not especially helpful when compared to sites with more practical, useful and relevant info. Languages like Python and CoffeScript are "verbally readable" in that they are closer to English syntax. Having programmed firstly and mainly in Python, I'm not so sure this is really a good thing.

The second interesting argument is that CoffeeScript is an intermediator, a step between two ends, which may increase the chance of bugs.

While CoffeeScript has other practical benefits, this question specifically requests evidence showing support for the counter-case of language "readability"