Has there really not been one thing in the past 20 years that provided huge software development gains?

In _No Silver Bullet_ , Fred Brooks makes a variety of predictions about the future of software engineering, best summed up by: > There is no single development, in either technology or in management > technique, that by itself promises even **one order-of-magnitude > improvement** in productivity, in reliability, in simplicity. His argument is very convincing. Brooks was writing in 1986: was he right? Do developers in 2014 produce software at a rate less than 10x faster than their counterparts in 1986? By some appropriate metric -- how large has the gain in productivity actually been?


Verifying a debit card online - What information is checked?

I am eager to know what information is checked by the online companies to confirm that the card is yours? If a programmer has to implement this functionality, how can he access information like address of the client which is not written on the debit card? Thanks


alerting that an object cannot be deleted (due to constraints)

Assume an application with a rich domain model with many classes (e.g `School`, `Classroom`, `Teacher`, `Student`, `Course`, `Exam`, `Submission`, ...) linking to each other. Model and links are mapped to the database which uses appropriate FKs and constraints (without cascade delete). In the admin panel the user has delete buttons next to each object. Attempting to delete an object has one of the following two outcomes:   * the object isn't being referenced from any other object, so it is deleted   * the object is being referenced by at least one other object so it cannot be deleted. An alert is shown to the user. I've got two ways to implement this:   1. prior to executing the sql delete, do whatever queries are necessary to discover whether this object can be deleted. If it cannot, then alert user.   2. go ahead and execute the sql delete and if that fails (due to the rdbms constraints) catch the sql exception and alert the user that it cannot be deleted. Both ways work well. The first way allows me to give the user a detailed reason why the object cannot be deleted (e.g it is being referenced by 2 `Course`s and 1 `Classroom`). The second way allows me to solve the whole problem by not writing any constraints checking code and rely on the solid (and existing) implementation of the db. Is there a reason why I should definitely choose one over the other?


lightweight document indexing to handle less than 250k potential records

Recently I've found myself chafing at the limitations of document indexing engines. I was developing a small website that needed some fairly robust searching capabilities but due to their hardware constraints I couldn't deploy a Lucene-ish solution (such as Solr or ElasticSearch, like I normally would) to handle this need. And even then, while I needed to serve up some complex data and calculations that were database-intensive, I didn't need to handle more than 250k potential records. Deploying an entire Solr or ES instance just to handle this seemed like a waste. After I thought about it, it seems like a fairly large problem. Most people handle search requirements solely with SQL. They just run SQL queries for their data and that's that. Their search capabilities also end up being terrible.   * Doing a blanket full-text wildcard search can be painfully slow on some systems (shared hosts in particular) and bog down your database, especially if you have complicated queries and lots of joins.   * You end up doing multiple queries on a single request from the user. You might get around this with ever-more-complicated queries, but see the previous point.   * Lack of features typically present in full-text engines. Databases had the same problem of needing to be deployed as a server and then SQLite came along and suddenly we could deploy a database that is self- contained in a single file. My Googling has produced nothing - wonder if something exist like this for full-text indexing/searching. What factors to take into account when deciding whether to implement lightweight document indexing (eg as explained in answers to another question) or keep using SQL for these situations?


WCF/webservice architecture question

I have a requirement to create a webservice to expose certain items from a CMS as a web service, and I need some suggestions - the structure of the items is as such:               item     - field 1     - field 2     - field 3     - field 4      So, one would think that the class for this will be:               public class MyItem     {       public string ItemName { get; set; }       public List<MyField> Fields { get; set; }     }          public class MyField     {       public string FieldName { get; set; }       public string FieldValue { get; set; } //they are always string (except - see below)     }      This works for when its always one level deep, but sometimes, one of the fields is actually a point to ANOTHER item (`MyItem`) or multiple `MyItem` (`List<MyItem>`), so I thought I would change the structure of `MyField` as follows, to make `FieldValue` as `object`;               public class MyField     {       public string FieldName { get; set; }       public object FieldValue { get; set; } //changed to object     }      So, now, I can put whatever I want in there. This is great in theory, but how will clients consume this? I suspect that when users make a reference to this web service, they won't know which object is being returned in that field? This seems like a not-so-good design. Is there a better approach to this?


Removing an element not currently in a list: ValueError?

This is something that's bothered me for a while, and I can't figure out _why_ anyone would ever want the language to act like this:               In [1]: foo = [1, 2, 3]          In [2]: foo.remove(2) ; foo  # okay     Out[2]: [1, 3]          In [3]: foo.remove(4) ; foo  # not okay?     ---------------------------------------------------------------------------     ValueError                                Traceback (most recent call last)          /home/izkata/<ipython console> in <module>()          ValueError: list.remove(x): x not in list      If the value is already not in the list, then I'd expect a silent success. Goal already achieved. Is there any real reason this was done this way? It forces awkward code that _should_ be much shorter:               for item in items_to_remove:        try:           thingamabob.remove(item)        except ValueError:           pass      Instead of simply:               for item in items_to_remove:        thingamabob.remove(item)      * * * As an aside, no, I can't just use `set(thingamabob).difference(items_to_remove)` because I _do_ have to retain both order and duplicates.


Designing a system with different business rules for different customers

My company is rewriting our proprietary business application. The current architecture is poorly done and inflexible. It is coded more procedural oriented as opposed to object oriented. It has become difficult to maintain. Our system is a web application written in .Net Webforms. I am considering ASP.Net MVC for the rewrite. We intend to rewrite it with a good, solid architecture with the goal of maintainability and reusable classes for some of our other systems and services. We would also like the system to be customizable for different customers in the event that we market the system. I am considering redesigning the system based on the layered architecture (Presentation, Business, Data Access layers) described in the Microsoft Patterns and Practices Application Architecture Guide. http://msdn.microsoft.com/en-us/library/ff650706.aspx Hopefully this isn't too open ended, but how would you recommend allowing for different business logic/rules for different customers? I'm aware of Windows Workflow Foundation, but from what I've read about it, it seems many business rules could be too complicated to handle there. Also, Can anyone point me to where I can download an example of a .net solution that is based on the Application Architecture Guide? I have already downloaded the Layered Architecture Solution Guidance and the Expense Sample on codeplex. I was looking for something a bit larger and more robust that I could step through the code and see how it works. If you feel there are better architectures to base our redesign on please feel free to share. I appreciate your help!


Is Domain Entity violating Single Responsibility Principle?

Single responsibility ( reason to change ) of an entity should be to uniquely identify itself, in other words, its responsibility is to be findable. Eric Evan's DDD book, pg. 93: > most basic responsibility of Entities is to establish continuity so that > behavior can be clear and predictable. They do this best if they are kept > spare. Rather than focusing on the attributes or even the behavior, strip > the Entity object's definition down to the most intrinsic characteristics, > particularly those that identify it or are commonly used to find or match > it. Add only behavior that is essential to the concept and attributes that > are required by that behavior. > > Beyond that, look to remove behavior and attributes into other objects > associated with the core Entity .Beyond identity issues, Entities tend to > fulfill their responsibilities by coordinating the operations of objects > they own. 1. > ... strip the ENTITY object's definition down to the most intrinsic > characteristics, particularly those that identify it or are commonly used to > find or match it. Add only behavior that is essential to the concept ... Once an _entity_ is assigned a _unique ID_ , its identity is established and so I would assume such an entity doesn't need any behavior to _maintain its identity_ or to _help it identify itself_. Thus, I don't understand what kind of behavior is author referring to ( besides `find` and `match` _operations_ ) with " _behavior that is essential to the concept_ "? 2. > ... strip the ENTITY object's definition down to the most intrinsic > characteristics, particularly those that identify it or are commonly used to > find or match it. ... Beyond that, look to remove behavior and attributes > into other objects associated with the core ENTITY. So any behavior that doesn't help identify the entity, but we'd still characterize that behavior as being an _intrinsic characteristic_ of that entity ( i.e. barking is intrinsic to dogs, flying is intrinsic to airplanes, laying eggs is intrinsic to birds ... ), should be put into other objects associated with that entity ( example: we should put barking behavior into an object associated with a dog entity )? 3. > Beyond that, look to remove behavior and attributes into other objects > associated with the core ENTITY. a) `MyEntity` delegates responsibilities `A_resp` and `B_resp` to objects `a` and `b`, respectively. Even though most of `A_resp` and `B_resp` work is done by `a` and `b` instances, clients are still served `A_resp` and `B_resp` through `MyEntity`, which means that from the client's perspective the two responsibilities belong to `MyEntity`. Thus, doesn't that mean `MyEntity` also has `A_resp` and `B_resp` responsibilities and as such is violating **SRP**? b) Even if we assume that `A_resp` and `B_resp` don't belong to `MyEntity`, `MyEntity` still has a responsibility `AB_resp` of coordinating the operations of objects `a` and `b`. So doesn't `MyEntity` violate **SRP** since at minimum it has _two responsibilities_ – to uniquely identify itself and also `AB_resp`?               class MyEntity     {         private A a = ...         private B b = ...                   public A GetA()         { ... }              public B GetB()         { ... }              /* coordinates operations of objects a and b */         public int AworkB()         { ... }     }          /* A encapsulates a single responsibility resp_A*/     /* A is value object */     class A     { ... }          /* B encapsulates a single responsibility resp_B*/     /* B is value object */     class B     { ... }      **UPDATE:** 1. > Behavior in this context is refering to semantic behavior. For example, a > Property on a class (i.e. attribute on a domain object) that is used to > uniquely identify it has a behavior. While this is not represented in code > directly. The expected behavior is that there will not be any duplicate > values for that property. So in code we would almost never need to actually implement a behavior ( i.e. an operation ) that would somehow maintain entity's identity, since as you explained such a behavior only exist as a concept in a domain model ( in the form of a ID attribute of an entity), but when we translate this ID attribute into code, part of its semantics is lost ( i.e. the part which implicitly makes sure the ID value is unique is lost )? 2. > Furthmore, a property such as Age has no context outside of a Person Entity, > and as such, makes no sense to move into a different object ... However that > information could easily be stored in a separate location that the unique > identifier, hence the confusing reference to behavior. Age could be a lazy > loaded value. a) If `Age` property is lazy loaded, then we may call it a behavior, even though semantically `Age` is just an attribute? 3. > You could easily have operations specific to Address such as verification > that it is a valid address. You may not know that at design time, but this > whole concept is to break down objects into their smallest parts While I agree that we'd lose context by moving `Age` into different object, the context wouldn't be lost if we moved `DateOfBirth` property into a different object, but we usually don't move it. What is the main reason that we'd move `Address` into another object, but not `DateOfBirth`? Because `DateOfBirth` is more intrinsic to `Person` entity or because there are less chances that somewhere in the future we may need to define operations specific to `DateOfBirth`? 4\. I must say I still don't know whether `MyEntity` also has `A_resp` and `B_resp` responsibilities and why `MyEntity` also having `AB_resp` isn't considered a violation of **SRP** **EULERFX** 1) > The behaviors that the author is referring to are behaviors associated with > the entity. These are the behaviors that modify the state of the entity a) If I understand you correctly, you're saying that _entity_ should only contain those _behaviors_ that modify its _attributes_ ( i.e. its _state_ )? b) And what about the _behaviors_ that don't necessarily modify the _state of the entity_ , but are still considered as being an _intrinsic_ characteristic of that _entity_ ( example: _barking_ would be _intrinsic_ characteristic of a `Dog` entity, even if it didn't modify _Dog's state_ )? Should we include these behaviors in an _entity_ or should they be moved to other objects? 2) > As far as moving behavior to other objects, the author is referring to value > objects specifically. Though my quote doesn't include it, but author does mention in the same paragraph that in some cases _behaviors_ ( and _attributes_ ) will also get moved into _other entities_ ( though I understand the benefits of moving _behaviors_ to VOs ) 3) Assuming `MyEntity` ( see question **3.** in my original post ) doesn't violate SRP, would we say that a _responsibility_ of `MyEntity` is among other things also comprised of: a. `A_resp` **+** `B_resp` **+** `AB_resp` ( `AB_resp` coordinates objects `a` and `b` ) or b. `AB_resp` **+** delegating `A_resp` and `B_resp` to objects ( `a` and `b` ) associated with `MyEntity`? 4) Eric Evan's DDD book, pg. 94: > CustomerID is the one and only identifier of the Customer ENTITY ( figure > 5.5 ), but phone number and address would often be used to find or match a > Customer. The name does not define a person's identity, but it is often used > as part of the means of determining it. > > In this example, the phone and address attributes moved into Customer, but > on a real project, that choice would depend on how the domain's customers > are typically matched or distinguished. For example, if a Customer has many > contact phone numbers for different purposes, then the phone number is not > associated with identity and should stay with the Sales Contact. a) > CustomerID is the one and only identifier of the Customer ENTITY ( figure > 5.5 ), but phone number and address would often be used to find or match a > Customer. The name does not define a person's identity, but it is often used > as part of the means of determining it. Quote states that only _attributes_ associated with _identity_ should stay in an _entity_. I assume author means that _entity_ should contain only those _attributes_ that are often used to _find or match_ this _entity_ , while ALL other _attributes_ should be moved? b) But how/where should other _attributes_ be moved? For example ( assumption here is that _address attribute_ isn't used to _find or match_ `Customer` and thus we want to move _address attribute_ out of `Customer` ): if instead of having `Customer.Address` ( of type `string` ) we create a property `Customer.Address` of type `Address`, did we move the _address attribute_ into an associated VO object ( which is of type `Address` ) or would we say that `Customer` still contains _address attribute_? c) > In this example, the phone and address attributes moved into Customer, but > on a real project, that choice would depend on how the domain's customers > are typically matched or distinguished. For example, if a Customer has many > contact phone numbers for different purposes, then the phone number is not > associated with identity and should stay with the Sales Contact. Isn't author in the wrong here, since if we assume each of the many _contact phone numbers_ that `Customer` has only belong to that particular `Customer`, then I'd say these _phone numbers_ are associated with _identity_ just as much as when `Customer` only had _one phone number_? 5) > The reason the author suggests stripping the entity down is that when one > initially creates a Customer entity, there is a tendency to populate it with > any attribute that one can think of being associated with a customer. This > is a data-centric approach that overlooks behaviors ultimately leading to an > anemic domain model. Off topic, but I thought _anemic domain model_ results from moving _behavior_ out of an _entity_ , while your example is populating an _entity_ with lots of _attributes_ , which would result in `Customer` having too much _behavior_ ( since we'd probably also include in `Customer` the _behaviors_ which modify these additional _attributes_ ) and thus in violation of SRP? thanks


How to negotiate with software vendors who do not follow HL7 standards

Take, for instance the "", I'd hope that anyone who has spent any time in dealing with HL7 messages knows that the "" signifies that something should be deleted. "" is not an empty string, it's not a filler etc... But occasionally, one may meet a vendor who persists in sending "" instead of just sending nothing at all. Since, I work for a small business and have an extremely flexible HL7 interface, I can ignore ""'s in received messages. But these things are adding up.   * Some vendors like to send custom formatted fields with psuedo-components that they leave others to interpret themselves.    * Some vendors send all their information in note segments and assume you're going to only show users the information they send in a monospace font.    * Some vendors even have the audacity to send Carriage Return Line Feeds at the end of each line of a file interface.    * Some vendors absolutely refuse to send decimal numbers and in-so-doing refuse to send any numbers. So, with all this crippling humanity against the simple plastic software man, how does one bend without breaking*? Or better yet, how does one fight back and still make money? *my answer is usually to create an interface for the interface and keep the HL7 processing pure, but I don't think this is the best solution


How can you tell good programmers from the average one?

> **Possible Duplicates:**   >  How do managers know if a person is a good or a bad programmer?   >  How to recognize a good programmer? For your record, I am a programmer myself, and I still do coding. We are not doing your-just-another-CRUD-app, instead we are working on CAD apps. The nature of software development makes it really hard to gauge a programmer's worth. How can you tell whether a programmer is good or not-so- good? All programmers who are working with me work on different parts of the applications, and how difficult it is to get those parts working is only known to the person who spend most time in it, in this case it's the programmers themselves; me as an outsider would not be able to fully appreciate the amount of sweat, ingenuity, effort they put in into solving those problems precisely because I don't have a chance to do the same job. This gives me a hard time when I evaluate them. How do I know programmer A is really great at solving the problem at hand and therefore I can throw him a bigger, harder task? And how do I know programmer B is just working hard, but not working smart? How can I evaluate and compensate programmers fairly?


How to recognize a good programmer?

Our company is looking for new programmers. And here comes the problem - there are many developers who look really great at the interview, seem to know the technology you need and have a good job background, but after two moths of work, you find out that they are not able to work in a team, writing some code takes them very long time, and moreover, the result is not as good as it should be. So, do you use any formalized tests (are there any?)? How do you recognize a good programmer - and a good person? Are there any simple 'good' questions that might reveal the future problems? ...or is it just about your 'feeling' about the person (ie., mainly your experience), and trying him out? Edit: According to Manoj's answer, here is the question related to the coding task at the job interview.


How to write efficient code despite heavy deadlines

I am working in an environment wherein we have many projects with strict deadlines on deliverables. We even talk directly to the clients so getting the jobs done and fast is a must. My issue is that i'd always write code for the first solution that comes to my mind, which of course I thought as best at that moment. It always ends up ugly though and i'd later realize that there are better ways to do it but can't afford to change due to time restrictions. Are there any tips by which I could make my code efficient yet deliver on time?


Allow threads (in c) to print messages without interfering with user input

I'm a writing a small webserver for personal use in c (not c++). I want to allow user input in the console like "shutdown server" or "restart server". In order to allow this kind of input the server is running in a seperate thread (pthreads), so the console isn't blocked. I also want this thread to print output in the console like "a new client connected" or "client requestet 'home.html'". > The problem is: If I'm typing something like "shutdown server" and at the > same time the thread prints something like "a new client connected" > everthing mixes up and I get something like "shuta new client connectedown > server" Is there an elegant way to print the output of the thread and at the same time allow the user to enter commands without both interfering? Or is this a stupid idea to begin with? If yes: Is there a standard way to handle things like that (i.e. to control server).


Why is test driven development missing from Joel's Test?

I was reading this blog by Joel Spolsky about 12 steps to better code. The absence of _Test Driven Development_ really surprised me. So I want to throw the question to the Gurus. Is TDD not really worth the effort?


What methods were used for online payments before API's and Paypal, etc

What methods (in programming/web dev terms) were used to take payments online before such things as Paypal, Google Checkout and various gateways and API's. How were such transactions carried out?


Command pattern design

I have this old implementation of the Command pattern. It is kind of passing a Context through all the _DIOperation_ implementation, but I realized later on, in the process of learning and learning (that never stops), that is not optimal. I also think that the "visiting" here doesn't really fit and just confuses. I am actually thinking of refactoring my code, also because a Command should know nothing about the others and at the moment they all share the same key- value pairs. It is really hard to maintain which class owns which key-value, sometimes leading to duplicate variables. An Example of use case: let's say **_CommandB_** requires **_UserName_** which is set by **_CommandA_**. Should CommandA set the key **_UserNameForCommandB_** = _John_? Or should they share a common _UserName=John_ key-value? What if the UserName is used by a third Command? How can I improve this design? Thanks!               class DIParameters {     public:        /**         * Parameter setter.         */         virtual void setParameter(std::string key, std::string value) = 0;         /**         * Parameter getter.         */         virtual std::string getParameter(std::string key) const = 0;              virtual ~DIParameters() = 0;     };          class DIOperation {     public:         /**          * Visit before performing execution.          */         virtual void visitBefore(DIParameters& visitee) = 0;         /**          * Perform.          */         virtual int perform() = 0;         /**          * Visit after performing execution.          */         virtual void visitAfter(DIParameters& visitee) = 0;              virtual ~DIOperation() = 0;     };


Contributor's actions after rejected pull request

Imagine, there is an open-source project with a Maintainer and a Contributor. Both of them have theirs repos exported to some repository hosting (github, bitbucket, sourceforge --- whatever, but they are public). Imagine further, Contributor did several commits, pushed them into his repo and sent pull-request to the Maintainer. Maintainer did review, made several comments about commits (fix this, fix that, simplify there, blah-blah-blah) and **rejected** the pull-request. Note:   1. For Contributor it's obvious that it's better to just fix patches/commits than rewriting from scratch.    2. Please consider situation, when there are many commits and fixes have to be scattered between them. What should Contributor do in this situation before making next pull-request? Remove invalid repo, rewrite history and push new one? Make a fix commit into current one? May Maintainer demand, that incoming history should be clean? I.e. is it technically simple enough to do?


Listing dependencies in the package.json for a node.js app on Heroku

I previously had an issue with my node.js app on Heroku. I added the dependency into my package.json and now it is working. But, is this the best way to do it?               {       "name": "application-name",       "version": "0.0.1",       "private": true,       "scripts": {         "start": "node app.js"       },       "dependencies": {         "express": "3.4.4",         "jade": "*",         "stylus": "*",         "ejs": "0.8.5"       },       "engines": {         "node": "0.10.1",         "npm": "1.3.14"       }     }      I ask because the other dependencies have a "*" which were there by default in my express app. What exactly does that mean and am I fine with leaving this file the way it is?


What is meant by a step-by-step refactoring plan describing implementation of design

> What is meant by a step-by-step refactoring plan describing how to implement > a certain design? As little as I know about refactoring it regards improving a (UML) design model and has nothing to do with the implementation of it. Therefore I'm pretty much confused by what this question means. Does anyone know and willing to explain? EDIT: In the context the design corresponds to a UML diagram with classes, methods and underlying associations.


Java Compiler and VM Compatibility

A co-worker and I recently had a discussion about Java versions and the JVM. I use Java 7 but we use Java 6 for our client (while he says that some are still on 5). My immediate thought was, why can't we target those VMs too? The Java VM is somewhat different than a real machine in that it has a bunch of runtime features. Type checking, exception handling, garbage collection, etc. But it's still a virtual machine which has a bytecode. (Which is why we can have things like C to JVM compilers.) So why can't we target older VMs with newer version of Java? Why does the language and the runtime have to be tied together? Besides the obvious performance penalties, it seems like it should be completely possible to compile Java 7 code to the Java 6 JVM. (And considering how little changed from Java 6 to 7, I can't imagine the compiler changes being that extensive.)


How to describe framework/features of a java application for client presentation?

I have been asked to put down the architecture and features of our Java application (more from infrastructure/software point of view). It will go on a Powerpoint presentation, so I need to provide the list. Please let me know how do I go about this.


Can daily reports decrease a developer's productivity?

In another question, I asked about why developers might don't like **daily scrum**. We talked to developers and we decided to not hold daily scrum for a while (to give it a try and customized scrum in our first attempt). This is the output of consulting with developers directly. On the other hand, we don't want to lose good parts of daily scrum, like getting a chance to coordinate developers everyday, or watching the work progress like a Key Performance Indicator, to take actions early. As an alternative to daily scrum, we're thinking about asking developers to provide daily reports with the following conditions:   1. No need to follow any specific format. Each and every format is accepted.   2. Even if the work is not done, we want to hear the amount of progress.   3. There is no need to mention the time spent on each task.   4. Development obstacles and coordination requirements should be mentioned.   5. There is no need to be obsessed with daily reports. It's not taken that strict. Do you think that this can decrease their productivity? Have you had any daily report experience? Do you have any suggestion for us, so that we can get sure that we're not micromanaging?


Is there ever a situation where it's ok to initiate a Delete on a GET?

When building a simple web app with database delete functionality, you normally would take the following steps:   1. User initiates a GET request using a delete link   2. User confirms the deletion   3. Upon confirmation, browser initiates a POST request to the server to perform the deletion What are the reasons for this convention? I understand that it sets up a confirmation step which would prevent automated calling of the delete function (as with spiders and such) - are there other reasons?


Ur/Web new purely functional language for web programming?

I came across the Ur/Web project during my search for web frameworks for Haskell-like languages. It looks like a very interesting project done by one person. Basically, it is a domain-specific purely functional language for web programming, taking the best of ML and Haskell. The syntax is ML, but there are type classes and monad from Haskell, and it's strictly evaluated. Server- side is compiled to native code, client to Javascript. See the slides and FAQ page for other advertised advantages. Looking at the demos and their source code, I think the project is very promising. The latest version is something 20110123, so it seems to be under active development at this time. My question: Has anybody here had any further experience with it? Are there problems/annoyances compared to Haskell, apart from ML's slightly more verbose syntax? Even if it's not well known yet, I hope more people will know of it. OMG this looks very cool to me. I don't want this project to die!!


API design with references to root object

[Normally I post on StackOverflow but as this is more a design/theory question rather than a code question I'll give it a shot here] Most of my applications currently use a core object model that I originally wrote 6 years ago and which has just grown as needed - as with most of my stuff, it was coded as is, without thinking up a design first. Part of it is too inflexible, part is poorly designed and yet more is clunky. So I decided to start again from scratch rather than trying to retrofit a new API on top of the existing one. And I also decided to actually map out the full API first upfront, then write the code for it. So far that approach is paying off I suppose and I have a nice little model brewing. However, I have one quandary in the new design. If you consider the automation models offered by things like Microsoft Word, most primary objects have a property named `Application` which points back to a core object. My existing object model follows pretty much the same principle and I am using that in the new one too. The current API however has a mix of approaches. Some objects store a reference to that root object. Others don't, and the property simply looks at a singleton "service" object, which at it's heart has a `ServiceContainer` to look up registered objects. Yes, a service locator. Some get it passed in through a constructor, others look it up _then_ store a reference. I normally like consistency, but this is a mess. My new design isn't changing this approach - objects still will have a property back the the root object with the idea being all the objects behave the same and I don't have to (manually) go hunting for an application when writing code for a given implementation. With that background information out of the way, here's my question. Should each object hold a reference to the root object, or should it not store a direct reference, but look it up somehow, ie from a singleton or a service locator. With the former approach, I'm going to use more memory - 4 bytes extra per object per object as I currently compiled everything as 32bit. While that doesn't sound a lot and I'm sure I'm not going to be creating many thousands of objects I sort of want the base API to be as efficient as possible as no doubt the apps I stick on top of it won't be! This approach also means I'm going to have to pass that object reference around in every single constructor, not much of a problem for real code but makes writing tests a bit more complicated. The latter approach means I save memory, but then I continue to use the bad practice of a service locator, and I supposed there's a at least the hint of a performance issue as having to lookup a reference isn't quite going to be as quick as returning a direct one. Or, is there another approach that large object models use that I haven't considered above? As mentioned I normally just dive in, make something that works then leave it alone until it breaks or I need it to do something else. I'm guessing the answer is going to be "just store the reference and stop complaining" but better to get a feel for other peoples opinions!


Development console commands registration

I have a DevelopmentConsole class. I am making functionality to register console commands for the subsystems. I don't want the console to know about them but also I don't want them to contain a debug code (like "Console.RegisterCommand..."). I think I should make an additional class hiearachy. For an example I have Player class.               IConsoleBuilder {          RegisterCommand(string command, Func<string[], string> action);      }          PlayerConsoleBuilderClient : ConsoleBuilderClient {          readonly Player _player =  ?inject?              public override void Visit(IConsoleBuilder builder) {              // builder.RegisterCommand("GetName", args => _player.Name) ;          }     }      Here I need to use Reflection to find all ConsoleBuilderClient subclasses. It's not a very good idea, is it? Can you suggest how to do it in a better way?


software developer designation related

What does designation "Associate software developer Grade 10" means? A company mention it in his offer letter. Here two words are confusing first "associate" and second "GRADE 10".


Replacing out parameters with struct

I'm encountering a lot of methods in my project that have a bunch of out parameters embedded in them and its making it cumbersome to call the methods as I have to start declaring the variables before calling the methods. As such, I would like to refactor the code to return a struct instead and was wondering if this is a good idea. One of the examples from an interface:               void CalculateFinancialReturnTotals(FinancialReturn fr, out decimal expenses, out decimal revenue, out decimal levyA, out decimal levyB, out decimal profit, out decimal turnover, out string message)      and if I was to refactor that, i would be putting all the out parameters in the struct such that the method signature is much simpler as below.               [structName] CalculateFinancialReturnTotals(FinancialReturn fr);      Please advise.


Can I use Apache Software License, Version 2.0 and GNU LGPL 3 licence plugins in my commercial web application?

I have two plug-ins. One has the GNU LGPL 3 license and the other has the Apache Software License, Version 2.0. Can I use them in my commercial app? And if yes, what precautions should I take?


What's the "normal" range for typing speed for developers?

Clearly, two finger typing is probably a sign the developer needs work to speed up his typing (or is lying about his experience as a developer), and 60+ WPM is more than sufficient. Has anyone studied this, though? How fast do developers type, on average, and what's the "normal" range of typing speeds?


How reduce the usage of Magic Strings?

In the application database there is a configuration table with this schema: Table: ReleaseProperty   1. ReleasePropertyID   2. ReleaseID   3. Name   4. Value Currently to retrieve a specific property I pass to the Repository class the arguments ReleaseID (that come from the current web page address) and a Name, that is basically hard coded E.g.               var property = ReleasePropertyRepository.Select(ReleaseID, "MyProperty");      I don't like to use hard coded strings around my code, and the only idea to improve the quality of this code is to use a container class for constants.               var property = ReleasePropertyRepository.Select(ReleaseID, Constants.MyProperty);      Is there any other way to develop a better code?


What could be a good thesis topic for software and business?

For my business studies, I need to explore the financial side of software engineering projects, but I am rather a technical person myself. What would be good place to start? What are the important financials (net-present-value does this make sense for software?) or performance-indicators of "good" software projects? What type of person in an organization I should contact? Thanks for any help.


Web-services REST security clarification

I'm newbie of web services programming and I have some problem to understand how to work authentication/security for REST WS pattern. I had read about OAuth but I haven't understand how it work in detail, however I think I don't need it because only my app use the API. I need authenticate the users that need to use the "privates" APIs, can you explain me the correct way for implement a REST WS authentication, or give me a good guide or flowchart?


In BDD, going from feature to user story how does it works?

My background is the book BDD in action. How one goes from Feature to Stories? More specifically I would like to understand the following: 1- When does one provide the decomposition into stories? Do you do it while spotting the examples that illustrate your feature ? 2 - If so how do you proceed in your development then: Do you first start to on work on the stories while leaving your feature pending ? Do you right the feature scenario first and then, move on the stories that comes out of it, while leaving the feature test pending ? The key here is the process, if i do a decomposition of a feature into stories, before writing my actual scenario that spot those stories, i might be writing stories that are not relevant to the feature isn't it? This though make me think that stories must be fleshed out in the same way as unit test/integration test are fleshed out of a user stories? However if one does that well it is difficult to plan a feature for scrum iteration. I understand that it is just a planning tool, but it would be interesting to understand how this planning is actually used in the context of dealing with a feature. I believe one should not do too much upfront planning, not commit to things without being sure, but in the mean time, it seem to me that the decomposition into the different process (stories) involve into the feature process requires some upfront planning. I would appreciate a clarification on that point.


What are graphs in laymen's terms

What are graphs, in computer science, and what are they used for? In laymen's terms preferably. I have read the definition on Wikipedia: > In computer science, a graph is an abstract data type that is meant to > implement the graph and hypergraph concepts from mathematics. > > A graph data structure consists of a finite (and possibly mutable) set of > ordered pairs, called edges or arcs, of certain entities called nodes or > vertices. As in mathematics, an edge (x,y) is said to point or go from x to > y. The nodes may be part of the graph structure, or may be external entities > represented by integer indices or references. but I'm looking for a less formal, easier to understand definition.


Best practices for logging user actions in production

I was planning on logging a lot of different stuff in my production environment, things like when a user:   * Logs In, Logs Off   * Change Profile   * Edit Account settings   * Change password ... etc Is this a good practice to do on a production enviornment? Also what is a good way to log all this. I am currently using the following code block to log to:               public void LogMessageToFile(string msg)             {                      System.IO.StreamWriter sw = System.IO.File.AppendText(                     GetTempPath() + @"MyLogFile.txt");                 try                 {                     string logLine = System.String.Format(                         "{0:G}: {1}.", System.DateTime.Now, msg);                     sw.WriteLine(logLine);                 }                 finally                 {                     sw.Close();                 }             }      Will this be ok for production? My application is very new so im not expecting millions of users right away or anything, looking for the best practices to keeping track of actions on a website or if its even best practice to.


How do I transition from a large enterprise to a small startup?

I am shortly going to move from a large, multinational, enterprise software house to a start up where I will be the only full time developer. I've worked in start ups and in companies where there have been only three or four devs before so I'm fairly happy with many of the differences in general company feel. But having never worked as a sole dev there a couple things I've got used to in a large company that I think will take more adjustment. And was wondering if there was any advice on how to manage them?


Books on improving JEE web application performance and responsiveness

Does anyone know of any good books on this topic? I did search on amazon but ones that I found are pretty old publications.


Best industry to work for as a developer

My contract has just ended and I'm wondering what possible jobs I might want to look at next. I've worked in banking and insurance industry for all my career (including one Fortune 500 company) and in my experience banking is the slowest (and most boring) industry to work for due to their strict business practices (which is fair enough). The upside is that they pay well. ### My questions are:   * What are the best and worst industries for developers to work in? That is, in the industries you have worked in, what was good and bad from a developer perspective (money, work, culture, benefits, colleagues, etc.)?    * How does working as a consultant affect your opinion of an industry?   * Seeing that I've mentioned boredom, which industry supports fast growth?


Tips/tricks to manage a new team with new code

How do you handle yourself in a new team where you are the senior most developer and most others in the team are junior to you by several years. The task ahead of the team is something nobody else including you has accomplished in their career before. Management insists on higher productivity of the whole team, and as senior developer you are responsible. Any tips for coming out trumps in a situation like this? Clearly, the entire team needs time to learn and let's not forget the team's new. However, deadlines are up ahead as well...


Best Usage of Multiple Computers For a Developer

I have two Macbook Pros - both are comparable in hardware. One is a 17" and the other a 15". The 17" has a slightly swifter CPU clock speed, but beyond that the differences are completely negligible. I tried a setup a while back where I had the 17" hooked up to an external monitor in the middle of my desk with the 15" laptop immediately to the right of it, and was using teleport to control the 15" from my 17". All development, terminal usage, etc. etc. was being done on the 17" and the 15" was primarily used for email / IM / IRC... or anything secondary to what I was working on. I have a MobileMe account so preferences were synced, but otherwise I didn't really use anything else to keep the computers in sync (I use dropbox/git but probably not optimally). For reasons I can't put my finger on, this setup never felt quite right. A few things that irked me was   * the 15" was way under-utlized and the 17" was overutilized    * having 2 laptops and a 21" monitor all on one desk actually took up lots of desk space and it felt like I had too much to look at. I reverted back to just using the 17" and the external monitor and keeping the 15" around the house (and using it _very_ sparingly). For those of you who are using multiple laptops (or just multiple machines for that matter), I'd like to see setups that work for you for when you have 2 or more machines that gives you optimal productivity and why. I'd like to give this one more shot but with a different approach than my previous - which was using the 15" as a machine for secondary things (communication, reading documentation, etc. etc).


Apple Dispatch Queue vs Threads

I've heard a lot about apple's famous dispatch queues and the **GCD** but today was the first time I decided to understand exactly what is going on, so I started reading Concurrency Programming Guide and this paragraph caught my eye. > If you have two tasks that access the same shared resource but run on > different threads, either thread could modify the resource first and you > would need to use a lock to ensure that both tasks did not modify that > resource at the same time. With dispatch queues, you could add both tasks to > a serial dispatch queue to ensure that only one task modified the resource > at any given time. This type of queue-based synchronization is more > efficient than locks because locks always require an expensive kernel trap > in both the contested and uncontested cases, whereas a dispatch queue works > primarily in your application’s process space and only calls down to the > kernel when absolutely necessary. What I understand is that they are suggesting executing two tasks serially to avoid use of locks, which can be done the same way in threads. For example in Java you can put two functions in your thread's runnable and the thread will execute them serially and you will not need locks in that case two. Now my question is that am I missing something ?


New to programming. How do I meet people to expand my programming knowledge and discourse?

I've been a tinkerer of tech and programming, but books and online resources only go so far. I want a community to engage in discussions about programming to take me beyond what books can give (also, often just to explain what the books are trying to convey). No one in my daily life is very tech-inclined in the slightest, so where do I go? Are online communities enough for you programmers out there? If not, where do you go, or recommend going? (specifically, I'm interested in C++, Linux, Python, & Objective-C, but that may not apply to the question)


Python is slowly replacing C in universities. Does this move degrade the quality of CS students?

I believe learning C is one of the most important aspects for any programmer. It's a beautiful combination of a high and low level language. Some universities are moving to stop teaching C in the introductory stages and are using Python instead. Will this move to Python, from C, degrade the quality of CS students? If you miss out on some of the aspects of a low level language, are you missing something important from you CS degree?


When to use identity comparison instead of equals?

I wonder why would anybody want to use identity comparison for fields in `equals`, like here (Java syntax):               class C {         private A a;              public boolean equals(Object other) {             // standard boring prelude             if (other==this) return true;             if (other==null) return false;             if (other.getClass() != this.getClass()) return false;             C c = (C) other;                  // the relevant part             if (c.a != this.a) return false;                  // more tests... and then             return true;         }              // getter, setters, hashCode, ...     }      Using `==` is a bit faster than `equals` and a bit shorter (due to no need for null tests), too, but in what cases (if any) you'd say it's really better **to use`==` for fields inside `equals`**?


How often is seq used in Haskell production code?

I have some experience writing small tools in Haskell and I find it very intuitive to use, especially for writing filters (using `interact`) that process their standard input and pipe it to standard output. Recently I tried to use one such filter on a file that was about 10 times larger than usual and I got a `Stack space overflow` error. After doing some reading (e.g. here and here) I have identified two guidelines to save stack space (experienced Haskellers, please correct me if I write something that is not correct):   1. Avoid recursive function calls that are not tail-recursive (this is valid for all functional languages that support tail-call optimization).   2. Introduce `seq` to force early evaluation of sub-expressions so that expressions do not grow too large before they are reduced (this is specific to Haskell, or at least to languages using lazy evaluation). After introducing five or six `seq` calls in my code my tool runs smoothly again (also on the larger data). However, I find the original code was a bit more readable. Since I am not an experienced Haskell programmer I wanted to ask if introducing `seq` in this way is a common practice, and how often one will normally see `seq` in Haskell production code. Or are there any techniques that allow to avoid using `seq` too often and still use little stack space?


What is the most efficient way to study multiple languages, frameworks, and APIs as a developer?

I know there are those out there who have read a slurry of books on a specific technology and only code in that one particular language, but this question is aimed at those who need bounce around between using multiple technologies and yet still manage to be productive. What is the most efficient way to study multiple languages, frameworks, and APIs as a developer without becoming a cheap swiss army knife? And how much time should one dedicate to a particular subject before moving to another?


Is it wrong to use Agile when clients' requirements don't change at all?

I have seen a lot of posts recently saying that one of the major reasons why Agile is used is because clients often change the requirements. However, let's say the clients **do not change the requirements often**. In fact, the clients have firm requirements though might be a bit vague (but nothing unreasonably vague), but I use Agile anyway. The reason why I employ Agile is because the software is complex enough that there are details, problems that I wouldn't recognize until I actually face them. I could do a full scale heavy planning approach like waterfall, but then it would take a few months to finalize all the high level design and low level coding signatures. There is a very specific, fixed architectural design for the system though. My question is: Would this be considered as bad, cowboy coding, anti-pattern, etc..? Must we employ waterfall and plan as much as possible in great details before we start coding **when requirements are stable** instead of this 'let's do it' mentality in Agile? EDIT: The major point here is that: we CANNOT blame the clients for changing requirements. Assume the clients pointed us to a very concrete problem, give us a wish list in very reasonable details and leave us alone (ie the clients have their own productive things to do, don't bug them any more. Only demo to them near the end when you have a minimum working prototype). Would it be wrong to use Agile in this scenario?


Using a Proxy as an ACL

I am building an MVC application in PHP, using Zend Framework. My model includes Domain Model and Mapper layers. I am trying to keep the domain model in pristine condition and have managed to keep it free from persistence-related code. Now I am trying to find a solution for ACL. I have 'general' ACL rules that can be easily enforced in a service layer, but I also have some very fine grained rules. The fine grained rules apply at the property level and affect whether the current user can alter a field, and if so, what the range of allowable values is. Currently I am thinking of using the proxy pattern, and that the proxy should extend the real object (to save me having to redirect 100% of calls). Does this sound reasonable? Is there a better option?


Getting help in programming while holding the reins tightly

I am starting an Internet business. Basically the most important part, the part that is making me actual money is still missing. I tried to deal with those issues several times but I always get distracted by other things. This is a typical example of not rising to a challenge. I thought about hiring a programmer to continue my coding but I came up with two problems:   1. When revealing my current code the programmer could just run the business on his own. How do I choose someone who won't do that?   2. Which way of payment is appropriate for the programmer in this situation? Per hour? How do I figure out the right amount? The code to be written will be in PHP + MySQL.


Is WCF strictly an asynchonous comms platform?

Since I last had to do any comms/network programming, the field has exploded with acronyms. In fact, networking almost feels like it is now described by a whole new language. The very name "Windows Communication Foundation" suggests it should be all things to all people... but I need to be sure I can program up some synchronous real-time* comms on a dedicated gigabit ethernet network. Can someone confirm that WCF is not a starter for this task... or if it is, which of the many confusing acronyms I should get familiar with? * By real-time, I mean I need to reduce latencies down to an acceptably low level. For our application, which involves transmitting results of video & audio analyses continuously every few milliseconds, I need to ensure 99% or better of those analyses are presented at the UI within (ideally) 0.5 seconds so that the user has time to respond before the originating network node deletes data out of its buffer to make way for subsequent analyses.


Combine Data from Two Tables-Help Needed

I have developed a web site with a mysql backend, but am not satisfied with how I am getting one set of data and do not know how to get another dataset. The page in question is at: http://whistclub.org/test/ajax.php?vichill/results/1 The results are shown through October so there is some data to use. I am pulling the results from two mysql tables (see below), but the code I have used is too ugly for me to tolerate. Yeah, it works, but I have some standards! Think calls to the database for each team. I think joins should be used, but I can't get it to work.   Ideally (I think) the result array would convert the teamIDs to team names and use names for the winner and loser VP columns. The standings table on the page is not working at all--what you see is hand coded just to show what is needed. The tables are:               teams:          id--autoincremented     teamID--Asssigned to each team as part of the game     teamName          games:          id--autoincremented     gameID--I suspect this is not needed since it duplicates id.     teamA     teamB      date     winner     IMPmargin     winnersVPs     losersVPS      The game is bridge and IMP and VP are scores. VPs are derived from IMPs and the loser often gets a few VPs. See the webpage for the details, but I do not think that is relevant to my issue. Here is some data from the games table:               id  gameID  teamA  teamB  date        winner  IMPmargin  winnersVPs  losersVPs     1   1       11     18     2013-09-25  18      12         20          10     2   2       12     17     2013-09-25  12      22         22          8     3   3       13     16     2013-09-25  13      20         21          9     4   4       14     15     2013-09-25  14      0          15          15     5   5       19     99     2013-09-25  NULL    NULL       NULL        NULL      Team 99 is a dummy for a bye week for a team. If the tables are designed too badly, let me know how to make them work better. Hopefully, that is enough for someone to point me in the right direction.


Is Object Oriented Design necessary when building Symfony web apps?

I am primarily a software developer, and as such, I do a lot of reading on the subject of Object Oriented Design; the 5 SOLID principles, design patterns, composition over inheritance etc. I currently work as a PHP developer building web applications in Symfony 2. Along with learning to use an Agile/BDD/TDD approach to building web applications, I try to incorporate some OOD by searching out the abstractions and jotting down some interfaces for classes to communicate with (dependency inversion). I was recently tasked with building a small, in-house CMS for a small, static website. This seemed a great opportunity to create, for example, an abstract "content" class and derive different types of content from it, or an interface for persisting content to the database. As it turned out, I didn't need any of the OOD knowledge that I have spent hours amassing. I just created Entities for each content type (albeit they derived from a base Entity), and I used the Symfony Form API to render forms for User input. Symfony functionality, when combined with Doctrine, handled all of the persisting to the DB. All that was left was to retrieve from the DB, process it, and pass it to the Twig template. So in consideration of this, I imagine that even had the application been much larger, it seems that the nature of most web applications is to take user input, process it, perhaps persist it, and render a view. None of this seems to require any OOD knowledge or design pattern knowledge. My question is whether my time is wasted learning OOD, or if I shouldn't place such importance on it, as perhaps modern web application development doesn't really fit that realm of "software" development. NB: I am aware that if I was to build a framework such as Symfony 2, then the OOD principles would apply, as that is truely building software from the ground up. My question is more related to when we use the Symfony (or any other) framework. **Edit** A better way to rephrase my question: do the majority of web application developers, whilst being rich in the knowledge of OOD, find that they needn't apply a vast majority of this knowledge when building web applications, because today's frameworks shelter you from such low level design. Does anyone have any examples of modules they have built that required Object Oriented methodology?


How you prepared for your .NET interview?

I gave many interviews in the last few years and each time I found the interviewers are not satisfied with what I know. My first company only developed desktop Windows applications using .NET. They had nothing to do with features like: _Remoting_ etc. We also had limited use of _Generics_ , _Reflection_ and _Multi-threading_. When I appeared for the interviews, I was asked questions on above features even when I told them that I don't have real-life experience. Now the .NET interviews are even more complex. Seeing my experience, the interviewers target the latest framework. I have no real-life exposure to the new features and technologies like WPF, WCF etc. Please suggest me how to effectively prepare for the .NET interview. I have 3 years experience in .NET but I only developed Windows based applications. At present I work on .NET Framework 3.5. I never worked on ASP.NET, as in my present company I work on PHP for web-applications.


High-Level Application Architecture Question

So I'm really wanting to improve how I architect the software I code. I want to focus on maintainability and clean code. As you might guess, I've been reading a lot of resources on this topic and all it's doing is making it harder for me to settle on an architecture because I can never tell if my design is the one that the _more experienced programmer_ would've chosen. So I have these requirements:   * I should connect to one vendor and download form submissions from their API. We'll call them the `CompanyA`.   * I should then map those submissions to a schema fit for submitting to another vendor for integration with the email service provider. We'll call them the `CompanyB`.   * I should then submit those responses to the ESP (`CompanyB`) and then instruct the ESP to send that submitter an email. So basically, I'm copying data from one web service to another and then performing an action at the latter web service. I've identified a couple high-level services:   * The service that downloads data from `CompanyA`. I called this the `CompanyAIntegrator`.   * The service that submits the data to `CompanyB`. I called this `CompanyBIntegrator`. So my questions are these:   1. Is this a good design? I've tried to separate the concerns and am planning to use the facade pattern to make the integrators interchangeable if the vendors change in the future.   2. Are my naming conventions accurate and meaningful to you (who knows nothing specific of the project)?   3. Now that I have these services, where should I do the work of taking output from the `CompanyAIntegrator` and getting it in the format for input to the `CompanyBIntegrator`? Is this OK to be done in `main()`?   4. Do you have any general pointers on how you'd code something like this? I imagine this scenario is common to us engineers---especially those working in agencies. Thanks for any help you can give. Learning how to architect well is really mind-cluttering.


C++ or C#: Which language is Microsoft going to use in development of future Windows versions?

I heard almost all parts of Windows are written in C and C++ with some assembly. Why did Microsoft skip C#? Is there any scope for C# in the development of future Windows versions?


using pre-commit / post-merge hook script to replace configuration values

I'm having some problem developing a web application with various developers, each one has an specific configuration to work. and i would like to use the less resource cosuming approach to avoid that any personal configuration goes to the repository. **the basic idea is:** to have a config file with all the pairs of key/values to store the configuration and substitute specific constants inserted in the code with the correpondent value in the code. I'm pretending to replace the values in the code with the key text using this syntax `{@KEY_TEXT}` in pre-commit and executing the opposite operation in the post-merge hook i'm doing this right? there's a more efficent way to do this? **EDIT:** Why i don't have all debug configuration in a single file, because all this values are inserted accross various files / and involves lot of different programming languages and differente context. i'm Using **PHP/javascript/Shell/Batch** file Language (Windows). in a cross plataform enviroment


How much to charge for project support after one year?

We did a project and the cost includes one year bug fixes and supporting.   How much should we charge for supporting the website for another one year? is there a formula or standard way to calculate this?


What's the reason for C standard to consider const-ness recursively?

The C99 standard says in 6.5.16:2: > An assignment operator shall have a modifiable lvalue as its left operand. and in 6.3.2.1:1: > A modifiable lvalue is an lvalue that does not have array type, does not > have an incomplete type, does not have a const-qualified type, and if it is > a structure or union, does not have any member (including, recursively, any > member or element of all contained aggregates or unions) with a const- > qualified type. Now, let's consider a non-`const` `struct` with a `const` field.               typedef struct S_s {         const int _a;     } S_t;      By standard, the following code is undefined behavior (UB):               S_t s1;     S_t s2 = { ._a = 2 };     s1 = s2;      The semantic problem with this is that the enclosing entity (`struct`) should be considered writable (non-read-only), judging by the declared type of the entity (`S_t s1`), but should not be considered writable by the wording of standard (the 2 clauses on the top) because of `const` field `_a`. The Standard makes it unclear for a programmer reading the code that the assignment is actually a UB, because it's impossible to tell that w/o the definition of `struct S_s ... S_t` type. Moreover, the read-only access to the field is only enforced syntactically anyway. There's no way some `const` fields of non-`const` `struct` are going really be placed to read-only storage. But such wording of standard outlaws the code which deliberately casts away the `const` qualifier of fields in accessor procedures of these fields, like so (Is it a good idea to const- qualify the fields of structure in C?): **(*)**               #include <stdlib.h>     #include <stdio.h>          typedef struct S_s {         const int _a;     } S_t;          S_t *     create_S(void) {         return calloc(sizeof(S_t), 1);     }          void     destroy_S(S_t *s) {         free(s);     }          const int     get_S_a(const S_t *s) {         return s->_a;     }          void     set_S_a(S_t *s, const int a) {         int *a_p = (int *)&s->_a;         *a_p = a;     }          int     main(void) {         S_t s1;         // s1._a = 5; // Error         set_S_a(&s1, 5); // OK         S_t *s2 = create_S();         // s2->_a = 8; // Error         set_S_a(s2, 8); // OK              printf("s1.a == %d\n", get_S_a(&s1));         printf("s2->a == %d\n", get_S_a(s2));              destroy_S(s2);     }      So, for some reason, for an entire `struct` to be read-only it's enough to declare it `const`               const S_t s3;      But for an entire `struct` to be non-read-only it's not enough to declare it w/o `const`. What I think would be better, is either:   1. To constrain the creation of non-`const` structures with `const` fields, and issue a diagnostic in such a case. That would make it clear that the `struct` containing read-only fields is read-only itself.   2. To define the behavior in case of write to a `const` field belonging to a non-`const` struct as to make the code above **(*)** compliant to the Standard. Otherwise the behavior is not consistent and hard to understand. So, what's the reason for C Standard to consider `const`-ness recursively, as it puts it?


How do I find a good middle way to make this library safe for concurrent operations

I've made a little library called SignalR.EventAggregatorProxy Before I push it into 1.0 state I need to fix so it works safely with concurrent operations. Easiest way is lock all operations but thats a huge performance impact. The library queues event subscriptions and when a event comes in it checks the subscriptions and updates the clients using SignalR This is the class that holds the subscriptions There are 3 methods that write/read to the subscription collection(s) (I aggregate the subscription both on a client level and event level, so its two collections)   * Subscribe    * UnsubscribeConnection   * Unsubscribe And one that that reads   * Handle I realize since this is a library I can't make it optimum for all users of the library, but how do I find a good middle way that does not use locks? I think the Handle method is the most important method and should be prioritized for performance over the other 3. I made this little Unittest to test for Concurrency fail **update:** I choose to have locked writes and unlocked reads. The writes didnt mutate existing state but overwrite the collection completely.


Best way to use source control for a project (1-3 people)

So my partner and I are working on a practice management system and at first we didn't use any version control, then I persuaded him to use git. At the moment our system is that we have three branches: develop, master and release. Our git repo is on an external server, which has Apache, MySQL, etc. We do our daily coding on the develop branch (commits) and then we we have done some testing to make sure it's (semi) bug-free we merge it into the master branch. If we want to do something radical we just make a branch of master, mess around and if it works, good, we merge it back in, if not, we delete the branch. Finally when we go for our weekly release we merge to the release branch to make sure we have a copy of the project as it was when we released. Unfortunately we don't track all files in git as it slows down git too much (e.g. images, especially since this is on an old server with a single-core 1.4 GHz AMD Sempron), as a `git status` usually changes from around 3s to about 1 minute; or because we can't (mysql databases). For us the slowdown is not workable so we just leave them out, and this has never seemed to be a problem because we haven't deleted any images, but we may start to soon as we start to optimize. So when we checkout previous commits sometimes the files aren't there and so it is broken (a big problem is we can't use version control on the database (because we don't know how), so because the schema has changed it is also broken if we go back). And that's pretty much our workflow. So after my background, my question is: **Do you think that there are any improvements we could make to the above?** And on a side note: Does any know a reliable and easy-medium difficulty (i.e. not _too_ hard) way to track mysql databases in git?


How to deal with hard configurations at the component level?

I distinguish three organisation levels while programming: the library level, the component level and the application level. A library defines functions to solve a range of related problems or preform related operations in _tools and no policies_ manner. An application lets several libraries interact and defines policies for diagnostic, error handling, internationalisation,… A component sits between the library and the application, it handles low-level errors and produce diagnostics, it might old global state and is aware of other components. Now I have a library implemented as a functor parametrised by a module holding a constant _n_ and values associated to different values of _n_ have incompatible types—which is the purpose of implementing the library as a functor. I call such a configuration a _hard_ configuration, because it must somehow be hard-coded in the program. Now I am facing the following problem: In this setting, I want to allow the user of the program to choose the value of _n_ for the duration of the program. Since the library is a functor, one feels forced to write the component interfacing the library to the program as a functor. But I want the choosed value of _n_ to be a property of the component, not of the application, and I want component to be regular modules (no functor allowed). How can I wrap a parametric library (implemented as a functor) in a non- parametric component, so that parameters can be chosen when the application starts? I insist on being able to express the application logic at the highest level in terms of non parametric modules, and want to avoid russian-dolls- alike parametrised modules at this level.


Implementation of chess endgame engine without Endgame Tablebases

I'm interested in creating an chess endgame solving engine. The endgames in chess are usually solved using the endgame table-bases generated by `retrograde algorithm`. I have found that Artificial Intelligence and Genetic Algorithms have been applied to the chess programming. However, before starting the implementation I wanted to find out whether the chess endgames can be played without the endgame tablebases? If yes, then what are the pros and cons of these alternatives to endgame tables? Are there any other algorithms known for this problem?


Website inheritance of ownership question

I paid for a web site for my motel business, then due to my landlord actions I was placed in a position to file for bankrupcy. I asked my IT manager and web developer to close down the web site for the business. He has since then sold my web site to the new owners. I took all the photos myself and I am in at least 4 of the photos on the site. There are no changes to the site as I left it and it now states that it is under the copyright on the new owners? I am not sure what I should do as this happen 10 months ago and I have just found this out. Thank you for your help, I am in Australia.


Keeping application backend and UI synchronised

I have an app that works with a list of objects so has one central keyed list. The main window has a tree containing these object with some information, which is easy enough to populate as a one off event after loading. Now, the complicated part, any part of the application can add, remove, and more importantly change the details of those objects at any time (all in the same process) and I'd like the tree to update to suit. I have a few options including passing events back down from the object to the list to the form which seems to be the most flexible way. I can also do it lazily and repopulate the tree each time or periodically (very hackish). Does anyone have any better thoughts on how to structure this? This is being done in C# 2.0 but the concepts apply to any environment. Thanks


Pricing personalized software?

Currently i'm working on a Purchased Order System Application Project for a small scale company. The Software that i am working on is personalized based on the on their business requirement. **The company told me to create proposal include the price how much is the application is so they can process the check for me.** The person who give me this project is the company supervisor and also a former supply chain supervisor in my employer before which i work also in some of their applications back then.So i want to be fair. This is my first time to create an application as a sideline so i really never experienced pricing a software even though i am working as full time web developer in a big company. Any tips and help ?


Will Authentication over HTTPS Slow My Application?

I am building a web application and RESTful web service. I have been reading various articles about the best way to authenticate the requests to the web service. The best option for me seems to be to use HTTP basic authentication. Pretty much every article ive read says that authentication should be encrypted over SSL or equivalent. Im not totally sure what this involves. Does this mean that my whole web service will have to be on a secure server? Will this slow things down?


What is the best way to work with large databases in Java depending on context?

We are trying to figure out the best practice for working with very large DBs in Java. What we do is a kind of BI (business Intelligence), i.e analyzing very large DBs, and using them to create intermediate DBs that represent intelligent knowledge of the DBs. We are currently using JDBC, and just preforming queries using a ResultSet. As more and more data is being created, we are wondering whether more appropriate ways exist for parsing and manipulating these large DBs:   1. We need to support 'chunk' manipulation and not an entire DB at once(e.g. limit in JDBC, very poor performance)   2. We do not need to be constantly connected since we are just pulling results and creating new tables of our own.   3. We want to understand JDBC alternatives, with respect to advantages and disadvantages.   4. Whether you think JDBC is the way to go or not, what are the best practices to go by depending on context (e.g. for large DBs queried in chunks)?


Is it possible to modify a video codec + distribute it?

this is my first question on this particular stackexchange node, not sure if it's the most appropriate place for this question (if not, guidance to the appropriate node would be appreciated). **the abstract:** I'm interested in modifying existing video codecs and distributing my modded codecs in such a way as to make them easily added to a users codec library... for example to be added to their mpeg streamclip, ffmpeg etc. **some details:** I've had some experience modifying codecs by hacking ffmpeg source files and compiling my hacked code (so that for ex: my version of ffmpeg has a very different h.263 than yours). I'm interested now in taking these modified codecs and somehow making them easily distributable, so others could "add them" to their "libraries." Also, I realize there are some tricky rights/patent issues here, this is in part my motivation. I'm interested in the patent quagmires, and welcome any thoughts on this as well. **ctx link:** if it helps (to gauge where I'm coming from) here's a link to a previous codec-hacking project of mine http://nickbriz.com/glitchcodectutorial/


What is the fitness landscape for minimal + viable solutions?

Let's say I'm trying to find a number from 1 .. 100. All numbers in this range are "valid", in that they could be interpreted as potential solutions. Let's say the ideal number is 50. And all numbers >= 50 are "feasible" in that they actual solve the problem. And all numbers < 50 are "not feasible" (but still valid). How would you code a scenario like this with a fitness function (assuming that the landscape is similar to but more complex than this contrived example)? Do you give "bonuses" to valid solutions? Do you measure how far an unfeasible solution has left to go before becoming optimal? And do you penalize excessive solutions?               if (solution < 50) {       maximalFitness = solution     } else if (solution >= 50) {       maximalFitness = 1_000 - solution     }      The curve wouldn't be continuous if all feasible solutions are strictly better than all unfeasible solutions, despite having a similar distance from optimal.


Why is trailing whitespace a big deal?

Trailing whitespace is enough of a problem for programmers that editors like Emacs have special functions that highlight it or get rid of it automatically, and many coding standards require you to eliminate all instances of it. I'm not entirely sure why though. I can think of one practical reason of avoiding unnecessary whitespace, and it is that if people are not careful about avoiding it, then they might change it in between commits, and then we get diffs polluted with seemingly unchanged lines, just because someone removed or added a space. This already sounds like a pretty good reason to avoid it, but I do want to see if there's more to it than that. So, why is trailing whitespace such a big deal?


As a beginning programmer, should I favor building my own libraries over using 3rd-party libraries?

As a beginning Python programmer, is it a good idea to build and understand my own libraries before jumping to advanced 3rd-party libraries that contains the functionality I need? Some projects (e.g. web frameworks like Django) are probably too large for this approach. But other projects (e.g. Web Crawlers, graph libraries, HTML parser) seem to be feasible. I worry that early reliance on 3rd-party libraries would stunt my growth. Note: this question and this question seem to focus more an experienced programmers, who are probably more focused on the efficiency of reuse than the learning benefit. My question, I think, is focused on beginners.


Evolution in coding standards, how do you deal with them?

How do you deal with evolution in the coding standards / style guide in a project for the existing code base? Let's say someone on your team discovered a better way of object instantiation in the programming language. It's not that the old way is bad or buggy, it's just that the new way is less verbose and feels much more elegant. And all team members really like it. Would you change all exisiting code? Let's say your codebase is about 500.000+ lines of code. Would you still want to change all existing code? Or would you only let new code adhere to the new standard? Basically lose consistency? How do you deal with an evolution in the coding standards on your project?


Any tips for designing the invoicing/payment system of a SaaS?

The SaaS is for real estate companies, and they can pay a monthly fee that will offer them 1000 publications but they can also consume additional publications or other services that will appear on their bill as extras. On registration the user can choose one of the 5 available plans that the only difference will be the quantity of publications their plan allows them to make. But they can pass that limit if they wish, and additional payment will be required on the next bill. A publication means: Publishing a property during one day, for 1 whole month would be: 30 publications. And 5 properties during one day would be 5 publications. ## So basically the user can:   * Make publications (already paid in the monthly fee, extra payment only if it passes the limit)   * Highlight that publication (extra payment)   * Publish on other websites or printed catalogues (extra payment) ## Doubts:   * How to handle modifications in pricing plans? Let's say quantities change, or you want to offer some free stuff.   * How to handle unpaid invoices? I mean, freeze the service until the payment has been done and then resume it.   * When to make the invoices? The idea is to make one invoice for the monthly fee and a second invoice for the extra services that were consumed.   * What payment methods to use? The choosen now is by bank account, and mobile phone validation with a SMS. If user doesn't pay we call that phone and ask for payment. Any examples on billing online services will be welcome! Thanks!


What are the barriers to adopting best practice? How can they be overcome?

We've all seen (and most of us have written) plenty of poorly written code. Why? What makes us adopt poor practices rather than good ones? The most obvious answer (to me) is "ignorance", but I'm sure that isn't the only reason. What others are there? What can we do to overcome the temptation to write bad code?


Web app outgrowing current framework

I have quite a bit of experience with using Django for websites and so when I started a new project I naturally chose to use Django for it. Everything went well for a time but now the application is really starting to rub up against what Django can comfortably cope with and I fighting all the time to ensure that things work as intended. I've been considering moving the site over to Java EE 7 now that it has been released. It certainly seems to provide the features I require as well as also being less forceful in the way that a project is laid out and maintained. I guess now that I have a good idea of how the application should be structured, development should be much faster. Have you felt the need to change the web framework you are using simply because it doesn't lend itself well to the type of project you are trying to produce?


What to test when building websites using CMS?

My job is mainly building websites using CMS such as Drupal, eZPublish or Magento. Most of the work is templating, CRUD and adhering to the specs with this. Occasionally, there is some business-specific logic, but it's usually 20 lines or so. Most of the logic is a bunch of `if` in the templates. In this context, I find it hard to argue over unit testing. What should I test? Only integration tests? They usually can only be done at a very high level, such as using Selenium IDE. And Selenium is a pain to handle in project-mode products, because the requirements often change in 6 months and then the project is over. There are also other difficulties such as URLs being dynamic. (CMS don't always respect a RESTful architecture, especially for contents.) I am in favor of unit testing. For libraries or framework-based projects, I easily write them and sets up a Jenkins server for them. But for CMS-based projects, I just don't know how and where to get started.


Talking about Front End Web Development frameworks from a designer's perspective

I am a Web Developer working at a company where the fronted framework we have selected is Angular JS. I am now in the position where I am the 'resident expert' whatever that may mean. I have been tasked with teaching/explaining everything that our Designers need to know about Angular JS. Unfortunately my knowledge/understanding of design begins and ends with the color wheel. Therefore I have the following question: What, if anything would a designer need to know about a front end javascript framework in general/Angular JS in particular in order to streamline their productivity? What kind of things are irrelevant? What kind of things are important?


Confusion in definitions of a method and a methodology in the book "OOAD with Applicatons" (Booch et al)

I am reading the book Object-Oriented Analysis and Design written by Grady Booch and others. In the Section : I Concepts in a subsection Bringing Order to Chaos authors suggest to separate between a _Method_ and a _Methodology_ : According to the book: **A method** is a disciplined procedure for generating a set of models that describe various aspects of a software system under development, using some well-defined notation. **A methodology** is a collection of methods applied across the software development lifecycle and unified by process, practices, and some general, philosophical approach. I understood that a _Method_ is used to built system models and a _Methodology_ is a set of such methods that are applied across software development lifecycle. To my knowledge, a software development lifecycle includes but is not limited to analysis, design, implementation and testing phases. How it can be that a _Method_ that is used to built system models is also applied in implementation or testing phase?


Can too much abstraction be bad?

As programmers I feel that our goal is to provide good abstractions on the given domain model and business logic. But where should this abstraction stop? How to make the **trade-off between abstraction** and all it's benefits (flexibility, ease of changing etc.) **and ease of understanding the code** and all it's benefits. I believe I tend to write code overly abstracted and I don't know how good is it; I often tend to write it like it is some kind of a micro-framework, which consists of two parts:   1. Micro-Modules which are hooked up in the micro-framework: these modules are easy to be understood, developed and maintained as single units. This code basically represents the code that actually does the functional stuff, described in requirements.   2. Connecting code; now here I believe stands the problem. This code tends to be complicated because it is sometimes very abstracted and is hard to be understood at the beginning; this arises due to the fact that it is only pure abstraction, the base in reality and business logic being performed in the code presented 1; from this reason this code is not expected to be changed once tested.  Is this a good approach at programming? That it, having changing code very fragmented in many modules and very easy to be understood and non-changing code very complex from the abstraction POV? Should all the code be uniformly complex (that is code 1 more complex and interlinked and code 2 more simple) so that anybody looking through it can understand it in a reasonable amount of time but change is expensive or the solution presented above is good, where "changing code" is very easy to be understood, debugged, changed and "linking code" is kind of difficult. Note: this is not about code readability! Both code at 1 and 2 is readable, but code at 2 comes with more complex abstractions while code 1 comes with simple abstractions.


Is there a difference between casting and converting types in imperative programming languages?

The question came up in a discussion at StackOverflow. Is there a clean distinction between the two concepts **cast** and **convert** (concerning the type of an object), or are these two words describing exactly the same? How about languages other than C++, Python and Java? **EDIT** : What if the types in question are primitive types, like `int` to `float`?


Involuntarily becoming a programmer: how to do it right?

My background is electrical engineering, DSP to be more precise. The company I currently work for does a lot of diverse projects, mostly building analog hardware. Being somewhat closer to computers than everybody else around here I'm often the one writing code for both embedded devices (which I'm perfectly fine with) and Windows or Linux OS. It is the latter that is foreign territory to me. I can code, and I know a few languages (C/C++, Java, some VB.NET), but I only used them for algorithm simulations in signal and image processing, neural networks, and other similar applications. For me programming has been a computational tool more than anything else. However, I get more and more projects where I have to write proper full-fledged software, and I don't really know how to do it, because I never had to do it, and I was never really interested enough. I have myself seen quite a few engineers who got converted into coders to a certain degree because of job demands, and most of them weren't that great at what they did. I'm sure many people have encountered the same. If I were to learn writing proper software with good user interface, good internal architecture and so on, how do I do it? We don't have anyone at work who could tell me what's good practice and what isn't. Given that I can write _code_ in the rawest sense of the word, what else is there to know about writing good software and how I do I get there on my own?


Is it legal to put `FSharp.Core.dll` from FSharp redistributable package?

Is it legal to put `FSharp.Core.dll` from FSharp Redist Package into my application package and redistribute it with my application? I couldn't find any information about this.


Making it work V/S Making it work right

I am somehow a bit good at coding algorithms for small projects, but when it comes to make an attempt for some biggies, I make a total hodge-podge and marshmallows of my project's structure. I have studied a lot of books on software engineering and SDLCs where they say that becoming a developer is what every nook and crook can do, but the actual developer is the one who follows a systematic approach to the problem and solve it the way its meant to be. My code works fine for such jumbled up projects, but it gets too difficult for maintenance and further upgrades. So, **I would like suggestions so as what should be the proper approach to planning the big moves**


Problem : Certificate for multi Clients of WCF

* If My WCF service have big number of clients through the Internet,then whether should all of them share the same Client Certificate(X509)?   * And if their certificates should be unique , what should I do on the WCF to identify all the certificates?   * Last question: Must I import the server-side certificate into TrustedPeople location on every Client ? (Which seems to be troublesome and any way convenient? )


Windows Phone 7 app development - Is it worth it?

I've written a Windows Phone 7 application to display the Ordnance Survey maps that are loved so much in the UK (I am amazed that no-one else has done this yet). However I was about to shell out the £65 to pay for the app hub and get my app to the marketplace when I started investigating how you actually get paid for the apps that people buy. Apparently if you are not a US developer then you have to start sending over forms e.g. W8BEN form? and even after this the IRS takes another 30% (after MS have taken their 30% share). It also mentions VAT so maybe there is more money taken off after this as well??? Has anyone from outside the US actually got all the paperwork sorted so they got paid? Did you get tax taken off as well? What percentage of the sales do you actually end up with? Is it all worth it? I don't expect to make much from the app but I would like to think I could recoup my £65 and have enough to buy a couple of beers as well.


What does backslash "\" escape character really escape?

What does backslash really escape? It's used as escaping character. But I always wonder what's escaping? I know "\n" is a new line character. But what in it is escaping? Why is it called like that?


Is CodeIgniter PHP Framework suitable for large ERP or Business Application?

Is CodeIgniter is recommended for a large web based ERP or Business Application? I want to use CodeIgniter for my future Project and I'm so confused whether to use it or not. Im so worried about in the long term process or lifetime of the application that it may crashed or produce a bug or error. I also worried about the performance of the framework when the data becomes larger and containing millions of records. I searched on the internet the answer but there is no exactly answer that will satisfy me. I think this question is important for the programmers like me who wanted to use PHP Framework for their large business application. I need an advice from you guys in order to decide whether to use it or not. thank you very much!


What to charge for a ready-built piece of software?

Recently I was contacted by someone interested buying a piece of software that I wrote to automate a process. The 'client' knows little about the program, except what it outputs and how easy it is to use. They are now interested in purchasing it, and I need to give a reasonable price. I've never done anything like this before, so as you might be able to guess, I do not know where to start with a price. I spent a good 12 hours+ working on the program itself. The client will probably want some changes also. **My question: How can I work out what to charge for a piece of software that I built in my own time?**


Adoption of Lean methods

Are there any studies on the adoption of agile methods based on Lean principles? Some of the stats I'm looking for:   1. How widely is Lean used?   2. In terms of Agile methods, how does the adoption of Lean compare with other Agile methodologies like Scrum, XP, etc?


Should companies require developers to credit code they didn't write?

In academia, it's considered cheating if a student copies code/work from someone/somewhere else without giving credit, and tries to pass it off as his/her own. Should companies make it a requirement for developers to properly credit all _non-trivial_ code and work that they did not produce themselves? Is it useful to do so, or is it simply overkill? I understand there are various free licenses out there, but if I find stuff I like and actually use, I really feel compelled to give credit via comment in code even if it's not required by the license (or lack thereof one).


Good resource for getting up to speed on windows forms development

I'm a .NET developer comfortable with C# and web application development. I need to improve my knowledge of Winforms. What is a good book or online resource that particularly covers the Winforms life cycle. Which events to use for what? How does OnLoad compare to Form_load etc.


How to recognize a bad client before you start to work for him?

I'm sure that many of you have encountered a bad client. I'm also sure you took some measures to prevent such encounters in the future. What is the most influential characteristic of a client that warns you to walk away?


How do you read this line of code?

Forgive me for my poor English, me and my friend were doing school homework, suddenly he asked me to read this line of code `ptr = &array[1][1][1]` (ptr is a pointer to an integer). He said > ptr is pointing to the address of the second element of the second column of > the second row of an array. I think he will be right if it was an array of char. As far as it's an integer 3D array I have no idea how to read that line of code in plain English. How would you read it?


What would a good work flow for a programming mentor look like?

I have read a junior mentoring topic which answered most of my doubts. However this topic gives general (though very good) advice on mentoring, while I am mainly interested in what a mentor's week looks like. This is my case. I have a junior (1 year of experience) who got a new project and I am mentoring him. While I am sure that he will use google and will not ask me silly questions, I want to make sure he's on the right path and not to create structures which are hard to maintain or slow in execution. Now, should I:   1. Check out the code each day and examine it?     * Pro: detect errors in its root     * Con: time consuming, may overlook something as there is a work day behind me as well.   2. When he needs to implement let's say singleton, do I tell him to find it on google and come back to me with a solution? Or I let him implement it and later review it?     * Pro: he does not wait for me to reply to him.     * Con: he may implement it wrongly and lose precious time.   3. Are there any situations when I can just check the result? Just like I am a QA. Or I must always stick to the code review?   4. At what point should I stop being a mentor? After how many projects or after how much time?   5. Anything else I have missed?