instruction
stringlengths
34
36.1k
I am debating with my colleague on when to perform code review - before or after unit tests. What is the best practice? Some factors we might need to take into account (there may be more): Size of code change - a big change means more changes will result from the code review. If these changes are big than, if UT was...
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...
I would like to make my programs much less of a hassle to extend or create, I am imagining a scenario where the end user has a variety of check box options that affect how the program interacts. Something like in a word processor where you say underline, or bold, or to a game where you say, include this feature exclude...
If I were to build a Twitter or Facebook application using pure client-side technologies like HTML and javascript, how would I mask/hide my API keys? For example, for Twitter I have consumer key and consumer secret. In order for me to call Twitter's API I'll have to pass these keys to authenticate my app. If I am usin...
Google App Engine has been great for trying out ideas and learning stuff, but so far I haven't seen much confidence in the community in using it for production applications. One significant issue that has come up over and over again is that when things go wrong, it's nearly impossible to actually talk to anyone at Goog...
Recently, I was developing a set of coding standards for our company. (We're a new team branching out into a new language for the company.) On my first draft, I set the purpose of our coding standards as improving Readability, Maintainability, Reliability, and Performance. (I ignored writability, portability, cost, c...
While I agree that catching ... without rethrowing is indeed wrong, I however believe that using constructs like this: try { // Stuff } catch (...) { // Some cleanup throw; } Is acceptable in cases where RAII is not applicable. (Please, don't ask... not everybody in my company likes object-oriented programming a...
I have been developing Windows applications in C++ for like 10 years now. And recently I've started digging into some Linux projects, and I can't stand how unproductive I am... I'm a fast learner, and I've been using Linux as a primary platform for some time now. And I do feel very comfortable with shell, OS principles...
Here's a question for me that really makes me wonder every time I start designing and developing a thick-client desktop application. I'm a .NET developer, and with my forms (WinForms mostly, but the platform should be unimportant) I also choose the startup position to be Center. The reason I do this is because I can't...
Say I have class that is partially implemented as a static class and partially implemented as a singleton. Besides "kludge" and "code-smell" (imo this is both) is there a more appropriate term for this type of mixing programming idioms?
I was reading the following article: Great Hackers The following part grabbed my attention: "When you choose a language, you're also choosing a community. The programmers you'll be able to hire to work on a Java project won't be as smart as the ones you could get to work on a project written in Python. And the qualit...
I'm trying to understand the origins of AJAX, and think MSXML and XMLHTTPRequest were the objects that started it all. Which came first, and/or became the defacto way to create dynamic pages?
In order to implement JSR 292, a.k.a. invoke dynamic, something called richochet frames is introduced into the hotspot vm. I'd like to know more about it, such as invoke dynamic itself, how richochet frames implements it, where the name richochet comes from, etc. Google seems to be not very helpful here. Any pointers w...
It would be interesting to hear what is used besides sketches from UX engineers during development of a GUI. Unfortunately our UX team provides just a minimum of requirements for GUI screens. I believe that a better solution would be to use some tables with requirements and state machines or may be just some text desc...
I am web developer and have experience of developing several web applications in PHP. I have an idea of developing a product for myself and decided to use a MVC based framework because I really like the idea of MVC and how one can easily manage and modify the application without any difficulty. I chose Zend Framework a...
Is there any other reason for using session variables besides keeping the values longer than the current request? For instance, is it advisable to use session data when storing information in a file on the file system to prevent one user from writing data to the file of another user? I understand what a session variabl...
I'm in the process of developing a signal management and routing module for an integrated audiovisual system and am designing it with the intent of being as flexible as possible across different signal distribution networks. The intent of the module is to handle routing across a number of stacked matrix switchers1 and ...
I want my app to be able to manipulate images and create watermarks and also needs to run on both windows and mac. Hence I've been investigating QT. Does QT ship with all the libraries I will need to achieve that? or will I have to get other standard C++ libraries? If so is it worth doing the project in QT?
If someone writes code so that an internal variable $_fields is accessible without using getter/setter methods, is there a proper term used to describe that? Something polite enough to use with management :)
I've been thinking about making a generator for managing subscriptions with options for a couple different payment processing services, it is something that I would use. Are there any existing examples of this, or any thoughts on a generator. I thought it might work like the scaffold function, similar to the authentica...
When a login is needed in a system to perfom any action. How do you express that in a Use Case Diagram? I have a system that will allow employees to perform sells. They must be logged in, but once they are, it is not necesary to log again until the session ends (typical login). I do not know how can I express that that...
There are many answers in my previous question about simplicity relating to readability that helped me see my definition and understanding of simplicity in code was, quite possibly, incorrect. How can I define simplicity in code? What software measurements and metrics are available to measure code simplicity?
Is it OK to have a nested class raise an event and for the parent class that subscribes to that event subsequently raise another event, which it's parent class has subscribed to - thus passing the original event up the class hierarchy? It may be easy to explain like this... We have... Class A Class B Class C Operation...
I'm a little bit confused about these two terms "Linq to SQL" and "Entity Framework". I have the general idea that both of them somehow allow you to refer to database tables as .net objects or something of the sort, but please explain to me the difference between these two terms.
I hear/read all the time that it is cleaner to keep your js, html and css separated. Supposedly it makes it more easy to maintain, debug. Supposedly it is more efficient, because it allows caching/minifying css and js files. As far as I am concerned, using web frameworks (Django, Rails, ...), javascript templating libr...
I am a c# developer. I have always been interested in increasing my skills and knowledge and trying to pickup new technology. However now I want to enhance my knowledge in Programming standards and principles. So for example I want to know about how to structure code, refactor code, coding standards and good practices ...
I recently joined a new position as SW developer and during the interview process everyone stressed the importance and the pride of the quality standards of the firm in each and every process they have. (This was one of the aspects that made me decide to accept the offer) When I started inspecting the database I realis...
What are the practical limits for the number of items a C# 4 Dictionary or Hashtable can contain and the total number of bytes these structures can reasonable contain? I'll be working with large numbers of objects and want to know when these structures start to experience issues. For context, I'll be using a 64-bit sys...
I’ve been hearing about the London style vs. Chicago style (sometimes called Detroit style) of Test Driven Development (TDD). Workshop of Utah Extreme Programming User's Group: Interaction-style TDD is also called mockist-style, or London-style after London's Extreme Tuesday club where it became popular. It is usually...
I am writing a routine which has the following form: TRY A IF no success, B IF no success, RETRY A IF no success, throw error It's not trivial to extract either A or B into it's own routine, so what is most simple structure that will allow me to retry A without code duplication? Currently, I have a do..while that allo...
What are some of the software technologies behind "real-time" web apps, like Twitter, Trello, or even Gmail? I know there's a webserver and probably a database on the backend, but what are the software pieces that make for that rich web interaction that I'm seeing more of today?
In my ample (NOT!) spare time, I'm fiddling with Lhogho and wondering how to go about morphing it into a script engine for web browsers, viz <h1>My First Web Page</h1> <script type="text/lhoghoscript"> print [Hello World] </script> </body> </html> Any suggestions where to start? For Windows, I supp...
I'm developing a GUI application, heavily working with graphics - you can think about it as a vector editor, for the sake of the example. It is very tempting to make all data structures immutable - so I could get undo/redo, copy/paste, and many other things almost without effort. Fot the sake of simplicity, I will use ...
Hello I think I have a nice idea to implement for human kind goodness. I call it FixTheUnFixed. The idea goes like this, imagine you are driving or traveling all over the world and when you see some obstacle or damage - broken light, trash covering the street or any other problem you would like the responsible authorit...
I am basically a java programmer who wants to move to .net. I haven't worked in .NET companies so I don't have any idea about the tools they use. In a Java company people use Maven, Hibernate and frameworks such as JSF or Tapestry. My questions are: What are the tools/frameworks that .NET/C# companies use? Do they use...
We are looking at improving the process for handing over tasks from architecture to development. At one end of the scale it there is no architecture guidance you risk getting chaos, with each developer doing things his way. At the other end of the scale where everything is specified, the specification takes longer than...
I am working on a side project at work where I find it beneficial to use some of my code that I have developed personally (outside of work) to speed my development. My side project is developing a C++ GUI application to let our power users run queries (built by me) against databases on several different platforms (DB2,...
My Agile team is following practices of XP like pair programming(J2EE), 45 work hours/week, TDD etc. Do you have any recommendations of open source tools (dev, test & build integration) and templates(user story, burndown charting) etc. for enabling my team to focus on business value delivery. I am the iteration manager...
I'm currently working on a website which is also supposed to be mobile optimized. My client has provided me with a layout of how the mobile version of how the website should look like. Making their design wish come true is no biggie, but making the design fit the screen is my issue. Right now I'm facing some issues r...
Is there an algorithm to search a directed graph (tree) for its neighbors neighbor? My current brute-force solution works as follows: for each node n: for each child c of n for each parent p of c if (p != n) insert edge (p,n) I am dealing with ca. 700.000 nodes each having between 1 to 100...
I appear to have done something wrong here, so let me try to rephrase this more simply so I stop giving the wrong impression. I'm in the planning stages of a project right now, on my own time; I'm currently defining the scope of the project. I can see this application also releasing an Android app; furthermore, I've lo...
I am contemplating a few different techniques for organizing code for a larger web application. For this situation, the server runs some Microsoft solution (probably ASP.NET MVC or OpenRasta) and the client (JavaScript, CSS, etc.) will consume this. Traditionally in an MVC application, the controllers and models along ...
Why standard C++ doesn't respect system (foreign or hardware) exceptions? E.g. when null pointer dereference occurs, stack isn't unwound, destructors aren't called, and RAII doesn't work. The common advice is "to use system API". But on certain systems, specifically Win32, this doesn't work. To enable stack unwinding...
I was wondering whether there were any estimating models for projects which use the results of previous projects. For example, imagine I want to develop an application for a phone based on a web app I completed last month. Say the web app took 1000 hours but that I don't know anything about mobile development. If you w...
HTML 5 applications in the browser really seem to be taking off. I've been using src:kit within Google Chrome for a few weeks and love it. I'm an ASP.Net (C#/MVC 3) developer by trade, and in the past did several pieces of WebForms programming. With Windows 8 app development moving into the trade of local HTML5 apps, ...
What thought process should one follow to convert a sequential algorithm to a parallel one ? Are there any specific code pattern that can be parallelized. Some patterns that I normally use are: Looking for loops that can parallelized. Try to break algo in some form of Map-reduce format. Looking for producer-consumer ...
I'm working on an application, and adding logging, but now I'm stuck. I want to allow (not force!) the user to set the location of the logfile. Basically, my problem is: logger initialization should be the first thing the program does but I can't initialize the logger until I determine where the user wants the log to ...
I am trying to find a name for this architectural pattern that I have seen in many places before: Poller - (There are a number of these) These are either plugins or services acting on there own communicate with equipment of various sorts collecting data and pushing that data to a central service in a normalized form. ...
Related: Should every git commit leave the project in a working state? Suppose I make the following commits locally: Modify the database schema, breaking the application. Update the application so it is compatible with the database schema again. As long as I push both commits, master remains in a working state. Howe...
I'm thinking about curiously recurring template pattern. I find it quite useful, and it's pretty well adjustable for many tasks. But I have to admit, I don't see much of CRTP code in the wild. Is it hard to grasp? Are virtual functions easier overall? Shouldn't it be used for 90% of cases where virtual keyword appears?...
My current project is part of a highly linked architecture, with individual systems each owning certain pieces of data, and exposing them RESTfully. Both our web services and our user interface take advantage of this linkage, storing links to the resources in other systems rather than storing a copy of the data, and pr...
When I do database table design, I often wonder if I should try to make the table as simple as possible, or if I should make the object as clear as possible. The requirement is to store all month of the year's salesTon and gross profit. I design from the object.The object has fields year, month, salesTon and gross prof...
We have a scripting language that we use internally for many things. It began as a simple evaluation statements for dynamic labels to become a Turing complete language used pervasively throughout our system. Problem is that it was never designed for this and it shows. Development environment is anemic, scripts produc...
Is there a way to measure the success of an agile project as it relates to a well defined outcome?  For example, I've pair coded Conway's game of life with 12 people using TDD, and each time it was different, but the goal of implementing a fully working version of the program was the same everytime. Clearly that's an e...
My task is to implement a distributed semaphore system (links to description) and an application for it. I will be using Java sockets, and it will use watermark arrays and priority queues (not sure where), and so I am curious about how to tackle this project. Specifically, I'd like to know what is a good first-step goa...
In my application, I'm getting product information files from an FTP server. They are text files that have been ZIP-compressed. At first, I thought uncompressed the file on the server then reading the text over the web would work, but the uncompressed files are ~900 MB, making it slow and inefficient while causing out-...
I have been searching for an example over the internet that shows any operation like saving a file or drawing anything in UI or any other sort that shows the implementation from High-leve language code to Low-level code to deep down machine level code. The basic idea is to explain the computer working in a nutshell. Li...
I am new to Java; through my studies, I read that reflection is used to invoke classes and methods, and to know which methods are implemented or not. When should I use reflection, and what is the difference between using reflection and instantiating objects and calling methods the traditional way?
We're teaming up with some non programmers (writers) who need to contribute to one of our projects. Now they just don't like the idea of using Git (or anything for that matter) for version controlling their work. I think this is because they just don't find it worthwhile to wrap their heads around the twisted concepts ...
I have been working with a complex system written with Java. It is made by with many java programs and many shell scripts which call them and some cronjobs to schedule them. The system is hard to maintain. Input/Output/Error/OK files were distributed in different place of the system by the hands of different programmer...
We have a web application which contains a web service with over 50 methods. The application is currently installed at a number of sites and is currently being maintained by one developer. The application is currently a single user system where all the data is stored in XML files. One of our main tasks is to make it a ...
A bit of background The company I work for has been creating database applications since around 1980 and, until relatively recently, most of these systems have been stand-alone "silo" systems. However, in the last few years, we've seen more of a shift towards gathering "intelligence" across all systems within our cust...
I am planning to use boost libraries, as it is quiet rich, and will save lots of time. But my question is, what are the guidelines i have to follow, so that I can replace some part of boost with standard C++ as and when they are supported, considering so many new features are coming in C++11. Also, how to encapsulate...
I have this new customer, that has this PHP App. It was written by a single developer that wanted to "make yet another framework" back in 2005. About 3 Years later the developer left the company, and with him all Knowledge on what this thing is actually doing. Now, as the App already went in production the manager jus...
So there is an insurance company which wants to move long term its proprietorially written software for different insurance products to a new platform / framework / concept / something. One of the applications is ~700 pages big. We would require some workflow application (ibm websphere products?). Transaction control, ...
I'm having trouble generating a proper database design for bill of materials in EF Code-first I just need a general structure then ill add additional fields So i need to have a Product that is assembled from other Products which are assemblies of other Products. Example: Product 1: Aluminum Box 1x Aluminum Sheet 4x ...
My department is planning on working on our next several releases (spanning a year) simultaneously. The powers that be are advocating we support this by refactoring all affected code into classes like AbstractGizmo, R1Gizmo, R2Gizmo, etc and use configuration (via Spring and/or ANT) to control which classes are used i...
I do quite a bit of ASP.NET work (C#, MVC), but most of it is typical web development. I do Restful architecture using CRUD repositories. Most of my clients don't have a lot of advanced requirements within their applications. I'm now looking at node.js and it's performance implications (I'm addicted to speed), but I ha...
A presentation linked in an answer here demonstrated a comparison of several web development frameworks. It was a good comparison but caused me a little worry based on the technology stack that I have been pushing for awhile now at my current company. While it seemed like the author was biased towards RoR, he pointed ...
I was looking to add a simple form that states my project's build number on a form to quick identify what version I am running. Then I realized I'm not sure what fits on an about page. In my highschool projects I would make silly splash screens with this info, with images and other unnecessary information. What are sta...
I like the concept of System.Tuple in that it allows me to return multiple parameters in a single function call without instantiating a new class, however does this defy any good programming practices such as Microsoft Patterns & Practices, SOLID Principles, etc. I'm just trying to gauge how liberally I should use thi...
Most everyone seems to agree that Reactive Management is worse than Proactive Management; however, it seems that I am constantly seeing Reactive Management from development managers. Logic would suggest that there is some benefit to Reactive Management, since it is seen so often. I tend to see nothing but negative iss...
I've never worked with sessions in a database before, and I'm a little unclear on how they work. I have a user class already designed which stores user information: username, password, email etc. I also have a session class which uses the user ID to store a session cookie in the user's browser so that when they return ...
I personally don't know much about iOS 5, but it seems like with automatic reference counting (ARC), you get rid of much of the memory management issues of the previous operating systems. So is it better to target iOS5 (and create apps that can only run on the newest iOS devices), or is it better for her to target iOS...
My team and I are struggling with the what and how meetings. It's hard for us to choose what to work on when we don't know how it is going to be done. Our estimations may be way off when pointing an estimated level of effort. At this point it's being discussed if we should do the how before the what so that pbi's ...
I am looking to port a tool from the Mac app store over to Windows, the platform where I spend most of my time these days. I've spoken with the author of the original app and we've begun talking about licensing options should I decide to sell the application, and it seems like it would be feasible. I've never sold soft...
I have never programmed in C++, but am going to be taking a class that involves programming in C++ in January. I want to be able to excel in the class, and looking for advice, as I come from a PHP background. How can I best prepare myself for success?
I have an application that writes to its own Event Source. The Event Source itself is created upon install to prevent user vs admin access issues at runtime. Should writing to our own Event Source fail, the event is instead written to the Application log (two events actually, on for the original event data, and anothe...
I am interested in learning design patterns and would like to know what are considered top tier books in learning this subject. Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on design patterns? What about that book makes it spec...
Looking for a guide or example of where a group facilitator walks a group through an agile software development cycle playing the role of both the event facilitator and the key stakeholder or project owner.
What limitations will we have if Unicode standards had decided to assign one and only one codepoint to every user-perceived character? Currently, Unicode has code-points that correspond to combining characters. Such characters combine with a previous code-point (or sequence thereof) to present to the user what appears...
I'm new here and pretty new to iOS development. My question is basically, should I learn the old school development methods or just learn how to do things using the latest tools (i.e. Storyboard)? I've had a go with the Storyboard feature of XCode 4.2 and it's very powerful. My only concern is that it requires iOS 5. I...
I am on my final year on CS, working on my first significant project, so I thought its about time to learn and use build tools. I have read about Maven mainly and heard about Ant. I would like to know your opinion about which I should learn to use for a project that will be developed only by one person, keeping in min...
Typical context: I make an extension method for a collection which considers that the elements are ordered. The function starts at the beginning, at index 0, and the order has significance. Examples: Grouping by sequence or Indexes of an item. However, I'm always stumped as to what to extend: IEnumerable<T> or T[]. My ...
This is something I've been wondering about for a while - are there any algorithms out there to scale pixel art down? I'm sure we all know about the upscale versions on the Wikipedia page on Image Scaling. I would have thought something like nearest neighbour resampling to get the colour pattern right, and then redrawi...
It's often said that the software industry is immature compared to manufacturing. Specifically with regard to being process driven. Question: Can we as developers learn from the processes of the manufacturing industry? Can adopting their processes increase the success rate of software development? My take: In manufa...
Instead of TV, I prefer to watch (free) on-line conferences or videos. As a software developer, my favorites are: InfoQ MSDN Channel 9 Google TechTalks LinkedIn TechTalks TED Business Of Software blog (I like entrepreneurship too) Maybe I'm losing other valuable sources (about software and startups) of these kind of ...
I have 5GB of free storage on Amazon's Cloud Drive service that I'm not using, so I'm wondering: is it possible to create an SVN repository and be able to commit/update through TortoiseSVN? I have an account at Assembla.com and use it for all my personal/school projects and love it, but Assembla has a 2GB limit.
Suppose I have a loop in C++ or C# that goes like this: while( true ) { doSomething(); if( condition() ) { break; } doSomethingElse(); } This is commonly called "infinite loop". Yet it is not technically infinite - it will stop once control flows through break. What's the term for such loop - t...
Continuous Delivery sounds good, but my years of software development experience suggest that in practice it can't work. (Edit: To make it clear, I always have lots of tests running automatically. My question is about how to get the confidence to deliver on each checkin, which I understand is the full form of CD. Th...
My existing application is a .NET 3.0 winform app that talks to a WCF service which in turn updates a MS SQL Server database; I can make changes at all spots (Windows client, WCF, server). I've had an inquiry into the possibility of allowing users to work offline and later sync their data back up. I have concerns about...
Many of us know that Delphi executables are little bit gigantic, but again it is acceptable as nowadays 1.5 mb is not a big issue in PC. But what about mobile devices? Currently Firemonkey supports iOS and in the near future it is going to Android and so on. Isn't 4 mb of executable size for mobile devices is too much ...
I am trying to implement a generic scheduler object in C# 4 which will output a table in HTML. Basic aim is to show some object along with various attributes, and whether it was doing something in a given time period. The scheduler will output a table displaying the headers: Detail Field 1 ....N| Date1.........N I want...
Our team is currently working on building our next generation HIS (Hospital Information System) comprising of over 30 modules (currently estimated at 400 man months), to be possibly hosted in a central location and accessed across geographies. Hence the primary UI NFRs (Non Functional Requirements) would be Multi bro...
I have two model classes User and Role and two managers/DAOs (UserManager and RoleManager) plus a method which gives me all users with a certain role (List<User> getUsersWithRole(Role)). In which manager does this method belong and why?
I was trying to solve a hobby problem that required generating a million random numbers. But I quickly realized, it is becoming difficult to make them unique. I picked up Algorithm Design Manual to read about random number generation. It has the following paragraph that I am fully not able to understand. Unfortunately...
I've been looking into several of the JavaScript MVC Frameworks (Backbone.js, Spine, SproutCore,etc.) and it seems to me that all of these are designed to act as 'single-page' applications. All of the examples I see have an index page that act as a front controller, and use # or #! style URLs for different pages, and h...
I developing a client using Flex and ActionScript that is run in the browser and communicates with our server backend. There has been concern that the application "needs" to have a graphic indicator to show whether the client has a connection to the server or not. Part of the problem of this requirement is that is comi...
During a discussion, one of my colleagues told that he has some difficulties with his current project while trying to solve bugs. "When I solve one bug, something else stops working elsewhere", he said. I started to think about how this could happen, but can't figure it out. I have sometimes similar problems when I am...
According to Wikipedia, Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. If this is true, how was the first Malbolge interpreter tested (to check if it did the right thing when a Malbolge program was given)? Was it tested at all?