A backlog of "bite-size" tasks in parallel to the "main" feature backlog?

After over two years of working in a highly siloed, "lone-wolf" development department structure, we're adopting Agile SCRUM. Great. I like Agile; as a dev it keeps you focused, busy, and productive without having myriad stakeholders shoving project after project down your throat with the expectation they all be done yesterday. There is, however, one aspect of moving to SCRUM versus our current "model", that I think people outside Development are not going to like in the slightest. That is their current ability to have us do small changes "while you wait". A large portion of our development is for in-house consumption only, and we're mostly all in the same building. So, it's been common practice for years for a department lead or manager elsewhere to come to the "codebase owner" of a particular application and ask for small stuff (sometimes not so small, but we're pretty good about not taking on three-week projects based on these "drive-bys"). Even our boss sometimes relays things brought up to him in this way. Very often, if we're working in the codebase in question at the time, we can simply pop up the source file, make the change, and run it with them looking over our shoulder to verify the change is what they want, before checking it into Subversion for inclusion in the next build. With a basic Agile SCRUM methodology, these tweaks would either be logged as defects (we didn't meet a requirement specified in a story previously consumed) or new small stories (we met all stated requirements, but those requirements were incomplete, vague or incorrect, or they changed after delivery once the users saw the new features). Either way, the vast majority would be one-pointers at most if not zeroes, and of relatively low priority (the system is usable in its current state, but it would be _so_ much cooler if...), making them unlikely to be brought into a sprint when working the backlog top-down. This possibility was raised at a dev meeting as being a source of active opposition to our Agile process by other departments, who would see it as less "agile" than our current ability to make small tweaks on request. It's a valid concern IMO; the stakeholders behind the PO don't always agree on what things are most important, because they don't all have the same point of view, yet it's typically only the managers who make the final decision, and therefore their bias is the one that shows in the product backlog. A solution was then proposed, which was tentatively called the "candy jar" (another term thrown out was the "gravy boat"). Small tweaks requested by the "little guys" in the various departments, that are not defects in an existing story, that are estimated by consensus or acclamation within the team to take less than one-half of a developer-day, and that would have an immediate, significant, positive impact on the user experience in the opinion of the end user, are put on a list in parallel to the primary backlog. They'd be identified as "stories", but would be kept separate from the primary backlog of "big" stories subject to prioritization. If, at any time during the normal progress of a sprint, we happen to be working in an area of the system in which one of these tweaks can be made, making the tweak trivial, we can bring the tweak into the sprint and code it alongside the larger story. Doing this _must not_ jeopardize the completion of the larger story or any other committed work. The PO would also have access to this list, and if they were working on an upcoming user story touching the basic feature involving the tweak, they could fold it into the story as a requirement and then we'd meet the requirement as we would any other. This, it was thought, would make tweaks more likely to be worked on sooner than later. This triggered the reaction among those of us with ScrumMaster training of "uh-uh". There is _one_ backlog. Two backlogs introduces the question of which #1 item is _really_ the most important, which list's items determine _real_ velocity, and which of the two backlogs a story actually belongs in (any demarcation of size/complexity is going to have some cases that fall relatively arbitrarily to one side or the other). "Let the process work", we said; if the change really is significant to the end users, they'll make enough noise to get the department heads making time/money decisions on board, and it'll get bumped up into the dev team's consciousness toward the top of the backlog. I thought I'd pose the question to the floor: **In your opinion, would a parallel list of "bite-size" stories have value in getting small, useful but ultimately low-priority changes made faster, or is it overall a better decision to fold them into the main backlog and let the basic process govern their inclusion in a sprint?**


Doing localization each Sprint

We need to support 5 languages for our product. This means that in order to have a potentially shippable product we need to translate all text new to the Sprint to all these languages. It doesn't make sense to me because the text might change after a few Sprints during which the users will use the application and give feedback. So paying the translating company for translating text that will most likely change doesn't seem to be a wise decision. So what do you do with localization in Scrum?


Should one time contributors be listed as an Author?

When working on open source projects should one time contributor's (I mean like single or minor patchset, nothing that would be considered a major contribution ) be listed as an Author? or should they simply get listed in say an acknowledgement section somewhere? If you contribute a small patch to a project where do you want to get listed?


Why is a linked list implementation considered linear?

Typically, computer memory is always linear. So is the term non linear used for a data structure in a logical sense? If so, to logically achieve non linearity in a linear computer memory, we use pointers. Is that right? In that case, if pointers are virtual implementations for achieving non linearity, why would a data structure like linked list be considered linear, if in reality the nodes are never physically adjacent?


Is it common to use code you don't understand?

I have been working on a project recently that uses a pretty comprehensive framework built by someone else. The framework is free to use commercially and privately as anybody sees fit, so there are no legal reasons not to use it. I do find myself, however, uncomfortable about the fact that I'm creating projects and submitting them without fully understanding everything that goes into a project. The entire framework of the project is built by someone else and I haven't had the time to go through it all and what I have gone through is slightly confusing. I'm a (ground up) kind of person by nature so building something off of another project makes me nervous, but is this a common practice to do even if you don't fully understand how or why the code you're using works? I'm mainly wondering if using other peoples code is a common practice when:   * You don't have the time to go through said code to fully understand what its doing, but you know it works (via tests and other reviews)   * You are submitting a project based on said code, but have only been exposed to the top layer you wrote yourself.


What does this duration reported by ffmpeg mean?

When I run ffmpeg on an mp4 file, it says the duration is:               00:03:57.54      What is the unit that `54` represents ? I am interpreting it as 0.0054 seconds (54 milliseconds).


Will my communication skills be wasted in a software engineering career?

I've been in the financial engineering arena (after BA Math and BA Computer Science) for about 5 years (20% analysis/programming, 80% communicating) and take pride in my ability to communicate with people and discuss technical problems (i.e. interacting with a team). I love this part of my job. Going to the white board to draw abstract ideas and brainstorm. However, for many reasons, I want to transition my career into a technology company (software engineering) but I'm deeply afraid that I will fall into a stereotypical programming job where programmers code with big headphones on. I certainly know this is only a stereotype but I've witnessed similar environments before (at startups) and it scares me to think that I would be migrating to a career of isolation. I love coding and thinking algorithmically, but I don't want to give up interacting with people. I understand that having communication skills is only a positive, but am I setting myself up for career-happiness failure by transitioning into software engineering. I'd love to hear any clarifications and/or advice.


A programming language that does not allow IO. Haskell is not a pure language

Are there any 100% pure languages (as I describe in the Stack Overflow post) out there already and if so, could they feasibly be used to actually do stuff? i.e. do they have an implementation? I'm not looking for raw maths on paper/Pure lambda calculus. However Pure lambda calculus with a compiler or a runtime system attached is something I'd be interested in hearing about.


Do you develop with localization in mind?

When working on a software project or a website, do you develop with localization in mind? By this I mean e.g.   * Externalizing all strings, including error messages.   * Not using images that contain text.   * Designing your UI with text expansion in mind.   * Using pseudo-translation to test your UI's early in the process.   * etc. On projects you work on, are these in the 'nice to have' category and let the localization team worry about the rest, or do you have localization readiness built into your development process? I'm interested to hear how developers view localization in general.


What programming languages have you taught your children?

I'm a C# developer by trade but have had exposure to many languages (including Java, C++, and multiple scripting languages) over the course of my education and career. Since I code in the MS world for work I am most familiar with their stack and so I was excited when Small Basic was announced. I immediately started teaching my oldest to program in it but felt that something was missing from the experience. Being able to look up every command with the IDE's intellisense seemed to take something from the experience. Sure, it was easy to grasp but I found myself thinking that a little more challenge might be in order. I'm looking for something better and I would like to hear your experiences with teaching your children to program in whatever language you have chosen to do so in. What did you like and dislike? How fast did they pick it up? Were they challenged? Frustrated? Thank you very much!


Authentication for users on a Single Page App?

I have developed a single page app prototype that is using Backbone on the front end and going to consume from a thin RESTful API on the server for it's data. Coming from heavy server side application development (php and python), I have really enjoyed the new different design approach with a thick client side MVC but am confused on how best to restrict the app to authenticated users who log in. I prefer to have the app itself behind a login and would also like to implement other types of logins eventually (openid, fb connect, etc) in addition to the site's native login. I am unclear how this is done and have been searching - but unsuccessful in finding information that made it clear to me. In the big picture, what is the current best practice for registering users and requiring them to login to use your single page app? Once a user is logged in, how are the api requests authenticated? Can I store a session but how do I detect for this session in the API calls? Any answers to this would be much appreciated!


Did jQuery kill the JavaScript discussions?

There are over 100,000 questions on Stack Overflow tagged as questions relating to JQuery troubleshooting/usage. Compare this to the 124,000 questions on stack overflow that are tagged for JavaScript issues. We are very close to almost half of all JavaScript related questions on Stack Overflow being attributed to JQuery (plus or minus any margin for the few other JS frameworks that get questions on SO). What I'm getting at is, jQuery is not a language and it is not the be all and end all of frameworks that must be applied to every scenario in which JavaScript is present, yet it is quickly catching (and I predict will soon eclipse) JavaScript as a source of discussion/inquiry on sites like Stack Overflow. Is jQuery killing the JavaScript star? Is there no longer a firm grasp by the next generation of web developers regarding the power, simplicity and use of JavaScript as a means for DOM manipulation? Is this just the natural evolution of things and the viewpoint I'm presenting typical of the coder's ego (i.e., is this how assembly programmers view the .NET/Java/Web crowd?) or is this really the beginning of the end of the true JavaScript developer?


Any ideas for a good way to get HTML Text-To-Speech?

We do online e-learning without using any third party tools like Adobe Captivate / eLearning suite, and it would be great to (somehow) get some text- to-speech going. Is there any way at all to get this working for free (or very cheap, some plans are just ridiculous such as http://www.acapela-group.com/text-to-speech- interactive-demo.html) Ideally what we need is for the user to select their language, however happy to start with just English, then just start reading the HTML on the page.. Or am I just barking up the wrong tree here, if people NEED TTS, they would just be using their own software or the ones the come with O/S...right? Edit: The requirement is to make the content a little more engaging. Also, it aids some people if they are slow readers. The reason I was thinking TTS over a proffesional Voice Over is that is should be easier to implement? Having a VO linked to each text "snippet" will require cutting up hundreds of MP3 files and then programming the elearning framework to do this. Having an automated TTS system should be easier for that, especially if in multiple languages However, I think it does need to be a professional VO. thanks for your thoughts/inputs


Silverlight - modularity. Best way to physically separate binaries?

We are working on LoB app with lot's of content. XAP download will be rather large I think for one time download. I'm planning to break solution into separate projects. Not sure why - but I DO NOT like many many projects in solution. IMO it is not very good idea. Even when we were working as a large team - it was pain with many projects. Even now when I'm using MEF/PRISM - there still going to be some core dependencies like:   1. PRISM libraries   2. Interfaces   3. Navigation   4. Shell/Bootstrapper   5. App styles   6. Converters/Commands/Validators   7. etc. And than I'm going to have modules that will use all that CORE stuff. Modules will have following inside them:   1. RIA Services client side   2. ViewModel's   3. Views Those modules will be loaded on demand using MEF. I think size-wise all those modules will be larger than core module because of ammount of logic in them. I expect to have about 5-6 modules and CORE. I think that will give me reasonable number of client-side projects and libraries/XAPS and it will be manageable solution to work with. Do you see any issue with breakdown like this? Some online videos will make 7+ projects out of CORE module. What's a point? I think it adds to complexity. Than they show 3-4 DLL out of module. One for views, one for viewmodels and so on. They still need to be loaded together so why? I'm looking for do's and dont's from you guys who went through this.. Thank you!


Is Android a language or a framework/platform?

I know that Android uses the Java language with a limited Java SDK and that Google claims it isn't Java. But is it right to say that Android is a Programming language? Or is it more right to say that Android is a framework in Java? Or is both true?


Working in a company that does not comment their code at all?

I work for a small software development house (10~ developers, a few product managers and a few support staff) that sells various products and services to organisations internationally through resellers. I arrived in the job 7 months ago into a role opened up by a developer who left after 3 years. The company has maybe been around for 10 years. Basically they have about 30+ separate products (in 30 separate .NET solutions which may consist of 10+ projects within each of those solutions). I would estimate each project or solution to be of medium to large size. **In each project there is absolutely no source code comments at all**. There's also no architecture diagrams or documentation for how the application is designed or the code hangs together. There's some business analysis (use case) type documentation for how the program is supposed to work, when it was first created, but that's it. As a new person to the company, for the past 7 months I've been thrown into various projects and had to fix bugs in these various products. I have an IT degree and I'm perhaps intermediate-senior level in HTML5/PHP/web development, also junior-intermediate level in .NET development. They recruited me for my web development skills and wanted to progress my .NET skills. I accepted as it was paying more than my old job in PHP and thought it would be useful for my career and more job options to have some more .NET development background. However each day I feel as though I'm floundering in the deep end and treading water. For starters to get anything done, reading the code is mostly pointless as you've got no baseline from where to start or find or fix a bug in this new project you've just been assigned. I end up talking to one of the other senior programmers to get an idea of where to start. By senior, I mean they've been there for 4 years and have a general idea of how a particular program might work. Even they didn't even write most of the software, a lot of it was written by a few older guys that have since retired and left the company. The code itself is very complex in my opinion. Maybe it's just because I'm not that skilled in .NET but there seems to be lots of unnecessary layers of complexity. You might have your basic 3 layers for MVC. Then whoever wrote the application added in more layers of code for the project, maybe to structure the application. For example, the front controller calls a few classes which bootstraps the application, then that calls the controller, then a method there might call a model then that model calls a business layer, then that calls a business logic layer, then that calls a data layer, then the data layer calls a service which has more classes to call stored procedures and get the data from the database. This is a far cry from my experience in PHP which even in complex web apps would still be as simple as the front controller calling a controller which calls the model, the model retrieves data from the database and renders it to the view/webpage. I mean what benefit are all these extra layers adding? Another thing, there might be a class, then they create an interface for just that class. There's no other classes using that interface or inheriting from it. They just create an interface for every class pretty much. As far as I can see there's no unit tests using the interfaces either. I'm sure it must've made sense to the senior developer writing it, but the meaning is lost on me. The other thing they like to do is because they don't have many developers in house, they write up some specs/documentation for a system they want, then outsource the project to another company to develop. Then once it's finished they bring it back in house for the local developers to maintain it. One company they outsourced it to was a local development services company, but that company in turn outsourced the development efforts to some developing country. Now I'm back here maintaining their code base, and it doesn't have any comments either. The program itself is probably the size of say Photoshop as an example. There's literally multiple layers of complexity and large parts of the code are commented out in chunks. Why is it commented out? Do they think they'll use that code in the future? No idea. No-one else knows either. The people that worked on it in the outsourced company have since left that company and disappeared. Early on when I joined the company, I was reading some convoluted project code and added some comments into the code so I could make sense of it later on if I had to come back to the project. A few days later one of the more senior developers there came and asked me some questions about that project. I found the thing he was trying to figure out was actually the thing I had figured out the other day. I had written a comment in the code explaining what it did and I showed him. Then he immediately deleted the comment without reading it, scrolled up the code and asked me another question. Then I said, well that can be explained in the comment below which you just deleted. He goes back and undoes the deletion then reads the comment... then he finally understands. I asked him why none of the code has any comments and his rationale was that the comments get outdated and become pointless. Well yeah, comments are supposed to be maintained along with the code. You update the code, you update the comment at the same time. The development manager's rationale for no comments was that good code should be understandable without comments. OK so they've got these hugely complicated systems and the only people that have some idea of how they work are the people that were there in the beginning or who have been working on them for many years. Basically if these people leave it would practically ruin the company in my opinion because no newcomers coming along will understand the code base and be able to maintain it. When I get asked to do something there, like add a new feature into the system, I think I could probably knock it out in HTML5/jQuery/PHP in a few days no problem. In this company, I've got to first figure out the system, then understand how the code works with no comments, then figure out where to put my code, then code it. Days turn to weeks. It's like searching for a needle in a haystack. My philosophy is to design and code something well the first time, in the simplest way possible to get the job done, while making the code easily maintainable and understandable so if a new person had to pick it up they can just run with it straight away. But that seems very contrary to what this company does. So my questions:   * **Is not commenting code a common practice in the software industry?**   * **Why is there so much aversion to commenting code?**   * **How can I perform my job well in this environment?**   * **Should I recommend they start commenting their code or leave them to it?**


Commenting MVC applications

I've recently realised that my workplace doesn't comment their ASP.NET MVC applications. By 'doesn't document', I mean there is probably 1 line of comment per model/view/controller. No file purpose, date created etc. The excuse is that the MVC should be self documenting, with skinny controllers, self-documenting view code etc. This is a fine explanation, but several things affect this statement:   * Javascript technologies are also being implemented alongside the view code with no documentation as to their integration (the javascript code is also undocumented)   * There are multiple databases and providers serving internal and external content (undocumented)   * There is regular confusion daily amongst the programmers of what exactly is going on in any particular module. THis takes about 3-4 minutes of a co-worker's time to clear up. Is this commenting practice lazy and bound to cause more problems than it's worth? Or am I just not adept enough at reading self-documenting code? As a side question, should MVC applications be less rigid in their commenting standards since the separation of concerns should make code obvious?


Self Documenting Code Vs. Commented Code

I had a search but didn't find what I was looking for, please feel free to link me if this question has already being asked. Earlier this month this post was made: http://net.tutsplus.com/tutorials/php/why-youre-a-bad-php-programmer/ Basically to sum it up, you're a bad programmer if you don't write comments. My personal opinion is that code should be descriptive and mostly not require comment's unless the code cannot be self describing. In the example given               // Get the extension off the image filename       $pieces = explode('.', $image_name);       $extension = array_pop($pieces);   The author said this code should be given a comment, my personal opinion is the code should be a function call that is descriptive:               $extension = GetFileExtension($image_filename);      However in the comments someone actually made just that suggestion: http://net.tutsplus.com/tutorials/php/why-youre-a-bad-php-programmer/comment- page-2/#comment-357130 The author responded by saying the commenter was "one of those people", i.e, a bad programmer. What are everyone elses views on Self Describing Code vs Commenting Code?


/*To Comment or Not To Comment...*/

> **Possible Duplicates:**   >  Self Documenting Code Vs. Commented Code > > “Comments are a code smell” > > Best practices in comment writing and documentation Is commenting code useful, or just a waste of time? It seems so trivial but I've partaken in several quite heated discussions on this topic as well as it being a long-standing point of contention between my own learned philosophies and those of our local university. After reading Bob Martin's Clean Code I chugged the "self commenting code" kool-aid and subsequently flew in the face of everything I was taught in my undergrad years regarding commenting my code. Does anyone find thoroughly commenting code good for anything other than obligatorily fulfilling your development group's coding standards? I'm very curious to hear everyone's take on this, from both sides. :)


XML and Registry

Which method is considered to be best practice for setting storage for applications: XML or Registry? What are the benefits/downsides of using either of these?


are f# computational expressions a form of aspect oriented programming?

are monads, or more specifically f# computational expressions, a form of aspect oriented programming? Update: f# workflow builders have methods other than bind and unit. They have hooks for lots of keywords. see Creating a New Type of Computation Expression.


Blocked Sites at work (that aren't even bad)

So here recently, i've been using google to look up information for basically random programming things (i was just hired on a month or so ago). So here recently I was actually looking up some information about RAW_SOCKETS (but thats beside the point) Anyways some of the tutorials sites/explaining how to use them and explaining the protocol sites are actually blocked. (and our manager sent out an email saying that if u run into a site just to email her just in case). Now obviously...w/e sys admins probably see these 'blocked' sites in their reports. But should I be worried? I mean....I literally am not trying to be devious Im just trying to learn stuff. I guess programming websites are sometimes labeled as "hacking". sometimes blogs get labeled like that, but alot of the time blogs have USEFUL information. This apparently happens alot of my other co- workers and they don't even bother emailing our manager.....but should I be worried? Or has this happened to you guys before?


Sending out a "Request for Comment" when establishing a new guideline

Do you send out a "request for comment" when establishing a new company guideline or standard? Companies need to establish consistent guidelines on things like development process, version control, release procedures, etc. Is it worth the effort to solicit feedback prior to publishing the final guidelines? What do you need to watch out for? In certain cases, such as when you have experienced engineers who can draft the guidelines, or where guidelines can be revised over time, I think the answer could be "No". Benefits   * Resolve corner cases or ambiguities prior to publication   * Better acceptance/adoption because the people that will use the guidelines were involved Drawbacks   * Takes time   * May not get useful feedback


Who pays for learning curve?

For those of us in consulting OR settings where you bill your hours whats the consensus on this? Should a client be billed for a certain amount of the learning curve? Should your employer be picking up the tab on overhead? Should it be you yourself the developer? Or perhaps a combination of all 3? I am conflicted on this - I've heard it being said both ways - that a client (or project budget) should not have to include the inefficiency of a lesser experienced programmer. And again I've heard it being argued that people learn on the job so projects should include a certain amount of training budget. I usually find that I (and other devs that I work with) work off hours or weekends reading up on technology , design patterns etc, sometimes struggling with a small piece that may go beyond contingency budgets - so most projects that we work on take up a bit more of our un-billed time than whats budgeted. I thought I'd open it up to the Stack-exchange hive mind for more insight from folks with much more experience. I am going to post the same question on the Project Management StackExchange and look at the delta.


How to deal with Project Leader who doesn't involve himself in project in any way?

Our division is a small offshore development-only unit (not more than 25 members) but we develop many projects. Our main focus is development. Developers are grouped under Project Leaders, and they in turn report to a Project Manager. I'm stuck with the most lamest Project Leader. Our team has 4 developers under this one guy, and we handle 4 projects. Some of his characteristics are:   * Doesn't contribute anything during design/coding   * Doesn't do any managerial tasks (such as getting us read-only access to servers, or getting us software to be installed, filling out forms, etc)   * Doesn't do any co-ordination work (such as giving instructions to QA team regarding requirements, co-ordinating with middleware team for deployment, etc)   * Doesn't respond to client emails, just forwards it back to us. In case he responds, he messes up things because he is not involved in the projects for too long   * Doesn't attend conference calls. Even in the rare case he does, he has nothing to contribute   * Doesn't troubleshoot any issue (doesn't even care to see the logs) in developer's absence   * DOES stock trading/researching from morning to evening   * DOES involve himself in success parties/calls for our projects   * DOES demand rating 1 for himself Overall, his title is "Project Leader" but he is not at all involved with the project. We developers do everything including the full grunt of design, development, co-ordination and support activities. He is quite vocal about it too. He says it is not his responsibility, and his full existence is to get work done from others. I can agree this, but as a Developer my work is to develop and deliver (heck we have so much development work), but I can't do support and co-ordination at the same time, sitting in phone calls and internal chat rooms and sending/receiving emails. I have explicitly said him that "I will do coding, you do support" but he just said he won't. In fact, during our last meeting when deciding about a new project - he explicitly said "Make sure it has no dependency on me". What can I say? He has been in the company for too long, nearly everyone who joined with him are in much higher ranks. He has been given this promotion recently just because of this one fact. The Project Manager too knows very well, but he is a new person and is afraid to act against a "veteran". I've tried a lot of things, like trying to talk with him about this ("I do coding, you do support"), talking with the PM, touting him in emails, etc. But he doesn't nudge. I'm not low enough to report this to higher management in US - but anyway they won't understand what's going on here. Due to his "communication" skills, they have a big impression of him. What do I do? Any traps that I can lay? Edit: More info: My growth is locked to his. Only if he becomes a manager and makes some way, I can fill up his place and become the Leader. But the whole problem is that he is content to just sit around without any aspirations, while we ambitiously do all his work without getting anything in return.


Is this an implementation of the promise pattern?

I am writing a library in C++ (making use of many C++11 features) that (as far as I can tell) implements the promise pattern. The library consists of a class that makes asynchronous network requests. When a user of this class invokes a method that issues a network request, an instance of another class (we'll call it the "promise class") is returned that provides methods for canceling the request. Since this application uses the Qt framework, the promise class also emits signals when certain events happen, one of which is the successful completion of the request. Because the result of the network request is often included when the signal is emitted, I feel that this class implements the promise pattern. According to the Wikipedia article: > "In computer science, future, promise, and delay refer to constructs used > for synchronizing in some concurrent programming languages. They describe an > object that **acts as a proxy for a result** that is initially unknown, > usually because the computation of its value is yet incomplete." > > * emphasis mine Have I missed anything? Does my class indeed implement the promise pattern?


Interpreting Date formats

Let's say I have a `DatePicker` control and I allow my US clients to type something like `"1/1"` in it and hit tab go to next control. So I will parse that date for them as "01/01/2014" and some more similar patterns. But they are all US-based so they are               "MM/dd/yyyy"      Now my question is about other formats? What If I want to support a country format that is like `"yyyy/mm/dd"` . How do those countries interpret such patterns?


How do I review my own code?

I'm working on a project solo and have to maintain my own code. Usually code review is done not by the code author, so the reviewer can look at the code with the fresh eyes — however, I don't have such luxury. What practices can I employ to more effectively review my own code?


Is it good or bad practice to provide separate classes for an object: one to build it, and one to use it?

Suppose I'm writing some C++ code to visualize "Foo" objects. I have two ways of getting a "Foo": computing it from data, or from taking the pieces of a precomputed "Foo" and building a new "Foo". Now, once a "Foo" is computed it's guaranteed to be good for visualization, but changing it may break this assumption. Therefore, I've decided to represent "Foos" in my code by a `Foo` class that has no mutating methods: once it is constructed and initialized, it doesn't change. But there's a second way to make a "Foo": build it from a precomputed "Foo"'s components. I've come up with several methods of building a `Foo` from precomputed data: ## Method 1: Constructor/Static methods Perhaps the most obvious method would be to add a new constructor or a static method to `Foo`, call it`fromPrecomputed`, that would read the components of the precomputed Foo and make a new `Foo` object, checking that it is valid. To explain why I'd like to shy away from this, I have to complicate my example: Let's say that one component of a "Foo" is a collection of "Bars". Now, in terms of implementation, sometimes a "Bar" is represented as a `std::vector<std::vector<Bar> >`, sometimes as a `Bar array[][2]`, sometimes as a `std::vector<std::pair<Bar,Bar> >`, and so on... I could have the user reorganize their data into a standardized form and have a single constructor for this standard, but this might require the user to perform an extra copy. I don't want to provide a static method for each format: `readPrecomputedFormatA`, `readPrecomputedFormatB`, and so on: this clutters the API. ## Method 2: Make `Foo` mutable If I exposed the `addBar(Bar)` method of `Foo`, then I could allow the user to iterate over their collection of "Bars" in their own way. This, however, makes `Foo` mutable. So I could compute a `Foo` that makes sense for visualization, then use `addBar` to add a `Bar` that makes the `Foo` no longer a "Foo". Not good. ## Method 3: Make a friend "builder" class I make a class called `FooBuilder` which has the `addBar(Bar)` method exposed. I make `FooBuilder` a friend of `Foo` and add a constructor to `Foo` that takes a `FooBuilder`. On calling this constructor, it checks to make sure that `FooBuilder` contains a valid "Foo" object, then swaps its empty representation of a Foo with what is inside the `FooBuilder`. Everybody is happy. The only "messiness" about method #3 is that it requires a friendship, but it's worth it to maintain encapsulation I think. But this has got me thinking: is this an established pattern? Or is there another, _better_ way of doing this that I don't know about?


Programming PHP without MVC, classes or framework: rewrite or continue on new features?

I have been programming for several years now, and back then (learning PHP) I've didn't learn to program using classes, MVC-logic or using any frameworks. I found my self solving my problems very well using my own functions. Eight months ago I was recruited to a start-up, to develop a huge social platform. I have been working there for several months now, and built up a huge website with various complicated features (+35k lines of code I guess), and I could see my self continue like this. Everything is coded without any framework, no classes or with MVC-logic, since I didn't have the time to learn it (we had to move fast). I do write everything in functions, and put a lot of effort in well documenting/describing my code as well as organizing it beautifully and easy- to-read. However, it _is_ top of my list to learn Classes > MVC > Laravel (or any other) framework. But I just can't see my self stopping now, learning above list, and then rewrite all code. This would simply push us back in time, and in the start-up we're moving fast and have many deadlines for new features/ideas/development. I've spoken with many people regarding this, and people say a lot of different things. Some say it's a matter of taste, and you'll be able to move on with it. Others say it's incredibly stupid, you're not scaleable, you're never get serious funding, you're the only one who ever be able to work on the project, you should stop and start learning it now, etc. Am I doomed? I feel lost. My personal opinion on this is, that even though it is a huge system already, it is still a MVP and I guess at some point in the future we would rewrite the code anyways. This is, if we're at such a successful stage in our venture and growing very fast / getting funding / etc.


Holding mutable data in a single place

Given a **mutable** property, it generally makes sense to _only hold/store that property in a single place_. When the data needs to change you only need to update a single field, and you can completely avoid bugs where the different fields get out of sync. An extremely simple example could be: The 'right' approach:               class Owner {         String name;     }          class Dog {         Owner owner;              String getOwnersName() {             return owner.name;         }     }      The 'wrong' approach:               class Owner {         String name;     }          class Dog {         Owner owner;         String ownerName;              String getOwnersName() {             return ownerName;         }     }      Experience has taught me that it's very seldom a good idea to break this rule of thumb. The risk of bugs being introduced and the increased effort required to understand the code almost always outweighs any benefit. My question is, is there a name for this rule/principle? Bonus points for linking to articles/blogs/etc. which make the argument for this clearly. Double bonus points for counter-arguments!


Are innovative programming languages too dangerous?

This question is a result of the question Which programming language do you really hate? where, unsurprisingly, all of the most popular languages are listed. Most of the top 15 are extremely common programming languages. One comment brings up **haXe** as an alternative to ActionScript, a language that can target Flash, PHP, JavaScript or native applications. Another similar alternative to JavaScript is GWT. I worked at a company a year ago that decided to adopt GWT for our next product. That didn't pan out as well as hoped because GWT hasn't really taken off. There's little example of best practice, limited support libraries, and some features are so immature that they are ridiculously difficult to use. And, worst of all for something like haXe or GWT, it's nearly impossible to find programmers who are already familiar with the platform and are ready to go, let alone bring their own expertise when you lose a developer (or want to grow). With a language like Java, it's not terribly difficult to find a rock star programmer to jump in and immediately make a difference. So my question is, even though there are many complaints about established languages, and many innovative improvements, variations, or completely new languages, are the alternatives simply too dangerous or costly for the corporate environment? If so, how will these innovative languages ever become adopted? It seems like technology moves too fast for innovations, even really good ones, to have time to build a following big enough to stay around when things start to change.


In which order should I do comparisons?

I'm a strong proponent of writing if statements like this:               variable == constant      Because to me it just makes sense, it is more readable than the inverted:               constant == variable      Which seems to be used a lot by C-programmers. And I see the use, namely that the interpreter or compiler will throw an error and let you know if you're not doing a comparison. But still it is less readable, and for that reason alone I don't think comparisons should be written in the manner of the second example. **The actual question is:** > **Does it exist a general best practice for this, or is it different > depending on language/religion/age/etc..?** I'm happy that so many seem to understand why you'd want to do as in the latter example, but that is not what I'm asking about.


coding style for If condition

I came across below style of writing if statements in C#, on msdn code examples. Usually when I write if statements, the conditions I would write `(Customer != null) I want to know if there is any difference/gain in writing statement like below:               Customer customer;     if (null != customer)     {       // some code     }      Or               if ("" != customer.Name)      {       // some code     }


Boolean condition before variable

I have noticed this style from time to time:               if ( 0 == myVar )      Rather than:               if ( myVar == 0 )      Is this just the individual programmers idiom? A defensive programming style? Does anyone know if it originated in some canonical text?


True/false on the left or the right?

I have heard that generally, an expression like: `if (true === $variable)` is faster than: `if ($variable === true)` My question is about the performance, not the readability. Questions such as this one do not mention explicitly in any of their answers whether there is a performance difference between the two. Is it true? Is the first form really faster than the second?


Ideas on writing a meaningful resume which is not a compilation of buzz words?

I'm am about to commence redesigning my resume all over. What I'm stuck with is where should I draw the line between writing _everything_ down and writing too little. I don't want my resume to be a pack of buzzwords nor do I want to seem to not know any of the things I do know. Keep these thoughts in mind and wanting to write a _meaningful_ resume, how do I go about it. Someone reading my resume should be able to tell if I'm a hacker culture person or someone who went to computer school just for the heck of it. **Edit:** In view of answer majorly focusing on buzzwords I would like to point out I'm also looking for things that make my resume more meaningful - I want the reader to be able to tell the difference between a hacker person and just another guy who went to computer school.


Who is Configuration Manager?

I would like to ask members of the community about the role of Configuration Manager, as you see it. I'm not asking what Configuration Management is, as long it had been asked before. What I need to know is:   1. What tasks do you think Configuration Manager should perform (or performs) in your team?    2. What is primary responsibility of Configuration Manager?   3. What are secondary/auxiliary responsibilities of Configuration Manager?   4. Does Configuration Manager need to be in charge of development processes on the project/company or he should be told what to do?   5. What are relations between Configuration Manager, Build Manager, Release Manager, Deployment Engineer, CI Engineer roles? Aren't they all the same - Configuration Management?   6. Maybe term Configuration Management is redundant and Technical/Team Lead should do all the related work instead? It would be really great if you could share your vision and experience.


Should I refactor this rails application?

I have taken over the code base for a ruby-on-rails application which relies very heavily on ActiveRecord callbacks to perform domain rules. The application can be compared to a bank application, where a customer has an Account. On each account you can register a Transaction (an amount of money that is either inserted or removed from the account). The Account has an account_balance that is updated every time a transaction is created. This update happens as an ActiveRecord callback.               class Account < ActiveRecord::Base            has_many :transactions            def update_account_balance         account_balance = 0         self.transaction_logs.each do |transaction|           account_balance = account_balance + (transaction.amount + transaction.commission)         end         self.account_balance = account_balance       end     end          class Transaction < ActiveRecord::Base            belongs_to :account            after_save :update_account_value            def update_account_value         self.account.update_account_balance         self.account.save!       end     end      I find that this way of coding makes it very difficult to figure out what happens (and what goes wrong when a bug occurs). Also, since the account needs to load all transactions, this will be heavier as more and more transactions are added. Had I been developing an application like this in .NET (in which I am much more familiar) I would have created something like this:               public class Account {            public void AddTransaction(decimal amount) {         this.Transactions.Add(new Transaction(amount));         this.AccountValue += amount;       }     }      And then made sure that a Transaction object is immutable. I am very tempted to refactor the system into something like that. But should I? Would that be the "rails way"? The drawback, as far as I can tell, is that my controller needs to explicitly handle controlling database transactions, something which happened implicitly in the Transaction.save! call currently called in the application. Are there other factors I should be aware of?


How could I implement multitouch gestures without a start event?

While working on multitouch, one of the problems I've run into is the fact that nobody seems to do gesture recognition without some kind of init event, whether it's a mouseclick or contact with a capacitive touchscreen. Is it possible to do an "always listening" gesture handler? If so, how to do it without mirroring input in realtime and thereby imposing gloomy processor overheads? Is there some kind of downsampling (ie take every nth input from the cursor)?


Does anyone have insight into whether MonoDroid is really dead?

My company just recently invested in the Mono for Android tools for Visual Studio as we have a lot of .NET developers and were impressed with how powerful the monodroid tools seemed. After reading the ZDNet Post I was saddened to see that this project may be dead. Is there anyone out there who might know anything more about this than what is listed in that article? Apparently legions of developers were let go from the mono project but I'm wondering if it's true. Any information would be greatly appreciated. We just bought the Enterprise 5 license, which was pretty costly and I'd be pretty mad if it died after I just bought this thing and started learning it!


Why do people nowadays use factory classes so often?

I've seen the history of several С#/Java class library projects on GitHub and CodePlex, and it seems like a trend. Why do people nowadays use factory classes so often for almost everything? I.e. We have pretty good library, where objects are created the old-fashioned way - by invoking public constructors of classes.. Now, in the last commits the authors quickly changed all of the public constructors of thousands of classes to internal, and also created one huge factory class with thousands of CreateXXX static methods that just return new objects by calling the internal constructors of the classes. The external project API is broken, well done... Why? What is the point of such "refactoring"? What is a great benefits from replacing calls to all public class constructors with static factory method calls? Is having public constructors something like "bad practice" now?


Writing Unit Tests in the Middle

Is unit testing a 100% or not at all kind of deal? I was browsing through my old projects and started adding features, this time with unit testing. However, is this ultimately worthless if I'm going to be re-using past components that do not have unit tests? Do I need to write unit tests for all the previous classes and not bother at all, or is it OK to only write unit tests for the new stuff I'm adding?


Generalized VS Specialized technical solution; what to take into account?

We recently had a discussion in the office because of conflicting views between developers. One side (side S) argued technical solutions -generally- need to be a specific as possible, while the other side (side G) argued generalized solutions are preferred. I'll try to keep it short; we deal with file transfers and we need to start saving three files (log.txt, details.txt, receipt.pdf) for each transfer. We already have a files table that we'll use but we all agree that we need a different table to create a one-to-many relationship between transfers and files. Side G proposed creating general resource_attachments table that can attach files to any type of resource it would look something like this;   resource_attachments   \- id : int   \- entityId : int   \- entityType : string   \- fileId : int   \- kind : string Side S disagreed and proposed creating a specialized transfer_attachments table, something like this;   transfer_attachments   \- id : int   \- transferId : int   \- fileId : int   \- kind : string One argument of side S is that any resource should be as specific as possible so its role and its attributes and their possible values are clear, so any new developer will have no trouble understanding it. An argument of side G was that a more generalized approach would provide a broader range of functionality; you can attach files to any resource, whatever their role will be. Though the practical differences are very small, there is some fundamental stuff going on here (this is where it gets philosophical); one person in the room sharply observed that the generalizer is the ruby expert, while the specializer is the java expert. Ruby is an interpreted language with dynamic typing while java is a compiled language with static typing. I found the matter wildly interesting and was wondering which approach is preferred; specialized or generalized solution, and what matters should be taken into account? Note that we're only talking about a the technical part of the solution, this has nothing to do with the end-user experience.


Is Spring + Hibernate prefered instead of EJB 3?

It is my perception that whenever new JEE projects start (where these technologies would be applicable), people prefer to use a combination of Spring + Hibernate instead of EJB 3. It seems junior programmers are even advised to go for that instead of EJB. Is this personal preference or are there pertinent reasons for it? (e.g. personal scars created by earlier EJB versions which caused mistrust in EJB or technology bloat versus performance reasons or learning curve)?


Program/library to match string patterns

I've city names, like Newyork. Somebody may misspell it and write it as Newyoork. I want an algorithm or library which can match such patterns with some confidence level. Any idea how to do it or if any pattern recognition library is present? It is same as when we type something in Google with spelling mistake in it but instead it automatically corrects the mistake.


Do you use Instant Messaging to communicate during your day with your fellow devs?

Hello Fellow Programmers: I run a small business and we typically communicate over IM during the say. We sign on to IM when we arrive and stay on all day. It seems to be quite distracting, in my opinion, and could detract from work. I'm interested in how other small businesses use IM. Do you use IM? If so, do you stay on all day or only come up when there is a question initiated by e-mail? I'm trying to create the most productive and effective work environment for geographically separated programmers. Interested in your opinions. Thank you.


interpreted languages vs compiled languages (from deployment point of view)

I many times read that if you keep updating your website you may consider an interpreted language to be better for this case. I want to understand why interpreted server side language is better if I keep updating my site (such as adding new features or change some functionality).?


Can I use a GPL licensed piece of JavaScript on a commercial website?

I'm looking at plupload for some upload features on a website I'm developing. Now plupload is GNU GPLv2 licensed and that implies that all derivative software should also be GPL licensed (right?). Therefore I run the plupload through my minifier, the single minified js file will violate the license, and upon request, I must make _all_ the sources of my page available (right?). I'm curious about:   * can I use the plupload API without having to open source my code?   * does the license exclude minified code somehow? See also: http://stackoverflow.com/questions/3213767/minified-javascript-and- bsd-license


Implicit or explicit database save actions

I'm writing a web app that requires the usage of drag and drop as well as other jQuery/HTML5 features. There are two options for saving a user's changes to a database   * Implicit: database save on the end of an event, such as drop, hover, ect.    * Explicit: save changes to local array and submit on submit button click event Currently, the only difference between the two is that implicit saves hooked to user events results in many more POST/GET data requests as compared to the explicit save. Other than that, is there a major distinction between the two, and what are the reasons for choosing either option?


Sharding with IoC

I've come across a situation where I need to shard a database (Oracle, but that doesn't particularly matter). The gist of the problem is I have written a large-scale system in a fairly standard TDD-style, with repositories and services hidden behind interfaces. Dependency injection is used to implement particular versions of the services and repositories at runtime, with this functionality allowing for crazy client requirements (for example we migrated from MSSQL to Oracle in under a week, which would not have been possible if the architecture was not properly decoupled!). The problem now arises that I need to shard off a large portion of the data into a separate archival system, for performance reasons. The table structure has to remain the same due to time constraints, and I would like the purity of the architecture to remain the same, with no one section of the system having knowledge of the inner workings of another. The system will need to be switched from one shard to another dynamically via a user input (what input this is is yet to be finalised). So, the two ways I can think of to approach this issue are: 1 - Pass in the required connection string on creation of a repository. This is not ideal as it means that the service layer, or worse, the UI, needs to know about the underlying sharding. This will make the design very inflexible in future, and require things like the sit-in-front caching layer (a write- through cache implementation on top of the IService) to be updates so their methods take a connection string as a parameter, which just seems _wrong_. 2 - Create a new IConnectionProvider subsection of the system that abstracts the connection information for the repository. This would be more ideal, as the repositories would remain self-contained, but I cannot think of a good way to switch this implementation without having to specify the relevant interface as a parameter to each method call, which goes back to the service layer specifying which connection to use. Does anyone have any experience with this issue, or any opinions on a preferably low-labor yet still fairly pure implementation in this situation?


In Scrum, should tasks such as development environment set-up and capability development be managed as subtasks within actual user stories?

Sometimes in projects we need to spend time on tasks such as:   1. exploring alternate frameworks and tools    2. learning the framework and tools selected for the project   3. setting up the servers and project infrastructure (version control, build environments, databases, etc) If we are using User Stories, where should all this work go? One option is to make them all part of first user story (e.g. make the homepage for application). Another option is to do a spike for these tasks. A third option is to make task part of an Issue/Impediment (e.g. development environment not selected yet) rather than a user Story.


What is an effective way to obtain use case information from preoccupied professionals?

When designing a novel system in a hospital or other clinical setting, I think it would be important to gather information from doctors, nurses, pharmacists, technicians, et al on use cases for the system. Aside from the fact that all of these are also busy professionals, what is a good way to get them to share information pertinent to their (possibly chaotic and time sensitive) workflow that would be usable in a software engineering design?


What can I do to strengthen up my pen and pencil coding skills?

I want to better write code with pen and paper. Whether it'll be in pseudocode or real code, doesn't matter. Could you kindly advise me sources for this?


What to do when the programming activity becomes a problem?

I once saw a program (can't remember which) where it talked about people "experiencing flow" when they are doing something they are passionate about. When "in flow", they tend to lose track of time and surrounding, concentrating only on their activity at hand. This happens a lot for me when I program; most particularly when I face a problem. I refuse to give up until it's solved. This usually leads to hours just rushing by and I forget to eat lunch, dinner gets pushed into far into the evening, and when I finally look at the clock, it's way into the wee-hours of the night and I will only get a few hours of sleep before having to rise early in the morning. (This is not to say that I'm in flow _only_ when facing a problem - but I find it particularly hard to stop programming and step back when there's something I can't solve immediately.) I love programming, but I hate it when it disrupts my normal routines (most importantly eating and sleeping patterns). And sitting still for so many hours, staring a screen, is not healthy. Please, any ideas on how I can get my rampant programming activity under control?


Scuttlebutt Reconciliation in the paper “Efficient Reconciliation and Flow Control for Anti-Entropy Protocols”

I am reading the paper "Efficient Reconciliation and Flow Control for Anti- Entropy Protocols"! , I couldn't clearly understand Section 3.2 "Scuttlebutt Reconciliation". Here I extract out some sentences from the paper, which especially confuse me.   1. If gossip messages were unlimited in size, then the sets contains the exact differences,just like with precise reconciliation.   2. Scuttlebutt requires that if a certain delta (r; k; v; n) is omitted, then all the deltas with higher version numbers for the same r should be omitted as well.   3. Scuttlebutt satises the global invariant C(p;q) for any two processes p and q:


how to use version control

I'm developing a web site in php in localhost and as modules of it gets completed, I upload it on the cloud so that my friends can alpha test it. As I keep developing, I've lots of files and I lose track of which file I've edited or changed etc. I've heard of something as 'version control' to manage all those but am not sure how it works. So, my question is: Is there an easy way/service/application available to me to track all the edits/changes/new files and manage the files as I develop the website. As Soon as I'm done with a module, I want to upload it on the cloud (I'm using Amazon Cloud Service). If something happens to the new files, I might want to get back to the old file. And maybe, in a click or two, I get to see the files which I've edited or changed since the last one I've uploaded?


Is Code First with Migrations or SQL Server Data Tools a better fit?

I have been given a spec to create a new MVC4 website, it will not be too large a project at first but I suspect it will grow as the business gets new ideas for it. Using .NET 4.5 ASP.NET MVC4 and EF I have to choose between code-first with migrations or Sql Server Data Tools (SSDT) for handling my database. With the SSDT I can control my database in a project as part of my solution and handle the changes all the way from dev through to production and beyond using dacpac files. My experience of code-first from MVC3 was not to use it beyond development due to the limited database options. It would always end up with dropping the Db on model change or handle the Db changes manually. However I am led to believe with MVC4 Migrations that is no longer the case and I can now push updates to the Db. So my question is which one is the most efficient to use based on saving time/effort in development but also scalable and able to handle production changes. I liked code-first and the ability to generate my Database from Models, does the introduction of migrations now make it viable in production?


Does learning to play an instrument improve programming ability?

I've seen plenty of questions asking if _listening_ to music boosts productivity, etc. but I haven't been able to find one about _performing_ music. Learning to play the piano has been on my to-do list for a while, partly because I have a sneaky suspicion that learning to deal with the relationships, recursions, etc. inherent in music will make me a better programmer (plus it looks fun). Does anyone know of any research on, or have first-hand experience with, learning a musical instrument having any sort of noticeable effect on one's programming or mathematical ability? Most of what I've been able to find seems to be interested in the effects of learning music at a very young age on boosting overall mental ability. I would also be interested in the other direction, aka learning to program improving one's ability with an instrument.


Which closely represents Aggregation?

I know Aggregation is a has-a relationship, but I encountered a question in a test which did not make sense (and had grammatical mistakes as well) Which of the following statements correctly describe the concept of aggregation in OOP?   * **A** Splitting a class into a several sub classes   * **B** Creating one piece of code that works with all similar objects   * **C** Accessing data only through methods   * **D** Combining several classes to create a new class   * **E** Creating a new class from an existing class I think;   * **A** Could be true.   * **B** Sounds like inheritance.   * **C** Seems like property.   * **D** Could be true.   * **E** Could be true. I'm uncertain how the has-a relationship translates into actual code in these statements. Any ideas?


What is consultant application development?

Recently I got a job offer from csc as consultant application development. Currently I am working as a software engineer. Can somebody enlighten me on what is consultant application development career growth , job type, security and what is there role ?


Architecture or Pattern for handling properties with custom setter/getter?

**Current Situation:** I'm doing a simple MVC site for keeping journals as a personal project. My concern is I'm trying to keep the interaction between the pages and the classes simplistic. Where I run into issues is the password field. My setter encrypts the password, so the getter retrieves the encrypted password.               public class JournalBook     {         private IEncryptor _encryptor { get; set; }      private String _password { get; set; }              public Int32 id { get; set; }         public String name { get; set; }         public String description { get; set; }         public String password       {           get         {                 return this._password;          }             set             {                 this.setPassword(this._password, value, value);             }         }         public List<Journal> journals { get; set; }              public DateTime created { get; set; }         public DateTime lastModified { get; set; }              public Boolean passwordProtected         {             get             {                 return this.password != null && this.password != String.Empty;             }         }              ...          }      I'm currently using model-binding to submit changes or create new JournalBooks (like below). The problem arises that in the code below `book.password` is always null, I'm pretty sure this is because of the custom setter.               [HttpPost]     public ActionResult Create(JournalBook book)     {         // Create the JournalBook if not null.         if (book != null)             this.JournalBooks.Add(book);              return RedirectToAction("Index");     }      **Question(s):** Should I be handling this not in the property's getter/setter? Is there a pattern or architecture that allows for model- binding or another simple method when properties need to have custom getters/setters to manipulate the data? To summarize, how can I handle the password storing with encryption such that I have the following,   * Robust architecture   * I don't store the password as plaintext.   * Submitting a new or modified `JournalBook` is as easy as default model-binding (or close to it).


Are there algorithims for polling optimization?

I have a web-application with an async HTTP backend, which gets called by the client by AJAX requests. The client has to start a job and then polls for the result. I started with a simple 150ms polling interval, which was fine for small jobs, but big jobs, which could take several minutes, threw many failed requests to the server. Currently, I just add 1000ms to the delay after every poll, so the polling gets slower over time for longer requests, but never longer than 10 seconds. **Are there some formulas, statistics, or algorithms that I could use to dynamically optimize the polling time?**


Criteria When Evaluating Middleware

What are some suitable criteria for evaluating a list of Companies complimentary middleware? I am doing a trade study on several Company's middleware implementations and so far I have came up with the following criteria:   1. Cost   2. Ease of Development/Ramp Up Time   3. Licensing   4. Support   5. Quality of Tools


The advantages & disadvantages to be had from using a Web Framework?

This question is focused on **extracting the advantages and disadvantages of using Web based Frameworks** : such as Cake PHP, Zend, jQuery, ASP.NET). This question is completely _language agnostic_. Let me start with the notion of _"Standing on the shoulders of Giants_ ". ## Advantages:   * **Empowers Developers** \- by taking features that would have previously have taken 100's of lines of code and compressing them into one simple function call empowers developers to integrate more complex features into their Web Sites.    * Allow for **Quicker development** of applications - this is very relevant for people that need websites created in a very small window (has anyone any examples of this?)   * **Lower Costs** \- allows programmers to pass cost savings onto the customer, a whole new range of customers generated that wanted a website but previously could not afford the higher development costs. ## Disadvantages:   * **Lost Understanding** \- by relying on the features of a framework a developer is in danger of loosing understanding on how things work (underneath the hood).    * The configuration cliff - once you go further than the configuration of your framework your productivity drops right off, it can be difficult to implement features outside of a frameworks configuration.    * **Developer tramlines** \- you (the developer) has to do things the way that the developer want you to do things.  I wonder what people make of my points, and whether anybody disagrees with them? Also if people have additional points I would be grateful.


How do I cluster strings based on a relation between two strings?

_If you don't know WEKA, you can try a theoretical answer. I don't need literal code/examples..._ I have a huge data set of strings in which I want to cluster the strings to find the most related ones, these could as well be seen as duplicate. I already have a set of couples of string for which I know that they are duplicate to each other, so, now I want to do some data mining on those two sets. The result I'm looking for is a system that would return me the possible most relevant couples of strings for which we don't know yet that they are duplicates, I believe that I need clustering for this, which type? Note that I want to base myself on **word occurrence comparison** , not on interpretation or meaning. * * * Here is an example of two string of which we know they are duplicate (in our vision on them):   * The weather is really cold and it is raining.   * It is raining and the weather is really cold. Now, the following strings also exist (most to least relevant, ignoring stop words):   * Is the weather really that cold today?   * Rainy days are awful.   * I see the sunshine outside. The software would return the following two strings as most relevant, which aren't known to be duplicate:   * The weather is really cold and it is raining.   * Is the weather really that cold today? Then, I would mark that as duplicate or not duplicate and it would present me with another couple. * * * How do I go to implement this in the most efficient way that I can apply to a large data set?


What should I do to be language-agnostic?

By now I work with asp.net and C#. I have done a decent work in Java as well. I am planning my career in such a way I should be language-agnostic someday. What are the things that I need to learn? First would OOP paradigms as its speaks about the Class design. Are there any others?


Is Groovy going away?

I am sure this question has been asked many times. However, I like to ask it again with the intention of what is the future of these languages. I was first introduced to Groovy and really liked it. I felt the syntax was simpler and it was much closer to Java and I was able to quickly learn Grails. Then there was Scala, and the web frame work Lift. I am still learning Scala and I find the syntax very difficult at times. However, I still wonder what is the future of Groovy. When the author of Groovy says he would have never created groovy if he knew about Scala, then it makes me wonder if there is a future at all. Of course Groovy has came a long way and Grails is used today by many large companies. If one was to look at Grails vs Lift today, then Grails would be clear winner. More companies are using it. But given everything I have said so far, I am interested to know if one should invest in Groovy? Is Groovy going away and Scala the better choice? If the CEO of BMW says he drives a Mercedes then one would wonder why shouldn't we all drive Mercedes too, right? (I understand if this question is really broad and might be closed. I hope to make it an open Wiki for others though.)


Smallest lexicographical rotation of a string using suffix arrays in O(n)

I will quote the problem from ACM 2003: > Consider a string of length n (1 <= n <= 100000). Determine its minimum > lexicographic rotation. For example, the rotations of the string “alabala” > are: > > alabala > > labalaa > > abalaal > > balaala > > alaalab > > laalaba > > aalabal > > and the smallest among them is “aalabal”. As for the solution - I know I need to construct a suffix array \- and let's say I can do that in O(n). My question still is, how can I find the smallest rotation in O(n)? (n=length of a string) I'm very interested in this problem and still I somehow don't get the solution. I'm more interested in the concept and how to solve the problem and not in the concrete implementation. Note: minimum rotation means in the same order as in an english dictionary - "dwor" is before "word" because d is before w. EDIT: suffix array construction takes O(N) LAST EDIT: I think I found a solution!!! What if I just merged two strings? So if the string is "alabala" the new string would me "alabalaalabala" and now I'd just construct a suffix array of this (in O(2n) = O(n)) and got the first suffix? I guess this may be right. What do you think? Thank you!


How can I get free artwork for my free software?

So many free software projects have beautiful art, specially websites, that I wonder where the coders meet their artists. Is there some place to ask for this besides the local art majors' schoolboard? I thought of IRC, but I fear that one might actually bother the small and frequent userbase by asking it there.


Sr. Dev made a database I disagree with.  Advice sought

I need to run to work soon, so this will be brief. I've only been with the company for a couple weeks. It is a good company, this is a contractor who just happens to be twice my age. I am new to the professional programming field. This database does exactly what wikipedia says not to do for 1NF. It repeats telephone columns in various tables. That is one strike. Strike two: Some data is duplicated across tables. Flat out duplicated. Strike three: Not vital, but he turned all the keys into bigints. All the "FK_" are also nullable. Wtf? We have not started using this database YET, but there has been a big time crunch to meet the client's needs and timeline since I joined and the current timeline will put it into use, say, tomorrow. It was okay for me to sit back while he made a mess since I did not have deal with it directly, but it sounds like I'm going to be taking over this section of the code while he's needed to architecture something else. Any advice would be greatly appreciated. My boss is a great man, but is also very, very busy and more stress is the last thing he needs. **Update:** Sorry this came off as a rant and less of a proper question. I really do appreciate all of the responses and they've helped me start viewing the "problem" more analytically. There's also some benefit to them being generalized in that the same advice will still apply to future "problems." Thank you. **Second Update:** So I kindly tried to figure out why he did what he did and for the most part he even admitted he didn't have a very good reason. We ended up spending some time and cutting almost all of the duplicated columns. For the rest of the oddities, I can bite my cheek well enough since they're just annoying and won't potentially wreak havoc if every duplicated field isn't updated. All in all a good day. PS I'm having a hard time choosing a best answer since there are so many good ones.


How to deal with WYSIWYG editors?

There are now lots of WYSIWYG editors, however whenever we use one on a CMS- based website we consistently have issues. The biggest being users pasting content from Word or other online sources and all the various formatting rules being added in "behind the scenes". How do you deal with these editors on a live production website? I love Markdown, however its target market is most definitely the tech industry.


What are some FizzBuzz-type questions for web or SQL developers?

After a while, we are hiring again, and I'm reviewing tests for programmers; some of them are a bit out of date. What are some of the FizzBuzz-type questions for web developers and SQL? That is, not too trivial, but still solvable in five to ten minutes with pen and paper and without Google? I typically eliminate about two thirds or more of the candidates based on CV, and then all but a few really good candidates in a one-hour interview (which can be over the phone). At this point the candidate is writing a personality test and has a chance to write a bit of FizzBuzz-like code. So, I'm not trying to eliminate a bunch of candidates, but I am trying to validate my initial assessment that candidate is hireable and able to code.


Web API architecture design

I'm learning and diving into Web API. I've used web services before but not specifically with web API. Below is how I am designing it so far and I was curious on the feedback. I have a ReturnMessages object. This basically is a standard object that gets returned from any of the API calls, correctly executed or an error happens. Within each API method I have a try catch. if everything is alright, I specify the values I need within my ReturnMessages object and than `Ok(_returnMessages)`. Now if an error happens I fill in the ReturnMessages object with the error information and once again return `Ok(_returnMessages)`. The ReturnMessages object contains a ReturnClass field to hold any type of other objects I may need to return. A single object or an Array. It also has a return code, return message, friendly message for the end user in case something wrong happens and than a generic string list of data that was passed in that I can send off and use for testing purposes to try and re-create the error. Below is a code sample from one of the methods that shows off what I am talking about. Is this approach ok with always returning Ok with the object I'm returning or am I missing potential pieces within the Web API that I should be utilizing? I've seen the NotFound exceptions and all that other fun stuff. **EDIT: I made some changes in terms of what I was passing back for when things don't work out. I took out the ReturnMessage and also the ReturnData and wrote that to the Application event log for a new string value for this particular web api. Taht occurs in the _lw code line which is just a LogWriter class that uses the values passed in to write to the application event log.               public IHttpActionResult method1(string arg 1= null, string arg2 = null, string arg3 = null)             {                 try                 {                     clrObject1 varClrObject = (from p in db.clrObject1                                                 where p.column1 == arg1                                                 select p).SingleOrDefault();                          if (varClrObject == null)                     {                         _returnMessages = new ReturnMessages                         {                             ReturnCode = 204,                             FriendlyErrorMessage = "Nothing found matches the supplied values."                         };                             _lw.SetupEventLog("No data was found that matched the information supplied.\n\nParameters:\narg1: " + arg1 + "\narg2: " + arg2 + "\narg2=" + arg2, "Warning");                     }                     else                     {                         _returnMessages = new ReturnMessages                         {                             ReturnCode = 200,                             ReturnClass = varClrObject,                             ReturnMessage = "Information Successfully Retrieved"                         };                     }                 }                 catch (Exception e)                 {                     _returnMessages = new ReturnMessages                     {                         FriendlyErrorMessage = "An error has occurred while getting your information. Please try again in a few minutes.  A notification was already sent to the company about this issue.",                         ReturnCode = 400                     };                          _lw.SetupEventLog("Parameters:\narg1: " + arg1 + "\narg2: " + arg2 + "\narg3=" + arg3, "Error", e);                 }                      return Ok(new { Response = _returnMessages });             }


What security practices should you be aware of when writing software?

What different types of security do there exist? Why and when should they be implemented? Example: SQL Injection Prevention


How much effort should we spend to programming for multiple cores?

Processors are getting more and more cores these days, which leaves me wondering... Should we, programmers, adapt to this behaviour and spent more effort on programming for multiple cores? To what extent should we do and optimize this? Thread? Affinity? Hardware optimizations? Something else?


Nearest color algorithm using Hex Triplet

Following page list colors with names http://en.wikipedia.org/wiki/List_of_colors. For example #5D8AA8 Hex Triplet is "Air Force Blue". This information will be stored in a databse table (tbl_Color (HexTriplet,ColorName)) in my system Suppose I created a color with #5D8AA7 Hex Triplet. I need to get the nearest color available in the tbl_Color table. The expected anaser is "#5D8AA8 - Air Force Blue". This is because #5D8AA8 is the nearest color for #5D8AA7. Do we have any algorithm for finding the nearest color? How to write it using C# / Java? **REFERENCE**   1. http://stackoverflow.com/questions/5440051/algorithm-for-parsing-hex-into-color-family   2. http://stackoverflow.com/questions/6130621/algorithm-for-finding-the-color-between-two-others-in-the-colorspace-of-painte **Suggested Formula:** Suggested by @user281377. Choose the color where the sum of those squared differences is minimal                (Square(Red(source)-Red(target))) + (Square(Green(source)-Green(target))) +(Square(Blue(source)-Blue(target)))


Short Sequential Search vs. Regular Sequential Search

Assuming a list of elements is sorted in ascending order, we search sequentially from the first element comparing the target to successive elements either until we find the target (succeed) or until the current element is greater than the target or we reach the end of the list (fail). **Is Short Sequential Search ever more efficient than regular sequential search? If so, when?**


How do I traverse a tree without using recursion?

I have a very large in memory node tree and need to traverse the tree. Passing the returned values of each child node to their parent node. This has to be done until all the nodes have their data bubble up to the root node. Traversal works like this.               private Data Execute(Node pNode)     {         Data[] values = new Data[pNode.Children.Count];         for(int i=0; i < pNode.Children.Count; i++)         {             values[i] = Execute(pNode.Children[i]);  // recursive         }         return pNode.Process(values);     }          public void Start(Node pRoot)     {         Data result = Execute(pRoot);     }      This works fine, but I'm worried that the call stack limits the size of the node tree. How can the code be rewritten so that no recursive calls to `Execute` are made?


Good furniture for programmers

What are some good furniture offerings for those of us that sit around all day every day? I'm interested in chairs, desks, etc... Bonus points for posting images. P.S. Is the GeekDesk really as great as Stack Overflow would have us believe? That's a lot of cheddar for an adjustable table.


Staying alert and awake while coding

What methods do you use to stay awake and alert while working? Personally I drink coffee non stop throughout the day. But I've also heard of this thing called exercise that should help too. Does anyone else have tips and tricks to stay more awake and alert while working? Redbull? Maybe a magic pill that won't require me to sleep?


How can rotating release managers improve a project's velocity and stability?

The Wikipedia article on Parrot VM includes this unreferenced claim: > Core committers take turns producing releases in a revolving schedule, where > no single committer is responsible for multiple releases in a row. This > practice has improved the project's velocity and stability. Parrot's Release Manager role documentation doesn't offer any further insight into the process, and I couldn't find any reference for the claim. My first thoughts were that rotating release managers seems like a good idea, sharing the responsibility between as many people as possible, and having a certain degree of polyphony in releases. Is it, though? Rotating release managers has been proposed for Launchpad, and there were some interesting counterarguments: >   * Release management is something that requires a good understanding of > all parts of the code and the authority to make calls under pressure if > issues come up during the release itself >   * The less change we can have to the release process the better from an > operational perspective >   * Don't really want an engineer to have to learn all this stuff on the job > as well as have other things to take care of (regular development > responsibilities) >   * Any change of timezones of the releases would need to be approved with > the SAs > and: > I think this would be a great idea (mainly because of my lust for power), > but I also think that there should be some way making sure that a release > manager doesn't get overwhelmed if something disastrous happens during > release week, maybe by have a deputy release manager at the same time (maybe > just falling back to Francis or Kiko would be sufficient). The practice doesn't appear to be very common, and the counterarguments seem reasonalbe and convincing. I'm quite confused on how it would improve a project's velocity and stability, is there something I'm missing, or is this just a bad edit on the Wikipedia article? Worth noting that the top voted answer in the related "Is rotating the lead developer a good or bad idea?" question boldly notes: > **Don't rotate.**


Do immutable objects that constantly change impact memory/performance?

I'm writing a program that goes into a loop and keeps changing the state of some models (similar to a game). Naturally, many things are mutable. However, I'm also writing some classes that are immutable because they're inherently treated like values (for example: vectors, matrices, etc.) However, these values change on every loop (maybe 50-100 times a second). Does this mean that on every change, the program would need to allocate a new chunk of memory? If I'm using managed code, does this mean that the memory usage will build up very quickly? How does this impact determinism, performance, and garbage collection in languages such as C# and Java, especially when many garbage collectors have to pause the entire program in order to clear the memory?


Putting books read in resume

Is it a good idea if I put the books I read on my resume, or at least those related to software development?


Do I go by ID or by Label while programming?

Suppose I have a table "Progress" with two columns. One column is ID which is identity. Another column is Progress_Label ID Progress_Label 1 Submitted 2 Approved by user 3 Rejected by leadership 4 Cancelled 5 Completed **What is the best programming practice** , should I go by ID or by label? In my stored procedures, functions, or in programming code methods etc should I search records by the ID = 3 for example or should I type "Where progress_lable is Rejected by leadership" ? If somebody would want to edit the labels, all the code would stop working if I go by the label? At the same type if I type the label, code looks more understandable since it says right in the code what is it we are looking for? Are there any articles regarding this?


Replacing Multiple Inhertance with delegation

I was going through "Object Oriented Modelling and Design" by James Rumbaugh et al and it said that in languages where multiple inheritance is not supported like Java three mechanisms can be used as workarounds   1. Delegation using aggregation of roles    2. Inherit the most important   3. class and delegate the rest Nested Generalization I couldnt understand the examples given in the text. Could any one please explain this with an example. I know that "diamond problem" is a problem within multiple inheritance and java supports multiple inheritance of interfaces.


Why does the word "Pythonic" exist?

Honestly, I hate the word "Pythonic" -- it's used as a simple synonym of "good" in many circles, and I think that's pretentious. Those who use it are silently saying that good code cannot be written in a language other than Python. Not saying Python is a bad language, but it's certainly not the " ** _end all be all language to solve ALL of everyone's problems forever!_** " (Because that language does not exist). What it seems like people who use this word really mean is "idiomatic" rather than "Pythonic" -- and of course the word "idiomatic" already exists. Therefore I wonder: Why does the word "Pythonic" exist?


How to maximise chances of success in an HR interview?

I was recently rejected for a Junior Web Developer role after a first interview with two members of HR staff. Personally, I think it's crazy that someone who hasn't written a single line of code in their life can make hiring decisions about programmers - the interview was an hour and a half long and they didn't ask a single technical question! However, this is not about opinions. So leaving opinion aside, my questions are:   1. How common is it for hiring decisions to be made by non-technical staff?   2. And more importantly...what can a programmer do to emphasise their skills and make a positive impact in an HR interview?


Is it Typical for Large Software Companies to Not Document or Refactor Code?

I have begun working at a large software company and was assigned to a project that is over a million and a half lines of code. It's part of a program suite that is sold to clients (not an in-house project) and the source code can be purchased if they desire (although given the extra fees associated with it, this seems rare). They've been doing software design for years and their current products are intended to be continued for the foreseeable future. To my surprise, the million and a half lines of code are almost completely lacking in documentation. Moreover, there are some areas of code that are incredibly messy to follow or could use some refactoring to become much easier to understand (for instance, an improvement in the programming language came out 10 or so years ago that would make large portions of code much cleaner, not to mention less prone to bugs). There doesn't seem to be any efforts to rectify this and my offers to do so for the parts I'm working with have met with resistance, for which I've never really gotten a clear answer. Are these practices common in a large business in the software industry? Or is my company unique in its lack of refactoring and documentation? Addendum: Based on some of the comments, I'd like to clarify what I'm looking for. I understand that my company has technical debt and this is bad. I'm not looking to determine whether or not my company is worse off because of this, I am just wanting to know whether or not this lack of documentation and resistance to refactoring is a fact of life within the programming world that I'll have to deal with if I continue working in it.


Is asking for control totals on a file an outdated means of verifying a file?

I'm in a new position where I need to process a flat files on a regular basis. The last time I did this was 5 or 6 years ago but as part of the file layout I received control totals. It gave me simplistic information on the file like the total number of records as well as sums of the important fields. This helped me during testing then also during production to verify the file arrived and has correct information. I have asked for similar data for this new project and have hit a wall of no. Is this no longer a standard practice? Is there a better way?


How is a "Software Developer" different from a "Software Consultant"? What makes a consultant?

I have seen a lot of people claiming themselves to be a "software consultant". These consultants do what a normal software developer does, write code, estimate tasks, fix bugs and attend meetings etc. The only difference being the financials, consultants end up earning more. Then how is a software developer different from a "consultant"? In addition to the main question, I would like to know how can a software developer become a consultant? Are there any specific guidelines for a consultant? Do they need to amass certifications and write up research papers? Please do not confuse the software consultant with a management consultant. Software consultants I have seen are not managers.


Multiple attribution in Python, JS, ...?

I accidentally discovered this `a=b=c=d=e=f=2` in python(2.7)(and JavaScript a few minutes later) interpreter . Is this a feature or just the way the interpreter works, if is a feature how it is called ? Do other languages have this feature ?


What is the concept of software wear and tear?

I have heard that over time, software can begin to show signs of wear and tear. What does wear and tear of software mean? Software itself not being a physical entity, so how can there be wear and tear?


Unable to debug an encodded javascript?

I’m having some problems debugging an encoded javacscript. This script I’m referring to given in this link over here. The encoding here is simple and it works by shifting the unicodes values to whatever Codekey was use during encoding. The code that does the decoding is given here in plain English below:-               <script language="javascript">     function dF(s){     var s1=unescape(s.substr(0,s.length-1)); var t='';     for(i=0;i<s1.length;i++)t+=String.fromCharCode(s1.charCodeAt(i)-s.substr(s.length-1,1));     document.write(unescape(t));     }     </script>      I’m interested in knowing or understanding the values (e.g s1,t). Like for example when the value of i=0 what values would the following attributes / method would hold                   s1.charCodeAt(i) and s.substr(s.length-1,1)      The reason I’m doing this is to understand as to how a CodeKey function really works. I don’t see anything in the code above which tells it to decode on the basis of codekey value. The only thing I can point in the encoding text is the last character which is set to 1 , 2 ,3 or 4 depending upon the codekey selected during encoding process. One can verify using the link I have given above. However, to debug, I’m using firebug addon with the script running as localhost on my wamp server. I’m able to put a breakpoint on the js using firebug but I’m unable to retrieve any of the user defined parameters or functions I mentioned above. I want to know under this context what would be best way to debug this encoded js. **EDIT** @blueberryfields Thanks for the neat code review. However, to clarify this is no homework its something i picked from a website about encoding and javascript.The material just looked interesting and decided to give it a go. I don't see the point of using the intermediate variables as I was hoping to make use of those already define (s1,t,i). Usually these variable types are seen in firebug way too often like the enumerable types. Beside, using a good breakpoint and the right place i can always step over these values in the loop. I changed my focus as someone on stackexchange told me to use dragonfly (opera) as i did I was able to retrieve the variable and their values with the breakpoint statement. For other values i just did `document.write` to get desired results. Here is the link of the screenshot. link. I was more interested in understanding the part of coding that actually tell the program to shift-back the unicode character based upon code key value. That part of code was `s.substr(s.length-1,1)`. He just extracted the last character which is the codekey number and then use it in calculating the matching charcode value. If you unescape this shift-1 code `%264DTDSJQU%2631MBOHVBHF%264E%2633kbwbtdsjqu%2633%264F%261Bbmfsu%2639%2638Ifmmp%2631Xpsme%2638%263%3A%264C%261B%264D0TDSJQU%264F%261B%261%3A%261%3A%261%3A1` you would get `&4DTDSJQU&31MBOHVBHF&4E&33kbwbtdsjqu&33&4F&1Bbmfsu&39&38Ifmmp&31Xpsme&38&3:&4C&1B&4D0TDSJQU&4F&1B&1:&1:&1:1` Although those last chars not required but were intentionally added so it helps in decoding.