问:
Asking for a code sample of the company at an interview
Asking a job seeker to show some code is a fairly common practice for a software company. However, would it be acceptable for the candidate to ask the interviewer to show him a small piece of code that he thinks is well written?</p>

答:
would it be acceptable for the candidate to ask the interviewer to
  show him a small piece of code that he thinks is well written?

You can ask whatever you want, but:

You probably won't get it.

If you do get it, it won't tell you anything useful. If 10% of their code is beautiful and the rest is spaghetti, you'll still be dealing mostly with spaghetti.

You'll seem like a smarty pants. That's not a big help if you ultimately decide you'd like to work there.

It's a waste of precious interview time.

There are better ways to find out what you want to know. Ask questions like:

What are the most important indicators of code quality?

Will I be mostly maintaining existing code or writing new code?

Can you explain briefly how your system works?

Do you have a coding standards document, and does everybody follow it?


问:
My work isn't being used... what can/ should I do?
Several months ago I was approached by a small business, who had seen my work previously and asked me to create a website for them.

Since then, the website hasn't changed one bit and I haven't heard a word from them. This sucks for them as they paid for a website and haven't used it. It''s frustrating for me because I spent a huge amount of time on the website and feel that all of that effort has been wasted, furthermore, I don't feel I can use the website on my portfolio/ CV.

I was thinking of offering to go round to their office for one day, and update the website for them then and there; but I'd need their support whilst there (to get the content for the about page, to get information for on their products etc.) and I don't want to disrupt their work day, nor do I want to sit there like a spare tyre and get nowhere.

Furthermore, if I were to do this, should I expect to receive money for it? It's a day of my life, but I'm doing it for my benefit rather than theirs (but they benefit as well).

Has anyone else had experience of a client not using their product; how did you handle it?

Additional background for those who want it:

The company is a local travel agent, and the website lets them CRUD offers and locations, and has several other static pages (about, contact, etc.)

At the time of creating the website, I filled the static pages with lipsum, and the offers and locations with fake information, so that I could give the business an idea about what the final pages would look like; during the hand over, I guided them through the CRUD forms (they made notes) and said if they sent me the text for the pages, I'd update it.

答:
Well, I agree with your idea that a good way to make them use your site is to somehow show-case the new site in action. I understand that you can't actually deploy it without their assistance, but maybe, if it's not a ton of work, you can set it up with some mock data? You can either do this on your laptop and pay them a visit to show them, or do it on a cloud service (like, borrow a cheap Amazon EC2 machine and set it up there).
Also I'd make a point of making sure I can specifically showcase some of the specific demands they made, like if they said, we really want feature A, which we don't have currently, and the new site has feature A, make sure you show case it.

UPDATE:

Sorry, I missed the update on your question. Ok, you made a IPSUM running version of the site, but try mocking the text/data more realistically, you know, with stuff that speaks to a non-technical person.

ContentLicense: CC BY-SA 3.0


答: Call them and ask them why they aren't using your website. There might be any number of reasons: maybe they have been too busy, are going bankrupt or they really don't know what to do with it. There might have been a disconnect between what they expected you to do and what you thought they wanted done. Discuss it and new work from them might follow or else you might learn something so you can avoid the situation in the future.</p>

Title: My work isn't being used... what can/ should I do?

Body:
Several months ago I was approached by a small business, who had seen my work previously and asked me to create a website for them.

Since then, the website hasn't changed one bit and I haven't heard a word from them. This sucks for them as they paid for a website and haven't used it. It''s frustrating for me because I spent a huge amount of time on the website and feel that all of that effort has been wasted, furthermore, I don't feel I can use the website on my portfolio/ CV.

I was thinking of offering to go round to their office for one day, and update the website for them then and there; but I'd need their support whilst there (to get the content for the about page, to get information for on their products etc.) and I don't want to disrupt their work day, nor do I want to sit there like a spare tyre and get nowhere.

Furthermore, if I were to do this, should I expect to receive money for it? It's a day of my life, but I'm doing it for my benefit rather than theirs (but they benefit as well).

Has anyone else had experience of a client not using their product; how did you handle it?

Additional background for those who want it:

The company is a local travel agent, and the website lets them CRUD offers and locations, and has several other static pages (about, contact, etc.)

At the time of creating the website, I filled the static pages with lipsum, and the offers and locations with fake information, so that I could give the business an idea about what the final pages would look like; during the hand over, I guided them through the CRUD forms (they made notes) and said if they sent me the text for the pages, I'd update it.


问:
How to avoid being an API programmer only?

Possible Duplicate:

  How not to degenerate into only a programmer who stitches together APIs?

I have almost six years of experience in java. I have developed many projects which used frameworks like Struts, Spring, Hibernate, JQuery , DWR, Ajax etc.

I have used these technologies in almost all the projects I have worked on. Projects were very simple mostly with crud based apps.

My everyday tasks involves creating few screens, writing queries, testing etc.

After all these years I feel like I have turned into an API programmer who just uses these above mentioned frameworks which is not giving me any satisfaction of being a programmer.

Is this normal or is it just me who is feeling like this?

答:
I agree with you as I found myself in a similar situation 1-2 years ago: I had something like 4-5 years of work experience, and 90% of it was using heavy frameworks and implementing the same CRUD-like (sometimes web) apps. Here's my 2c on this:

I see that some people say that there's nothing wrong with only working like that. I disagree. It's one thing to use Spring batch and write a bit of business logic, and it's entirely different to do your own multi-threading batching engine, tailored to the type of treatment you'll be using it for. It's more complex, the category of challenges and issues is completly different. The same goes for dropping from Hibernate-only data-access application to using a low level driver and making your own code to deal with the data. Just the optimization issues alone change completely, and those are only half of the major differences in paradigm. So yeah, I think you miss out A LOT by only being an API programmer, at least that's how I used to feel.

Luckily now I have work projects which avoid greatly the use of "famous" frameworks like Spring, Hibernate, even Servlets in favor of custom made, from scratch, code. This is because the projects I had at work were not very common, and these generic frameworks are really made with a certain type of project(s) in mind, but don't work well for others. Also there was the issue of performance: putting aside all the other pitfalls of making your code from scratch vs using a library/framework (speed of development, less bugs, more tested code etc), from a strictly performance-wise point of view it's almost always better to avoid a library/framework and do your custom code specifically tailored for the problem at hand.

Never forget that one of the greatest advantages of open-source development is that you have all you need free to access whereever & whenever. If your curious how to implement this and that without using a framework, try doing it at home, by yourself. You don't have to make a project similar in size and goal to those you have at work, that would be unwieldy, you'd waste a lot of time, but try prototyping certain things just to see how that goes. For example I've tried coding by hand different types of game loops (which later on I used to make simple games), I've tried implementing various algorithms (like AStar), I played around with MongoDB driver to see how it can handle CRUD operations without extra help from other frameworks, etc.


答:
Yes, this is absolutely normal and there is no reason to feel bad about it. Do you also feel bad for not coding a custom OS and device firmware for every single project?

Every programmer is only an API programmer

It's what you do with the APIs that defines the value and complexity of your work.

Whatever you do, do not start reinventing wheels in work projects just to increase your personal satisfaction. Do so in your free time, or when there is a concrete reason why for this particular project's requirements, none of the existing wheels are adequate.

Title: How to avoid being an API programmer only?

Body:
Possible Duplicate:

  How not to degenerate into only a programmer who stitches together APIs?

I have almost six years of experience in java. I have developed many projects which used frameworks like Struts, Spring, Hibernate, JQuery , DWR, Ajax etc.

I have used these technologies in almost all the projects I have worked on. Projects were very simple mostly with crud based apps.

My everyday tasks involves creating few screens, writing queries, testing etc.

After all these years I feel like I have turned into an API programmer who just uses these above mentioned frameworks which is not giving me any satisfaction of being a programmer.

Is this normal or is it just me who is feeling like this?


问:
Is it possible to migrate struts/spring based application to GWT?
I am using the combination of spring, spring-security, struts and iBatis in my application. Now I am looking to migrate the struts UI to GWT.

The new combination must be spring, spring-security, GWT and iBatis.

I applied a layered approach to develop my application. In Controller/UI layer i am using Struts. I want to replace struts and use GWT in Controller/UI layer.

Is is possible to use GWT without affecting another layers DAO/BL/SL?

答:
Well, yes, sure you can. Just make sure that the classes used in your frameworks are on the GWT white list. What that means in practice is:

Decide on the version of GWT you'll use in your project. If no constrains exist, use the latest.

Decide the versions of the other frameworks as well.

Decide which of the classes from those frameworks will be used in the CLIENT side code of your GWT project

Finally, if you arrive in a situation where certiain classes that come from your framework(s) will not be directly usable in GWT client code, there's multiple solutions:

check out if there's not already a "bridge" library/framework that deals with this issue (like Gilead for Hibernate)

if you have to do it by hand, explore the options (by maybe doing a small proof of concept): either implement a custom serialization policy, or make a DTO layer, etc.


答:
You can use that website on your portfolio web site (if you have), display screen shots, or fill it with dummy data.

If they have paid you, you shouldn't give much of a concern. They should decide whether and when use it or not what they have paid for. You can ask them just to be polite and caring, but if there would be any problem from their part, they would definitely call you.


答:
My advice is when you build a site. Make relevant screengrabs and add it to your portfolio and then move one and forget about the site. You can't go around checking up on every site you've built. It will only frustrate you. They are misusing classes so the layout isn't as it is supposed to be , the texts are old/stale/none informative. They are using text colors and different fonts than you intended.

There's a lot of things that might bother you. But once a customer has accepted your site and starts using it, well it's their responsibility.

What you did is good. If you have enough time and need some more income you can always offer your services to update and pull together the website again.

And be grateful for people messing up their website. If you did a good job in the first place you will be called upon again for the redesign ;)

Kind regards,
Ryan


答:
From my experience of working in a small/medium company, one of the hardest parts of getting a website up and running is getting the content together. So much so that for some of the required contributors if the choice was being fired or producing some text they would have to think about it.

What you could try is offering to interview the various people who could contribute (set up appointments) and get make notes of what they think should be on each page. Then write the text yourself, this is more or less the process that I had to go through.


问:
Should I use switch statements or long if...else chains?
Often when I hear about the switch statement, its put off as a way to replace long if...else chains. But it seems that when I use the switch statement I'm writing more code that I would be just writing if...else. You also have other issues like keeping all variables for all calls in the same scope.

Here's some code that represents the flow I normally write (thanks to diam)

```<code>String comment;   // The generated insult.
int which = (int)(Math.random() * 3);  //  Result is 0, 1, or 2.

if (which == 0) {
    comment = "You look so much better than usual.";
} else if (which == 1) {
    comment = "Your work is up to its usual standards.";
} else if (which == 2) {
    comment = "You're quite competent for so little experience.";
} else {
    comment = "Oops -- something is wrong with this code.";
}
</code>```

Then they want me to replace that with this:

```<code>String comment;   // The generated insult.
int which = (int)(Math.random() * 3);  //  Result is 0, 1, or 2.

switch (which) {
    case 0:
             comment = "You look so much better than usual.";
    break;
    case 1:
             comment = "Your work is up to its usual standards.";
    break;
    case 2:
             comment = "You're quite competent for so little experience.";
    break;
    default:
             comment = "Oops -- something is wrong with this code.";
}
</code>```

Seems like a lot more code in a much more awkward syntax. But is there really an advantage to using the switch statement?

答:
I prefer switch in those kind of cases, it matches much better the point of the code, execute a different statement for each different input value. The if..else acts more like a "trick" to achieve the same effect.

switch statements are also cleaner, it's easy to have a typo hidden in all those ==

Also, for big blocks in C, switch is faster.

else..if can be more appropriate when you have something like ranges (between 1 and 100, do this, between 100 and 200 do that), or in C, when you try to make  switch with elements like strings (that is possible in other languages). Which is a same.

I tend to use a lot of switches when I program in C.

ContentLicense: CC BY-SA 2.5


问:
How do I implement the bg, &, and fg commands functionaliity in my custom unix shell program written in C
I am extending the functionality of a custom unix shell which I wrote as part of my lab assignment. It currently supports all commands through execvp calls, in-built commands like pwd, cd, history, echo and export, and also redirection and pipes. Now I wanted to add support for running a command in background e.g. $ls -la&  I also want to implement bg and fg job control commands.

I know this can be achieved if I execute the command by forking a new child process and not waiting for it in the parent process. But how do I again bring this command to foreground using fg? I have the idea of entering each background command in a list assigning each of them a serial number. But I don't know how do I make the processes execute in the background, then bring them back to foreground. I guess wait() and waitpid() system calls would come handy but I am not that comfortable with them. I tried reading the man pages but still am in the dark. Can someone please explain in a layman's language how to achieve this in UNIX system programming? And does it have something to do with SIGCONT and SIGSTP signals?

答: I'd suggest to read the relevant chapters of Advanced Programming in the Unix Environment of W. R. Stevens. There is lot of background information to know and that's the only place where I know for sure it is present in an understandable way.


问:
is 'protected' ever reasonable outside of virtual methods and destructors?
so, suppose you have some fields and methods marked protected (non-virtual). presumably, you did this because you didn't mark them public because you don't want some nincompoop to accidentally call them in the wrong order or pass in invalid parameters, or you don't want people to rely on behaviour that you're going to change later.

so, why is it okay for that nincompoop to use those fields and methods from a subclass? as far as i can tell, they can still screw up in the same ways, and the same compatibility issues still exist if you change the implementation.

the cases for protected i can think of are:
non-virtual destructors, so you can't break things by deleting the base class.
virtual methods, so you can override 'private' methods called by the base class.
constructors in c++. in java/c# marking the class as abstract will do basically the same.

any other use cases?

答:
Yes.

A situation where a non-virtual protected method makes sense might be something like bool IsInitialized(). The class is designed to be sub-classed. The sub-class might provide new methods, or overriding methods. In either case, before these methods can be run, it is important to check that the class is initialized. So the IsInitialized() method is provided for that purpose. It is intended to be used by the new or overriding methods in the sub-class only, and not the calling code. It is also intended that IsInitialized() not be overridden. The way to provide this is by declaring IsInitialized() to be protected and non-virtual.


问:
What level of detail to use in an interface members descriptions?
I am extracting interfaces from some classes in .NET, and I am not completely sure about what level of detail of description to use for some of the interface members (properties, methods).

An example:

```<code>interface ISomeInterface
{
    /// <summary>
    /// Checks if the object is checked out.
    /// </summary>
    /// <returns>
    /// Returns true if the object is checked out, or if the object locking is not enabled,
    /// otherwise returns false.
    /// </returns>
    bool IsObjectCheckedOut();
}

class SomeImplementation : ISomeInterface
{
    public bool IsObjectCheckedOut()
    {
        // An implementation of the method that returns true if the object is checked out,
        // or if the object locking is not enabled
    }
}
</code>```

The part in question is the <returns>...</returns> section of the IsObjectCheckedOut description in the interface.

Is it ok to include such a detail about return value in the interface itself, as the code that will work with the interface should know exactly what that method will do? All the current implementations of the method will do just that. But is it ok to limit the possible other/future implementations by description this way?

Or should this not be included in the interface description, as there is no way to actually ensure that other/future implementations will do exactly this? Is it better to be as general as possible regarding the interface in such circumstances?

I am currently inclined to the latter option.

答:
I would advise taking a step back and looking at what you're trying to achieve.

What does the XML documentation give you? XDoc Documentation? Think about what you want to see in that document. Intellisense? Think about what you want to see when someone is using that method from the interface. Or are you just doing it because you think you should? If so then stop it, you're wasting valuable time.

Already I can see that the method name doesn't match what the method does. And that's probably the reason you're having to ask this question.

Should the method really be named IsObjectCheckedOutOrNonLockable()? Or does IsObjectNonLockable() implicitly include "checked out" on the objects you currently have implemented? Or is there a better description that covers all those conditions?

Does renaming the method make it more obvious what you should put in the XML documentation and more obvious what is expected of future implementations?


问:
Hiring at start-ups vs established companies
I have always wondered about this and perhaps experienced folks here can comment on this. I always read that big established software companies such as Google, Microsoft, etc are always wary of hiring software engineers/(or other related professionals) who don't exactly meet the job requirements, and would rather turn down a close "Yes/Maybe" decision.

There's also the general perception that start-ups are generally more willing to hire such "less-than-perfect" employees. But to me this sounds counter-intuitive: start-ups are generally much smaller and resource constrained so they would actually need a "10/10" hire while established companies with bigger teams and more resources would be willing to take a (small) risk on a hire.

Anyone have any comments on this from first-hand experience?

Thanks,

答:
My experience is that smaller startups are much more willing to hire someone who can do the job but may not have the credentials, so to speak.

what this means, is the smaller startup companies don't have much of an HR filter for you to get through.  They usually are more willing to to hire those without formal training/degrees and more likely to take a chance on someone then the larger companies. They either don't have an HR staff or, at least, have a smaller one. In many cases, the engineering staff (vp/ceo/etc.) can directly interview pretty much anyone because they have the time and resources to do so.

The larger corps simply don't.  Can you see The Gates interviewing every single developer who sends him a resume and is even remotely able to do the job?  I don't see THAT happening.


答:
About 15 years ago when I started programming for a job, less APIs were available, just because there was not as much out-of-the-box libraries available.

Nowadays with modern IDEs and extensive libraries either built in the library or development tool or 3th party libraries, APIs are more and more important.

However, there are still a lot of challenges, even with just using APIs:
- architectural decisions, i.e. what about usability, maintenance, non functional requirements.
- design desicisions, i.e. usage of design patterns, objects, classes etc. Also modelling has become more and more important
- implementation: this part has been made easier over the years, and thus less time consuming.
- testing, allthough testing was always needed (or should be needed), testing is more and more important to the increased complexity of software in general.

How to avoid:
- try to get up int he direction of making more design decisions or architectural decisions. Also since UI / GUI is more and more important, focus into that direction, especially if you have creative skills.


答: Be as specific as you can describing how interfaces should look and behave. There is no use having an interface method whose return value is ambiguous - it breaks the whole notion of interfaces. Just because few languages offer the ability to enforce all the requirements and intentions of the interface, such as the precondition and postcondition support in Eiffel, it should not stop you communicating expectations to both callers and implementers. </p>

Title: What level of detail to use in an interface members descriptions?

Body:
I am extracting interfaces from some classes in .NET, and I am not completely sure about what level of detail of description to use for some of the interface members (properties, methods).

An example:

```<code>interface ISomeInterface
{
    /// <summary>
    /// Checks if the object is checked out.
    /// </summary>
    /// <returns>
    /// Returns true if the object is checked out, or if the object locking is not enabled,
    /// otherwise returns false.
    /// </returns>
    bool IsObjectCheckedOut();
}

class SomeImplementation : ISomeInterface
{
    public bool IsObjectCheckedOut()
    {
        // An implementation of the method that returns true if the object is checked out,
        // or if the object locking is not enabled
    }
}
</code>```

The part in question is the <returns>...</returns> section of the IsObjectCheckedOut description in the interface.

Is it ok to include such a detail about return value in the interface itself, as the code that will work with the interface should know exactly what that method will do? All the current implementations of the method will do just that. But is it ok to limit the possible other/future implementations by description this way?

Or should this not be included in the interface description, as there is no way to actually ensure that other/future implementations will do exactly this? Is it better to be as general as possible regarding the interface in such circumstances?

I am currently inclined to the latter option.


答:
An interface defines an API and a protocol. I.e., two interfaces can have the same API, but have different protocols. Method A in Interface 1 can do one thing and method A in interface 2 can do a completely different thing.

An interface should only enforce an API (by the compiler) and a protocol (by the developer); it shouldn't enforce or even hint at any implementation details.

Your problem lies in the approach of "extracting the interface" from a concrete class.
You (and your code) already know (and possibly care) about the actual implementation.

Instead of doing that, try refactoring client code to use a hypothetical interface that looks right and its goal is self-explanatory by its use. Then, and only then, adjust your concrete class to implement that interface.


问:
Is scanning the ports considered harmful?
If any application is scanning the ports of other machines, to find out whether any particular service/application is running, will it be considered harmful? Is this treated as hacking?

How else can one find out on which port the desired application is running (without the user input)?

Let's say I only know the port range in which the other application could be running, but not the exact port. In this case, my application ping each of the port in range to check whether the other application is listening on it, using already defined protocol. Is this a normal design? Or is this considered harmful for the security?

答: It is not a good idea to scan for ports. Port scanning probably will be against network policies. You should make it configurable which port to connect, and use a default if not configured specifically.</p>


答:
Yes, portscans are considered a form of hacking, but a relatively low threat level (and pretty common), so it's unlikely to have any consequences except possibly getting your IP blocked.

How else can one find out on which port the desired application is running (without the user input)?

Applications typically run on a fixed "well-known" port that is hardcoded as default.

Title: Is scanning the ports considered harmful?

Body:
If any application is scanning the ports of other machines, to find out whether any particular service/application is running, will it be considered harmful? Is this treated as hacking?

How else can one find out on which port the desired application is running (without the user input)?

Let's say I only know the port range in which the other application could be running, but not the exact port. In this case, my application ping each of the port in range to check whether the other application is listening on it, using already defined protocol. Is this a normal design? Or is this considered harmful for the security?


答:
Smaller startups need good hires as much as corporations.  There may be a higher percentage of "risk" hires in startups because potentially there are less people to perform interviews and thus fewer diversified opions.

Additionally, when you are hiring someone, there's no such thing as a "maybe".  If the candidate isn't a fully qualified YES, then they're a NO.

Title: Hiring at start-ups vs established companies

Body:
I have always wondered about this and perhaps experienced folks here can comment on this. I always read that big established software companies such as Google, Microsoft, etc are always wary of hiring software engineers/(or other related professionals) who don't exactly meet the job requirements, and would rather turn down a close "Yes/Maybe" decision.

There's also the general perception that start-ups are generally more willing to hire such "less-than-perfect" employees. But to me this sounds counter-intuitive: start-ups are generally much smaller and resource constrained so they would actually need a "10/10" hire while established companies with bigger teams and more resources would be willing to take a (small) risk on a hire.

Anyone have any comments on this from first-hand experience?

Thanks,


问:
My father wants to learn PHP-MySQL to port his application. What I should do to help?
My father is a doctor/physician. About 15 years ago he started writing an application to handle his patient's medical records in his clinic at home. The app has the ability to input patient's medical records (obviously), search patients by some criteria, manage medicine stocks, output receipt to printer, and some more CRUDs.

He wrote it in dBase III+. A few years later he migrated to FoxPro 2.6 for DOS and finally in a few more years he rewrote his app in Visual FoxPro 9. And now (actually two years ago) he wants to rewrite it in PHP, but he doesn't know how.

The Visual FoxPro version of this app is still running and has no serious problem except sometimes it performs slowly. Usually there are 1-5 concurrent users. The binary and database files are shared via windows share. He did all the coding as a hobby and for free (it is for his own clinic after all). He also use this app in two other offices he managed.

Some reasons of why he wants to rewrite in PHP-MySQL:

He wants to learn

Easier to deploy (?)

Easier client setup, need only a browser

What should I do to help my father? How should he start?

I explored some options:

I let my father learn PHP and MySQL (and HTML (and JavaScript?)) from scratch.

I create/bundle framework. I'm thinking on bundling CodeIgniter and a web UI framework (any suggestion?) especially to reduce effort on writing presentation codes.

What do you think?

tl;dr

My father (a doctor) wants to rewrite his Visual FoxPro app in PHP-MySQL. He knows very little of PHP and MySQL but he wants to learn. What should I do to help? How should he start?

Some facts:

My father is 50 years old.

His first encounter with a PC is in early 1980s. It was IBM PC with Intel 8088.

He knows BASIC.

He taught me how to use DOS and how to program with BASIC.

The other language he knows fairly well is dBase/FoxPro.

I got my bachelor CS degree last year.

I know the internals of my father's app because sometime he wants me to help him writing his app.

Update

After reading early responses, there seem to be better alternatives to PHP for this case. I'm open for other language/technology suggestions.

答: Not to be a Java troll (which I am, but I'm trying to cut back), why not use the nice Google App Engine and Google Web Toolkit plugins for Eclipse and make it all in Java? You don't have to touch database configurations, Java is pretty easy to learn, you have a (somewhat) decent UI visual editor for GWT, and test deployements and production deployements are a one click deal. Plus when you tinker with the client code you only need to refresh your browser to see the change (when testing the app locally). And you're abstracted away from Javascript and Ajax.</p>


答:
Well, since you have a CS degree, and your father is also knowledgeable, you should have no problem.This should be simple to prototype, since you already have the application written.

Server:
For simplicity, grab a copy of LAMP(linux), WAMP(windows), or MAMP(macintosh) server and install it on your machine, make sure to install a mysql and php environment. Very simple process. Google is there for you!

HTML / CSS Template:
If you want your clients viewing this on browsers with no worries, then you need to worry about cross browser compatability. Luckily, very smart people have done this for us. Check out HTML5 Boilerplate, Initializer, Normalize.css respectively.

You should be able to google your way around using phpmyadmin (a simple GUI for interacting with your database) and get a backend database going. PHP database connectivity should be very easy for you.

For learning PHP, it is very easy to copy and paste from the web. Try to avoid this. Grab an O'Reilly media book, or something from a publisher you trust, and keep it for reference.

I think that covers the basics...

Title: My father wants to learn PHP-MySQL to port his application. What I should do to help?

Body:
My father is a doctor/physician. About 15 years ago he started writing an application to handle his patient's medical records in his clinic at home. The app has the ability to input patient's medical records (obviously), search patients by some criteria, manage medicine stocks, output receipt to printer, and some more CRUDs.

He wrote it in dBase III+. A few years later he migrated to FoxPro 2.6 for DOS and finally in a few more years he rewrote his app in Visual FoxPro 9. And now (actually two years ago) he wants to rewrite it in PHP, but he doesn't know how.

The Visual FoxPro version of this app is still running and has no serious problem except sometimes it performs slowly. Usually there are 1-5 concurrent users. The binary and database files are shared via windows share. He did all the coding as a hobby and for free (it is for his own clinic after all). He also use this app in two other offices he managed.

Some reasons of why he wants to rewrite in PHP-MySQL:

He wants to learn

Easier to deploy (?)

Easier client setup, need only a browser

What should I do to help my father? How should he start?

I explored some options:

I let my father learn PHP and MySQL (and HTML (and JavaScript?)) from scratch.

I create/bundle framework. I'm thinking on bundling CodeIgniter and a web UI framework (any suggestion?) especially to reduce effort on writing presentation codes.

What do you think?

tl;dr

My father (a doctor) wants to rewrite his Visual FoxPro app in PHP-MySQL. He knows very little of PHP and MySQL but he wants to learn. What should I do to help? How should he start?

Some facts:

My father is 50 years old.

His first encounter with a PC is in early 1980s. It was IBM PC with Intel 8088.

He knows BASIC.

He taught me how to use DOS and how to program with BASIC.

The other language he knows fairly well is dBase/FoxPro.

I got my bachelor CS degree last year.

I know the internals of my father's app because sometime he wants me to help him writing his app.

Update

After reading early responses, there seem to be better alternatives to PHP for this case. I'm open for other language/technology suggestions.


问:
Empirical evidence for choice of programming paradigm to address a problem
The C2 wiki has a discussion of Empirical Evidence for Object-Oriented Programming that basically concludes there is none beyond appeal to authority. This was last edited in 2008. Discussion here seems to bear this out: questions on whether OO is outdated, when functional programming is a bad choice and the advantages and disadvantages of AOP are all answered with contributors' opinions without reliance on evidence.

Of course, opinions of established and reputed practitioners are welcome and valuable things to have, but they're more plausible when they're consistent with experimental data. Does this evidence exist? I know that evidence-based software engineering is a thing, but can I practice it in this context? Specifically, if I have a particular problem P that I want to solve by writing software, does there exist a body of knowledge, studies and research that would let me see how the outcome of solving problems like P has depended on the choice of programming paradigm?

I know that which paradigm comes out as "the right answer" can depend on what metrics a particular study pays attention to, on what conditions the study holds constant or varies, and doubtless on other factors too. That doesn't affect my desire to find this information and critically appraise it.

It becomes clear that some people think I'm looking for a "turn the crank" solution - some sausage machine into which I put information about my problem and out of which comes a word like "functional" or "structured". This is not my intention. What I'm looking for is research into how - with a lot of caveats and assumptions that I'm not going into here but good literature on the matter would - certain properties of software vary depending on the problem and the choice of paradigm.

In other words: some people say "OO gives better flexibility" or "functional programs have fewer bugs" - (part of) what I'm asking for is the evidence of this. The rest is asking for evidence against this, or the assumptions under which these statements are true, or evidence showing that these considerations aren't important. There are plenty of opinions on why one paradigm is better than another; is there anything objective behind any of these?

答:
It seems that in many cases there isn't a corpus of research big enough or of high-enough quality to allow general conclusions to be drawn about whether one practice in software engineering is better than another. I was specifically looking for research into working in different paradigms, but the lack of availability is not limited to that arena so I'll frame my answer in a broader sense.

A paper from 2004, Evidence-Based Software Engineering by Kitchenham et al, covers quite succinctly the benefits to be derived from an evidence-based approach and the problems with implementing it in software engineering. I won't discuss the benefits side here (it's clear from the question that I would like to be able to work in this way), but the problems are relevant as an answer to the question I asked.

firstly, if you're not a member of the ACM then you probably can't read the link above at all, which covers the first problem: not all of the extant research is actually available to practitioners.

much software engineering practice goes on in secret as part of commercially-confidential processes so there's no visibility onto what did or didn't work for those people.

software engineering is a skilled practice, so it's hard (not impossible, merely hard) to arrange a suitably-blinded study.

the different parts of the software lifecycle affect each others' outcomes to an extent that's hard to control for in any experiment.

as evinced by the discussions here, many practitioners do not see "the literature" (or the academic side of software engineering in general) as relevant to their work.

So the answer I'm after is "no", the evidence I'm looking for probably doesn't exist. I should choose my paradigm based on the existing popular criteria of what I know, what's cool and expert opinion.


答:
If the network in question has any kind of intrusion detection, scanning a significant number of ports will tend to throw up a flag and attract administrator attention. Depending on the policies in place and whether you are inside or outside the network, the response could be anything from blocking your scans to cutting off the machine doing the scan to coming and finding you to yell at you.

Most applications run at a fixed 'well-known' port number (for instance, web servers normally answer at port 80). Thus, you usually don't have to scan for things.

If you absolutely have to have a range of ports (I can't think why), then you need to keep the range of ports small (5-10 ports would be good) and don't hammer on all of them as fast as possible. You'll be unlikely to attract attention if you go at reasonable rates.


答:
Yes, as other have noted use a well-known or default port.  Make it configurable.

Scanning may not work anyway as some sites/servers will stop responding to you if it detects port scanning.

Port scanning for security purposes is acceptable with appropriate authorization.  In this case it us used to determine if services which should not be available are available.  It can also be used to provide a map of listening ports for additional uses including service auditing.


答:
In python, there is no switch statement, because if/elif/else is nice:

```<code>a = 5

if a==1:
    print "do this"
elif a == 2:
    print "do that"
elif a == 3:
    print "do the other"
elif 3 < a < 9:
    print "do more"
elif 9 <= a < 15:
    print "do nothing"
else:
    print "say sorry"
</code>```

Simple right?

Title: Should I use switch statements or long if...else chains?

Body:
Often when I hear about the switch statement, its put off as a way to replace long if...else chains. But it seems that when I use the switch statement I'm writing more code that I would be just writing if...else. You also have other issues like keeping all variables for all calls in the same scope.

Here's some code that represents the flow I normally write (thanks to diam)

```<code>String comment;   // The generated insult.
int which = (int)(Math.random() * 3);  //  Result is 0, 1, or 2.

if (which == 0) {
    comment = "You look so much better than usual.";
} else if (which == 1) {
    comment = "Your work is up to its usual standards.";
} else if (which == 2) {
    comment = "You're quite competent for so little experience.";
} else {
    comment = "Oops -- something is wrong with this code.";
}
</code>```

Then they want me to replace that with this:

```<code>String comment;   // The generated insult.
int which = (int)(Math.random() * 3);  //  Result is 0, 1, or 2.

switch (which) {
    case 0:
             comment = "You look so much better than usual.";
    break;
    case 1:
             comment = "Your work is up to its usual standards.";
    break;
    case 2:
             comment = "You're quite competent for so little experience.";
    break;
    default:
             comment = "Oops -- something is wrong with this code.";
}
</code>```

Seems like a lot more code in a much more awkward syntax. But is there really an advantage to using the switch statement?

Body:
In python, there is no switch statement, because if/elif/else is nice:

a = 5

if a==1:
    print "do this"
elif a == 2:
    print "do that"
elif a == 3:
    print "do the other"
elif 3 < a < 9:
    print "do more"
elif 9 <= a < 15:
    print "do nothing"
else:
    print "say sorry"

Simple right?


问:
Distributed Transaction Framework across webservices
I am designing a new system that has one central web service and several site web services which are spread across the country and some overseas. It has some data that must be identical on all sites.

So my plan is to maintain that data in the central web service and then "sync" the data to sites. This includes inserts, edits and deletes.

I see a problem when deleting, if one site has used the record, then I need to undo the delete that has happened on the other servers. This lead me to idea that I need some sort of transaction system that can work across different web servers.

Before I design one from scratch, I would like to know if anyone has come across this sort of problem and if there are any frame works or even design patterns that might aid me?

答:
This is a classic distributed transaction. </p>

<p>First issue a lock to each on he web-services, that lock will freeze all transactions on the targeted record(s). Once all the locks have been secured, issue the delete command.  </p>

Body:
This is a classic distributed transaction.

First issue a lock to each on he web-services, that lock will freeze all transactions on the targeted record(s). Once all the locks have been secured, issue the delete command.


答:
Sounds like you want to use the two phase commit protocol.  A lot of hits come back from a google search, so you'll find plenty to research with.

Here's a quick description from the Wikipedia site.

```
In a "normal execution" of any single distributed transaction, i.e., when no failure
occurs, which is typically the most frequent situation, the protocol comprises two phases:

    The commit-request phase (or voting phase), in which a coordinator process attempts
to prepare all the transaction's participating processes (named participants, cohorts,
or workers) to take the necessary steps for either committing or aborting the transaction
and to vote, either "Yes": commit (if the transaction participant's local portion
execution has ended properly), or "No": abort (if a problem has been detected with the
local portion), and
    The commit phase, in which, based on voting of the cohorts, the coordinator decides
whether to commit (only if all have voted "Yes") or abort the transaction (otherwise),
and notifies the result to all the cohorts. The cohorts then follow with the needed
actions (commit or abort) with their local transactional resources (also called
recoverable resources; e.g., database data) and their respective portions in the
transaction's other output (if applicable).

```

Title: Distributed Transaction Framework across webservices

Body:
I am designing a new system that has one central web service and several site web services which are spread across the country and some overseas. It has some data that must be identical on all sites.

So my plan is to maintain that data in the central web service and then "sync" the data to sites. This includes inserts, edits and deletes.

I see a problem when deleting, if one site has used the record, then I need to undo the delete that has happened on the other servers. This lead me to idea that I need some sort of transaction system that can work across different web servers.

Before I design one from scratch, I would like to know if anyone has come across this sort of problem and if there are any frame works or even design patterns that might aid me?

Body:
Sounds like you want to use the two phase commit protocol.  A lot of hits come back from a google search, so you'll find plenty to research with.

Here's a quick description from the Wikipedia site.

In a "normal execution" of any single distributed transaction, i.e., when no failure
occurs, which is typically the most frequent situation, the protocol comprises two phases:

    The commit-request phase (or voting phase), in which a coordinator process attempts
to prepare all the transaction's participating processes (named participants, cohorts,
or workers) to take the necessary steps for either committing or aborting the transaction
and to vote, either "Yes": commit (if the transaction participant's local portion
execution has ended properly), or "No": abort (if a problem has been detected with the
local portion), and
    The commit phase, in which, based on voting of the cohorts, the coordinator decides
whether to commit (only if all have voted "Yes") or abort the transaction (otherwise),
and notifies the result to all the cohorts. The cohorts then follow with the needed
actions (commit or abort) with their local transactional resources (also called
recoverable resources; e.g., database data) and their respective portions in the
transaction's other output (if applicable).


问:
Does Rhodes actually create a Native app or a Hybrid app
Rhodes claims to be able to build Native apps but I'm not sure or not if this means a native shell + embedded Web Browser like PhoneGap or does it create a true Native app like (I believe) Titanium does.</p>

答:
It embeds a web browser like PhoneGap.

http://docs.rhomobile.com/rhodes/introduction#rhodes-application

There are advantages and disadvantages to each. The embedded web browser approach is likely to minimise effort for you but there may be functionality limitations such as camera or accelerometer access, and it may be slow, as the Facebook apps developed in this way are.

http://www.guardian.co.uk/technology/appsblog/2012/aug/24/facebook-iphone-app


问:
What is the opposite of initialize (or init)?
The term will be used as a method name. The method is called when a part of the user interface is hidden (or removed), and it is used to reset values to default and dispose objects that will not be used any more.

Possible names are: release, remove, dispose, clear etc.

Which do you think is the most appropriate?

答:
My first thought was tear down, but that is used in many testing frameworks. Finalize and dispose have similar problems. Reset, or clean up both seem like good choices. Reinitialize makes it clear it goes back to the initialized state, which would be good if the state you go back to is the initial state.

Just make sure your term isn't overloaded in your current context.


答: I quite like 'destroy'. Couldn't be clearer unless you're writing a video game or something.</p>

Title: What is the opposite of initialize (or init)?

Body:
The term will be used as a method name. The method is called when a part of the user interface is hidden (or removed), and it is used to reset values to default and dispose objects that will not be used any more.

Possible names are: release, remove, dispose, clear etc.

Which do you think is the most appropriate?


答:
I typically go with either Finalize, Destroy, or Terminate depending on what the objects function is.

For the case you describe, Finalize is what I would go with based on my scheme.


答: If the object the method is being called on will cease to be used, I would just use the standard destructor.  That doesn't sound like the case, though, so rather than getting too generic, a better name is probably something like hide() if the object itself is being hidden or hideUserInterfacePart() if composed objects are being hidden.


答:
http://www.wordhippo.com/what-is/the-opposite-of/initialize.html

I would go with finalize. However I think it is a little bit dependent the exact use case: e.g. If you use it mainly to to release resources, close connections, files then release would be more meaningful.

If you are looking for a notion for general use, or standardize, I would choose some less meaningful, something with no special meaning like release, or remove.

The concept of init vs (whatever) is similar to (constructor vs destructor), or in java finalize.

(Note: If the language has the concept construct and destruct objects, its little or no need to use init(). )


问:
DDD / Layers and legacy systems
I have to refactor a complex C# app (many dialogs, mixed logic and so on).

There is a part managing the communication with special hardware equipments (sending commands and receive data via asynchronous c# callbacks). The code is "spaghetti" with mixed UI/Logic/Communication/etc and my task is to split the layers in a DDD sense.

So, to which layer belongs a callback driver routine?

The callbacks are creating "bubbles" in the system, up to the UI layer and because of this I cannot enforce the essential principle that any element of a layer depends only on other elements in the same layer or on elements of the layers "beneath" it.

答: You're not as inexperienced with special hardware that sends asynchronous events as you seem to think you are.  That describes a mouse or keyboard perfectly.  Just use the same patterns.  In the driver layer, have some sort of registerListener method and create an interface for other classes to implement for receiving events.

OwnerDisplayName: CSM

Title: DDD / Layers and legacy systems


答:
close()

No-one has proposed close() yet.  Java 7 has a new "try with resources" feature.  A class that gets cleaned up automatically has to implement java.lang.AutoCloseable which has a single close() method.  shutdown() or cleanup() might be good too.

Not finalize()

finalize() means something specific to the garbage collector in Java, and the way it works is a little weird.  I would stay away from finalize() unless you want exactly what Java does with finalize().


答:
and it is used to reset values to default and dispose objects that
  will not be used any more.

reset seems like a good term if you're resetting the object to defaults. reinitialize could also be appropriate if the use of this object is similar to what initialize does. It sounds like this method will dispose other objects, not the one that's receiving the message, in which case either of the above should be fine. If you're really doing the opposite of init and preparing the receiver to be destroyed, dispose would be a good choice.


答:
There are programming contests that use a computer grading system and allow you to write in various languages and post all kinds of results and things.  I bet they have good data for you.  Here's a list of 8:
http://www.makeuseof.com/tag/8-onlineprogramming-contests-challenge-win/

I imagine you can make meaningful comparisons of solutions to very simple and clear-cut problems, like sum of squares, or Fibonacci series, or drawing a straight line using the Bresenham's line algorithm.  Most real-world programming tasks do not have such clear-cut goal posts and every language has its sweet spots.  Much of the benefit of a language is subjective.  You might find more meaningful data by surveying programmer and client happiness than by counting lines of code or numbers of defects.

I remember when I spent a half day writing one of my first Awk programs, I thought it would have taken me a whole week to do the "same" thing in Java.  But that's because my Java solution would have focused on being robust where as the Awk solution was quick and dirty and required some manual tweaking on the input and output and was really throw-away when I was done.  Awk and Java are both great, just not for the same things.

I guess what I'm saying is that for real world applications, comparing languages or tools in a meaningful way is extremely difficult - the old apples and oranges issue.  Good luck!  I'd love to see what you find out.

Title: Empirical evidence for choice of programming paradigm to address a problem

Body:
The C2 wiki has a discussion of Empirical Evidence for Object-Oriented Programming that basically concludes there is none beyond appeal to authority. This was last edited in 2008. Discussion here seems to bear this out: questions on whether OO is outdated, when functional programming is a bad choice and the advantages and disadvantages of AOP are all answered with contributors' opinions without reliance on evidence.

Of course, opinions of established and reputed practitioners are welcome and valuable things to have, but they're more plausible when they're consistent with experimental data. Does this evidence exist? I know that evidence-based software engineering is a thing, but can I practice it in this context? Specifically, if I have a particular problem P that I want to solve by writing software, does there exist a body of knowledge, studies and research that would let me see how the outcome of solving problems like P has depended on the choice of programming paradigm?

I know that which paradigm comes out as "the right answer" can depend on what metrics a particular study pays attention to, on what conditions the study holds constant or varies, and doubtless on other factors too. That doesn't affect my desire to find this information and critically appraise it.

It becomes clear that some people think I'm looking for a "turn the crank" solution - some sausage machine into which I put information about my problem and out of which comes a word like "functional" or "structured". This is not my intention. What I'm looking for is research into how - with a lot of caveats and assumptions that I'm not going into here but good literature on the matter would - certain properties of software vary depending on the problem and the choice of paradigm.

In other words: some people say "OO gives better flexibility" or "functional programs have fewer bugs" - (part of) what I'm asking for is the evidence of this. The rest is asking for evidence against this, or the assumptions under which these statements are true, or evidence showing that these considerations aren't important. There are plenty of opinions on why one paradigm is better than another; is there anything objective behind any of these?


答:
Some questions in response to your question:

Is the computer on the other end under your "control" (on the same LAN/WAN/VPN, accessible by you under some agreement with whatever remote network the computer is hooked into)?

Are you scanning "intelligently" (trying the ports most likely to be the ones used first)?

Could there be multiple copies of the same or similar software running on different ports?

If the answers are "yes", "yes", and "no", respectively, then a port scan is probably permissible. If you don't know exactly which port you must connect on (and it's not the default for the application or higher-tier protocol being used), then the only two options are to ask some authority (human or automated) or to try all possibilities.

Things that are always bad about port scanning are:

Port scans are a common attack precursor; the attacker is looking for an open door to establish a connection for further exploits. Thus, sysadmins and the hardware they maintain will see your scan, assume it's hostile and take steps to shut you down.

If port scans are to be expected as normal, the effectiveness of many anti-hacking tools is greatly reduced. As in the previous point, port scans are a common precursor to an attack. If some scans are to be expected as normal, and others shut down as hacking, the sysadmin/firewall must know exactly which is which (and whenever there's a legitimate way to get in, there's a way to spoof it).

Port scans take time. If the remote computer ignores rather than rejects connection requests, each attempt must time out (taking several seconds) instead of your scan being able to move on to the next port after a rejection (bound mainly by threading and network latency).

However, targeted port scans on computers under your control can be a useful diagnostic. I implemented a port scanner into some software my company's help desk uses, as a diagnostic to determine why a machine they support is responding to pings but not allowing more advanced access.


答:
Port scanning is rude, likely to be against network policies, and won't scale very well.

There are systems intended for things like service discovery, such as zeroconf.  Look into those.


答:
I use :

initialize()

terminate()

I find it the more appropriate:

it's hard to not see it in code, because it's both long words (I don't use init)

it's correct english (AFAIK)

in my head, terminate avoids ambiguity. It doesn't match begin (which matches end), start (which matches stop), create  (which matches destroy), setup  (which matches unset), load (which matches unload) etc.

Some people could find it a question of taste though.


答: You might want to look at the event aggregator pattern. On one side, you will have the code that interfaces with the hardware. When a message comes in from the hardware, you should post it to the event aggregator (or maybe convert it into an internal event type and post it). Any other component that is interested in that information can subscribe to it and receive it when it comes through. This pattern decouples the code that interfaces with the hardware from the rest of your system.</p>

Title: DDD / Layers and legacy systems

Body:
I have to refactor a complex C# app (many dialogs, mixed logic and so on).

There is a part managing the communication with special hardware equipments (sending commands and receive data via asynchronous c# callbacks). The code is "spaghetti" with mixed UI/Logic/Communication/etc and my task is to split the layers in a DDD sense.

So, to which layer belongs a callback driver routine?

The callbacks are creating "bubbles" in the system, up to the UI layer and because of this I cannot enforce the essential principle that any element of a layer depends only on other elements in the same layer or on elements of the layers "beneath" it.


问:
Is it a good practice to have Epics under User Stories?
In my current team there is a practice of putting Epics under User Stories and sometimes even User Stories or Epics under Tasks! When questioned, the usual reply is: "if it is not a good practice then the project management tool would not have allowed doing so!" (IBM Rational Team Concert, for one does not prevent such practice.)

What do the experts here think about this?

答:
I would say that beyond the admonition that user stories be small enough to finish in a sprint, it's really a matter of what works best for the team, and tools should lean toward flexibility rather than arbitrary restrictions.

For most teams in most circumstances, putting an epic under a task makes no sense, but I can think of some use cases for the tool allowing it.  For example, we often have a story where the output of that story is a set of future stories, like to investigate a feature and break it down to the user story level.  Being able to attach those stories to the investigation story would be extremely convenient, then split them off before you close it.

For another example, maybe something turns out to be a lot more difficult than you first expected, and you need a convenient place to rescope the work.  Just because you've never needed a feature doesn't mean it's useless.


问:
Must all new features go through betatest?
Obviously, small usability fixes and bugfixes go directly into the stable product. What about small new features? Can you afford to just release them after internal testing, or do they have to be betatested by customers first?

Situation: This is a young commercial project, produced by a one-person company. It has an existing userbase and is at it's second major version. Previous betatests have produced some results, however most feedback came from the stable product and not from beta versions.

答: If you're code has good test coverage, including unit and integrations tests, and it's not mission critical software, I personally don't see the harm in skipping a beta test version.  After all, a beta test is only useful if people actually use it to test it for issues, which it sounds like is not the case here.  </p>


问:
Do story points have a direct relation with task estimates?
In my current team, where we run multiple scrums, the Story points are usually based on the effort required to complete the User Story. For example if an User Story has 2 tasks, both needing 5 days each, they the Story is assigned 10 points. So 1 day of effort is considered to be one Story point.

Is this practice a good one?

答:
Yes, it's fine.  Story points are abstract units.  They may be related or derived from real units, but it's not important what units, as long as all of the stories use the same units.  Since the number of units of work allowed into an iteration is based on the number of units of work completed in the past, the units must be consistent.

Here's an example: Suppose that we tend to overestimate, on average, taking half the time to do a task as we estimated.  In the last week-sized iteration we estimated 10 days worth of work but took five actual days to do them.  Since past performance is 10 estimated days, we allow 10 estimated days into the next iteration.  As long as our estimates are consistently bad, it all works out.  That's why the actual units don't matter.


答:
Ideally, sure, you'd want actual users to have a chance to test the new functionality out.  But thats not always feasable/practical, and the effort in doing so doesnt always pay off.  I agree that beta testing doesnt always produce the information you need in such a situation.  Whats often most helpful for small changes is to have a quick single round of 'testing' by beta testers to ensure there are no glaring problems.

If you are comfortable with the internal testing, what you can do is make the beta available for those who want it for a short period.  On your website, or wherever is appropriate.  You may get some feedback on it, maybe not (depends on the features and size/nature of the user base).  After a short 'open beta', unless major problems are reported, send it out the door.

If your user base allows, perhaps build a small mailing list of users who'd be interested in trying beta builds.  That can get a beta build into the hands of a few customers just to ensure there arent any show stoppers you might have missed.  It doesnt have to be a formal beta process.

Another option here is to separate your development channels.  If you have an auto-updater built into your software, make an option for the user to be notified of beta updates.  Put a beta update online, and when you are satisfied with it, mark it as a release so that everyone else will get notified of the update.  This way you do a 'soft' roll out, with a subset of the users getting the update, so if there is a problem, only 10% of your users are affected, not 100%.

Title: Must all new features go through betatest?

Body:
Obviously, small usability fixes and bugfixes go directly into the stable product. What about small new features? Can you afford to just release them after internal testing, or do they have to be betatested by customers first?

Situation: This is a young commercial project, produced by a one-person company. It has an existing userbase and is at it's second major version. Previous betatests have produced some results, however most feedback came from the stable product and not from beta versions.


答:
I don't want to discourage beta-testing, but you might want to look into regression testing - to ensure that your "fix" doesn't break anything else.  I collect my test plans for each new feature, so that I can later retest that those features aren't broken when new functionality is introduced.  A basic plan that tests the most used and most important parts of the system, with links to detailed plans for specific parts of the system seems to work best, so that you can mix and match to focus your testing for a specific release.

If a full, written regression test is too much for you at this point, pretend to demonstrate the features of the software to an imaginary audience.  I find more bugs that way...


问:
Is it OK to mix C and C++ in an interview?
If I am asked in an interview to write down some code, should I completely stick with C++ or is it acceptable to "mix" the two to write easy code as it comes to my mind?

I'll explain it: if I'm asked to create a "stack" data type, a C++ class is perfectly suited, while if I need to parse some strings a strtok/sscanf is far easier than STL. On the other hand, if I need a generic container STL and templates are the way to go.

Everything can be done in C or in C++, but in an interview I can't code everything or remember every standard/STL function. What is an acceptable tradeoff?

答:
Unless specified, most programming questions will let you use whatever language you want when answering a specific question. You may want to explain which language you are using to answer the specific question to avoid confusion and explain why you are using it.

If you are not sure if this will be OK with the interviewer, ask - it is absolutely acceptable to ask if you can answer different questions using different languages (in most on-paper answers, pseudo-code will be more than acceptable).


答:
You should just ask to the interviewer what he prefer, if you know how to use both.

Depending on his answer you can discover:

if he really know the differences between C and C++;

if he knows about C++ standard library;

if it's important to him.

There is no generic answer to this question. It's too dependent on the job and the objectives of the recruiter. If he wants you to show language knowledge then he will be specific. If he want you to show you problem solving skills, and communication skills, then he will not really care.

Title: Is it OK to mix C and C++ in an interview?

Body:
If I am asked in an interview to write down some code, should I completely stick with C++ or is it acceptable to "mix" the two to write easy code as it comes to my mind?

I'll explain it: if I'm asked to create a "stack" data type, a C++ class is perfectly suited, while if I need to parse some strings a strtok/sscanf is far easier than STL. On the other hand, if I need a generic container STL and templates are the way to go.

Everything can be done in C or in C++, but in an interview I can't code everything or remember every standard/STL function. What is an acceptable tradeoff?


答: I think that when you are actually explicitly asked to do a short assignment in C++, it would be of utmost importance to actually stick with C++ and not mix C with it. Modern C is not a subset of modern C++, as such mixing the two would only imply that you aren't very familiar with what clean, modern C++ is like.</p>


答:
Unless your interviewer explicit request that you code in C or C++, I would just use what ever is appropriate for the interview.

For me, if my candidate was mixing the two up, I would be more interested in his strategy or reason for mixing the two language. Having someone on my team that can provide a solution and be able to justify the solution is extremely valuable.


答: To be really pedantic, the C++ offers supports for C, natively, maybe only a subset, but if the topic is the C++ the C programming language is included, and this is not an opinion, i would expect no arguments on that in a professional environment.


答:
Sometimes it's useful for a team to start like that if they're having difficult grasping the abstraction.  The most important thing is if it is working for you.  However, that practice also has several limitations:

Different team members will take different amounts of time on the same story.  10 points for the new hire should be equivalent to 10 points for the rock star, so you can dynamically reallocate stories as needed.

Stakeholders will be tempted to rely on those estimates directly instead of velocity.

Team members will be tempted to manipulate those estimates instead of thinking about it abstractly and letting velocity evolve naturally.

It's difficult to factor in things like interruptions, availability, etc.

Your resolution is fixed.  Stories smaller than a day are likely to get overestimated.

A lot of stories that involve debugging are difficult to estimate time-wise, but easier to estimate as a relative complexity.

You will annoy agile purists (never mind, put that in the "plus" column).

Title: Do story points have a direct relation with task estimates?

Body:
In my current team, where we run multiple scrums, the Story points are usually based on the effort required to complete the User Story. For example if an User Story has 2 tasks, both needing 5 days each, they the Story is assigned 10 points. So 1 day of effort is considered to be one Story point.

Is this practice a good one?


答:
Startups do tend to hire people who may not be fully qualified for the job because:

Expertise: start-ups generally do not have the expertise to hire more qualified people.  The CEO's generally hire less than perfect IT managers because usually they don't know any better. These IT managers tend to hire other IT professionals who may be less than perfect for their jobs because managers are not fully qualified to perform good interviews themselves.

Financial Constraints: start-ups are tied for funding so they look for folks who are willing to work long hours and put in extra effort to get the product/service out the door for lesser money, no matter if the code base internally truly sucks and is a real maintenance nightmare .  They generally offer promises for promotions, bonus, equity, etc. which mid-level folks do not mind working extra hard for.  It's common human psychology -- why should I work 10+ years to become a VP when I can work 1 year and if successful I can have the same title.  Or why should I work 20+ years to save $250k when I might be able to get that in a couple of years if the start-up is successful.  Big corporations generally pay a fair market salary to their employees, may or may not offer bonus/equity, and generally have clear career paths.


问:
Do immutable objects and DDD go together?
Consider a system that uses DDD (as well: any system that uses an ORM). The point of any system realistically, in nearly every use case, will be to manipulate those domain objects. Otherwise there's no real effect or purpose.

Modifying an immutable object will cause it to generate a new record after the object is persisted which creates massive bloat in the datasource (unless you delete previous records after modifications).

I can see the benefit of using immutable objects, but in this sense, I can't ever see a useful case for using immutable objects. Is this wrong?

答:
There is another way to use immutable objects...

Instead of storing a values 5.0, 6.0, 7.0, 8.0 and copying the whole record every time, you can instead store something like this: 5.0, +1.0, +1.0, +1.0, and then build a dependencies correctly to reconstruct the sequence 5.0, 6.0, 7.0, 8.0. This way small modifications only take small amount of memory...


问:
What should developers know about Windows executable binary file compression?
I'd never heard of this before, so shame on me, but programs like UPX can compress my files by 80% which is totally sweet, but I have no idea what the the disadvantages are in doing this.  Or even what the compressor does.

Website linked above doesn't say anything about dynamically linking DLLs but it mentions about compressing DESCENT 2 and about compressing Netscape 4.06. Also, it doesn't say what the tradeoffs are, only the benefits. If there weren't tradeoffs why wouldn't my linker compress the file?

If I have an environment where I have one executable and 20-30 DLL's, some of which are dynamically loaded an unloaded fairly arbitrarily, but not in loops (hopefully), do I take a big hit in processing time decompressing these DLL's when they're used?

答:
Does executable compression hurt performance?

As with most performance questions, I suspect the answer is, "Do some performance tests / profiling for yourself and see what you find out."

Performance might be worse, because you have the run-time overhead of decompression.

Performance might be better, because you have less data that you need to read off of the hard drive.

Performance might be worse, because the executable must be read and decompressed into memory, instead of letting the OS map virtual memory space directly to the on-disk executable, which would let it more easily load pages on demand, share them between multiple executable instances, and discard them if there's memory pressure.

Wikipedia has a more in-depth discussion of the advantages and disadvantages of executable compression.

Why don't linkers automatically use executable compression?

There are probably two main reasons:

It adds complexity, and in programming, complexity is Bad™.

It just doesn't give much benefit.  Saving space under c:\Program Files isn't of much use; modern hard drives are so big that your exe space is a non-issue.  Download speeds are important, but your installer already compresses your exes, so compressing them again with UPX won't make a substantial difference.  If you're trying to make a portable (no-installation-needed) executable, then UPX could help, but that's something of a niche market.


问:
What are C++/CX and C++/CLI, and how do they relate to C++ and WinRT?
I was considering taking up the challenge of learning C++ for designing Metro apps and that's when I came across C++/CX.

Can Metro apps be coded in C++ 11? Do they require C++/CX to work? And what exactly is C++/CX? Is it possible to create a Metro app using only C++, or is C++/CX required? Also, how does C++/CLI tie into this picture?

答:
Citing https://devblogs.microsoft.com/cppblog/ccx-part-0-of-n-an-introduction/:

. . . while C++/CX is syntactically similar to C++/CLI and thus looks almost
the same in many ways, it is semantically quite different. C++/CX code
is native code, no CLR required. Programming in C++/CLI can be very
challenging, as one must deftly juggle two very different object
models at the same time: the C++ object model with its deterministic
object lifetimes, and the garbage-collected CLI object model. C++/CX
is much simpler to work with, because the Windows Runtime, which is
based on COM, maps very well to the C++ programming language.

Windows Runtime defines a relatively simple, low-level Application
Binary Interface (ABI), and mandates that components define their
types using a common metadata format. C++/CX is not strictly required
to write a native Windows Runtime component: it is quite possible to
write Windows Runtime components using C++ without using the C++/CX
language extensions, and Visual C++ 2012 includes a library, the
Windows Runtime C++ Template Library (WRL), to help make this easier.
Many of the Windows Runtime components that ship as part of Windows
(in the Windows namespace) are written using WRL. There's no magic in
C++/CX: it just makes writing Windows Runtime components in C++ much,
much simpler and helps to cut the amount of repetitive and verbose
code that you would have to write when using a library-based solution
like WRL.

ContentLicense: CC BY-SA 4.0


答:
Microsoft used to simply make a C++ system that let you access their Windows API (called win32), then one day they invented .NET and figured everything had to change.

So they created "Managed Extensions for C++" which was basically C++ but with a load of non-standard extensions, adding keywords like __gc to support .NET features (like allocating on the GC heap rather than the native one)

But people didn't like this as it really wasn;t C++, having all those extra keywords, so Microsoft redesigned it and called it C++/CLI, which had a much smaller set of additional keywords but introduced syntax changes like the ^ (which is a reference 'pointer' to a .NET object on the GC heap).

A few years later and Microsoft has realised .NET isn't the silver bullet they said it was, and they also merged their in-fighting Windows and Developer teams. Part of this re-evaluation led to the creation of a brand new Windows API, called WinRT, that is entirely native code and this meant the old extensions were no longer useful, so Microsoft developed their C++ extensions to one that made working with the new WinRT API easier - by keeping a few extensions from C++/CLI (such as the ^).

So - there you go, 3 different versions of an extended C++ that is superficially C++. At least the latest version is native code again, so you don't need to use the extensions if you don't want to as you can directly access the API (it's called WRL and is a lot like the old ATL template classes)

If you think you might be coding cross-platform code you won't want to - you can change the API calls, but you cannot use the ^ on any compiler other than Visual C++. I'd recommend using the WRL API and keeping your code as standard as possible given the 'extra code' you'd need to write compared to C++/CX isn't so great.

Title: What are C++/CX and C++/CLI, and how do they relate to C++ and WinRT?

Body:
I was considering taking up the challenge of learning C++ for designing Metro apps and that's when I came across C++/CX.

Can Metro apps be coded in C++ 11? Do they require C++/CX to work? And what exactly is C++/CX? Is it possible to create a Metro app using only C++, or is C++/CX required? Also, how does C++/CLI tie into this picture?


问:
GPL - what is distribution?
An interesting point came up on another thread about alleged misappropriation of a GPL project.  In this case the enterprise software was used by some large companies who essentially took the code, changed the name, removed the GPL notices and used the result.

The point was - if the company did this and only used the software internally then there isn't any distribution and that's perfectly legal under GPL.  Modifications by their own employees for internal use would also be allowed.

So At what point does it become a distribution?

Presumably if they brought in outside contractors under 'work for hire' their modifications would also be internal and so not a distribution.

If they hired an external software outfit to do modifications and those changes were only used internally by the company - would those changes be distributed? Does the GPL apply to the client or to the external developers?

If the company then give the result to another department, another business unit, another company?  What if the other company is a wholly owned subsidiary?

ps.  yes I know the answer is ask a lawyer. But all the discussion I have seen over GPL2/GPL3 distribution has been about webservices - not about internal use.

答:
The essence of the GPL is that it does not limit what you can do with the software -- it imposes requirements on you when you Convey or Propagate the covered work.  To quote the GPLv3:

To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. [emphasis added]

So if the only use is with a private copy you are not Propagating or Conveying the work so the conditions that allow you to Convey the work are not relevant.

See this FAQ:

Does the GPL require that source code of modified versions be posted to the public?

The GPL does not require you to release your modified version, or any part of it. You are free to make modifications and use them privately, without ever releasing them. This applies to organizations (including companies), too; an organization can make a modified version and use it internally without ever releasing it outside the organization.

Title: GPL - what is distribution?


问:
Is there a name for this use of the State design pattern?
I'm looking to see if there is a particular name for this style of programming a certain kind of behavior into a program.

Said program runs in real time, in an update loop, and the program uses the State design pattern to do some work, but it's the specific way it does the work that I want to know about.

Here's how it's used.

```<code>- Object Foo constructed, with concrete StateA object in it
- First loop runs
--- Foo.Run function calls StateA.Bar
--- in StateA.Bar replace Foo's state to StateB
- Second loop runs
--- Foo.Run calls StateB.Bar
- Third loop runs
--- Foo.Run calls StateB.Bar
- Fourth loop
--- etc.
</code>```

So in short, Foo doesn't have an explicit Initialize function. It will just have Run, but Run will do something unique in the first frame to initialize something for Foo and then replace it with a different action that will repeat in all the frames following it- thus not needing to check if Foo's already initialized. It's just a "press start and go" action.

What would you call implementing this type of behavior?

答:
I would call it lazy initialization implemented using the state pattern:

...lazy initialization is the tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed.

This is typically accomplished by maintaining a flag indicating whether the process has taken place. Each time the desired object is summoned, the flag is tested. If it is ready, it is returned. If not, it is initialized on the spot.

See lazy evaluation for a general treatment of this idea. In heavily imperative languages this pattern carries hidden dangers, as does any programming habit that relies on shared state...


答:
I like release for a method that disposes of objects and other resources (e.g. as preparation for destruction). I would choose reset for a method that resets values to default.

If the "default" state doesn't require any resources, then reset may be able to call release to perform that part of its operations.


答: Yes, it is actually a commonly used practice, though some people would say you are estimating in Ideal Developer Days, or just Ideal Days.  Don't get hung up on using the term story point.  This method is actually mentioned in Mike Cohn's Agile Estimating and Planning book.  See Chapter 5. Estimating in Ideal Days.</p>


答:
A chainsaw will allow you to cut your leg off, that doesn't mean you should do it.

That being said, if there is reason the team is doing it (e.g. It helps to tie it back to a master road map or similar), then by all means continue.  If you are just doing it because the tool allows you too, then it beings to feel a lot like muda and a good topic for discussion at the next iteration retrospective.

Title: Is it a good practice to have Epics under User Stories?

Body:
In my current team there is a practice of putting Epics under User Stories and sometimes even User Stories or Epics under Tasks! When questioned, the usual reply is: "if it is not a good practice then the project management tool would not have allowed doing so!" (IBM Rational Team Concert, for one does not prevent such practice.)

What do the experts here think about this?


答:
I've been studying different ways to develop software for 30+ years.  There is
a dearth of good published evidence on choosing a paradigm.

I put together a large searchable ASCII bibliography. This includes a lot of IEEE and ACM papers and articles.  I tag the items with the type of evidence provided. Here are the most common tags:

```<code>...
133 =EXPERIMENT
177 =HISTORY
233 =IDEA
267 =SURVEY
338 =ESSAY
395 =THEORY
454 =ADVERT
491 =EXPERIENCE
500 =DEMO
</code>```

Now search for PARADIGM and count the tags

```<code>  1 =ESSAY
  1 =EXPERIENCE
  1 =HISTORY
  1 =IDEA
  1 =POLEMIC
  1 =SURVEY
  1 =TALK
</code>```

If you want to dig deeper, http://cse.csusb.edu/dick/lab.html
and I hope it helps...

Body:
I've been studying different ways to develop software for 30+ years.  There is
a dearth of good published evidence on choosing a paradigm.

I put together a large searchable ASCII bibliography. This includes a lot of IEEE and ACM papers and articles.  I tag the items with the type of evidence provided. Here are the most common tags:

...
133 =EXPERIMENT
177 =HISTORY
233 =IDEA
267 =SURVEY
338 =ESSAY
395 =THEORY
454 =ADVERT
491 =EXPERIENCE
500 =DEMO

Now search for PARADIGM and count the tags

  1 =ESSAY
  1 =EXPERIENCE
  1 =HISTORY
  1 =IDEA
  1 =POLEMIC
  1 =SURVEY
  1 =TALK

If you want to dig deeper, http://cse.csusb.edu/dick/lab.html
and I hope it helps...


问:
Using XML as data storage
I was thinking about the XML format and the following quote:

“XML is not a database. It was never meant to be a database. It is never going to be a database. Relational databases are proven technology with more than 20 years of implementation experience. They are solid, stable, useful products. They are not going away. XML is a very useful technology for moving data between different databases or between databases and other programs. However, it is not itself a database. Don't use it like one.“ -Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold (page 230, Part 4, Item 41, 2nd paragraph)

This seems to really stress that XML should not be used for data storage and should only be used for program to program interoperability.

Personally, I disagree and .NET's app.config file that's used to store a program's settings is an example of data storage in an XML file. However for databases rather than configurations etc XML should not be used.

To develop my point, I will use two examples:

A) Data about customers with fields that are all on one level i.e. there are a number of fields all relating to one customer with no children

B) Data about configuration of an application where nested fields and properties make a lot of sense

So my question is, Is this still a valid statement and is it now acceptable to store data using XML?

EDIT: I've sent an email to the author of that quote to ask for his input/extra context.

答:
This is really subjective.  That quote is, like, someones opinion, man.

Honestly, I think XML is a viable alternative to a database as it has multiple advantages over a RDMS, including low overhead, which equals cheaper storage (especially when using a hosting service that charges for databases separately).

Take a look at dasBlog and BlogEngine.  Both of those applications use xml for storage as a default.

That said.  It isn't a RDMS, and if you have high volatility (lots of updates, inserts, or deletes) in your data or require high availability, use a database.  XML is fine for storing small things like configuration data and low volatility data.

Title: Using XML as data storage


答:
Why would you actually want to use XML for storing data in the first place? I mean, it's a language after all...

While one could argue that it's a flexible and easy to understand format, that only applies when you have to do manual editing to the files. When you actually interact with the database with common interface(fetch data X which meets the requirements Y and Z, store/update data X, ...) those advantages become void.

Title: Using XML as data storage

Body:
I was thinking about the XML format and the following quote:

“XML is not a database. It was never meant to be a database. It is never going to be a database. Relational databases are proven technology with more than 20 years of implementation experience. They are solid, stable, useful products. They are not going away. XML is a very useful technology for moving data between different databases or between databases and other programs. However, it is not itself a database. Don't use it like one.“ -Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold (page 230, Part 4, Item 41, 2nd paragraph)

This seems to really stress that XML should not be used for data storage and should only be used for program to program interoperability.

Personally, I disagree and .NET's app.config file that's used to store a program's settings is an example of data storage in an XML file. However for databases rather than configurations etc XML should not be used.

To develop my point, I will use two examples:

A) Data about customers with fields that are all on one level i.e. there are a number of fields all relating to one customer with no children

B) Data about configuration of an application where nested fields and properties make a lot of sense

So my question is, Is this still a valid statement and is it now acceptable to store data using XML?

EDIT: I've sent an email to the author of that quote to ask for his input/extra context.


答:
XML Is viable depending on the context. If your data is pretty static, and not changing much (Sample data for example), yes XML Is a good use.

Configuration settings, sample data (even if it's millions of rows, but rarely changing), are all good uses of XML.

Hard disk read/writes are expensive, way more than accessing data from an Oracle/Sql stack.

Title: Using XML as data storage


问:
Why is it you never get as much done as you'd planned?
I always start the day thinking "I'll easily get this done by the end of the day" and set what looks like a realistic target.

So why do I never hit it? The task always ends up taking 3x longer due to unforeseen bugs, last minute changes etc.

Is it just me?  I don't seem to be getting any better predicting what can be done in a day.

答: You may want to expand you timeframe of predictability. Can you determine what you can get done in a week? If every task is taking three times longer than you thought, it sounds like you're consistent enough to be predictable. You just need to adjust by 3x ;)</p>


问:
What is the meaning of 'high cohesion'?
I am a student who recently joined a software development company as an intern.  Back at the university, one of my professors used to say that we have to strive to achieve "Low coupling and high cohesion".

I understand the meaning of low coupling. It means to keep the code of separate components separately, so that a change in one place does not break the code in another.

But what is meant by high cohesion. If it means integrating the various pieces of the same component well with each other, I dont understand how that becomes advantageous.

What is meant by high cohesion? Can an example be explained to understand its benefits?

答: It means that the parts of an object are closely related to the function of the object. This means that there is very little or no waste within the object in terms of function or responsibility. This in turn can improve the understanding of what the object in question is supposed to be used for.</p>

Title: What is the meaning of 'high cohesion'?


答:
High cohesion means to keep similar and related things together, to couple or fuse parts which share content, functionality, reason or goal. In other words, low cohesion could for example mean a function/class/code entity which serves multiple purposes rather than being "to the point". One of the carrying ideas is to do one thing and do it well. Others could include the obvious fact that you don't replicate similar functionality in many places. This also improves locality of the code base, certain kinds of things are found at a certain place(file, class, set of functions, ...) rather than being scattered around.

As an example, consider a class which serves two or three purposes: Loads/stores resources(for example a file) and then analyses and displays the content. Such a class has low cohesion because it manages at least two separate tasks which aren't related at all(file I/O, analysis and display). A high cohesion design could use distinct classes for loading and storing the resource, analysing it and then displaying it.

On the other hand, low coupling aims to keep distinct things separated - so that they interact with each other as little as possible which then reduces complexity and simplifies the design.

Title: What is the meaning of 'high cohesion'?

Body:
I am a student who recently joined a software development company as an intern.  Back at the university, one of my professors used to say that we have to strive to achieve "Low coupling and high cohesion".

I understand the meaning of low coupling. It means to keep the code of separate components separately, so that a change in one place does not break the code in another.

But what is meant by high cohesion. If it means integrating the various pieces of the same component well with each other, I dont understand how that becomes advantageous.

What is meant by high cohesion? Can an example be explained to understand its benefits?


问:
Should an image be able to resize itself in OOP?
I'm writing an app that will have an Image entity, and I'm already having trouble deciding whose responsibility each task should be.

First I have the Image class. It has a path, width, and other attributes.

Then I created an ImageRepository class, for retrieving images with a single and tested method, eg: findAllImagesWithoutThumbnail().

But now I also need to be able to createThumbnail(). Who should deal with that? I was thinking about having an ImageManager class, which would be an app-specific class (there would also be a third party image manipulation reusable component of choice, I'm not reinventing the wheel).

Or maybe it would be 0K to let the Image resize itself? Or let the ImageRepository and ImageManager be the same class?

What do you think?

答:
The question as asked is too vague to have a real answer as it really depends on how the Image objects are going to be used.

If you are only using the image at one size, and are resizing because the source image is the wrong size, it might be best to have the read code do the resizing.  Have your createImage method take a width/height and then return the image having been resized at that width/height.

If you need multiple sizes, and if memory isn't a concern, it is best to keep the image in memory as originally read and do any resizing at display time.  In such a case, there are a couple different designs you might use.  The image width and height would be fixed, but you'd either have a display method that took a position and a target height/width or you'd have some method taking a width/height that returned an object that whatever display system you are using.  Most drawing APIs I've used let you specify target size at draw time.

If the requirements cause for drawing at a different sizes often enough for performance to be a concern, you could have a method that creates a new image of a different size based on the original.  An alternative would be to have your Image class cache different representations internally so that the first time you call display with the thumbnail size it does the resizing while the second time it just draws the cached copy it saved from last time.  This uses more memory, but it is rare you'll have more than a few common resizings.

Another alternative is to have a single Image class that retains the base image and have that class contain one or more representations.  An Image itself wouldn't have a height/width.  Instead, it would start with one ImageRepresentation that had a height and width.  You'd draw this representation.  To "resize" an image, you'd ask the Image for a representation with certain height/width metrics.  This would cause it to then contain this new representation as well as the original.  This gives you a lot of control over exactly what is hanging around in memory at the cost of extra complexity.

I personally dislike classes that contain the word Manager because "manager" is a very vague word that doesn't really tell you much about exactly what the class does.  Does it manage object lifetime?  Does it stand between the rest of the application and the thing it manages?