问:
How to retain student/intern programmers?
We have a small team in our department and typically employ 1-3 students/interns.  The problem we have is retention.  We like to hire a student that will stick around as part of the team for more than just a summer quarter.  The problem is though the last 4 students we hired, up front we discussed this with them and they all ended up leaving earlier than we would have liked.

The relationships all ended in a good fashion, the students either obtained teaching assistant or research positions within the university, or went on to bigger and better things.  This is all understandable and we do not hold it against them for doing what is best for them.

But my perspective is different as I worked within our department for 2 years during undergraduate at which point I was brought on full time upon graduation.

How can we retain students?  We give them hardware they need/want, we provide them with problems to solve in anyway they see fit (within reason).  All in all to me this type of job for a student programmer is so flexible and awesome I cannot see how anyone would want to leave.

Thoughts ?

答:
I worked as a student programmer as an intern at two different jobs while in school. I am now graduated and work with another company full time. (a third).

The main reason I didn't stick with those companies while as a student was because I didn't see an opportunity to move forward/up in the company. Also, they use one technology and didn't show any signs of expanding out.

As a student about to graduate you feel that you shouldn't make a commitment that easily because you don't want thousands of dollars and 4 years of school to go to one job where you will sit and get stale (even though that's the case a lot of times.) Security isn't in the minds of those kids yet, but it's not their fault.

Show them the company can grow, and they can grow with it in their careers, and show them you guys are open to new technologies and learning.


问:
US Software Patents
Hypothetical:
I’m based in the UK.  I’ve developed an application only to discover after it has gone live, that someone else has filed a US Patent application for similar software.  I don’t know if the patent will actually be granted, since the software-functionality has probably already existed long before now.  Definitely the business process has been done for many decades albeit manually or semi-manually.
What are my options?
I’m thinking

Assume the patent will fail and just carry on. But be prepared to stop shipping if and when they are granted the patent.

Assume it will be granted (because that what they normally do by default) and stop selling the application now; and offer refunds to those already purchased.

Open the source.  Make my source code open-source and free to amend etc. But copyrighted.  Then I could at least continue and get cred for giving the software away free and revenue for improving or customising the application for individuals.

答:
If you've shipped before the patent was granted and can show that your application was in development before the patent was requested, then your application is prior art and invalidates their patent. That's my layman's understanding, anyway- after all, you can't protect an idea as your original idea that you should own and nobody has devised before, if you aren't the first to come up with it.

However, as Wooble pointed out, if you aren't prepared to go to court to defend yourself in the United States, then the validity or not of the patent could be quite moot.

You could attempt to interfere with the patent filing. The US Patent office must have a procedure for patent disputes before they're filed. If you could prevent the patent from being granted in the first place, you'd be better off.

ContentLicense: CC BY-SA 3.0

Title: US Software Patents


答:
We can't give out legal advice here.  I can tell you, the legal advice I've seen online indicates that lawyers generally tell developers not to look into software patents because, at least in the US, if you knowingly infringe then courts will award punitive damages of 3 times the regular damages awarded in a lawsuit.

So, now that you know about the patent application, you might have changed the game.

However, if it's not a patent yet, then you can sell it.  My understanding is that once the patent is granted they can go and get an injunction against you so you can't sell it, or something like that.  But IANAL.

You could go ask an IP lawyer.  I've talked to them before.  They're expensive, but depending on how much business you intend to do, it might be worth the money.

Title: US Software Patents

Body:
Hypothetical:
I’m based in the UK.  I’ve developed an application only to discover after it has gone live, that someone else has filed a US Patent application for similar software.  I don’t know if the patent will actually be granted, since the software-functionality has probably already existed long before now.  Definitely the business process has been done for many decades albeit manually or semi-manually.
What are my options?
I’m thinking

Assume the patent will fail and just carry on. But be prepared to stop shipping if and when they are granted the patent.

Assume it will be granted (because that what they normally do by default) and stop selling the application now; and offer refunds to those already purchased.

Open the source.  Make my source code open-source and free to amend etc. But copyrighted.  Then I could at least continue and get cred for giving the software away free and revenue for improving or customising the application for individuals.


问:
Do you do any validation on directories when recursively deleting them?
How do you recursively delete paths of the data that your app created?

The deleting process itself is trivial. The question is, do you do extra validation? And if so, what kind?

From one point of view, maybe it's simply an uncomfortable task to do, but on the other, imagine if the program has a bug and something passes "c:\" to the recursive function, or if there is a memory overflow and some data becomes corrupt, causing paths you work on to be truncated etc.

Is there even a way to do a clean validation?

答:
I would suggest that you use a thread safe stack to keep track of all of the specific temporary files and directories that you created and in what order.

After completion of processing (or during exception handling), you then have a complete list of actions to perform (in reverse, hence using a stack) to roll back to the previous clean state.

Note that only files and directories you actually create should go on your clean up list. If you go to create C:\Temp\MyApp, and it already exists, you shouldn't try to delete it afterwards after, even if you normally would. It is possible that someone may have placed other data that you didn't generate in that directory.

Overall, you should be very careful about deleting temporary files and directories, especially if you are doing so recursively and even more especially if they are out side of the OS temp directory.

If you are not absolutely sure that you created something, you are better off not deleting it.

A user might get annoyed with a few extra temporary files that you didn't properly clean up, but they are likely to be angry if you delete files they actually wanted to keep.

Also, if a bug in your application causes all of the users data files to be deleted, you could be considered professionally negligent and in some places that might be lead to an actionable legal case for damages.


问:
Why do websites have to ask language and country when the browser can tell them that?
So, why do websites have to ask (spoken) language and country when the browser can tell them that?

Edit:
Specifically, I mean why not use the accept-language section in the http header, set by the language settings in the browser, not based on the IP address.  This question focuses the websites that put up a wall, forcing the user to select a language before using the website, that should instead make available an easily accessible setting.

Edit:
This is a user experience question, focused on the point that the user should have set the language settings in the browser when they first set up their computer (if the user is smart enough, or can ask someone smart enough).

答:
Simple example: I'm living in Flanders (Dutch speaking Belgian part) and when visiting ibood (an internet store) I'm presented with a country choice.

How could they know my choice?

Browser language? I prefer to see all my programs in English, not Dutch.

Country language? Do you show it in Dutch, French or German? All three are correct.

In fact, this often leads to websites forcing me to see a website in French. Games for Windows live comes to mind, I haven't even found a way to change my language to Dutch.

In my opinion it's best to let the user choose once and remember it.


问:
A modern review of Java
I've been programming for a few years and I began in Java, and in my time I've found many different sources claiming Java to be an inferior language in some way or another. I'm well aware that each language has it's strengths and weaknesses, but a lot of things I've read about Java seem to be dated.

The most often cited reason for Java being inferior is that it is much slower than other natively compiled languages, like C++ for example. Many people criticize the game designer Notch (who developed Minecraft) for using Java because of its apparent lack in the performance department. I know Java was much slower back in the day, but there have been many improvements since, especially JIT compilation.

I would like to get some objective opinions of Java as a language today. So my question has 4 parts.

Performance.

a. How does Java's speed today compare to C++?

b. Would it be possible to create a modern AAA title using Java?

c. In what areas specifically is Java slower than C++, if at all? (i.e. Number-crunching, graphics, or just all around)

Is Java now considered a compiled language or interpreted language?

What are some major shortcomings of Java that have been addressed since the early days?

What are some major shortcomings of Java that have yet to be addressed?

Edit:

Just for clarification purposes I'm not making this Java vs C++, obviously on average c++ will be a little faster than Java. I simply need something to compare Java to in terms of maturity as a language at this point in time. Since c++ has been around forever I thought I would be a good point of comparison.

答:
a. How does Java's speed today compare to C++?

Difficult to measure. It's worth noting that a major part of the speed of an implementation, it's memory allocator, are very different algorithms in Java and C++. The non-deterministic nature of the collector makes it extremely difficult to obtain meaningful performance data in comparison to the deterministic memory management of C++, because you can never be certain what state the collector is in. This means that it's very hard to write a benchmark that might meaningfully compare them. Some memory allocation patterns run much faster with a GC, some run much faster with a native allocator.

What I would say, however, is that the Java GC has to run fast in every situation. A native allocator, however, can be swapped out for one that's more appropriate. I recently fielded a question on SO about why a C# Dictionary could execute in (0.45 ms on my machine) compared to an equivalent std::unordered_map which executed on (10ms on my machine). However, by simply swapping out the allocator and hasher for more appropriate ones, I cut that execution time to 0.34ms on my machine- a thirtieth of the original run-time. You could never, ever hope to perform that kind of custom optimization with Java. An excellent example of where this can make a real difference is threading. Native thread libraries like TBB provide thread-caching allocators which are massively faster than traditional allocators when dealing with many allocations on many threads.

Now, many people will talk about JIT improvements and how the JIT has more information. Sure, that's true. But it's still not even remotely close to what a C++ compiler can pull- because the compiler has, comparatively, infinite time and space in which to run, from the perspective of the run-time of the final program. Every cycle and every byte that the JIT spends thinking about how best to optimize your program is a cycle that your program isn't spending executing and can't use for it's own memory needs.

In addition, there will always be times where compiler and JIT optimizations cannot prove certain optimizations- especially in the case of things like escape analysis. In C++, then as the value is on the stack anyway, the compiler doesn't need to perform it. In addition, there are simple things, like contiguous memory. If you allocate an array in C++, then you allocate a single, contiguous array. If you allocate an array in Java, then it's not contiguous at all, because the array is only filled with pointers which could point anywhere. This is not only a memory and time overhead for the double indirections, but cache overheads as well. This kind of thing is where the language semantics of Java simply enforce that it must be slower than equivalent C++ code.

Ultimately, my personal experience is that Java could be about half the speed of C++, on average. However, there's realistically no way to back up any performance statements without an extremely comprehensive benchmark suite, because of the fundamentally different algorithms involved.

b. Would it be possible to create a modern AAA title using Java?

I assume that you mean "game", here, and not a chance. Firstly, you'd have to write everything from scratch yourself as nearly all the existing libraries and infrastructure target C++. Whilst not making it impossible per se, it could certainly contribute solidly towards unfeasible. Secondly, even the C++ engines can hardly fit in the tiny memory constraints of existing consoles- if JVMs even exist for those consoles- and PC gamers expect a little more for their memory. Creating performant AAA games is hard enough in C++, I don't see how it could be achieved in Java. Nobody has ever written an AAA game with significant time spent in a non-compiled language. More than that, it would simply be extremely error-prone. Deterministic destruction is essential when dealing with, for example, GPU resources- and in Java, you'd basically have to malloc() and free() them.

c. In what areas specifically is Java slower than C++, if at all?
  (i.e. Number-crunching, graphics, or just all around)

I'd definitely go for all-around. The enforced-reference nature of all Java objects mean that Java has far more indirection and references in it than C++ does- an example I gave earlier with arrays, but also applies to all member objects, for example. Where a C++ compiler can look up a member variable in constant time, a Java run-time has to follow another pointer. The more accesses you do, the slower this is gonna get, and there's nothing the JIT can do about it.

Where C++ can free and re-use a piece of memory almost instantly, in Java you have to wait for the collection, and I hope that piece didn't go out of cache, and inherently requiring more memory means lower cache and paging performance. Then look at the semantics for things like boxing and unboxing. In Java, if you want to reference an int, you have to dynamically allocate it. That's an inherent waste compared to the C++ semantics.

Then you have the generics problem. In Java, you can only operate on generic objects through run-time inheritance. In C++, templates have literally zero overhead- something Java can't match. This means that all generic code in Java is inherently slower than a generic equivalent in C++.

And then you come to Undefined Behaviour. Everyone hates it when their program exhibits UB, and everyone wishes that it didn't exist. However, UB fundamentally enables optimizations that can never exist in Java. Take a look at this post describing optimizations based on UB. Not defining behaviour means that implementations can do more optimizations and reduce the code required to check for conditions that would be undefined in C++ but defined in Java.

Fundamentally, the semantics of Java dictate that it is a slower language than C++.

Is Java now considered a compiled language or interpreted language?

It doesn't really fit into either of those groups. I'd say that managed is really a separate category on it's own, although I'd say it's definitely more like an interpreted language than a compiled language. More importantly, there pretty much only are two major managed systems, the JVM and the CLR, and when you say "managed" it's sufficiently explicit.

What are some major shortcomings of Java that have been addressed
  since the early days?

Automatic boxing and unboxing is the only thing I know of. The generics solve some issues, but far from many.

What are some major shortcomings of Java that have yet to be
  addressed?

Their generics are very, very weak. C#'s generics are considerably stronger- although of course, neither is quite templates. Deterministic destruction is another major lack. Any form of lambda/closure is also a major problem- you can forget a functional API in Java. And, of course, there's always the issue of performance, for those areas that need them.

Title: A modern review of Java


问:
Are there still any companies/academic centers that use mainframes from 60s-70s?
As a young software engineer, I often hear other colleagues talk about the days of punch cards and "computers as big as the room."

The earliest memories of computers that I have involve MS DOS and Windows 3.1.

My question is, are there still any companies, academic centers, or government agencies that still use mainframes from the 1960s-70s in their daily operations?

If so, can you think of a place that would allow visitors to observe such a machine at work? I know that there are several museums out there that possess such pieces, but I cannot think of a functioning one.

答:
The business of our company (a car rental company) is based on a mainframe, originally installed in 1972. There is no signs of it being replaced in the near future - it would cost an enormous sum of money and several years of effort.

One of my previous employers (an airline company) also had a mainframe as the backbone of its operations. They started to work on its replacement a couple of years ago, but I don't know where they are currently.

So yes, there are lots of them still in use, especially at banks. Since typically these run business critical systems, without which the whole company shuts down, they are tucked away in safeguarded data centers. Therefore, unfortunately I don't think they accept visitors from the outside world in most of these places.


答:
NASA at the very least. The retired space shuttles ran the same computer programs and equipment from initial commission. If I remember correctly, they had about 32K of RAM.

The reason they did this was that the software and hardware was known to be bug free, upgrading or changing equipment/software might have introduced life threatening bugs or have been prohibitively expensive to produce to such a high degree of bug free-ness.

Title: Are there still any companies/academic centers that use mainframes from 60s-70s?

Body:
As a young software engineer, I often hear other colleagues talk about the days of punch cards and "computers as big as the room."

The earliest memories of computers that I have involve MS DOS and Windows 3.1.

My question is, are there still any companies, academic centers, or government agencies that still use mainframes from the 1960s-70s in their daily operations?

If so, can you think of a place that would allow visitors to observe such a machine at work? I know that there are several museums out there that possess such pieces, but I cannot think of a functioning one.


问:
Why shouldn't "responsive" web design be a consideration?
This might seem like more of a graphic design question than a programming question, but I think it has much more technical/programming merit than actual graphic design.

The concept of "responsive" web design revolves around using media queries in CSS3 to detect the size of the viewing device and adjust the CSS rules accordingly - essentially, dynamic CSS. This fills the void on a lot of deployment cases - mobile, in particular.

I think use of media queries is surfacing slowly (I've found that many people don't really know about it), but I'm wondering if there is a reason for slow adoption. Is it impractical for web applications? Is there something I'm missing that might be a fundamental pitfall?

答:
You have to jump through hoops to get it to actually work. For a site I'm developing I used @media (max-width:800px) to define a stylesheet for phones and other smaller screens. But it wasn't being used by e.g. iPhone.

Turns out that phone browser developers assume that people won't take small screens into account so they lie to the rendering engine (iPhone claims to be more than 900px wide, for example) unless you put in an extra meta-tag to tell it not to lie. When it gets to the point that you're fighting the browser implementers you start to wonder whether it's worth the effort.


问:
Do you sign each of your source files with your name?

Possible Duplicate:

  How do you keep track of the authors of code?

One of my colleagues is in the habit of putting his name and email address in the head of each source file he works on, as author metadata.  I am not; I prefer to rely on source control to tell me who I should be speaking to about a given set of functionality.

Should I also be signing files I work on for any other reasons?  Do you?  If so, why?

To be clear, this is in addition to whatever metadata for copyright and licensing information is included, and applies to both open sourced and proprietary code.

答:
It is standard for us to put our name in the source code and additionally, if we modify it, to mark those changes with a change number and our name against that change number. </p>

<p>TBH, this is the sort of thing that I would have expected to see in in-house coding standards. </p>

Body:
It is standard for us to put our name in the source code and additionally, if we modify it, to mark those changes with a change number and our name against that change number.

TBH, this is the sort of thing that I would have expected to see in in-house coding standards.


答:
No, I don't. However, any mandated headers (a particular company-standard header comment is part of the coding style guidelines) are included, so if they require this as part of them, then I would. If you don't have project, program, or corporate coding styles, then you should, and any mandated file header comments should be clearly defined.

Like you said, version control should be managing this. When other people touch the file, are they supposed to update a field that's already automatically tracked by version control, which identifies exactly what was changed and who made the change between every version? That just seems like overhead, especially if a developer forgets to update that and future developers go by the header rather than looking in version control.

Title: Do you sign each of your source files with your name?

Body:
Possible Duplicate:

  How do you keep track of the authors of code?

One of my colleagues is in the habit of putting his name and email address in the head of each source file he works on, as author metadata.  I am not; I prefer to rely on source control to tell me who I should be speaking to about a given set of functionality.

Should I also be signing files I work on for any other reasons?  Do you?  If so, why?

To be clear, this is in addition to whatever metadata for copyright and licensing information is included, and applies to both open sourced and proprietary code.


答:
I don't do this, specifically as you said because it is tracked in source control.  Any time information like this is kept in two places (source control, and the file itself as you said), they will become out of synch.  Since source control automatically adds the information, I don't think there's any reason to include it directly.

That being said, if there's something that's non-obvious that you're adding, or may warrant further discussion, I think it's worthwhile adding comments around a block of code indicating the change made and why with your name.


答:
Not really, no. There are a couple of reasons why:

Your version control system (VCS) stores this metadata already. E.g. each commit in git has a field for the name who made the commit. Competent version control systems allow you to see who made a change on a specific lines of code as well. That functionality is usually called blame which is a misnomer as, instead of finding someone to do actual blaming on, it is most useful for finding someone to talk with about a problem you have in the context of the piece of code).

I've seen some header comments that have history log as well, but that can easily be extracted from a VCS as well.

It discourages code collaboration. "Hey, someone made this... maybe we shouldn't touch his code". If there is no sole code ownership on some source code file then the higher chance that someone else will change it, which in turn facilitates and enables refactoring.

What about copyright notices?

Though for the sake of copyright you might want to add the company's name as the copyright holder in the header comments (aka copyright banner). If it's an open source project then it is often the name of the maintainer organization or just one maintainer instead. However it is now common practice to put this information in text files at the root of the project. You can see these text files done on open source projects with names such as README, LICENSE, and/or CONTRIBUTORS.

What about database scripts?

You could argue you need to do history logs in header comments with database SQL scripts though lately with database migration tools has made this an obsolete practice. Database migration tools usually keep track of which migrations were run and can do rollbacks as needed. These tools are more flexible to use than a text file.


问:
Scrum re-estimation of stories
Every day, after the stand-up, my team and I update our estimates for each story. I have a feeling that there is something wrong with the way we do it, so I need your help.

This is how we do:

Story A estimate: 24 hours (8 hours per day - we use "ideal days" as the measure)

Day N: developer starts working on Story A in the morning (8 hours of work completed by the end of the day)

Day N+1: Story A re-estimation = 16 hours (one workday taken out of Story A, from day N)

Day N+2: Story A re-estimation = 8 hours (one workday taken out of Story A, from day N+1)

Day N+3: Story A should be done by now. But it's not. The developer reckons it
will take another 3 hours to finish. We update the story on the whiteboard
and burndown accordingly.

Day N+4: Story A took the whole day to be finished instead of only 3 hours! Now it's done. The difference, 5 hours, is completely unaccounted for in our planning.

How should we be daily re-estimating our stories?

答:
The difference, 5h, is completely unaccounted for in our planning.

Yes, it is accounted for implicitely because the following tasks are delayed. If there was a burndown chart just for that developer, you'd notice that the curve has remained "flat" for one day while it would have gone down if the developer had finished it early enough to take on another task.

There's nothing wrong with the way you're re-estimating during daily meeting, re-estimation is more about figuring out if we can make it for the end of the sprint than it is about tracking the exact lateness of each task. All you need in Scrum to be able to adjust your plan on a daily basis is something that indicates Sprint progress and how far you are from meeting the Sprint goal (typically, a burndown chart).

Title: Scrum re-estimation of stories


答: You can watch a Zuse Z3 in the museums in Munich and Hünfeld, Germany. It's the first fully functional, program controlled (freely programmable) computer of the world.</p>


答: A lot of air traffic control systems use Univac systems.</p>


答: git blame (or svn blame if you must) is a much better tool for deducing code "ownership" than a one-liner at the top of a file, especially after a project has grown a few whiskers.


答: In my company, we use a standardized header with a copyright note for our company name, and keyfields for the version control, like Revision, Date, Id</p>


答:
Should I also be signing files I work on for any other reasons? Do
  you? If so, why?

There is a reason for putting your name in your files. The book "The Pragmatic Programmer" encourages it, because the authors assume that you'll write better code when your name is written on it, so you can take pride in your work. Programmers wouldn't want to sign messy pieces of code, would they?

Well, here's where reality strikes. Most of the times, only the initial author is in the files and like others here stated, this information will be out of synch soon. And it does not prevent messy code. Most just ignore the fact that their name is listed in the file's header. This isn't a very pragmatic advice at all, from an otherwise excellent book, although to some people it may make a difference.

Another reason for keeping your name in the files is when you want to publish source code, for example for an open source project. This can be seen as some sort of advertisement.

But in most cases, this information is merely redundant noise.


答:
My IDE automatically puts usernames at the top of files when you create a new class. It's kind of annoying actually, because we just ignore that header.

hm, maybe we should institute a new coding standard where everyone has to turn that off in the preferences of their IDE and/or delete the automatic header...


答:
When I was working at RAF Filingdales in the mid 90's, on the Ballistic Missile Early Warning System there, we were told that they couldn't directly connect anything but the original mainframe to the radar array, as it would be considered a violation of a strategic arms treaty governing the use of the early warning radar system.

I'm not now convinced that this was true, given the current National Missile Defence upgrade, but the original CDC-Cyber mainframe could still be in use if the NMD project has not yet been completed.

Certainly RAF Filingdales is not somewhere you should expect to get into legally without government vetting, though you could always join the CND instead. *8')

Given my doubts, I have created a question on skeptics: Are the computers connected to missile early warning systems limited by international treaty?.


问:
When writing a library, how much should the end user do?
First off, this question goes beyond my example (don't want this to be too localized or migrated to Stack Overflow) but I've come across this when thinking about something I wanted to try in C so I thought I'd use that as an example.

So my idea is to create a generic linked list in C and started it last night and it is coming along pretty well for being new in C. The issue I ran into is type casting and it leads me to this question: how much work should a library designer expect the end user to do when using the library?

If you take my example, right now, I don't perform any casts and return an Object (which is a typedef of void*). Is it reasonable to make sure that the end user keeps track of their types or should the library designer make sure that the list is type safe (I think I have a general idea on how to implement that for at least the built in data types)? Is it reasonable, when designing a library to expect a certain amount of work on the end users part to use the library or should it be dumbed down as much as possible? Are there factors that would affect this decision, such as language?

答:
Your library should be considered to be a black box. The user of the library should not have to have any prior knowledge going into the process. They should be able simply to call the methods in the library with the following understanding:

```<code>Calling method X with parameter Y produces Z
z = x(y);
</code>```

They should know the type going in as a parameter and they should know the type coming out as a parameter. The user should not be required to have any inside knowledge of your library or how it produces the type, only that the type being produced is what is expected.

Body:
Your library should be considered to be a black box. The user of the library should not have to have any prior knowledge going into the process. They should be able simply to call the methods in the library with the following understanding:

Calling method X with parameter Y produces Z
z = x(y);

They should know the type going in as a parameter and they should know the type coming out as a parameter. The user should not be required to have any inside knowledge of your library or how it produces the type, only that the type being produced is what is expected.


答:
Who the library is for is definitely a consideration. If the library is for use by other people in your team, then I wouldn't call it unreasonable to expect a little bit of extra work on their part to use it (type casts and such. Perhaps some less leniency on data coming in to functions and the like).

If the library is for public use, I would expect to reduce the amount of work required as much as possible, to reduce the "difficulty" of using it.

Title: When writing a library, how much should the end user do?

Body:
First off, this question goes beyond my example (don't want this to be too localized or migrated to Stack Overflow) but I've come across this when thinking about something I wanted to try in C so I thought I'd use that as an example.

So my idea is to create a generic linked list in C and started it last night and it is coming along pretty well for being new in C. The issue I ran into is type casting and it leads me to this question: how much work should a library designer expect the end user to do when using the library?

If you take my example, right now, I don't perform any casts and return an Object (which is a typedef of void*). Is it reasonable to make sure that the end user keeps track of their types or should the library designer make sure that the list is type safe (I think I have a general idea on how to implement that for at least the built in data types)? Is it reasonable, when designing a library to expect a certain amount of work on the end users part to use the library or should it be dumbed down as much as possible? Are there factors that would affect this decision, such as language?


答:
1) Strictly talking about the UX I get with Java, it feels slow. I can't tell you why really. I have yet to come across a Java based desktop application, that doesn't feel slow and has a faster non-Java alternative. That being said, Java can be very fast in pure computational speed and the internet is full of benchmarks to prove that. However the boot time of Java apps and the responsiveness of their GUIs has yet to improve IMHO. Maybe you could do it ;)

In the end, speed is not so much of an issue. Not only is hardware getting faster and faster, it's also that most people still care surprisingly little for it as long as the software does, what it should do and the ratio of time spent interacting vs. time spent waiting is reasonable.

2) This distinction has become so blurry lately, that there's really little value to it.

3+4) There have been quite some changes to Java actually. Some people argue already, that these changes have tainted Java's purely simplistic philosophy by bolting on alien features. It's really hard to say objectively, what a shortcoming is, and what a strength is. To me, Java is unnecessarily verbose, restrictive and poor in features, while other people consider these very traits as a pleasant unambiguity, safety and clarity.

So while it is these things, that personally make me not use Java, I do not think simply adding the things I miss in Java is a good idea. There's a lot of languages I like running on the JVM and bending Java to be closer to them would just defeat Java's purpose.

It's a matter of preference

The thing with Java is, that it is designed to prevent you from shooting yourself in the foot. A noble cause, but with all the restrictions it straps onto you, it is not unlikely, that you trip over one of your safe feet, can't brace yourself with your hands being tied behind your back for your own safety and finally die, because you break your skull. :D

In a way, Java was a response to C++, which gives you enough rope to not only hang yourself, but also the rest of the world. It's all that rope, which makes it so attractive for cowboys. All that freedom and all that power.

So simply put, this is really just a matter of preference.

But, a point is, with C++ as an alternative to Java, you're free to choose your own restrictions. Or to really go nuts with all the control you have, risking to utterly confuse your peers:

I saw `cout' being shifted "Hello world" times to the left and stopped
  right there.

      — Steve Gonedes

Java chose not to offer operator overloading, for that very reason. Of course this prevents people from obfuscating their code by multiplying function pointers with lists. But at the same time it prevents other people to perform geometric/algebraic calculation with the usual operators. (v1 * v2 / scale) + (v3 * m) really is a lot clearer than v1.multiply(v2).divide(scale).add(v3.multiply(m)). I see why this can put off people who deal with 3d graphics and calculation.

Java chose to impose garbage collection, whereas in C++ you can choose. You can really dig all the way down and get close to the hardware. You can pack data densely into structs. You can perform dark magic, such as the fast inverse square root. You can perform some of the most convoluted and cryptic metaprogramming on earth using templates. But it also means, you can get lost and spend hours debugging all the mess you created or looking over absolutely unhelpful compiler errors.

But if you have the discipline to only use the parts of the language you really master, you can write C++ code just as safely as Java code, but you have the option of gradually pushing forward.

So while nothing technically prevents you from writing cutting edge software with Java, you will find that many developers really passionate about writing great software and having fun and evolving while doing so move on beyond what Java has to offer as a language.

But the world doesn't consist only of people set out do create the next big thing or only of people who will restrict the usage of the power given to them only as far as they control it. IMHO Java is the perfect match for people who want to produce stable results in a comfortable manner.

Title: A modern review of Java

Body:
I've been programming for a few years and I began in Java, and in my time I've found many different sources claiming Java to be an inferior language in some way or another. I'm well aware that each language has it's strengths and weaknesses, but a lot of things I've read about Java seem to be dated.

The most often cited reason for Java being inferior is that it is much slower than other natively compiled languages, like C++ for example. Many people criticize the game designer Notch (who developed Minecraft) for using Java because of its apparent lack in the performance department. I know Java was much slower back in the day, but there have been many improvements since, especially JIT compilation.

I would like to get some objective opinions of Java as a language today. So my question has 4 parts.

Performance.

a. How does Java's speed today compare to C++?

b. Would it be possible to create a modern AAA title using Java?

c. In what areas specifically is Java slower than C++, if at all? (i.e. Number-crunching, graphics, or just all around)

Is Java now considered a compiled language or interpreted language?

What are some major shortcomings of Java that have been addressed since the early days?

What are some major shortcomings of Java that have yet to be addressed?

Edit:

Just for clarification purposes I'm not making this Java vs C++, obviously on average c++ will be a little faster than Java. I simply need something to compare Java to in terms of maturity as a language at this point in time. Since c++ has been around forever I thought I would be a good point of comparison.


问:
How to best approach planning and budgeting of software performance optimization efforts?
There is a software system that has been with the client for some time now. If is feature-rich, mature, complex enterprise application that client uses in production. Due to the rapid expansion of the client's business the software system in subject cannot handle the volumes efficiently and overall performance does not satisfy the customer anymore.

So the customer asks the vendor of the software system for improvements in performance and efficiency of the system. The customer also expects the vendor to prepare a plan and ballpark budget so the cost of such optimizations is roughly known upfront.

What do you think is the best approach for such plan and high level budget that one could prepare for the customer? I'm asking the question because I've seen some of this kind of plans before and they are usually very vague and imprecise mainly due to the fact that such exercise is kind of chicken and egg dilemma. In order to know what exactly should be optimized and tuned in complex system the benchmarking, profiling and research is required. And that investigation is also the part of the planned project, so it is impossible to know upfront what efforts can such benchmarking results require to implement improvements.

答:
I would be honest with them. If they plan to fund this, and it indeed will take a lot of time to find the performance issues, tell them it should be funded in two stages. First scope out the work needed to perform investigation, benchmarking, and analysis. The end result of that effort can be a proposal for what areas need to be optimized. Find where the most bang-for-the-buck is. This might be optimizing a function or refactoring/changing the system's architecture. You can evaluate the risk/reward and decide how much risk you/they are willing to take for how much performance gain.

If they're not willing to pay for the first phase, you may have to fund it yourself as part of doing proposal/analysis type work.

Then you can be better prepared to give them options for phase 2 -- actually optimizing the performance. You'll have sound recommendations and be able to actually provide some kind of estimates.


答:
What I've found to be most effective is:

Size stories by points (or T-shirt sizes.)

Re-estimate any story in the product backlog at any time (but especially right before sprint planning.)

Do not re-estimate stories that are scheduled for this sprint -- feel free to bring up concerns at standup, but do not change the estimates.

Use yesterday's weather to schedule sprints

If stories are entering the sprint with bogus estimates, pre-sprint planning re-estimates will let you fix them before they become an issue. If stories are taking longer than expected because the team is too optimistic, yesterday's weather will keep you on track.

Daily re-estimates of what's remaining tend to be totally bogus, as you described in your question. Work completed/remaining is a bogus number designed to make it look like you're working "hard enough". Far better is to ask, "When do you think you'll be done," and make clear that if there's an issue with a story, that the team will step up to help.

Title: Scrum re-estimation of stories

Body:
Every day, after the stand-up, my team and I update our estimates for each story. I have a feeling that there is something wrong with the way we do it, so I need your help.

This is how we do:

Story A estimate: 24 hours (8 hours per day - we use "ideal days" as the measure)

Day N: developer starts working on Story A in the morning (8 hours of work completed by the end of the day)

Day N+1: Story A re-estimation = 16 hours (one workday taken out of Story A, from day N)

Day N+2: Story A re-estimation = 8 hours (one workday taken out of Story A, from day N+1)

Day N+3: Story A should be done by now. But it's not. The developer reckons it
will take another 3 hours to finish. We update the story on the whiteboard
and burndown accordingly.

Day N+4: Story A took the whole day to be finished instead of only 3 hours! Now it's done. The difference, 5 hours, is completely unaccounted for in our planning.

How should we be daily re-estimating our stories?


问:
Is SCRUM Methodology a good technique to go with in crucial deadline project?
I am just join a firm and they are working in a (their called) SCRUM methodology, They have very sharp deadline and the project development doesnt seems to have any direction or neither it is looking like (This is what we want.) I am developing a module which doesnt have Database, neither I have any information which needs to linked to this module, the people who are linked to the modules and messed up with their own work because which I am not able to get their support in it.

Now could anyone suggest me that is this the good way to go ahead in this methodology, which doesnt contain any DB table for to be developed module?

Please Suggest Something..

Thanks

答:
It looks to me like you are in an environment that is not proper scrum.

the project development doesnt seems to have any direction or neither it is looking like (This is what we want.)

In Scrum, you are supposed to have a "Product Owner", who defines what the product is supposed to do, and is available to answer detailed questions about how it should work. If you have no direction, your Product Owner is either missing, or not doing their job.

I am developing a module which doesn't have a Database, neither do I have any information which needs to linked to this module, the people who are linked to the modules and messed up with their own work because which I am not able to get their support in it.

While lack of a database is not, in and of itself an issue, your question reveals some serious issues in your company's Scrum implementation. In Scrum, stories should be about functionality, and should be developed in "vertical slices", adding whatever infrastructure is needed to enable the functionality. If you have no database, and no support on other modules that you are supposed to link to, it sounds to me like the project has been sliced "horizontally". An app developed using Scrum should start very thin, and fatten up with features.


答: The State of Michigan driver's license system still runs on a 1970s mainframe.</p>


问:
What is the best strategy for quickly implementing small business applications?
I'm not a software developer, but I have previously developed a project-specific Access application for another employer. My current employer would like me to help organize their workflow and data for an upcoming project, and I was considering using Access again. In previous projects the staff used large piles of Excel spreadsheets; now they would like to keep their data more organized as well as automate some processes.

I've found that it is difficult to create forms in Access that are pleasant and usable, due to the limited control over forms. Are there better options for quickly developing a business application, such as MS LightSwitch, Delphi, or .NET?

The team that will be using the application is small - less than five users.

答:
Have you considered using Google Docs?

Seriously, some of the online collaboration tools are pretty good nowadays and suffice for most small business purposes.

For example, a customer sales pipeline can pretty easily be managed with a single shared spreadsheet on Google Docs.

More importantly, using an existing or even free online application is an awful lot easier than writing, maintaining and hosting your own applications on an ongoing basis.

Surely running your business is more important than spending time building custom back-office applications?


问:
How do I deal with a slow and undedicated colleague in the team?
I have been working on a new project. The project works like this: The end user can access a webapp using a link and he can add multiple systems on his network and manage that particular systems details. My part involves the front end and the webserver, which is done in python. My python actually communicates with another project which is entirely done in c & c++. The c/c++ project is the main app which does all the functionality. My python sends the user request to it and displays the response from it to the user.

I am very familiar with my work and I will finish it soon. Since that's not much work in it. And I am a person who loves to work. I spends most of the time in office and only go home when I feel sleepy.

The c/c++ app is managed by another colleague who has 5+ year experience and can do things much faster than me, but he never does it. May be he doesn't like to do it. His app crashes often when my python communicate with it or returns wrong values. It's full of bugs. Since my app depends on it, I am having a hard time building it. Instead of fixing the bugs, he asks me to slow down my work. He asks me to tell manager that my work needs a lot of time. He is asking me to fool the manager and even forcing me to work slowly like him.

During project meeting, when manager asks him about the bugs he says that he fixed everything and it works fine. Since he is my colleague, I couldn't tell anything to the manager. I obviously need to have a good relationship with my colleagues more than my manager, since most of the time we will be with our colleagues, not with the manager.

I am not able to tell the manager anything regarding this, since if manager asks him why, then he may think I complained about him to the manager. And he keeps on lying in the meeting. And since he fixes the bug slowly, it even slows down my work. Now I thought of working on the front-end part of my app  and finishing it off so that in the mean time he can make his project stable. Now he is asking me to tell the manager that my front end part require a lot of work and I may need more and more time, simply so that he can drag the project down. And the sad thing is our actual manager has gone to the US, so we have a temporary manager and this guy doesn't know about the project much, so the c,c++ just fools him.

Can anyone suggest me how I deal with this?
I wanted to finish off the project soon. How can I make him work even by maintaining a good relationship with him?

Responses to comments:

If he's really deliberately misleading the company, you should report him to management.

I am new to this company and the other guy has been there for many years. And I have just started knowing my colleagues. If I directly go and complaint him, I don't think so I can make good relationship with my other colleagues. Even he has the power to mislead them. I am not telling he is a bad guy, he can do the work, but he is not doing it.

Doesn't your company have any kind of bug tracking system ?

Here actual bug tracking system isn't there. The company tries to finish off the project as soon as possible and gives it to the QA. And then fixes the bugs reported by QA.

This is why companies should give employees stock / options or some sort of ownership. That way you can literally tell the guy "You are costing me monetary growth... don't you want to make money also?".

The company has the stock options they have given me a 2500 share, mostly he too would have got some more.

Seniority does deserve some benefit of a doubt. You really need to speak to him first and try to understand the problem. He may be out of his depth, you may be able to help him, there could easily be variables you are unaware of. It may be hard now, but you could easily make the situation a lot worse by jumping the gun.

I even does it, first his app wasn't handling multiple requests at a time, he was using a queue to handle the requests I sent to him. I even suggested to him some of my ideas on it. He said he already had these ideas, and will be executing them. His explanations was: "Everything require certain time to do and this is a project which may need two years to complete and we are asked to finish it in two months". I used to have a hard time coding during first few weeks because of this bug. But now he fixed it. But he is using a single queue for a user requests and that is now slowing down the app, since it processes one request at a time.

What is QA doing this whole time? Why aren't they reporting/confirming the status of the project(s)?

The manager is the person who decides when to give to the QA. As of now it has not yet given to QA. He said we should give it by this month end.

答:
"I am a person who loves to work. I spends most of the time in office and only go home when I feel sleepy."

This is not healthy and cannot be expected of colleagues, unless you are compensated to the point of being able to take years off for the inevitable burnout.  (Something like >10% ownership in the company or above $200k a year).  Maintaining expertise to get to the point where he can develop very quickly takes time.  Some of your time should be devoted to developing expertise.

"The c/c++ project is the main app which does all the functionality. My python sends the user request to it and displays the response from it to the user. ... May be he doesn't like to do it."

Python is a more agile language than C/C++.  His app seems to contain all the functionality; your app just the UI.  More likely than not, these are not  equal in difficulty.  He may not be producing code quickly; but quality coding is much better than quantity coding.  You very well may have unrealistic expectations for how fast he can code in the hours he's willing/expected to work (typically ~40 hr week; and remember if he's been there for years, he's likely accumulated other tasks like managing others or help maintaining older projects that take up a significant part of the work week).

Don't lie for him; but again don't criticize him either.  Talk about how his system is great; granted it needs more work until its finished.  Give your manager an accurate status update without naming names/assigning blame.  Write a mocked-up version of his system that conforms to the same standard that his system should conform to.  Make sure your system works perfectly with your mocked-up system with an automated test suite.  Then your system can be finished (e.g., it syncronizes perfectly with the mock-up), even if the live system is still buggy.

Then you can write a automatic test suite for his system being called externally that conforms to the agreed upon standards.  E.g., test than Foo(1,2,3) gives back a response of "Bar 4 5 6".  This could help him identify bugs and speed along his development (and doesn't need to mess with his code).  Once those things are done, you'll be able to move on to another project/task (such as helping him with the C/C++ parts).


答:
There is no such general strategy when it comes to technology selection. There are only tradeoffs. As a single example, choosing a new tool or library will introduce a learning curve, but if it's the best tool for the job, it might make it easier to express your solutions. Ultimately, everything has to be based on the requirements of the project and the capabilities of the team (to either use what they already know or learn something new) as those will add constraints to what you can or can't do.

I don't think anyone can give you the advice or suggestions that you are looking for. There aren't really any tips that will apply to every project at every moment in time.

Title: What is the best strategy for quickly implementing small business applications?

Body:
I'm not a software developer, but I have previously developed a project-specific Access application for another employer. My current employer would like me to help organize their workflow and data for an upcoming project, and I was considering using Access again. In previous projects the staff used large piles of Excel spreadsheets; now they would like to keep their data more organized as well as automate some processes.

I've found that it is difficult to create forms in Access that are pleasant and usable, due to the limited control over forms. Are there better options for quickly developing a business application, such as MS LightSwitch, Delphi, or .NET?

The team that will be using the application is small - less than five users.


答:
First of all, you might not want to reinvent the wheel.  GLib has a very useful linked list library in C.

However, if you are intent on rolling your own, GLib and GTK+ are good models for relatively clean APIs.  Keep in mind that a few design principles in other languages don't really apply in C due to its limitations.    For example, GTK+ requires users to perform typecasts in several places, but they provide macros to make it easy, like the GTK_WINDOW() in:

```<code>gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
</code>```

In another language, it would be considered poor practice not to use polymorphism for the window variable.  In C, casts like this are par for the course.  Likewise for needing to cast a void* return value into something useful.  In other languages, best practices would dictate you use something like templates to give you the right return type.  In C, that's not available, and most importantly, C programmers don't expect it to be.  APIs are all about meeting the users' expectations with the least amount of surprise.

Body:
First of all, you might not want to reinvent the wheel.  GLib has a very useful linked list library in C.

However, if you are intent on rolling your own, GLib and GTK+ are good models for relatively clean APIs.  Keep in mind that a few design principles in other languages don't really apply in C due to its limitations.    For example, GTK+ requires users to perform typecasts in several places, but they provide macros to make it easy, like the GTK_WINDOW() in:

gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);

In another language, it would be considered poor practice not to use polymorphism for the window variable.  In C, casts like this are par for the course.  Likewise for needing to cast a void* return value into something useful.  In other languages, best practices would dictate you use something like templates to give you the right return type.  In C, that's not available, and most importantly, C programmers don't expect it to be.  APIs are all about meeting the users' expectations with the least amount of surprise.


答:
Use stackoverflow.com or superuser.com if you have specific problems with designing Access forms. I know you want to give users a pleasant experience, but I'm sure you can make something more visually pleasing than what they get in Excel. Make their job easier without too much emphasis on some visual wow factor. Not that employees want to look at ugly stuff all day, but they're easier to please then attracting buyers to a website.

If they're using Excel as a way to maintain data, a database will be much better. Those who do a lot of analysis, their own formulas and like to tweak the appearance every time they create a spreadsheet will not prefer a new app.

Make sure you're solving the problem instead of giving an alternative solution.


答:
I think it depends based on the library you're building. If you're building a library with implementations of Abstract Data Types as in your example I wouldn't want to do anything myself. I would expect something which is completely finished and supports a typesafe way of adding/removing/selecting/iterating.

The reason for this is that it's a domain of which anyone can have a very complete understanding. I would expect anyone who builds a library and expect me to use it to be an expert in the domain he's building the library for (if he's not I can just as well build it myself). For me typesafety in datastructures is an absolute requirement.

If you have a problem domain which is much more flexible (or which is not yet that cultivated) I would expect a library to leave more room for adjustments by consuming code as multiple implementations might be possible. But as I've stated before, the developer has to be a real expert in the domain so he'll probably know where to make his library extensible (as this is a key part of knowing a domain well).

And in any case, spend a lot of time on your public interface as this will be the primary thing your 'users' will see when consuming your library. If they have to check the documentation for every single function they want to use, because the can't tell by the signature what it will do, the benefits are minimized


答:
At my current company we are still using IBM TPF mainframes (several of them, given our performance constraints).

We are in the process (and have been for at least the 4 years I have been there) of migrating toward Linux-based boxes (swarms of them) with Oracle/MySQL/SQlite DBs (depending on the requirements).

It's a long and energy consuming task, but the mainframes are at their limits, and it would require buying even bigger/newer mainframes to replace them.


答:
I can see 4 reasons for this:

None of the languages in Accept-Language are available

The developer is not aware that such a HTTP header exists

The developer does not have the time to implement it (we are not master of our time)

The technology used strips/mangles the HTTP header (erf...)

That said, even though one can correctly detect the Accept-Language does not mean it should be the sole way to set a language.

A user may have a good reason to want to change of language. For example, what if I am browsing from a Chinese Cyber-Cafe ? I can probably find the browser (thanks for icons), but being that I don't speak chinese, I doubt I'll be able to change the settings... even if I were allowed to!

Title: Why do websites have to ask language and country when the browser can tell them that?

Body:
So, why do websites have to ask (spoken) language and country when the browser can tell them that?

Edit:
Specifically, I mean why not use the accept-language section in the http header, set by the language settings in the browser, not based on the IP address.  This question focuses the websites that put up a wall, forcing the user to select a language before using the website, that should instead make available an easily accessible setting.

Edit:
This is a user experience question, focused on the point that the user should have set the language settings in the browser when they first set up their computer (if the user is smart enough, or can ask someone smart enough).


答:
I've just read "The Clean Coder" by R.C. Martin (Uncle Bob).  The main point of the book is that programmers in general don't get much respect because they are not behaving professionally.  That means mainly that they don't communicate effectively with management about the status of the project.

Lying is certainly a very very bad form of communication.  Your colleague is being extremely unprofessional and so are you.  You both are doing nothing good to improve the perception of programmers.

I would advise you to go right away to management.  However, I have gotten in trouble in the past for having been too "honest" (in some unrelated situation), so I'm not sure you should take my advice.
Also, as many have pointed out, maybe your perception of the situation is not as accurate as you think.

Title: How do I deal with a slow and undedicated colleague in the team?

Body:
I have been working on a new project. The project works like this: The end user can access a webapp using a link and he can add multiple systems on his network and manage that particular systems details. My part involves the front end and the webserver, which is done in python. My python actually communicates with another project which is entirely done in c & c++. The c/c++ project is the main app which does all the functionality. My python sends the user request to it and displays the response from it to the user.

I am very familiar with my work and I will finish it soon. Since that's not much work in it. And I am a person who loves to work. I spends most of the time in office and only go home when I feel sleepy.

The c/c++ app is managed by another colleague who has 5+ year experience and can do things much faster than me, but he never does it. May be he doesn't like to do it. His app crashes often when my python communicate with it or returns wrong values. It's full of bugs. Since my app depends on it, I am having a hard time building it. Instead of fixing the bugs, he asks me to slow down my work. He asks me to tell manager that my work needs a lot of time. He is asking me to fool the manager and even forcing me to work slowly like him.

During project meeting, when manager asks him about the bugs he says that he fixed everything and it works fine. Since he is my colleague, I couldn't tell anything to the manager. I obviously need to have a good relationship with my colleagues more than my manager, since most of the time we will be with our colleagues, not with the manager.

I am not able to tell the manager anything regarding this, since if manager asks him why, then he may think I complained about him to the manager. And he keeps on lying in the meeting. And since he fixes the bug slowly, it even slows down my work. Now I thought of working on the front-end part of my app  and finishing it off so that in the mean time he can make his project stable. Now he is asking me to tell the manager that my front end part require a lot of work and I may need more and more time, simply so that he can drag the project down. And the sad thing is our actual manager has gone to the US, so we have a temporary manager and this guy doesn't know about the project much, so the c,c++ just fools him.

Can anyone suggest me how I deal with this?
I wanted to finish off the project soon. How can I make him work even by maintaining a good relationship with him?

Responses to comments:

If he's really deliberately misleading the company, you should report him to management.

I am new to this company and the other guy has been there for many years. And I have just started knowing my colleagues. If I directly go and complaint him, I don't think so I can make good relationship with my other colleagues. Even he has the power to mislead them. I am not telling he is a bad guy, he can do the work, but he is not doing it.

Doesn't your company have any kind of bug tracking system ?

Here actual bug tracking system isn't there. The company tries to finish off the project as soon as possible and gives it to the QA. And then fixes the bugs reported by QA.

This is why companies should give employees stock / options or some sort of ownership. That way you can literally tell the guy "You are costing me monetary growth... don't you want to make money also?".

The company has the stock options they have given me a 2500 share, mostly he too would have got some more.

Seniority does deserve some benefit of a doubt. You really need to speak to him first and try to understand the problem. He may be out of his depth, you may be able to help him, there could easily be variables you are unaware of. It may be hard now, but you could easily make the situation a lot worse by jumping the gun.

I even does it, first his app wasn't handling multiple requests at a time, he was using a queue to handle the requests I sent to him. I even suggested to him some of my ideas on it. He said he already had these ideas, and will be executing them. His explanations was: "Everything require certain time to do and this is a project which may need two years to complete and we are asked to finish it in two months". I used to have a hard time coding during first few weeks because of this bug. But now he fixed it. But he is using a single queue for a user requests and that is now slowing down the app, since it processes one request at a time.

What is QA doing this whole time? Why aren't they reporting/confirming the status of the project(s)?

The manager is the person who decides when to give to the QA. As of now it has not yet given to QA. He said we should give it by this month end.


答:
As far as software goes, sure.  IBM, at least, has put a LOT of effort into maintaining upward compatibility.  There's business logic that's still happily being used by a lot of large organizations.

As far as hardware goes, probably not:

The older systems are slow, and consume a lot of power, and consume a lot of air conditioning (or water cooling).  A newer system of equivalent power costs much less to run; the hardware replacement costs are dwarfed by the power/cooling/space that's not used by the replacement.

There aren't many parts available for the older systems.  Even when there are spares, it's going to be less expensive to replace an older system than fix it.  The older the system is, the truer this is.

There are few people left to fix the older systems.  The manufacturers (e.g., IBM) don't maintain them any more, and I doubt anybody's even offering training in how to maintain/repair the older systems.

Economically, it doesn't make sense to run hardware that's that old.  Replacing it with newer (but software-compatible) hardware costs less, and gives you a system that's more reliable and more maintainable.

However, economically, it does make sense to run software that's that old, if the business logic is still valid.  (But that's a whole other conversation.)  So, yes, there are an awful lot of business still running software that was written that far back.


答:
3)  Shortcomings that were fixed.

A few years ago there was a lot of anger at Java.  Most Java programmers are web/server programmers and they were going mad with the verbosity of Java.  So some languages like Ruby became popular and Java started to wane.  However, with the new annotations and frameworks like hibernate and Spring, people have stopped complaining and gone back to Java.

4)  Current shortcomings

The hardware is all going multicore.  Although Java can do multithread, it's based on C which is a sequential language and the functionality for making it multithreaded is not elegant, to say the least.  By the way, that's not just a critcism of Java, but pretty much of all languages.  Some completely different way of thinking about code is needed.  Maybe functional programming is the way of the future.

Title: A modern review of Java


问:
Is there an analogue to "FizzBuzz" for choosing clients?
This is for the freelancers.

In my past life as a full-time employee, I was involved in hiring and interviewed a good number of developers. I learned that it was much more valuable to see a developer work through a problem, however small, than to talk about experience, etc.

Now I'm working as a freelancer/consultant. One of the nicer things is the freedom to choose what I want to work on. But now, a few years in, I've learned (the hard way) that some clients are not worth the money. They can be fickle, unreasonable, demanding, and difficult to work with in a very demoralizing way.

So I've been wondering: is there a better way to "interview" clients? Obviously any method would have to be subtle, as the client probably isn't expecting to be tested. But is there an analogue to "FizzBuzz" that will tell me whether I should sign on, or back away slowly?

答:
For many of my former clients, I often scheduled initial meetings at their office. Ostensibly this creates less heartache for them because you're saving them the trip, but more importantly it keeps them from seeing the "man behind the curtain" and it gives you a good close up look at how their office operates.

I would typically show up anywhere from 30 minutes to an hour before the scheduled appointment. I would bring a technical book that I could skim and read, and I would patiently wait in some out of the way area. This would afford me a good opportunity to gauge how the client reacted to difference in the time. Often I would offer to wait eagerly because I wanted to see how the office interacted. If a client treats the people who work for him every day like dirt, chances are good that he'll treat you like dirt once he no longer needs to worry about being nice to you.

If that didn't work, I would offer a meeting place where I could buy the prospective client(s) lunch. Then I would watch to see how they treated the wait staff, and I would be very attentive to their comments about the other patrons, etc.

Since the relationship with the client is exactly that, the only way to test the truth of a potential relationship is to see how the person behaves towards people they don't have to treat with respect. Observation is your best friend, and unfortunately in most client situations, you are in a carefully controlled meeting environment that prevents this very important data.


答:
I agree with Joel's answer, but I've handled this in a different manner.

When freelancing, I tried my best to filter out clients. I came up with ways (in my brain) to judge whether they were "good" clients (smooth transactions, great communicators) or "bad" clients (192 new emails). It never worked. Some seemed like they were great clients at first, then it slowly deteriorated, I'm sure not unlike some people that you've hired in your day.

Then I inflated my rates slightly. I haven't had a "bad" client since - organizations and/or people who are willing to pay slightly more for your services generally do so with a respect for your offerings. If you're being shopped by a budgeted prospective client, chances are they're running lean in the worst way possible, which is cutting corners to save money.

Are there good clients only able to pay market rate? Absolutely - but you'll roll the dice. It isn't an easy task to pick those up.

Edit: I should also mention that I was much more inclined to discount my services from time to time for my very best clients. Maybe not directly, but by cutting a few billable hours off or something.

Title: Is there an analogue to "FizzBuzz" for choosing clients?

Body:
This is for the freelancers.

In my past life as a full-time employee, I was involved in hiring and interviewed a good number of developers. I learned that it was much more valuable to see a developer work through a problem, however small, than to talk about experience, etc.

Now I'm working as a freelancer/consultant. One of the nicer things is the freedom to choose what I want to work on. But now, a few years in, I've learned (the hard way) that some clients are not worth the money. They can be fickle, unreasonable, demanding, and difficult to work with in a very demoralizing way.

So I've been wondering: is there a better way to "interview" clients? Obviously any method would have to be subtle, as the client probably isn't expecting to be tested. But is there an analogue to "FizzBuzz" that will tell me whether I should sign on, or back away slowly?


答: A very simple answer to this question is that very possibly, the business users concerned have demanded it for reasons which may be unclear to you. And that very often, they will require inclusion a cookie so that the preference is remembered in the future. </p>


问:
What does the 'cyclomatic complexity' of my code mean?
I am new to static analysis of code. My application has a Cyclomatic complexity of 17,754. The application itself is only 37,672 lines of code. Is it valid to say that the complexity is high based on the lines of code? What exactly is the Cyclomatic complexity saying to me?</p>

答:
What exactly is the Cyclomatic complexity saying to me?

Cyclomatic complexity is not a measure of lines of code, but the number of independent paths through a module. Your cyclomatic complexity of 17,754 means that your application has 17,754 unique paths through it. This has a few implications, typically in terms of how difficult it is to understand and test your application. For example, the cyclomatic complexity is the number of test cases needed to achieve 100% branch coverage, assuming well-written tests.

A good starting point might be the Wikipedia article on cyclomatic complexity. It has a couple of snippits of pseudocode and some graphs that show what cyclomatic complexity is all about. If you want to know more, you could also read McCabe's paper where he defined cyclomatic complexity.

My application has a Cyclomatic complexity of 17,754 lines of code. The application itself is only 37,672 lines of code. Is it valid to say that the complexity is high based of the lines of code?

Not at all. An application with few lines of code and a high number of conditionals nested within loops could have an extremely high cyclomatic complexity. On the other hand, an application with few conditions might have a low cyclomatic complexity. That's oversimplifying it a big, but I think it gets the idea across.

Without knowing more about what your application does, it might be normal to have a higher cyclomatic complexity. I would suggest measuring cyclomatic complexity on a class or method level, however, instead of just an application level. This is a little more managable, conceptually, I think - it's easier to visualize or conceptualize the paths through a method than paths through a large application.

ContentLicense: CC BY-SA 4.0


答:
It's the number of distinct paths in your application. Check out this IBM article on CC.

It seems high but in your case it is the addition of the CC of all your methods of all your classes and methods. My examples are far stretched since I don't know how your code is structured but you may as well have one monster method with 37672 lines of code or 3767 methods with about 10 lines of code. What I mean is that at the application-level, this indicator does not mean much, but at the method-level it may help you optimize/rewrite your code into smaller methods so that they are less prone to errors.

What I have personally read a lot of times is that methods with a CC higher than 10 have higher risks of defects.

I use Sonar to test code quality of my applications and by default I think it raises a warning if you have methods with +10 CC. Still that may mean nothing. One concrete example: if you use Eclipse to generate a equals method based on the properties of your bean, the CC will very quickly go above the roof...

Title: What does the 'cyclomatic complexity' of my code mean?

Body: I am new to static analysis of code. My application has a Cyclomatic complexity of 17,754. The application itself is only 37,672 lines of code. Is it valid to say that the complexity is high based on the lines of code? What exactly is the Cyclomatic complexity saying to me?</p>


答:
I think much of the bad client experience comes down to expectations. "fickle, unreasonable, demanding" sounds like feature creep to me.

The best tip I ever received to screen out bad clients, and even turn bad clients into good ones, is to charge like lawyer.

Lawyers, for the most part, work on retainer. The client pays a deposit which pays for x number of hours of work. Once the retainer runs out work stops (invoice for the next retainer well in advance).

Feature creep has almost vanished for me with this system of billing. Clients are aware they're on the clock and are much less likely to bother you with unreasonable demands.


问:
Why is the c family the standard CS study regiment for Mathematics/CS programs instead of the LISP family?
I have been familiarizing myself with LISP for self improvement purposes. One of the things I have noticed is that LISP is much more within the paradigm of Mathematics than say C. The syntax and design structure seems to echo directly the actual mathematical model of an algorithm. It doesn't make sense to me why even good Mathematics based CS programs study C instead of LISP. I think that LISP more directly employs higher mathematical concepts than C. I am not saying that you can't model mathematical structures in C. I am merely noticing that LISP seems to be hard-wired for mathematicians.

I have read many of Joel Spolsky's rants on the JAVA schools and what not--and I agree with his assesment--, but my school didn't teach JAVA for that very reason. They were stringent in teaching fundamental concepts like pointers, algorithm design, recursion, and even assembly instructions. However, they did this all in C and c++. Does anyone know the reasons for this and/or its history?

答:
OK. So, the boring answer is that, in the end, most schools teach what the professors are comfortable with, and most professors did not grow up hacking Lisp; they spent their early  years in the field with Algol-based languages. Because of this, years later, when they are building curriculum, you wind up with schools that teach CS with a foundation in Pascal, then C, then C++, and then Java.

Then you have schools that are a tier lower and some years younger. And they look up to the bar that was set by the schools leading the way, and they see that students leave those schools knowing C, and they see that their own students expect the same -- so they begin teaching C, then C++, then Java.

Finally, you have some of the technical or 'lower end' institutions that simply teach whatever set of tech will match keywords the students want on their resumes -- so you pretty much just get Java.

That being said, some schools do teach Lisp, although it may be more of an elective rather than a foundational language. And even the schools that do not teach Lisp as a standalone language, use it extensively in AI courses, so beginner AI courses do get a concentration in beginning Lisp programming.


问:
How much should Developers interact with Clients?
A philosophical discussion has come up in my department that I'd like p.se's opinion on. We're a 6 person development department inside a 60 person IT shop. All other departments are growing FAST, and ours has been the same size (and not fully booked at that size) for a few years.

My manager, and old-school mainframe guy, contends that developers should never ever have ANY client contact. That all interaction with the client should be mitigated by a Project Management layer. He asserts that this allows a coder the focus they need in order to CODE, and protects the business's relationship with the client from the autism-spectrum tendencies of Joe Average Code Monkey. (My words, not his.)

His boss, the owner of the company, told him this morning that every single person in the company needs to think of themselves as an extension of the sales department, and needs to be listening all the time for upsell opportunities. To this end, he thinks clients ought to have more or less full access to developers directly, in part so that devs have the opportunity to hear sales opportunities.

I'm somewhere in the middle, myself. I think it's nice to shield devs from clients to some extent, but in practice that will never be total. And yes, every single job in the company includes sales, but that doesn't necessarily mean that everyone has the same opportunity for it.

EDIT: We're not an agile shop. Some of us (cough) would like to head that direction, but for now assume this is a traditional fixed-bid-contract shop.

EDIT2: The autism joke wasn't funny. Got it. Entirely possible that autism jokes never are. That said: there are developers who have a capacity to represent themselves and their employers well and developers who don't (currently) have that capacity. My manager has a real concern about how the company would be represented if all developers were structurally empowered to be company representatives.

It's also getting increasingly clear from reading your responses that the real push-and-pull here is between waterfall and agile.

答:
Personally I would not work anywhere that I didn't have the opportunity for direct client contact. Trying to resolve an issue with the requirements when you have to go through layers of PMs and BAs is painful and the message never gets through clearly. I want this access to improve the product so that it actually reflects the clients needs and not the interpretation of those needs by someone who doesn't know the right questions to ask.

It may be relevant in my answer that I do database ETL work and often a 5-10 minute conversation with the client's IT person can resolve a long-standing issue with imports or exports. Sometimes our IT people need to talk to their IT people. This is especially true if this is a delta import or one that goes two ways. I have to understand their database structure and needs as well as my database's needs. Direcly talking is the only way to get this information.

However, I do not want the client to routinely be given my email and phone as some of them will call directly when they should not. I only need to to talk to them when there is an issue we can't resolve any other way. And you have to be able to set boundaries so they don't try to take advantage of the access to get work from you that they aren't paying for. I always refer any new requests outside the bounds of the issue we are supposed to be discussing to the sales side.

Even when directly talking to the client, I rarely, if ever, see an additional sales opportunity, my brain just doesn't work that way.


答:
I can agree to an extent with not being fully shielded from the client, but the developers shouldn't be moonlighting as the damn sales staff.

A developer is just that, someone how develops the end-product. Meeting with the client a few times is a good thing as it allows the two parties to hash out any potential issues that would arise from developing particular items. The client would be able to express what they want directly and the developers could express what is possible in a time frame.

Where this can go wrong is constant contact. Imagine your client is the type of person who changes their mind every other day. Now imagine that client emailing the dev-team every other day with their change of plans and how that would wreak havok with the development of the product. Forcing the client to go through more "proper channels" to discuss changes in the product allows the developers to focus on finishing the product and only changing things up if the need truly arises.

Title: How much should Developers interact with Clients?

Body:
A philosophical discussion has come up in my department that I'd like p.se's opinion on. We're a 6 person development department inside a 60 person IT shop. All other departments are growing FAST, and ours has been the same size (and not fully booked at that size) for a few years.

My manager, and old-school mainframe guy, contends that developers should never ever have ANY client contact. That all interaction with the client should be mitigated by a Project Management layer. He asserts that this allows a coder the focus they need in order to CODE, and protects the business's relationship with the client from the autism-spectrum tendencies of Joe Average Code Monkey. (My words, not his.)

His boss, the owner of the company, told him this morning that every single person in the company needs to think of themselves as an extension of the sales department, and needs to be listening all the time for upsell opportunities. To this end, he thinks clients ought to have more or less full access to developers directly, in part so that devs have the opportunity to hear sales opportunities.

I'm somewhere in the middle, myself. I think it's nice to shield devs from clients to some extent, but in practice that will never be total. And yes, every single job in the company includes sales, but that doesn't necessarily mean that everyone has the same opportunity for it.

EDIT: We're not an agile shop. Some of us (cough) would like to head that direction, but for now assume this is a traditional fixed-bid-contract shop.

EDIT2: The autism joke wasn't funny. Got it. Entirely possible that autism jokes never are. That said: there are developers who have a capacity to represent themselves and their employers well and developers who don't (currently) have that capacity. My manager has a real concern about how the company would be represented if all developers were structurally empowered to be company representatives.

It's also getting increasingly clear from reading your responses that the real push-and-pull here is between waterfall and agile.


答: My feeling is that developers should not be interacting with clients directly, but rather through management when getting work or feedback or a Client Support department when getting support issues. Developers should be getting actionable tasks and should not be trying to figure out what the clients want/need through direct contact (e.g. e-mail correspondence). That should be left to management or other departments, such as a Sales department, so that they can manage the direction the software is going in and figure out where the wants/needs of clients fit in.</p>


问:
Class as first-class object
Could a class be a first-class object? If yes, how would the syntax for dynamically creating new classes look like?

To narrow the question - how would you give this functionality while keeping language consistent?

For example how you create reference for new type. Do you make reference first-class object too and then use something like this:

```<code>Reference<newType> r = new Reference<newType>();
r.set(value);
</code>```

Well this could get messy so you may just force user to use Object type references for dynamically created classes, but then you loose type-checking.

I think creating concise syntax for this is interesting problem which solving could lead to better language design, maybe language which is metalanguage for itself (I wonder if this is possible).

答:
Ruby has this capability, along with a (perhaps too-) detailed API for modifying classes on the fly.

You can get a taste of this by looking through the documentation for the Ruby core classes
Class and Module (Class is a subclass of Module, as they share some code for namespace management), and most Ruby books will have at least some coverage of this.

Title: Class as first-class object


答:
Your PM is right.
Once your client has the Dev's Direct #, the Dev will be inundated with support calls.

The PM should me technical enough that he\she can act as a middel person without becoming a hindrance.

The following needs to be yelled out from the rooftops.. so here goes:

THAT'S THE PM'S JOB!!! TO INSURE THE DEVELOPERS HAVE EVERYTHING THEY NEED TO DO THERE JOB, AND TO INSURE THEY CAN WORK WITHOUT CONSTANT INTERRUPTION! THE PM WORKS FOR THE DEVS!!! ANY PMS WHO THINKS THE DEVS WORKS FOR HIM IS WRONG, AND MISMANAGING THE PROJECT!


答:
That's more or less the case in Ruby.

Object.const_set("Student", Class.new)

This is maybe the most simple way to demonstrate this feature. A class in Ruby is an instance of Class. With more code you can add member functions and variables.

Explained in more detail here

Title: Class as first-class object

Body:
Could a class be a first-class object? If yes, how would the syntax for dynamically creating new classes look like?

To narrow the question - how would you give this functionality while keeping language consistent?

For example how you create reference for new type. Do you make reference first-class object too and then use something like this:

```<code>Reference<newType> r = new Reference<newType>();
r.set(value);
</code>```

Well this could get messy so you may just force user to use Object type references for dynamically created classes, but then you loose type-checking.

I think creating concise syntax for this is interesting problem which solving could lead to better language design, maybe language which is metalanguage for itself (I wonder if this is possible).


答:
I believe that there should be a few set points of contact with the customer. In traditional project management, this person is the project manager. In Scrum, you would call this person the Product Owner. In Extreme Programming, it's the customer representative. Note that in Scrum and XP, nothing says that this person has to be from the customer's organization, but only be given the voice of the customer when it comes time to make decisions.

To me, the biggest concern is the number of communication paths. The number of communication paths on your project team is defined as (N × (N-1)) / 2 where N is the number of people on the project team. If everyone on the team has communication access to the customer or client, then N increases by the number of contacts within the customer's organization, greatly increasing the communication paths. It becomes nearly impossible to know who knows what information, who said what when, and keep all communication organized.

My second biggest concern with free communication between your development team and your client is keeping track of who is saying what in terms of the current health and status of the project, meeting estimates on schedule and budget, and so on. Having a primary point of contact ensures that everyone outside the development organization knows exactly what's going on at the appropriate level of granularity, and ensures that each member of the team has everything they need to do the tasks assigned to them.

My manager, and old-school mainframe guy, contends that developers should never ever have ANY client contact. That all interaction with the client should be mitigated by a Project Management layer. He asserts that this allows a coder the focus they need in order to CODE, and protects the business's relationship with the client from the autism-spectrum tendencies of Joe Average Code Monkey.

I agree with your manager, for the most part. Your developers are there to develop and your testers are there to test. Does that mean that one of your developers can't be a customer contact, a Product Owner, or a customer representative? Absolutely not. In fact, it might be helpful to have someone with a technical background by involved with interacting with the customer, especially when it comes to requirements engineering, feasibility discussions, and scheduling (after all, engineers are the best at scheduling engineering tasks).

Asserting that your client needs to be shielded from your developers is wrong, and perhaps even offensive. Your engineers should have the knowledge and skills that it takes to interact with clients (and all stakeholders to a project). It's just that they shouldn't all be called upon to do it.

His boss, the owner of the company, told him this morning that every single person in the company needs to think of themselves as an extension of the sales department, and needs to be listening all the time for upsell opportunities. To this end, he thinks clients ought to have more or less full access to developers directly, in part so that devs have the opportunity to hear sales opportunities.

The owner is absolutely wrong. People without sales or marketing education or training should not be doing the job of those departments. Might the engineers need to interact with sales and marketing? Absolutely yes. But it's not their job to sell software, it's their job to build software that meets the requirements of the stakeholders. If all of your developers are busy selling and marketing the software, who is designing, building, and testing it?


答:
Cyclomatic complexity is a way to determine if your code needs to be refactored.  The code is analyzed and a complexity number is determined.  Complexity is determine by branching (if statements, etc.)  Complexity also might take in to account nesting of loops, etc. and other factors depending on the algorithum used.

The number is useful at the method level.  At higher levels it is just a number.

A number of 17,754 indicates project level complexity (total code), which doesn't have that much meaning.

Drilling down into class and method level complexity will determine areas of the code that need to be refactored into smaller methods or redesigned to elminate the complexity.

Consider a CASE statement with 50 cases in one method.  Maybe each state has different business logic.  That will generate a cyclomatic complexity of 50.  There are 50 decision points.  The CASE statement may have to be redesigned using a factory pattern to get rid of the branching logic.  Sometimes you can refactor (break up the method into smaller parts) and in some cases only a redesign will reduce the complexity.

In general, for method level complexity:

< 10 Easy to maintain

11-20 Harder to maintain

21+ Candidates for refactoring/redesign

Also consider that higher complexities make the code harder to unit test.

The highest complexity I have seen on a single method was 560.  It was about 2000 lines of if statements in one method.  Basically unmaintainable, untestable, full of potential bugs.  Imagine all the unit test cases needed for that branching logic!  Not good.

Try and keep all methods under 20 and realise there is a cost to refactoring any method to make it less complex.


答:
Re-estimating committed user stories during sprint doesn't make sense. It only waste your time. You already did commitment and it doesn't matter if you do re-estimation or not.

The different situation is with user stories which are not committed to current sprint. From time to time it is good to make re-estimation (no more than once per sprint before the planning). Situations why it can be reasonable to re-estimate can be:

Product owner changed any user story

Product owner split or merge any user story

Product owner added user story

You have some additional knowledge which was not available during last user story

You found that some user stories are related and you already did part of another one not committed yet

etc.

You don't need necessarily re-estimate every user story but you can. For complete re-estimation you usually need some fast method. Planning poker can be damnly slow, inefficient, boring and sometimes also inaccurate if you take more then 10-20 stories to estimation. Alternative can be Magic estimation.

Title: Scrum re-estimation of stories