问:
Logging-in and database connectivity in Android
I am completely new to Android development and have been reading many articles on the Android site and elsewhere.  There are a lot of articles that give very specific examples, but I haven’t bumped into the articles explaining the following:

Logging-In:

I haven’t noticed market applications forcing me to create login credentials (per se), only verification of access to types of permissions.  However, they surely must need some kind of login credential.  This means Android is providing this access (somehow).

How?

What process?

Database Location:

Some articles I’ve read “imply” a copy of the applications database is located on the phone (itself), others imply a database located elsewhere (cloud etc.).  Lastly, others imply they use both a local database for quick updates and a remote database for synching and error-analysis.

Is there a common database available for everyone to use?

I wouldn’t “think” so

Do you generate the local copy automatically every time?

Seems wasteful as you just have to re-create the whole thing and re-synch EVERY entity...but I’ve seen articles promote it.

Which databases are you using?

What best-practices do you use for synching?

Lastly:

If this forum isn't the right one I will be happy to move this question.  I looked at the Android Enthusiast forum and it didn't look like the correct one either.

答:
About databases, Android applications use SQLite natively. So if you need local storage you can just use it.

Applications that need to sync with an external database probably cache a number of query results and re-do the queries when needed, since it's uncommon you need the whole database locally (do yo make a local copy of a website database each and every time you use a web application inside your browser?)

For example, Twitter queries the central server when needed and keeps a cache of past tweets.

About credentials, roughly speaking every application you install creates its own user, so it doesn't really need to know any login credential, because it can use only its own user. Think of it as a kind of sudo.


问:
What's it like to work in a large programming team?
I've always felt lucky to work in a small programming team.  I think the most I've worked with is 11 programmers.  What is it like working on a project with hundreds of developers? Thousands?  What does scale and what doesn't?

EDIT: Thanks for all the responses! There seem to be very few positives:

possible to work on mega-large codebases

better internal career development

employee protection against abusive management (this is more -ve on small than +ve on large)

Is there any other benefit to large teams?

答:
I've worked (briefly) in an organization with at least hundreds of developers. But of course (?), the organization is internally partitioned so that you as a single employee don't have direct contact with all the others, that would be very hard to keep up with.

At that particular place, the software was split into components, with teams formed around components. Some teams would work with only a single (large) component, while many teams had the responsibility for a bunch of (smaller) components.

Of course this implies everything that working with a very large code base does; things like configuration management, building, integration, and so on become important, big, things that are in turn made by specialized devoted departments. And you awe them, for being able to collect all developer departments' output and regularly (once a week, where I worked) integrate it all together into one cohesive whole that actually worked.

OwnerDisplayName: Colin Pickard

ContentLicense: CC BY-SA 2.5

OwnerDisplayName: unwind


答:
Communication is what I have found to be the biggest thing that starts to degrade as the size of the team grows.  It becomes harder to get communication out, and harder to ensure that everyone is still on the same page.  I work indirectly on a team of about 75 developers, we use a common code base, but many of the 75 break out into smaller groups for individual "activities".  For us the communication is just an utter nightmare.

Management of larger groups is also harder, as in most environments after 8-12 people additional members of management get involved, sadly this just exaggerates the communication problem as it typically creates a "silo" type environment where the individual subsets start breaking off of the large group and try to keep knowledge inside their group.

Title: What's it like to work in a large programming team?

Body:
I've always felt lucky to work in a small programming team.  I think the most I've worked with is 11 programmers.  What is it like working on a project with hundreds of developers? Thousands?  What does scale and what doesn't?

EDIT: Thanks for all the responses! There seem to be very few positives:

possible to work on mega-large codebases

better internal career development

employee protection against abusive management (this is more -ve on small than +ve on large)

Is there any other benefit to large teams?

OwnerDisplayName: Mitchel Sellers


答:
I find bureaucracy scales really well.

Other than that, not a whole lot.  Large projects have large teams because there's no other way, not because it's more efficient (per developer).  You pay a cost as soon as you add a second person to the mix in terms of inefficiency (ie knowledge transfer and communication).

Largest project I worked on had 70 or so develoeprs across 5 different sites.  Even a one line change took a day minimum although that was in part due to the fact that the build took 45+ minutes over a network link from Zurich to London and starting the app took another 45 minutes.  Check-ins took about 5 minutes per file.  I'm not kidding.  The London developers could do this in a fraction of the time.

Anyway, what you tend to find is that on large projects you'll have a bunch of team members that you don't interact with all that much.  It's more like a loosely affiliated collection of mini projects.  I once read that Microsoft development tended to break down projects into teams of 5-7 developers, even for large projects like Microsoft Office.

Part of the difference is also the difference between small and large companies: larger ones tend to have more process, more rules, less flexibility and so on.  But that's by no means guaranteed.

It can be good for career development though.  In a small company someone has to leave or die before you can get a promotion (or the company has to be growing such that the team expands and you move upwards) whereas in larger dev departments you can move between teams and so on.

Additionally you can sometimes find some really smart people to attach yourself to and learn from.  In small companies being so isolated and self-reliant can be conducive to programmers going a bit "strange", sorta like a hermit.

OwnerDisplayName: cletus


答:
I once spent a year working on a team with over 500 people on it, about 200 of those were developers. We were delivering an EOA, integrating several different SOA solutions.

In practise there were somewhere between 30 and 50 teams, each with varying numbers of programmers (3 on our team), each with responsibility for a different aspect of the overall deliverable.

The largest team I ever worked on was about 15 people (this was only for 3 or 4 months, in a differnt company). I was technical lead on the team, and took to getting into work at 7am, I'd get 2 quite hours before everyone else got in, it was the only way I could get any of my own tasks done.

I wouldn't like to work on a team with more than 8 or 10 developers, 15 was far too many for a single team (the team could easily have been split into two, not my call unfortunately), 3 or 4 devs is a nice comfortable size IMHO

OwnerDisplayName: Binary Worrier


答:
Back when I made software for weapons systems we had LARGE teams of software developers.  Since no one person can wrap their head around the requirements (some of which were classified), it was all about teams and how the teams interacted with each other.

Configuration Management -- the nightly build process -- was a very big deal.  In those days it took a large distributed computing cluster to recompile the world every night.

Work authorizations -- and charging your time to the correct line item on the master overall project schedule -- was a big pain in the neck.  Down to the 0.1 hr. increments.

But the biggest deal was change notification.  Particularly interface changes.

This was so important, they invented this crazy two-layer process.  Most of the effort went into making sure that the Interface Change Notice Request (not the notification itself, but the request for notification) had elaborate support software with a database and reports and what-not.

Once the request was approved, the actual notice more-or-less went without saying.  Meaning that it was really a one-layer process and the request effectively was the notice.  But when you're doing waterfall development, everything has to be thought of a long time before any developers show up.

With so many people working in parallel, there was a Configuration Control Board.  All the various team managers, plus group of folks who's job was simply to coordinate changes.


答:
I've never worked for a large team of programmers, but the result of an organization increasing in size is usually more rules.  This isn't necessarily always a bad thing!  In addition to the rules that make everyone's life difficult, there are also more rules to protect employees and ensure good process.

I've seen managers in small organizations get away with things that would've immediately gotten them terminated by an enterprise HR department.

OwnerDisplayName: Jason Baker


答:
My first "real" programming job was to work with an army other others to develop international air traffic control systems. It was a very successful endeavor and we were considered a Capability Maturity Model Level 5 environment. Since then I've been in mid-sized and small shops. So, which is the best place to be? Personally I would take a smaller shop over s huge one any day. While some might consider Level 5 as the Holy Grail, for me it was suffocating. Everything has to be documented, approved, signed-off, etc. Don't get me wrong, I defintely see the value in it, especially for systems as critical as air traffic control, but the question is how do you want to spend your day? Do you want the freedom of being able to dream things up and then implement them, or do you want to write to the requirements? Perhaps if I had stayed longer with the ATC system I might have risen to the level of being able to design as well as develop, but even that required X number of years, Y number of approvals, Z number of promotions--all well prescribed with no chance of deviation. It was stifling.

One last thing, in general I find the quality of developers to be much higher in smaller companies simply because they can't hide. Its not hard to be mediocre in a very large company, but it becomes painfully obvious in a small one and they often don't last long.

OwnerDisplayName: BillJ


答:
The one difference I've noticed with big projects is the office politics. The larger the projects the more dominant the politics are.

My first project out of school was a couple of hundred developers. As a cocky and naieve developer fresh from school I was really not ready for that. The only thing that saved my hiney (and it is the only thing that will ever really protect you) was the amount of friends I made.

That's the biggest lesson I learned from that. Try to make friends with everyone. Even the jerks. In particular, if you have a chance to stop work for a minute and have a conversation with someone you've never talked to before, do it.


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

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

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

答: Not to mention that some people speak/read multiple languages as well so the browser language setting and the desired language might not agree.</p>

ContentLicense: CC BY-SA 3.0


问:
What kind of licensing is required for Visual FoxPro?
I am thinking of developing customized software for desktops in Visual FoxPro 9 and want to know what type of licensing is required.

As a developer, would I need to have a Visual FoxPro 9 license and would my users need to have the End User License? What type of licenses would be needed for commercial release? How would the licensing change if I released this as freeware?

答:
Frankly, I recommend that you don't waste your time starting any new development in VFP:

As a developer, you'd need a full license for VFP - a dead product.

VFP 9 "will be supported by Microsoft through 2015." (Source: Alan Grivier, Microsoft).

VFP is now in maintenance mode and is not going to be enhanced or updated

VFP apps can't be ported to 64-bit and are likely to increasingly encounter compatibility issues, for which there will be no fixes.

VFP apps most likely won't run in Win8 on ARM-based devices (tablets, phones, etc).

If you're going to start any new development, I strongly encourage you to do so in a modern development language, platform and toolset (e.g. C# in Visual Studio 2010).


问:
Creating a New Scripting Language For the Learning Experience?
Is creating a scripting language for my own personal learning experience worth it?

The reason I ask is that there are so many programming languages available already, I know mine will never have any actual use other than providing a good learning experience.  I do, however, see drawbacks with just trying to make a scripting language as a learning experience: it will take a lot of time and effort in which I could be doing something more "productive."

Would creating a programming language (including writing drafts of its intended purpose, syntax, philosophy, interpreter, etc) be worth the time, effort and learning experience? Or are there other projects I could benefit more from?

答:
It would take a while to do. Do you plan on maintaining it?

Would creating a programming language (including writing drafts of
  its  intended  purpose, syntax, philosophy, interpreter, etc) be worth
  the time,  effort and learning experience? Or are there  other
  projects I could benefit more from?

I'm assuming your financial status is not infinite, so I would say that it is not worth the time. You can spend your time on other useful projects that can make you money. Keep in mind this may not be the answer you are looking for, but from a logical stand point, I would say that your programming language may not be the right project at the moment. I would consider it if you were a retired computer scientist, and felt the need to contribute to the industry. It seems that you have a strong passion for programming, and that is great. But, building an entire new scripting language? That will be an extremely long project. In that time you could have built many applications that you can toss into your portfolio. I think the question is: Do I have the time and/or an open priority in my life that will enable me to create a new programming language from scratch?


答:
Build Up your Skills AND your Portfolio

In my opinion that would be a very good learning experience as it will:

force you to look under the hood,

guide you to learn how things are internally done,

encourage you to look at and compare other implementations,

keep your algorithmics skills up to speed,

make you code (and hopefully document) a lot, which isn't a
bad either,

give you a significant project and codebase you could share online
for all to see, for:

personal enjoyment and gratification,

showcasing your skills to potential employers,

communicate and exchange with peers interested in the same area,

potentially let it grow into something more...

So I do see this as produce, useful, and overall "worth it".

Get Started

Now you can use different approaches, depending on how much time you
plan on spending on this...:

If you have a limited time-frame, I'd say dive in and code the thing.

If you have a wider timeframe, then you could indeed go the
long-winded way and write specs, tutorials, manual, etc...

Start Small

I would rather recommend you to start small. No one has ever, that
I know of, written directly an awesome language just like that. You
stumble and fall, and fail, and fail and fail. Then you succeed, in
that it works but still sucks, so you start over once more. And you
add new features and it's finally getting cool, but suddenly you
realize that there's a fundamental concept that you screwed up at the
beginning. So you start over once more...

Seems very educational to me.

Go ahead (and share the link with us).

Small, as in "short"

But again, I'd recommend you start small. Don't be afraid if
people say it's going to take a lot of code and time. Not necessarily,
if you don't aim for a complicated language. Alan Kay and other
Xerox PARC engineers allegedly developed an early version of
Smalltalk that fit on a single sheet of paper, as an objective
for terseness (read Xerox PARC: Dealers of Lightning for details
about the history of the PARC). Seems a good, educational and
constrained enough approach (as long as it doesn't sacrifice
readability).

Small, as in "constrained"

You don't need to support right away an advanced type system,
higher-order funcitons and a mix of 42 different paradigms. It could
just be a mathematical expression language.

Re-use (and Peek at) Other's Knowledge

You may also want to have a look at tools that are used to write
languages from scratch. You can re-implement everything youself, but
maybe it's also worth looking at existing lexers and parser
generators, for instance.

And obviously, you may want to read up on compiler construction at large.

Now, if we modify your question to be "would it be THE MOST productive
use of your time?" it becomes an entirely different issue :)

There are tons of other learning projects you could tackle, and that
would train and showcase your skills equally well, if not better. It
depends what you want to aim for.

Title: Creating a New Scripting Language For the Learning Experience?

Body:
Is creating a scripting language for my own personal learning experience worth it?

The reason I ask is that there are so many programming languages available already, I know mine will never have any actual use other than providing a good learning experience.  I do, however, see drawbacks with just trying to make a scripting language as a learning experience: it will take a lot of time and effort in which I could be doing something more "productive."

Would creating a programming language (including writing drafts of its intended purpose, syntax, philosophy, interpreter, etc) be worth the time, effort and learning experience? Or are there other projects I could benefit more from?


问:
Is learning C# as a first language a mistake?
I know there are similar questions on here, which I've read, but I recently read this post by Joel Spolsky:

How can I teach a bright person, with no programming experience, how to program?

And it got me thinking about my way of learning and whether it might actually be harmful in the long run.

I've dabbled with various languages but C# is my first serious one, I've read "Head First C#" and created a few projects. But after reading the post above I've found it a bit disheartening that I may be going about it all wrong, obviously I respect Joel's opinion which is what has thrown me a bit.

I've started reading "Code" as recommended in the reading list and I'm finding it pretty hard going, although enjoyable. I feel like it's taken the shine off of my "noobish hacking about" in Visual Studio.

So now I'm unsure as to what path I should take? Should I take a step back and follow Joel's advice and start reading?

I guess my main aim is just to become a good programmer, like everyone else, but I don't want to be going into bad practice by learning a .NET language when someone who's opinion I respect thinks that it is harmful.

Thoughts?

答:
Don't worry yourself about it that you happened to learn C# first.  It's akin to being concerned that your first step was taken with your left foot or right foot.  The only difference between learning a managed language first is you're just delaying when you have to learn pointers and detailed memory management.  This can actually work in your favor, since when it's time to learn C the only new stuff you'll worry about is memory management- you won't also be juggling trying to learn control structures, the concept of functions, etc. and will be able to concentrate completely on pointers and memory management.

The stereotype exists because there are managed language programmers who never did that second part and learned C and C++, and then applied to C and C++ jobs.

It's like learning a musical instrument- the first one is difficult because you're trying to learn the mechanics of reading written music AND the physical mechanics of articulating an instrument to do what you want.  For the second and subsequent instruments you learn you can concentrate solely on what makes that instrument different from what you already know.


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

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

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

Performance.

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

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

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

Is Java now considered a compiled language or interpreted language?

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

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

Edit:

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

答: I can point you a source that may help answer the first part of your question for you.  Programming languages shoot out http://shootout.alioth.debian.org/u64q/which-programming-languages-are-fastest.php is a pretty good source to see how fast languages compare to each other.  They can even be filtered on different categories to see in which areas languages do better than others in.  Java is much faster than it was several years ago.  </p>

Title: A modern review of Java


答:
I'll start with the proviso that it's nearly impossible for anybody to give a truly neutral opinion about programming languages. If you know two languages well enough to comment on them meaningfully at all, it's nearly inevitable that you'll prefer one over the other. As fair warning, I prefer C++ over Java, which undoubtedly influences my comments to at least some degree.

1a. Speed: the speed you get from either C++ or Java will generally depend less on the language or its implementation than the skill of the programmer(s) using it. Ultimately, C++ probably can win for speed more often than not, but the differences in the code you write are what really matter.

1b. Yes, probably. At the same time, C++ is already well established, and I doubt most game studios see enough advantage to bother switching to Java.

1c. A thorough answer to this could probably fill a large volume. C++ will generally do better with more limited resources. Java benefits more from (for example) having a lot of "spare" memory available.

2. Slow execution and slow garbage collection would probably be the two most obvious. The early windowing library (AWT) was quite clumsy -- Swing was a major improvement.

3. Verbosity. Lack of operator overloading. Use of garbage collection. Lack of multiple inheritance. Java Generics are extremely limited compared to C++ templates.

I should add that some (all?) of those disadvantages (especially use of garbage collection, but the others as well) are seen by many as advantages of Java. The only possible exception would be its verbosity. The verbosity situation is slowly improving a little, but you certainly don't see Java winning code golf contests very often, and in ordinary code it tends to use quite a lot of code as well. I suspect there are at least a few who see it as more readable and understandable, so it can probably be seen as an advantage as well.

Title: A modern review of Java

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

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

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

Performance.

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

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

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

Is Java now considered a compiled language or interpreted language?

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

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

Edit:

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


答:
A certian area of speed comes down to compiler vs compiler. Not language vs language. There can be advantages to JIT compilation since it can optimize for the specs of the machine it's running on. Compare JIT compiled C++ vs Java for a more "apples to apples" compiler comparison.

But there are some things where the Java language itself limits it's own performance.

allocation on the stack. Java can't do this. For small fixed size classes in a non-recursive solution this is often ideal. You can also avoid heap fragmentation.

non virtual functions. Java can't do this. All method calls receive a permanent hit even when they are not planned to be overridden.

Probably some other stuff but that's all I can think off the top of my head.

Title: A modern review of Java


问:
Is it possible to create and boot a scratch-built Operating System for iTouch devices?
So, what would I need to write "Hello world" on the iPod Touch on boot? Make that the entire operating system? Which compiler would I use, how would the graphics be done...? Can this be done without too much effort? I know writing an Assembly boot loader isn't that hard...</p>

答: Without the hardware specs (MMU, GPU, register maps, etc., etc.) and IO drivers, you would have a very hard time creating an alternate OS, even if you could jailbreak and mod the bootloader.</p>


问:
Further writings by Rob Pike on software complexity and design
in "Notes on Programming in C", in section "Complexity", Rob Pike writes:

Most programs are too complicated - that is, more complex than they
  need to be to solve their problems efficiently.  Why? Mostly it's
  because of bad design, but I will skip that issue here because it's a
  big one. .../...

Does anyone know whether Rob Pike has written more about software design and how to avoid complexity, and where this might be found?

答:
You might want to look at Pike (and Brian Kernighan) book, "The Practice of Programming" (http://www.amazon.com/Practice-Programming-Brian-W-Kernighan/dp/020161586X).

The Text Editor Sam has some efficiency and design philosophizing in it.

Pike, sad to say, isn't amazingly prolific in terms of writing.

UPDATE: Rob Pike has a blog.  I found this blog after I wrote my answer above.


答:
My advice to you is

Do not reinvent the wheel

The inspiration for this idiomatic metaphor lies in the fact that the wheel is the archetype of human ingenuity, both by virtue of the added power and flexibility it affords its users, and also in the ancient origins which allow it to underlie much, if not all, of modern technology. As it has already been invented, and is not considered to have any operational flaws, an attempt to reinvent it would be pointless and add no value to the object, and would be a waste of time, diverting the investigator's resources from possibly more worthy goals which his or her skills could advance more substantially.

You should ask yourself:

Why do you need to create script? Is the existing script out there is not good enough?

Will you maintain and publish it, and you are confident that your script will be used by other programmers? If your answer is no, don't do it.

I understand that you want to have more learning experience and for that reason personally I think that creating framework will give you more learning experience and with the bonus that you/your team/community can reuse it later, than creating a script.

And this xkcd comic is a bit relevant, just change "standards" to "language" also:


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

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

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

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

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

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

Responses to comments:

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

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

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

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

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

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

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

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

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

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

答:
There are a number of issues at work. Be aware that:

You are making assumptions about the motivations of other people

You are coloring facts with opinions.

Outsiders (anyone else) are not aware of the history and are not aware of your frustrations with your colleague.

You may look childish if it appears that you are playing a "gotcha" game. Your colleague can probably play it better - after all he still has a job doesn't he?

Therefore, when presenting the status of your project:

Do not mention the other person.

When reporting errors or issues with the code - not the developer. Say "The call to method FooBar() is returning 1 when it should be returning a 2". Then any issue is not a personal attack, you are just talking about code - not people.

stick to the facts that you have proof for.

If your colleague gets defensive or hostile, ask questions. "I don't understand why you think that I should do _ "

Be oblivious to social slights or innuendoes. Pretend you don't get the personal attack.

Get lots of sleep the night before any status meeting, so you are mentally nimble.

Document, document, document.

Don't be shy about asking this guy to help you with some interesting problem, he might take to you if he feels that you respect him. This is about building rapport. (note this is not sucking up - this is something else )

Be prepared to leave if you have to, so that way you are not needy or emotionally trapped. This will help with keeping your head in meetings.


答:
Designing and implementing a (toy but complete) programming language was actually one of the (required?) exercises in one of my upper division CS classes (either the compiler class or the programming language survey, I forget which...)

So at least one CS professor thought so.

You will end up with a much better appreciation for all those "quirks" that other languages have.


问:
Ruby IDE code completion
I just started writing some ruby in my spare time and am currently using Netbeans 7 with the Ruby and Rails plugin v0.111. I'm primarily a Java programmer coming from IntelliJ and Eclipse.

One downside of my Ruby programming setup is that my Netbeans isn't very helpful when it comes to code completion. This seems due to the fact that Ruby is not strongly typed and since the IDE doesn't know the type it can't suggest methods. As a result I must spend a lot of time in my browser looking at documentation and switching back to my IDE to manually type in the method there.

Are there any changes I can make to my setup to get code completion for Ruby or is it pretty much impossible due to the nature of the language? How do other developers work with Ruby, other than memorizing all the methods in the Core Library?

答:
Rubymine does it better than most (not surprisingly, coming from the guys who brought you IntelliJ), but of course there are always going to be limitations with a dynamic-typed language like Ruby or Python. This is always going to be one of the costs of going to one of those languages.

But, for some people, the core libraries are pretty easy to learn and the Pickaxe book is an excellent Ruby core library reference. Likewise, The Rails 3 Way is an excellent Rails reference.

It's all a question of whether you think the benefits of a dynamic-typed language outweigh that cost. Not all do. If not then stick to a static-typed language.

Title: Ruby IDE code completion


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

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

Please Suggest Something..

Thanks

答:
Scrum is all about iterative releases, showing the user what they are getting before they get it, letting them prioritise the goals. This is perfect when your deadline is tight and the project seems directionless. It means that the customer can see the constant development (rather than it being a black box which churns out a useless product just before the deadline) and direct which parts are most important for that deadline to be considered a success.

As to whether your module has a database or not, that's not really relevant to the question. But if you code it well, it shouldn't matter. Use a file-based storage or even hardcode the data while demoing to the user, but keep that code well abstracted from the real logic. When the database is ready, you should be able to just switch out that part of the code easily.

A bit of advice: write unit tests for the bones of your module. This will show you quickly how to abstract data layers from logic.


答:
I say go ahead.

Implementing a programming language covers a broad range of topics, and you'll learn a lot about how things work under the hood. You'll probably live through a half-dozen or so failed attempts, but the learning experience is invaluable.


答: Also, multilingual people notice which of their languages is being given first-class status.  I may prefer to read in language N, but if it's going to be a clumsy translation, or if their language N content isn't being kept up to speed, it's in the site's best interest to allow me to switch language rather than loose me altogether.</p>

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

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

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

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


问:
Which books or references cover design of domain specific languages?
There are a lot of books on domain specific languages (DSLs). Such books talk about compilers, interpreters, parsing, lexing, semantic analysis, and other various bits someone needs to implement a DSL.

I already know how to implement a DSL; I've implemented several. However, several such DSLs have been monsters to work with. One starts out with whatever features one wants to support in the DSL, only to find that more features get added later, resulting in a mess of wacky and inconsistent conventions.

I'm going to be designing a new DSL here and I want to start off on the correct foot, with an eye this time for future expansion of the language. The few books I've been able to find on language design seemed to be focused on general purpose (and C derived) language design, which is not a path that makes sense for my domain.

What kinds of references or books are available on this topic?

答:
I have not read it, but I'd recommend the book by Martin Fowler on the subject "Domain Specific Languages". Many of his other books have proven to be very insightful and helpful in my thinking about software development. And I expect the DSL book to be as much so (it is on my to read list).

http://martinfowler.com/books.html


答:
The sites that do are really really annoying!

Google who are pretty much the state of the art as far as Web UI is concerned get this consistently wrong as far as I (and many other people) are concerned.

I travel a lot and it really annoys that I need three clicks to get to "google.com"

Intial www.google.com which redirects to www.google.co.?? with all menus in local language and script.

Click on the "www.google.co.?? in english " link.

Click on the "go to www.google.com" link.

In Belgium they get it really wrong, the first page is nearly always in Flemish. With 40% of the population speaking French and language being a hot political issue they manage to upset a considerable number of people.

The point here is that if Google with all their resource and expertise can get this wrong what chance have ordinary mortal web designers. The simplest easiest solution is to default sensible, reasonable language(s) for your home page and allow the user to choose how they view the rest of the site.


答:
Practical Common Lisp goes through details of designing several DSLs. Something on denotational semantics and languages in general might add a bit of necessary understanding.

There are no widely accepted "best practices" and methodologies yet - it is still pretty much an art, so the best way of learning is by example of existing successful implementations, and of course an underlying theory of programming languages is essential.

Title: Which books or references cover design of domain specific languages?

Body:
There are a lot of books on domain specific languages (DSLs). Such books talk about compilers, interpreters, parsing, lexing, semantic analysis, and other various bits someone needs to implement a DSL.

I already know how to implement a DSL; I've implemented several. However, several such DSLs have been monsters to work with. One starts out with whatever features one wants to support in the DSL, only to find that more features get added later, resulting in a mess of wacky and inconsistent conventions.

I'm going to be designing a new DSL here and I want to start off on the correct foot, with an eye this time for future expansion of the language. The few books I've been able to find on language design seemed to be focused on general purpose (and C derived) language design, which is not a path that makes sense for my domain.

What kinds of references or books are available on this topic?


答: The bottom line in all of this is: Computers are dumb.  Despite all the major advances that have taken place, there are some things where a computer's ability to adequately judge a situation and make the proper decision is limited because of numerous obstacles.  Personally I find that applications and websites which take too much control are down right annoying.  Its a natural instinct as a programmer to want to automate as much as possible under the premise of "its more efficient this way".  But thinking this way, IMO, sometimes causes programmers to forget that some decisions aren't as simple as they might first seem to be, thus resulting in frustration rather than simplicity.   Besides... having to answer an occasional "stupid" question keeps the mind fresh! ;)</p>


答: Now that I think about it, there's probably a Firefox plugin to change the Accept-Language on a per-site basis, but in general browsers don't support that easily. If you've ever tried following instructions in one language for doing something on a site which has decided to show you another language you'll know how useful the ability to quickly and temporarily switch language can be.</p>


问:
Is it acceptable to use lambda functions\methods in business software?
I've noticed posts on here demonstrating the use of delegates\lambda functions to solve the hole in the middle idea without a lot of repetition: http://www.markhneedham.com/blog/2009/04/04/functional-c-the-hole-in-the-middle-pattern/

The problem seems to be that junior developers and others don't necessarily understand what the function pointer\delegate\lambda function concept is, which seems to make reading (and possibly debugging) the code more difficult.

Should we avoid or severely limit the use of this tool in writing business software, especially in small team or sole developer shops?

Or is it acceptable to use it with appropriate comments and expect that when I'm no longer around that the next developer will understand or learn about lambda functions?

答:
I often find certain concepts hard to understand because they're only described in the abstract, rather than encountering them in practical, real-life situations. So I'd personally be in favor of encountering such constructs.

The main scenario I can think of for avoiding doing this is if programming isn't the main task of the other person. For example, a system administrator, or a bioinformatician who spends most of their time doing actual experiments (a "lab rat").


答:
IMHO, writing at any technical level higher than the technical level of the team, is wrong. If your team members are not really comfortable with lambda expressions and function and they don't have time to spend learning it (they should spend their time on performance tuning database, work on UI more, create components, etc.), then I strongly suggest not to use them. However, if they are willing to learn and have free time, or they already know the knowledge, then why not?

I think this is a relative issue that should be judged per team and team's technical level. And this is not only the case of lambda functions. This is the case of technical knowledge. So, for example whenever a team knows about repository pattern is has the expertise to implement and maintain it, then let'em do it. But if they don't, simply find another way. If they know about OO JavaScript, then let'em create more scalable code in JavaScript. But if they don't, simply get back to procedural JavaScript.

Title: Is it acceptable to use lambda functions\methods in business software?

Body:
I've noticed posts on here demonstrating the use of delegates\lambda functions to solve the hole in the middle idea without a lot of repetition: http://www.markhneedham.com/blog/2009/04/04/functional-c-the-hole-in-the-middle-pattern/

The problem seems to be that junior developers and others don't necessarily understand what the function pointer\delegate\lambda function concept is, which seems to make reading (and possibly debugging) the code more difficult.

Should we avoid or severely limit the use of this tool in writing business software, especially in small team or sole developer shops?

Or is it acceptable to use it with appropriate comments and expect that when I'm no longer around that the next developer will understand or learn about lambda functions?


答:
If your company actually uses SCRUM, then the project has a SCRUM Master whose main job it is to remove any obstacles the team members see in their progress. If you believe the lack of a database hinders your work, discuss it with the SCRUM Master.

I see three possibilities:

As a new team member, you're unused to the way things are done in this company. Perhaps the SCRUM Master can give you some explanations after which you'll understand better

The work is disorganized and the SCRUM Master is not doing his job properly. Perhaps he does not have the time due to other duties. You should discuss this with management, but (especially as a new employee) be very polite and focus on the fact that there is a problem that needs to be solved, not on assigning blame.

The project does not have a SCRUM Master. The company is not, in fact, using SCRUM, no matter what they claim.

Title: Is SCRUM Methodology a good technique to go with in crucial deadline project?

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

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

Please Suggest Something..

Thanks


问:
What are the boundaries of the product owner in scrum?
In another question, I asked about why I feel scrum turns active developers into passive developers, and it seems that the overall problem is not scrumy (related to scrum), and rather it's related to the bad implementation of scrum. So, here I have some questions about the scope of the responsibilities of PO (product owner) and the limitations he/she shouldn't pass.

Should PO interfere the UI design, when there are designers at work in scrum team? (an example of this which has happened to us, is to replace checkboxes with a drop down list with two items, namely, yes and no; or to make some boxes larger, or to left-align some content instead of centering them on the page, or stuff like that). If yeah, to what extent? Colors? Layout?

Should PO interfere in Design and architecture of coding? This hasn't happened to us yet, but I'm really curious about the boundaries. For example does PO has the right to change the platform (moving from ASP.NET MVC to PHP, or something like that), or choosing the count of servers (tier architecture), etc.

Should PO interfere in validation mechanisms? For example, this field should be required, or we don't need to get this piece of information from user. Sometimes, analyzers and designers confirm that something can be handled behind the scene, like extracting the user profile info from another source, instead of asking for it in UI.

How granular could/should PO get into the analysis and design? For example, a user story might be: "As a customer, I'd like to be able to buy new domains online". However, scrum team can implement this user story in a wizard of five steps, or in one single page. To which level PO should monitor, or govern, or supervise the technical analysis, design, and implementation?

I asked these questions to judge whether our implementation is right or wrong?

答:
1.Should PO interfere the UI design, when there are designers at work in scrum team?

I think yes, the PO has the ultimate world in UI/usability issues. Of course, it is the developers' responsibility to assess possible options from the technical point of view, and even to point out potential usability or whatever kind of problems. But ultimately, if the PO is willing the pay the price (whether in cash, lost development/user time, lower productivity, or ...), it is his/her right to choose.

The developers may also try to demonstrate the infeasibility of an approach with a quick prototype, and/or using the feedback cycle of early and regular releases. And of course it is always useful to try to understand why the PO prefers a specific solution - it might be that (s)he has a good reason for it. Communication is always a prime factor in being agile.

But ultimately, there are POs who (sometimes or regularly) make stupid decisions. I don't think it is a problem of the process per se. In fact, Scrum/Agile gives a lot of possibilites to discuss the pros and cons of specific approaches, and allows the PO to change his/her mind relatively easily. This is way more than what traditional process-heavy approaches offer.

2.Should PO interfere in Design and architecture of coding?

Depends on the definition of "interfere" :-) It is the developers' responsibility to evaluate all possible architectural choices (e.g. using Oracle vs using MySQL), and uncover all potential costs, risks and benefits. After that - even though developers make suggestions/preferences, which normally should be taken seriously - ultimately it is the PO's right to choose. E.g. it may be that - even though Oracle is way more expensive than MySQL, and technically not superior for the task at hand - the PO chooses Oracle because all their existing infrastructure is Oracle based.

3.Should PO interfere in validation mechanisms? For example, this field should be required, or we don't need to get this piece of information from user.

I think this is basically a usability issue, so it is a subcase of question 1.

4.How granular could/should PO get into the analysis and design?

The example you bring is again a UI design problem, not a program design one. So again, case 1 applies. Program design, however, should be the developer's area since the PO usually has neither the expertise nor the interest to get involved in that.

Update

As a bottom line, I feel you have a people issue here: your particular PO may be micromanaging the project, which is not good indeed. I tend to agree with answers to your previous question that this seems to have created a distorted, "scrum but" process, which could be fixed, if you take the initiative and start communicating with your teammates and the PO. If the PO is not receptive to your concerns though, maybe it is better to start looking for a better project/workplace...?


答:
1) irrelevant, and argumentative to boot.
 Not only can major pieces of software be created in Java, such systems are delivered every day and run most major companies in the world by now.

2) ditto.
Read the JVM spec and you know. Java was never an interpreted language.

3) ditto.
Read the 15 years of release notes. Impossible for us to figure out what you consider "major flaws" to be addressed.

4) ditto.
The major flaw that has to be addressed is the JCP which is prone to meddle with the core language and libraries for no other apparent reason than to get somoene's name on a JSR so they can write a book with an authorative blurb that "they were the leader of JSR-666". Hopefully Oracle's restructuring of the JCP will take care of that.

You seem to just want to stir up a language war here, and get your prejudice against Java confirmed by others because you can't find any real justification for it yourself.

Title: A modern review of Java


答:
In general, the role of the PO during a sprint should be passive, i.e. provide feedback when asked for it, but not micromanage the work of the team. Any changes that result from such feedback have to be weighed against other priorities. But ultimately, the PO represents those paying for the project and thus calls the shots. As for your specific questions:

If the PO has detailed expectations about the design, these should be provided as a branding / CI guide before development starts. Demanding lots of detail changes only after seeing the UI in development is not ideal, but if the PO feels these changes are very important and is willing to accept the consequences, i.e. features dropped out of an iteration because people had to implement the desired changes instead, that's OK too.

Choosing specific elements of the architecture is certainly the domain of the PO, but very much something that should be done before development starts. Fundamental changes later on will cause massive delays (it's pretty much guaranteed you'll have to abort the current Sprint and use at least the next one mainly to implement those changes). Again, if the PO accepts the consequences, it's his decision. If no, it starts to look like the project lacks the main foundation of Scrum: the assumption that everyone is working on a common goal and making rational decisions on how to best get there.

Again, it's ultimately the PO's decision, and this kind of thing is perfectly OK to discuss with the PO if there are open questions, since he may have domain knowledge your analysts don't have. But if he insists on doing things differently than those who have studied the problem recommend, and without providing a rationale, then that also strongly hints at someone not well fit for the job.

Whether to implement something as a wizard or a single complex page is a very good example for something the team could ask the PO to make a decision on. But having him give constant feedback on details is not efficient. Basically the idea is to have the team implement a complete usecase and only occasionally get feedback on things they are not sure about or when they have completed a significant piece of work. To get back to your example: after getting the PO's decision, the Team might create a GUI mock-up for the complete wizard or page, show that to the PO to get feedback, change one or two things and implement it, then show the complete implementation in the sprint review.

Title: What are the boundaries of the product owner in scrum?

Body:
In another question, I asked about why I feel scrum turns active developers into passive developers, and it seems that the overall problem is not scrumy (related to scrum), and rather it's related to the bad implementation of scrum. So, here I have some questions about the scope of the responsibilities of PO (product owner) and the limitations he/she shouldn't pass.

Should PO interfere the UI design, when there are designers at work in scrum team? (an example of this which has happened to us, is to replace checkboxes with a drop down list with two items, namely, yes and no; or to make some boxes larger, or to left-align some content instead of centering them on the page, or stuff like that). If yeah, to what extent? Colors? Layout?

Should PO interfere in Design and architecture of coding? This hasn't happened to us yet, but I'm really curious about the boundaries. For example does PO has the right to change the platform (moving from ASP.NET MVC to PHP, or something like that), or choosing the count of servers (tier architecture), etc.

Should PO interfere in validation mechanisms? For example, this field should be required, or we don't need to get this piece of information from user. Sometimes, analyzers and designers confirm that something can be handled behind the scene, like extracting the user profile info from another source, instead of asking for it in UI.

How granular could/should PO get into the analysis and design? For example, a user story might be: "As a customer, I'd like to be able to buy new domains online". However, scrum team can implement this user story in a wizard of five steps, or in one single page. To which level PO should monitor, or govern, or supervise the technical analysis, design, and implementation?

I asked these questions to judge whether our implementation is right or wrong?


问:
Custom vs. browser-native scrollbars
Including customizable, JavaScript-based scrollbars (and scrolling functionality in general, i.e. bind the control to the mouse scroll wheel) in your webapp can be a great temptation.

However all solutions I could find were developed by individuals (which can equal lack of formal or future support). In addition I fail to remember any mainstream site using them.

In my particular case, no-JavaScript or IE6/odd-browser environments are not intended to be supported.

Should custom scrollbars be avoided nowadays? If not, what's the best option one can choose?

答:
My idea is that using custom scrollbars, if remain in the scope of aesthetics, i.e. look like just changing the skin of the default scrollbar, is not a bad idea. Users immediately understand other custom parts of a web page like custom buttons, custom checkboxes, etc. Do you have problem understanding the clickable attribute of vote buttons in stackexchange sites? Or do you have problem interacting with custom input text boxes for tagging questions in stackexchange sites, or Yahoo mail? Scrollbars also can be fast-recognizable by end users, as long as they don't change the layout, or the expected functionality of the browser, for example scrolling in the reverse direction, or creating a circular scrollbar. You're good to go as long as you only change the skin.

However, there are some problems with custom scrollbars that you should consider:

They usually need a considerable amount of time to become cross-browser

They might not be forward-compatible, i.e. by releasing new versions of browsers, they may break functioning.

You have to manually implement scrolling behavior. For this item, consider HTML buttons. When you add disabled='disabled' attribute to them, browser simply won't accept clicks or enters anymore on them. However, when you use a
 element to mimic the behavior of a button, then you should implement disabled behavior on your own. Custom scrollbars also should implement scrolling functionality, which is already implemented by browser.

In spite of the things we say, I recommend you start a hobby project (not production) to experience using and implementing custom scrollbars. See this page for good examples.

Title: Custom vs. browser-native scrollbars

Body:
My idea is that using custom scrollbars, if remain in the scope of aesthetics, i.e. look like just changing the skin of the default scrollbar, is not a bad idea. Users immediately understand other custom parts of a web page like custom buttons, custom checkboxes, etc. Do you have problem understanding the clickable attribute of vote buttons in stackexchange sites? Or do you have problem interacting with custom input text boxes for tagging questions in stackexchange sites, or Yahoo mail? Scrollbars also can be fast-recognizable by end users, as long as they don't change the layout, or the expected functionality of the browser, for example scrolling in the reverse direction, or creating a circular scrollbar. You're good to go as long as you only change the skin.

However, there are some problems with custom scrollbars that you should consider:

They usually need a considerable amount of time to become cross-browser

They might not be forward-compatible, i.e. by releasing new versions of browsers, they may break functioning.

You have to manually implement scrolling behavior. For this item, consider HTML buttons. When you add disabled='disabled' attribute to them, browser simply won't accept clicks or enters anymore on them. However, when you use a <div> element to mimic the behavior of a button, then you should implement disabled behavior on your own. Custom scrollbars also should implement scrolling functionality, which is already implemented by browser.

In spite of the things we say, I recommend you start a hobby project (not production) to experience using and implementing custom scrollbars. See this page for good examples.


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

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

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

Is there even a way to do a clean validation?

答:
I think validation should always be in action, but not for every folder you try to delete, just for the top level folder, to get sure that you haven't by any accident issued the deletion command for c:\windows\system32 for example.

However, you don't write the delete method in many frameworks and you simply call a function of the library you use. For example, in .NET you simply call Directory.Delete(path, true) and the second argument specifies whether you want a recursive deletion or not.

If the framework you use has a built-in mechanism, then simply trust it. Because I/O operations are tested millions of times in different applications.

However, if you want to create your own implementation, then still I recommend validate the path before each delete action.


答:
In my opinion, it's primarily the responsibility of the operating system to prevent undesired deletes.

The most important folders are write-protected by windows 7 for example. Deleting them will fail with an exception. On Unix, you'll have to make sure appropriate file-system permissions are in place and you can't do much harm.

However, we all know a sysadmin who told us the story of his accidental rm -rf / command, issued as root.

As for applications: Make sure the filesystem-permissions are setup reasonably, then you can prevent at least some harm. It's a best practice to run applications with the least privileges necessary.

If your program needs to be run as root, for whatever reason, then throw in some code to check if the location to be deleted is not critical to the system. Or chroot the system for the application.

You could also white-list the directories that are allowed to be deleted and double check everytime, if that makes you feel safe. But memory corruption for example has a chance to break through any validation-routines. If you have temporary data, keep it in a wellknown folder and don't distribute it accross the system.

Edit: Now I've been talking to various co-workers of mine and we inspected our codes and guess what: All of the directories we are deleting are hard-coded constants. There're only a few cases in which files are deleted, mostly by extension or the name they start with. So in most of our cases another layer of validation is simply pointless and a unit test is enough to make sure that the right directory is cleared or deleted.

Now, there might be other cases where paths are combined with environment variables and so on. But when the environment variable is set to the wrong value and you hit by accident a directory which shouldn't have been deleted, who should've kown that but the sysadmin? Clearly, this falls in his responsibility then.

The only edge case I can imagine are deletions by regular expressions. But what good are regular expressions for deletion when you want to validate by white listing file names? Or what good are validations by regular expressions when you're deleting by regular expressions?

The only case in which I'd recommend some sort of whitelisting validation is, when you are blindly concatenating strings to create a directory name. But I'd rather have a decent unit test for it.

And protection against memory corruption: Well, there's little you can do, because you cannot guarantee any behaviour whatsoever when that strikes.

Title: Do you do any validation on directories when recursively deleting them?

Body:
How do you recursively delete paths of the data that your app created?

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

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

Is there even a way to do a clean validation?


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

Asking for the country can be beneficial even if the language doesn't change; for example, there're a lot of sites offering different services and products for different regions. I don't like to be bothered with the products that aren't available for me in general. However, what if on the next day one of my friends will tell me that they will travel to X country and he could pick something for me while he's abroad? Valid user case for changing country for checking availability.

Spoken language is another thing; sites can offer multiple languages if they have a good system for doing that (that's quite a problem even in the most popular systems like Wordpress and Drupal, just do a quick search). And even if they have the right system it's quite likely that the same content is going to be slightly different on the different languages.

Example situation - Site for a Hungarian company targeting international market

Imagine that you're a native Hungarian like me. You speak some English, enough to communicate, but not on a native level. You get a job for building a site for a Hungarian company which would like to target both Hungarian and international market. So you will have to make a multilanguage site. But what if the content creators at the company aren't speaking English well? The content qualities won't be the same in Hungarian and English. Maybe you'll have some mistranslated stuff as well. Even in the best case it could take some time to translate the content. It's possible that the new content won't be uploaded in every supported language at the same time.

Reverse: international company targeting a new region

The reverse situation is possible, to, for an international company with a new Hungarian office. If I would like to read their site, I'm almost sure that I would change to English immediately. It's likely that they won't be able to translate every article to Hungarian if they have a really tight timeframe.

Summary

Basically the more freedom people has with choosing the language and region, the better. It's not recommended to rely only on environmental settings like browser settings, OS settings, since it's quite common that a language switch is needed. (It can happen even in the midst of reading an article when you suddenly realize that you're not good enough in that language to read that article.) The content creator most likely won't be able to support all the languages at a time, so it's likely there will be some delay in translating content - another reason why you should allow switching.

Of course you should try to guess which should be the default language for the user. In this case, using the browser's language detection should be a good starting point.


问:
In pseudo code what does := mean?
The section entitled Algorithmic Implementation has the following code:

```<code>// Return RC low-pass filter output samples, given input samples,
 // time interval dt, and time constant RC
 function lowpass(real[0..n] x, real dt, real RC)
   var real[0..n] y
   var real α := dt / (RC + dt)
   y[0] := x[0]
   for i from 1 to n
       y[i] := α * x[i] + (1-α) * y[i-1]
   return y
</code>```

what does := mean?

答:
I'm guessing it's assignment (I think it is the assignment operator in Delphi), so in y[0] := x[0] you're assigning the value of x[0] to y[0].

But AFAIK there's no such thing as a standard pseudo code, so in theory it could be anything :=).

Title: In pseudo code what does := mean?


答: It usually means the same thing it means in mathematics: assignment.</p>

Title: In pseudo code what does := mean?

Body:
The section entitled Algorithmic Implementation has the following code:

```<code>// Return RC low-pass filter output samples, given input samples,
 // time interval dt, and time constant RC
 function lowpass(real[0..n] x, real dt, real RC)
   var real[0..n] y
   var real α := dt / (RC + dt)
   y[0] := x[0]
   for i from 1 to n
       y[i] := α * x[i] + (1-α) * y[i-1]
   return y
</code>```

what does := mean?


答:
:= is the assignment operator for languages that use single equals sign equality testing. The most well known of those languages is Pascal. Due to C's influence most languages switched to = for assignment and == for testing. Some older texts and authors that were trained in such styles use := for pseudocode. You sometimes see arrows <- as well for assignment.

From the article:

```<code>input: an array a of length n with array elements numbered 0 to n − 1

inc ← round(n/2)
while inc > 0 do:
    for i = inc .. n − 1 do:
        temp ← a[i]
        j ← i
        while j ≥ inc and a[j − inc] > temp do:
            a[j] ← a[j − inc]
            j ← j − inc
        a[j] ← temp
    inc ← round(inc / 2.2)
</code>```

Some modern languages use arrows for assignment; most notably R, which uses it for global assignment whilst using the single equals ( = ) for local assignment.

From Sebesta's Concepts of Programming Languages and the class notes of Dr. K. N. King we learn that the assignment standards go back much farther than C or Pascal. It appears that in 1958 when Algol was being designed, it was decided to use := for assignment. The commitee was composed of American and European representatives. Some of the Germans on the committee were familiar with Konrad Zuse's Plankalkul language (which was drafted during World War II but not published until 1972 and not implemented until 2005) and wanted the assignment to follow that language's proposed assignment method which was b+c => a where b+c is assigned to a. The committee changed this to =: on the grounds that the method of entering programs at the time called a keypunch, did not have a ">" to use. So they compromised on the equals colon. However, the Americans being familiar with FORTRAN (it didn't have lower case until 1990) wanted the assignment to operate to the left since that was how FORTRAN did it.

So they managed to get it changed to := instead and had the assignment operate toward the left rather than the right in the style of FORTRAN (being a known implemented language) rather than Plankalkul (a virtually unknown language outside of Germany and not implemented). Algol 60 strongly influenced all major subsequent imperative languages including Pascal and C. Thus Pascal kept ALGOL's syntax for assignment and both kept the lefthandedness of assignment.

ALGOL was designed to be easy to read and close to mathematical notation. It was the de facto (and basically de jure) standard for writing algorithms in journals for next 20+ years. Therefore, instructors and computer scientists educated from 1960 to around 1980 would have been familiar with that style of notation.

The release of the IBM 029 Keypunch in 1964 allowed for > and < characters, thus prompting their inclusion in C among others.

Title: In pseudo code what does := mean?

Body:
:= is the assignment operator for languages that use single equals sign equality testing. The most well known of those languages is Pascal. Due to C's influence most languages switched to = for assignment and == for testing. Some older texts and authors that were trained in such styles use := for pseudocode. You sometimes see arrows <- as well for assignment.

From the article:

input: an array a of length n with array elements numbered 0 to n − 1

inc ← round(n/2)
while inc > 0 do:
    for i = inc .. n − 1 do:
        temp ← a[i]
        j ← i
        while j ≥ inc and a[j − inc] > temp do:
            a[j] ← a[j − inc]
            j ← j − inc
        a[j] ← temp
    inc ← round(inc / 2.2)

Some modern languages use arrows for assignment; most notably R, which uses it for global assignment whilst using the single equals ( = ) for local assignment.

From Sebesta's Concepts of Programming Languages and the class notes of Dr. K. N. King we learn that the assignment standards go back much farther than C or Pascal. It appears that in 1958 when Algol was being designed, it was decided to use := for assignment. The commitee was composed of American and European representatives. Some of the Germans on the committee were familiar with Konrad Zuse's Plankalkul language (which was drafted during World War II but not published until 1972 and not implemented until 2005) and wanted the assignment to follow that language's proposed assignment method which was b+c => a where b+c is assigned to a. The committee changed this to =: on the grounds that the method of entering programs at the time called a keypunch, did not have a ">" to use. So they compromised on the equals colon. However, the Americans being familiar with FORTRAN (it didn't have lower case until 1990) wanted the assignment to operate to the left since that was how FORTRAN did it.

So they managed to get it changed to := instead and had the assignment operate toward the left rather than the right in the style of FORTRAN (being a known implemented language) rather than Plankalkul (a virtually unknown language outside of Germany and not implemented). Algol 60 strongly influenced all major subsequent imperative languages including Pascal and C. Thus Pascal kept ALGOL's syntax for assignment and both kept the lefthandedness of assignment.

ALGOL was designed to be easy to read and close to mathematical notation. It was the de facto (and basically de jure) standard for writing algorithms in journals for next 20+ years. Therefore, instructors and computer scientists educated from 1960 to around 1980 would have been familiar with that style of notation.

The release of the IBM 029 Keypunch in 1964 allowed for > and < characters, thus prompting their inclusion in C among others.


答:
Im sorry but I need to completely disagree with almost all of the answers to this question. Some of them present perfectly good situations where you may not wish to use the default language, but these situations account for less than 5% of use cases. Why bother the 95% of cases where the default is acceptable?

Imagine that the language of the page and default location was set in line with the browsers configuration. 95% of people will now be able to browse the website in their desired language without having to specify it. To cater for the 5% who wish to change language, simply display a prominent "switch language" or similar button.

The alternative is to ask every single user to pick a language, inconveniencing 95% of the user base who simply select the default anyway.

Why would you choose to inconvenience every user, when you can only inconvenience 5%?

Unfortunately web developers tend to follow existing trends rather than think about what they are doing and provide appropriate solutions.

Also, bear in mind the OP is talking about setting the language based on the browsers language setting, and NOT based on IP address. Therefore working over VPNs, proxys, travelling abroad etc will not affect this setting, and will continue to display the appropriate language to you.


答:
Pat's answer was great. I agree 100%. Don't go sneak a meeting with the boss. Either take it with your colleague between 4 eyes or do it with all 3 of you. But Pat's suggestion to focus on the code issues and not on people is the right way to go.

Btw, 40h/week is enough dude. You need to keep your motivation high!

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

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

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

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

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

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

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

Responses to comments:

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

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

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

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

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

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

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

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

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

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


答:
Regarding performance;

In pure code execution speed, Java is about equal to straightforward C++. But Java tends to use a lot more memory - partially because it's GC-based, partially because its design places more focus on simplicity and safety than on efficiency. Due to cache issues, more memory translates to lower speed. A lot lower when compared to highly-tuned C++.

If you assume that an AAA title must work at the edge of what is possible using current hardware, no. At least not on the client side. I'd be willing to bet that some AAA titles already use Java for parts of the backend infrastructure.

Anything where you work with large datasets and C++ can be optimized to access them in a cache-friendly manner.

It's compiled to bytecode and JIT-compiled at runtime. Compiled vs. Interpreted is a false, outdated dichotomy.

& 4. There's too many things to list them all, and there will be disagreement on most of them.

Title: A modern review of Java


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

This is how we do:

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

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

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

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

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

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

How should we be daily re-estimating our stories?

答:
The question you should be asking is: Should we be reestimating our stories?

I would argue that you should allow the Agile "magic" to balance your under- and over-estimations over an iteration when calculating your velocity for the next (which is the only reason to correct a value). See Mike Cohn's Agile Estimating and Planning for more info.

However, there is a case where you should reestimate: where something you've learned about a category of work adjusts all estimates going forward.

eg. If adding a column to a database is estimated to take an ideal hour, but it turns out to take 3 hours because of some factor that no one considered and it looks like that factor will apply every time you're adding a field to the database then all estimates for work of that nature should be adjusted, including the one you are working on.

Title: Scrum re-estimation of stories


答:
I think this is not a problem. Rather, it may be lack of experience. The more you follow scrum, the more developers get used to provide preciser estimates. This is our experience of implementing scrum after 5 months.

In planning poker sessions, our developers were suggesting very diverse estimations for each PBI and each task in first sprint. However, now, we're almost equal on the time and estimation. How long have you been using scrum? If not that much, give it some time. But if it's a long time, then as @pdr suggested, consider adding extra margin for tasks with higher risks. For example, each time our team wants to make a piece of UI cross-browser, we pass our estimation. Thus, we always multiply cross-browser tasks' estimation by a factor to get sure we can cover it.

Title: Scrum re-estimation of stories

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

This is how we do:

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

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

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

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

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

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

How should we be daily re-estimating our stories?


答: To be honest, this doesn't sound like Scrum problem to me, but rather lack of proper engineering. Scrum process was probably put in place to "fix" things, but they can't even do that one properly. Well the bad news is, any methodology will not work without craftsmanship. </p>


答:
Firstly some context, my C++ is very rusty, so most of my experiences with Java relate to my more recent experience with C#, which is a much more apples to apples comparison anyway.

1. Speed

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

I think this is best answered by the SO question Why did java have the reputation of being slow? but I also think this whole question is coloured by Jeff Atwood's blog post, Gorilla vs. Shark. Thanks to Péter & Christopher.

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

That depends on the developers priorities and the skills of the developers. Plus it's not an either/or situation, different parts of the title may require different different things of the language they are implemented in, leading to a heterogeneous language environment.

I've seen a number of games recently mentioning that they are loading a Python environment while they are loading and I suspect that horses for courses is a strong motivation if you want to get your title out in time for the holiday season (for example).

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

You can write poorly performing code in any language, but some languages make it easier to make good choices, while others are more likely to let yourself get hoist by your own petard. Java falls into the former category, C++ definitely falls into the latter.

With great power comes great responsibility as they say (not to mention the ability to completely screw up your heap *8').

2. Is Java now considered a compiled language or interpreted language?

I can't say what most people consider it to be, but many people know the difference between compiled and interpreted languages, and hadn't been living in a cave for the last 20 years, would also know that the JIT (Just-in-Time) compiler is an important part of the Java ecosystem, so is is probably more likely to be considered compiled these days.

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

I'm a fairly recent convert to Java, so I have little context as to how it has evolved. But it is interesting to note that there are books like Java: The Good Parts which seek to steer people in the direction of the parts of the language which should be preferred these days and steer people away from the areas which are, or should be, deprecated.

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

To my mind, one problem with Java has been the slow adoption of new features.

Having come to Java from C#, and looking through the Wikipedia comparison page, these are the things that stand out for me:

Things I miss in Java, compared to C#

Properties, especially automatic properties. They make building and maintaining interfaces much easier.

<s>Closures/lambdas. I was really disappointed when I heard that Java support was being pushed back again.</s>Finally we have Closures/lambdas in Java 8, but the time it took attests to my statement about slow adoption.

Type inference (var) may seem like syntactic sugar, but when you have complex generic types, it can make code much clearer by removing a lot of worthless duplication.

Partial classes really help to keep automatically generated code (say from a GUI builder) separate from programmer written code.

Value types, sometimes there is an argument for using a lightweight struct over a full class.

Extension methods can make systems complex if over used, but are great for indicating the canonical way of implementing something for a class if it is needed.

Unsigned types, sometimes that extra bit can make all the difference. *8')

Things I don't miss in Java, compared to C#

Operator overloading is great when it is used correctly, but when used badly can result in hard to find bugs and a disconnect between what an operator should obviously do and what it actually does.

Nullable value types always seemed to cause more trouble than they were worth.

Access to unsafe code. You have to be so careful with this that I've rarely found it worth the extra effort.

As such, even when comparing apples to apples, Java is considered to have fallen behind.

The other two big problems I see with Java are the egregious start-up delay and the fact that (for some JVMs) you have to micromanage your heap and even permanent generation heap. With C# applications always started immediately and I never once had to even think about heap, since it was allocated out of the system memory pool, not from a pre-allocated pool assigned to the virtual machine.

Title: A modern review of Java


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

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

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

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

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

You have no way of knowing about a patent until it is published (at least a year after filing, but can be kept hidden for longer). If you do know about it earlier then it becomes invalid.

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

It's not if it's valid that matters. It's if a judge and jury in East Texas decide if you infringe (which they will unless you are more american than the other guy or you know a lot of judges in east texas)

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

You can still sue an OS app for patent, or all of it's users, or the grandmother of somebody who had sat next to someone who had heard about the app from a man on the bus.

The normal advice (IANAL) is that if you aren't in the US ignore the threats until they sue somebody bigger than you and win.

Title: US Software Patents