Programming with Dyslexia

I have very severe Dyslexia along with Dysnomia and Dysgraphia. I have known about it since I was a child. My reading and writing skills are pretty crippled, but I have learned to deal with it. However, with today's IDEs, I find it very easy to stay focused and in the zone when I code. But when I write text (like this post) I find it much harder to stay focused. In general, do dyslexics find it easier to read and write code compared to general reading and writing? What types of tricks and tools do dyslexics use to help them master programming better than normal reading and writing?


Android game loop in separate thread

I am about to port a game that was initially written for iOs and I am having some doubts how certain things should be done. I have been looking many of the examples of the game loops for android, and almost everywhere the game loop is designed to run in separate thread and not in main UI thread which seems fine and logical to me. However, my game scene is combination of OpenGL graphics and standard android views (buttons, labels, etc...) and by design, the primary game logic and OpenGL drawing would be done in separate thread and rest of the standard stuff would be done in main UI thread. In many situations, I will need to call functions that should run in game thread from main UI thread and vice versa. As a very basic, simple example, when user performs touch (which is detected in UI thread) the event should propagated and be processed by the game thread. Do you know some good mechanisms or patterns on how to such cross thread interaction? Is there a simpler solution to a game loop, maybe by not running loop in a separate thread?


What are ways I can speed of development time when building applications?

I noticed that overtime with experience that the curve of learning shifts from trying to learn a language or technology (the way it works) to how to develop applications faster and with less code. I am very interested to see how other developers have minimized the time it takes to get applications to market. I know for a fact that by learning just one thing it can save you a ton of time. For example I started learning lambda expressions and code that normally took 3 lines now only takes 1 and is alot faster to type. Another angle is shortcuts and tools in an IDE itself. For instance I can't believe I didn't know how to remove unused using statements from my source code so I used to do it manually until I found out there was a tool in VS for removing them. Are there any resources for learing faster ways of developing applications? Keyboard Shortcuts, tools, programs, references? Is there like a reference where one can learn these things? If not can you please share how you learned some of these tips? **NOTE:** This question is geared towards .NET, C# and the Visual Studio IDE


How does Javascript code become asynchronous when using callbacks?

I've been doing a lot of reading online trying to figure out how to write asynchronous JavaScript code. One of the techniques that has come up a lot in my research is to use callbacks. While I understand the process of how to write and execute a callback function, I'm confused why callbacks seem to automagically make the JavaScript execution asynchronous. So, my question is: how does adding in callback functions to my JavaScript code make said code automagically async?


Factory Method: does the Product have to be a different class than the Creator?

I want to build three sites in PHP. I'm doing this as slowly, thoughtfully and carefully as I can, to learn as much about things like OOP and software architecture as possible. From past experience I already know there will be a time when I will be glad to have logging functionality. I probably want to have different types of logs, by which I mean that in a `.ini` file, I want to be able to specify if logging should go to a text file (perhaps a tab-delimited or CSV file), a database table, or smoke signals. I'd have (let's say) a Logger class, which would define, for example, an AddEntry() method. For each log type, I'd make a subclass that knows how to log to CSV file, write to a database or kindle a fire, respectively. Since I know I will want to have an instance of a subclass, but I won't know which subclass to instantiate until runtime, I figured I'd use the Factory Method pattern. However, When I look at its Wikipedia article I'm noticing that the `Creator` and `ConcreteCreator` have a different type than the `Product`, if I'm reading the UML correctly. My question comes down to this: I want to have the factory method as a static method of the Logger base class itself. If I do that, am I setting myself up for a trap that I'm not seeing yet? Is there a reason why the `Creator` and `ConcreteCreator` should be of a different type than the `Product`?


What's the difference between fault, error and defect?

> **Possible Duplicate:**   >  Difference between defect and bug in testing In computer science technical writing, especially in software engineering, what's the difference between fault, error and defect? I want to quote an answer on Stack OverFlow by Daniel Joseph: > To quote the Software Engineering Body of Knowledge > > Typically, where the word “defect” is used, it refers to a “fault” as > defined below. However, different cultures and standards may use somewhat > different meanings for these terms, which have led to attempts to define > them. Partial definitions taken from standard (IEEE610.12-90) are: > > Error: “A difference…between a computed result and the correct result” > > Fault: “An incorrect step, process, or data definition in a computer > program” > > Failure: “The [incorrect] result of a fault” > > Mistake: “A human action that produces an incorrect result” Based on my understanding of above definition, error is the result of fault, i.e., failure. Could someone explain more clearly?


Difference between bug, defect and flaw

I was reading "Software Security: Building Security In" and in the first chapter I faced with 3 terms: bug, defect and flaw. The author gave a definition for each of them but I couldn't completely understand these. Can someone give me some examples for each term? What is a defect and what is a flaw? I think I know what bug is, a bug is a malfunction of a part of system which produces undesirable result, be it crashing on a wrong input or miscalculating a series of computations. Can someone elaborate more and correct me if I am wrong in this? **UPDATE**   To be more precise in the book I mentioned above, they (the words) are presented in a way to make a distinction, that's why I am asking to know more. In that book there are some examples denoting which sample belongs to what and which category. For example: Buffer overflow is said to be a bug and issues in method overriding (subclassing issues) is being related to flaw category. Again race condition handling issues are considered bugs and Error-handling problems (fails open) are told to be flaws! I want more elaboration on these regards.


Would you tell your manager about intent to apply for a growth opportunity elsewhere

I like the company I am currently with as a .NET Software Developer - high- tech, great atmosphere, great people and great cause. I also have a fair bit of flexibility and resposibility in that I try to keep us up to date with recent technologies and come up with the architecture for our desktop applications, when we have to design something new, a rare occassion. Overall, it is a great place, albiet with mediocre compensation. It has been almost 4 years and things are getting stagnant in terms of growth and challenges. There is currently a good growth prospect with a previous employer that I am entertaining and will have a good chance with sufficient effort. But I have neither asked for a promotion nor thoroughly expressed my career ambitions to my current manager. So there is this feeling I am putting him at a disadvantage. My current manager is a level headed guy which makes me think I can discusss this challenge with him. After all, he could act as a reference for me in the future. Also, I am sure there are good thing to be said about honesty and professionalism and trying to avoid using the other offer to gain internal promotion. I want to grow professionally but cannot affort to jeopardize relationships or burn any bridges. Would you talk to your manager about entertaining a position somewhere else? If I were a manager, I sure would appreciate if one of my employees came up to me to talk about this. If he were one of my key guys, I sure would do what is neccessary to keep him around.


When should I backup files?

At our company we are not using a source control so we do backup manually. My habit is like this: I backup only scripts where I removed code snippets, and those scripts where I only added code snippets I don't backup. Is it reasonable to backup each time when you change something, or there are some conditions for file subversion? And when we backup changed files, should we only backup that file or all the project?


What factors should be evaluated when determining a desktop software price?


random.choice in other languages

Python has a nice function in the standard library `random.choice` which returns a random element from a sequence. But none of the other languages I've developed in have thought to include such a feature. Do other languages provide such a feature? Why not?


PCI Compliance, FDMS and TransArmor

So, I've been tasked to work on an integration project where we will ask customers for credit card information and send it over to our integration partners, who will process the payment/cc info and process the rest of the order. So, one the tasks for become PCI compliant. However, the partner is also looking to get PCI compliant, and they said that as part of that process, they cannot accept cc info over the internet from an external source. But then I was reading about it, and found out there is some way to become a TPA (Third Party Accepter) that can allow the passing of the credit card to the partner. I also heard the word FDMS thrown around at the first meeting - some research led me to believe this stands for First Data Merchant Services. What I found is that First Data is a merchant processor, who actually contacts the issuing banks to check the credit cards and then collect payment. The partner wants to achieve a level of PCI compliance where they do not store credit cards, so they said when they take credit cards they will send it to FDMS using something called TransArmor, where they send the CC info to FDMS and they send back a token - and that is what they use to access the CC info. I did my research on this, and there is a lot of information out there, and I cannot find a clear and concise place where I can read about all of this - so I have a few questions on this whole process:   1. Is there one place where I can read what exactly it takes to become PCI compliant?   2. Are there different levels of PCI compliance?   3. Where exactly does TPA fall into all this?   4. Is there an example of how TransArmor works? Lots of loaded questions, but thanks all!


How to manage your functional documentation?

Our functional / business documentation is spread across Word files on our corporate Intranet. It's difficult to find and update information. There has to be a better way. Any ideas? We had thought a Wiki would work great. Would seem to be an easy way to find information and easy for individual developers and analysts to add bits of documentation quickly and easily. We'd be curious to know if other development (or business analysis) teams use Wiki's with success. The target for this documentation is the internal development team: developers, qa, and to a lesser extent business analysts.


Do I need to Clean/Rebuild a project before Debugging/Publishing it in Visual Studio?

This is probably a stupid question, but do I need to Clean/Rebuild before Debugging or Publishing a Visual Studio project? I see other developers doing it all the time, and at some point I started doing it without even thinking. It seems habit to always go Clean, wait, Rebuild, wait, Publish. I know I didn't always do it.... I think I started to do it after spending a bunch of time debugging an error, only to discover it went away when I Cleaned and Rebuilt the solution. I've had this issue more than once too, so I know it wasn't a one-time thing, but it seems like a huge waste of time to always be cleaning/rebuilding your projects.


Why coffeescript instead of javascript?

I think somehow building a language which compiles to another language feels like a bad idea from the start, instead of learning javascript properly from the start. Look into Douglas Crockfords Good Parts and then are you hooked. And javascript is not hard - writing good code is hard regardless of language! If you write crappy code in javascript, then you propably will write crappy code in coffeescript or lattescript or what the flavor will be of the day. And to say that coffeescript syntax is beautiful passes me. I like my curly braces and C syntax - and would preferably work in a language which is like that (sorry VB!). And more toys and languages and frameworks for doing the same thing all over again feels not like progress to me anymore!


How to handle 'external' dependencies in scrum?

If you've planned a number of user stories for a sprint and one candidate story is dependent on some external provider delivering something to your team. For example an online service provider adding a new API call to their system or enabling your test account on their system or suchlike. You know it's coming 'soon'. Do you go ahead and add the story to the sprint hoping they'll deliver what is required in time for you to complete your story **or** do you wait till the next sprint, when you know it will be ready and you can start immediately even if it means not starting the story as early as you could. If the former how do you handle 'unearned' story points lost because of the dependency? partial credit (eek!) or take it on the chin.


I'm trying to make a case for not putting the structure in the parent BaseModule class I've shown below. I'm more for a Strategy Pattern, and minimizing inheritance in favor of has-a relationships, but I am not really sure of what principle of OOAD this pattern is breaking. What principle of OOAD is this pattern breaking? Potential Pattern:               public interface IStringRenderer     {         string Render();     }          public class BaseModel : IRequestor     {         public abstract void  Init();         public abstract void Load();     }          public class BaseModule<TModel> : IStringRenderer where TModel : BaseModel     {         public TModel Model { get; set; }              public override string Render()         {             return             string.Join(                 "",                 new string[]                 {                     "<header/>",                     "<main-container>",                         "<side-nav>",                             "<side-navigation/>",                         "</side-nav>",                         "<main-content>",                             RenderMainContent(),                         "</main-content>"                 });         }              public abstract string RenderMainContent();     }          public class MyModuleModel : BaseModel     {         public List<int> Ints { get; set; }                      ...     }          public class MyModule : BaseModule<MyModuleModel>     {         public override string RenderMainContent()         {             return             string.Join(",", Model.Ints.Select(s => s.ToString()).ToArray());         }     }      Preferred Pattern (duplicated some code to be clear):               public interface IStringRenderer     {         string Render();     }          public class BaseModel : IRequestor     {         public abstract void Init();         public abstract void Load();     }          public class MyModuleModel : BaseModel     {         public List<int> Ints { get; set; }              ...     }          public class MyModule : IStringRenderer     {         public MyModuleModel Model { get; set; }              public MyModule(MyModuleModel model)         {             this.Model = model;         }              public override string Render()         {             return             string.Join(                 "",                 new string[]                 {                     "<header/>",                     "<main-container>",                         "<side-nav>",                             "<side-navigation/>",                         "</side-nav>",                         "<main-content>",                             RenderMainContent(),                         "</main-content>"                 });         }              public string RenderMainContent()         {             return             string.Join(",", Model.Ints.Select(s => s.ToString()).ToArray());         }     }      There are parts of this pattern that I'm not trying to focus on, but instead I am thinking about where the 'structure', or the 'tags' are living. In the first example they live in the parent, but in the second example they have been pushed into the derived class. Right now, the examples are pretty simple, but something like 'side-nav' could potentially get complicated, and may need to be controlled by the child anyway. I feel the principle here is that I don't feel like the 'tag' structure shouldn't be in the parent class as in the first example. There are other things I've removed in my 'preferred version' -- namely the generics. (Any suggested reading on good/bad for that choice is welcome). Proponents of the first example's embedded structure like the fact that they can wield changes to large amounts of child classes. I feel offering the flexibility to derived classes is the way to go, and if there needs to be a parent that parent only offers functionality and cross-cutting features, but does not bottle up canned structure.


should you always enter a bug in a bug tracking system

> **Possible Duplicate:**   >  Should developers enter bugs into the bug tracking system?   >  Should I log trivial fixes? For a project I'll be doing in school soon I will be working with 6 other people. We will probably be using YouTrack to track our bugs and we can obviously see the value in this system. My question, however, is whether a bug should always be entered in the bug tracking system. In our case, some people will be front-end developers, others will be back-end developers but the complexity of the project will not be of such a high level that back-end developers wouldn't know how to solve a front end bug. By this I don't mean that they will actually solve it but because they (think) they know it's an easy fix, what's stopping them from just letting one of the front-end developers know about the bug by telling him across the table. The main reasons I can come up with are these:   * The bug might at first seem very easy to fix but actually uncover a far larger problem (at this point in time presumably it would be entered, but by the frond-end developer.   * You might take someone of out of the "zone" by just casually mentioning they have a bug somewhere, which might be solved in 10 seconds but then requires them 15 minutes to get back in the zone. On the other hand it does seem silly that you'd have to enter a bug which **could** be fixed in 2 minutes, especially if the part you're working on at the time needs that bug to be fixed. I understand this is probably a bit subjective, but I also feel that other people could give very good reasons for doing it one way or the other which is what I would like to hear.


Should I log trivial fixes?

I'm in a code shop of two. And while I understand that a bug tracker is useful where the number of programmers is greater or equal to one, I'm not so convinced that logging bugs, changes, and fixes is worth the time when they're trivial. When I find a simple bug, I understand it, fix it, and run it through some testing. And THEN I realized I need to go log it. I know in theory that bug logging should be done somewhere between finding the bug and fixing the bug, but if fixing it is faster than logging it, it seems like a drag. In larger code-shops, the boss pays attention to who is doing what and it's nice to know where others are mucking about. I find myself describing things that I've already fixed and then instantly closing them. I have doubts that anyone will ever look at this closed bug again. Is it time to trim the process fat?


regular, average programmer - scared of geeks and their skills

Just like in any other field, 90% of workers do trivial routine things and only less than 10% actually do the most difficult things. Most programmers in the industry are average, and so am I. There are lots of smarties/geeks who have been coding/programming since age 10-12. Obviously they have more experience than me -- I started learning software development/programming at age 20, when I first went to university. I realize that to match their level, I would have to spend all my time for years, just solving problems, making my brains work hard and get used to a developer's mindset. With many other things to do in life, I understand that I will most likely be constantly behind geeks - I can't solve TopCoder/Google CodeJam problems, I'm bad with algorithms etc. I should have studied programming since childhood to match the level of other geeks. In other words, I feel guilty, stupid and most of all envious and scared of geeks! No super brainy geek knows everything about programming but: there are guys who are simply 10x better than me. I feel compelled to study all the time, but I can't and don't want to. I'm sure many developers have had this feeling - when you envy someone much smarter than you. How do you deal with this feeling? I'm really confused, I keep thinking they can steal my job, and I can't even compete with them.


What is a generic term for name/identifier? (as opposed to label)

I need to refer to a number of _things_ that have both an identifier value (used in code and configuration), and a human-readable label. These things include:   * database columns   * dropdown items   * subapplications   * objects stored in a dictionary I want two unambiguous terms. One to refer to the identifier/value/key. One to refer to the label. As you can see, I'm pretty settled on the latter :) For the former, _identifier_ seems best (not everything is strictly a _key_ , and _value_ and _name_ could refer to the label; although, _identifier_ usually refers only to a variable name), but I would prefer to follow an established practice if there is one. Is there an established term for this? (Please provide a source.) If not, are there any examples of a choice from a significant source (Java APIs, MSDN, a big FLOSS project)? _(I wasn't sure if this should be posted here or toEnglish Language & Usage. I thought this was the more appropriate expert audience. Happy to migrate if not.)_


Publish/Subscribe/Request for exchange of big, complex, and confidential data?

I am working on a project where a website needs to exchange complex and confidential (and thus encrypted) data with other systems. The data includes personal information, technical drawings, public documents etc. We would prefer to avoid the Request-Reply pattern to the dependent systems (and there are a LOT of them), as that would create an awful lot of empty traffic. On the other hand, I am not sure that a pure Publisher/Subscriber pattern would be appropriate -- mainly because of the complex and bulky nature of the data to be exchanged. For that reason we have discussed the possibility of a "publish/subscribe/request" solution. The Publish/Subscribe part would be to publish a message to the dependent systems, that something is ready for pickup. The actual content is then picked up by old-school Request-Reply action. How does this sound to you?


Term for an error when code is executed before its ajax response?

What's the term for an error caused by executing a block of code before its relevant ajax response has come back? e.g., a timeline: **13:00:01** execute getDataViaAjax(); **13:00:02** execute doSomethingWithMyAjaxData(); **13:00:03** ajax data comes back, too late since I forgot to make the code wait for it... I have a feeling I may say "doh!" when someone tells me the answer, but I can't for the life of me think what type of error it might be called.


What is the benefit of 64 bit A7 in iPhone

I'm trying to figure out why going to 64 bit processors is such a big deal in an iPhone. I understand that there will be twice as many registers so the processor can work with twice as much data which should increase performance. However I don't see many phones going to more than 4GB of memory any time soon. It seems like overkill and it would negatively impact battery life. Another problem that I see is that most variables now need twice as much memory. This will create problems in a mobile environment with small amounts of memory. I believe that the folks at Apple are intelligent and they probably have great reasons for doing this, I'm just trying to understand them. **EDIT** Don't know much about GPU's but I was told that with 64 bit registers 2 pixels can be loaded into each register and operations can be performed on them individually. Is there a graphical advantage regarding 64 bit?


Should my team use some common well-regarded coding standard as a basis for its own?

The R&D team I'm in has decided to adopt a coding standard. We have only recently formed, and have too little code and common coding time of our own to base our standards/conventions document on what has developed organically in our team, and on good examples from our own code etc. Now, every one of us has some experience from past workplaces - although none of us is at a state of saying "let's adopt this here comprehensive document I have found to be fitting for the kind of work we do here" (*). Plus, some of us (including myself) only have experience from places with no official coding standard, or writing in different languages in a different setting (high- pressure weekly-release production environment as opposed to more research- oriented development work) So, one of the options I've been thinking about is taking a relatively well- known and well-regarded document, snipping off what we don't care about/care for, and making some modifications based on our preferences. Is this a common practice? Do you believe this is a good idea? If so, what would be a reasonable 'baseline' coding standard (don't tell me which is best, I don't want to start a religious conflict here; just point out what would be comprehensive or 'neutral' enough to build upon.) **Notes:**   * We are expecting to work with C, C++, OpenCL, CUDA, Python.   * We are a team of 4 people + manager, expected to grow to about 5-6 within a year or so.   * In our company, teams are almost entirely autonomous and usually don't interact at all (not even by using each other's code - the work is on entirely different projects); so - no company-wide considerations to make.   * Regarding tools, at the moment what we know is that we're going to be using Eclipse, so its code formatter is going to be one tool at least. Ctrl+Shift+F has long been my friend   * When I write Java, I've adopted the practice of adhering as strictly as possible to Bloch's Effective Java. Now, that's not quite a coding standard, but you could call some bricks, cement and mortar for a coding standard. I was thinking of possibly including something like that as part of the 'mix' (minding that we don't do Java).   * I mean coding standards in the wider sense of the word, e.g. adopting suggestions made in the answers to this P.SE question.   * I've found a big list of C++ coding standards documents; maybe I should mine that our baseline.   * (*) That's not quite true, but I don't want to complicate this question with too many specifics.


How to do ab testing

Many books on startups/kanban strongly advocate the use of AB testing to validate product features. I haven't had any experience with this but it sounds like a great idea for some projects. My question is, how does one go about AB feature testing in practice? Say you want to test how registered users interact with a specific feature. Do you create tables to set what batches of users see what features? What about non-registered users. ect. Say it's determined the feature isn't needed based on your tests. Do you go back into the code base and cut that code out?


In scrum, how do you use "usability testing" in team?

I am currently reading some material by Jeff Patton regarding Agile and UX. http://www.agileproductdesign.com/presentations/index.html I was interested to find out from the community what UX design and testing behaviors seemed MOST helpful to their scrum teams to create GREAT and delightful products.   1. hallway usability?   2. paper prototypes?   3. seeing how users actually use the software?   4. others? Thanks!


Newbie ASP.NET developer being forced into MVC4 with WebForms

I recently got hired on as a new ASP.NET developer (C# code behind). When I arrived, I was told that they were moving to MVC 4, and so I bought two books on that. However, the other day I learned that they are NOT using Razor, but using WebForms. Most of the results via Google returned articles from before the WebForms view engine was apparently selectable as an option instead of Razor, but my question is this:   * Is it possible to learn MVC through WebForms, and not Razor? By possible, I mean is it "worth the time", or should I stick with Razor (as covered in both of my books) and slowly adapt that knowledge to WebForms?   * Are there any drastic changes that need to be understood when learning MVC from the WebForms perspective? Thank you for your time.


What were the historical conditions that led to object oriented programming becoming a major programming paradigm?

What were some of the economic (and other historical) factors that led to object oriented programming languages becoming influential? I know that _Simula_ started things off, but was the adoption of OOP languages due to the ever increasing needs of business? Or, was the adoption due more to the new things that could be done with OOP languages? **Edit** I'm really most interested in whether there was some factors going on external to the languages themselves that allowed for them to take hold.


A Class named Class?

This is more of a style question, but it is something I am currently pondering for a project of mine. Assume that you're creating an application which is modeling a school. So there are entities like Student, School, etc. Now this is all fine and intuitive until you get down to Class, as (in most languages) `Class` is a reserved word. So, given that `Class` is a reserved keyword, what would you call such an entity that models a school class?


Need interpretation of section in C# specification

I am reading the C# specification. I could use clarification on a segment: > C# has a unified type system. All C# types, including primitive types such > as int and double, inherit from a single root object type. Thus, all types > share a set of common operations, and values of any type can be stored, > transported, and operated upon in a consistent manner. Furthermore, C# > supports both user-defined reference types and value types, allowing dynamic > allocation of objects as well as in-line storage of lightweight structures. What does “in-line storage of lightweight structures” mean in this context?


What constitutes a good Database System(Java / SQL related)

I've given this so much research but still couldn't come to my own conclusion, before continuing this question I would like to give you a rough idea of my current situation. I'm 18 years old and have recently been selected and offered by my school to design and develop a database system for my Psychology department. The system itself is very easy, especially on paper, but after reading so much I'm not sure how to tackle this situation. I've never built a whole system before, I've worked with multiple APIs, game clients, personal programs and small mini projects but never have I done it for someone else. I kindly as for your help to answer my question. I have been coding for a while and Java is my strongest point, I still have alot to learn in regards to other C-Style languages, my school trusts me and I'd feel ashamed to let them down. What constitutes a good Database system? * * * When building a database system what are the first key factors that one ought to consider? I presume it's directly related to the actual skeleton of the system and the layout. That's relatively easy to do or better, not as complicated as the rest to do. This would include a normalized database which is secure and easy to use. This is where my question comes in with Java and SQL joined together. I can obviously(And already have) written a database system entirely in Java, literally no SQL in it, wrote the queries myself and did it all with Java however I don't think that's very satisfactory for most people (I'm not sure why, if someone could clarify would be great). I've read into JDBC and I still have to go a bit more into it as self-teaching it does get a tad tricky every now and then. I however searched more into it and have seen various Java Database Engines, such as: > HypersonicSQL - http://java-source.net/open-source/database-engines \- Open > source Database Engine How good would it be to work with such engines, is there any security risks run with it or should I just scrap off the idea? I know a lot of you here on StackOverflow are VERY knowledgeable in this field and know alot of you have built your own database systems (offline) so I kindly ask to pass on some knowledge that could prove valuable.


How to manage styles on a group of websites

Up until now the styles were handled by a single CSS file (for each site). I'm customizing it like this:   * opened the site in Firefox   * opened inspector/style editor   * changed CSS values around until I was happy with how the site looks   * copied the generated CSS code and pasted it in the .css file from the server The design is quite outdated, so I decide to upgrade the application that powers the sites and the designs. But now, my developer tells me I'm doing it wrong. He wants to use "less", "compile and cache to css", create themes and allow me to change only basic stuff like colors and fonts through an administration interface. He says that if I want to customize deeper things I would have to learn CSS and edit the "less" files inside a code editor, not Firefox. Is he crazy or what? I don't understand how is this better than what I'm currently doing?


ISC license advice

Is the ISC license suitable as a MIT or Simplified BSD license replacement? What are the pros and cons of ISC compared to MIT or BSD?


DVCS blessed repo replication among geographically distributed teams

My company is exploring the move from Perforce to a DVCS and we currently use lots of Perforce proxies because the **software development teams are spread over Germany, China, USA and Mexico** and sometimes bandwidth from one place to another is not that great. Speaking with IT, we started looking for a way to keep things running smooth from the geographically distributed perspective so that everyone gets the latest and greatest without determining what repo server is the source of truth (i.e. **replicating transparently** ). I thought that **maybe we could emulate the DNS mechanism through pre-push and pre-pull hooks**. For example, consider countries A, B, and C. Upon pulling from blessed A, A itself will pull for changes from B, which in turn will pull for changes in C. If B and C have new changes they will fall towards A. Conversely, when there is a push, it could be propagated to all blessed repositories. I'm aware that **generally you only have one blessed repo, however this may not scale globally** and each blessed repository would just be applicable to the teams from a single country. **My question is** : is the conception of DVCS repo replication something used in practice?, has anyone done it succesfully?, if so, what is the correct way to do it?


Generate a productive environment when developers have different opinions

My question is simple. I'm a developer and work with another developer who's been here for many more years than I have. He has his opinion about implementing stuff; he's more of a do it yourself kind of person. I'm more of a let's not re-invent the wheel kind of person. Recently for example we had a big discussion about how I think we should move to the cloud and how he thinks that we should keep an in-house solution for our servers (to host our websites). Or how I think Java is better suited for what we need, but he likes PHP so that's what we have to use. These are all arguments that people have on the web... some like the cloud, some don't... some like Java, some don't. And I'm totally ok with diverse opinion... however it's come to the point of being unproductive, and without a boss that knows about programming (our boss doesn't know anything about coding, he just manages us) that takes the position of making a decision, it's always a winner towards his opinion, because he's the more experienced developer... which I don't think is productive. Did you ever confront such a team issue? What do you think I should do? What is the best way to create a productive environment?


Is it reasonable to use POCO's that inherit from DTO's?

I'm designing a tiered .NET application, and I want to use the Code First approach. I'm new to this, so I'm struggling to envision how it ought to be designed. Would the following be a reasonable approach? What problems or limitations might I run into?   * Write DTO classes for my domain. These will be used for data transfer between the server and client over WCF.   * Write a set of POCO classes that inherits from the DTO classes. Use these to generate the database on the server.   * Write another set of POCO classes that inherits from the DTO classes. Use these to generate an SDF database on the client.


Transition from engineering to programming

I got a degree in Chemical Engineering but held a part time job as a PHP programmer the whole time. This has developed into a full-time job. I was wondering how having a Chem-e degree instead of a CS one will affect me progressing further in this career. Does anyone have experience with this and maybe some hints?


What is the point of having every service class have an interface?

At the company I work at, every service class has a corresponding interface. Is this necessarily? Most of these interfaces are only used by a single class and we are not creating any sort of public API. With modern mocking libraries able to mock concrete classes and IDEs able to extract an interface from a class with two or so clicks, is this just a holdover from earlier times?


Do I need to use an interface when only one class will ever implement it?

Isn't the whole point of an interface to for multiple classes to adhere to a set of rules and implementations?


Everything has an Interface

> **Possible Duplicate:**   >  Do I need to use an interface when only one class will ever implement it? I am taking over a project where every single real class is implementing an Interface. The vast majority of these interfaces are implemented by a single class that share a similar name and the exact same methods (ex: MyCar and MyCarImpl). Almost no 2 classes in the project implement more than the interface that shares its name. I know the general recommendation is to code to an interface rather than an implementation, but isn't this taking it a bit too far? The system might be more flexible in that it is easier to add a new class that behaves very much like an existing class. However, it is significantly harder to parse through the code and method changes now require 2 edits instead of 1. Personally, I normally only create interfaces when there is a need for multiple classes to have the same behavior. I subscribe to YAGNI, so I don't create something unless I see a real need for it. Am I doing it all wrong or is this project going way overboard?


How do I prevent unknowningly duplicating code?

I work on a rather large code base. Hundreds of classes, tons of different files, lots of functionality, takes more than 15 minutes to pull down a fresh copy, etc. A big problem with such a large code base is that it has quite a few utility methods and such that do the same thing, or has code that doesn't use these utility methods when it could. And also the utility methods aren't just all in one class (because it'd be a huge jumbled mess). I'm rather new to the code base, but the team lead who's been working on it for years appears to have the same problem. It leads to a lot of code and work duplication, and as such, when something breaks, it's usually broken in 4 copies of basically the same code How can we curb this pattern? As with most large projects, not all code is documented(though some is) and not all code is... well, clean. But basically, it'd be really nice if we could work on improving the quality in this respect so that in the future we had less code duplication, and things like utility functions were easier to discover. Also, the utility functions are usually either in some static helper class, in some non-static helper class that works on a single object, or is a static method on the class which it mainly "helps" with. I had one experiment in adding utility functions as Extension methods(I didn't need any internals of the class, and it definitely was only required in very specific scenarios). This had the effect of preventing cluttering up the primary class and such, but it's not really anymore discoverable unless you already know about it


How do you structure your shared code so that it is "re-findable" for new developers?

I started working at my current job about 8 months ago, and its been one of the best experiences I've had as a young programmer. It's a small company, and both my co-developers are brilliant guys. One of the practices that they both have been encouraging is lots of code- reuse. Our code base is mainly C#, and we're using a centralized revision control system. The way the repository is currently structured, there is a single folder in which all shared class libraries are placed (along with unit tests for each library), and our revision control system allows for sharing or linking those libraries out to other projects. What I'm trying to understand at this point is how the current structure of the folder can be made more conducive for finding those libraries again. I've talked to the other developers about this, and they agree that it's gotten a little messy. I find that I am sometimes "reinventing the wheel" because I didn't realize that there was an existing piece of code that solved a particular problem. The issue is complicated further by the fact that we're sharing some code between ASP.NET MVC2, WinForms, and Windows CE projects, **and** sharing code between applications built against multiple versions of .NET. How do other people approach this? Is the answer in naming the libraries in a certain way or is it preferable to invest in some code-search software? Is the answer in doc comments? Should we be sharing libraries at all or should we simply branch the class libraries for re-use? Thanks for any and all help!


Who is responsible for software licensing in ITIL?

In a standard ICT Department who is responsible for managing software licenses? I would start by saying that the ICT Manager is accountable for it. But who gets the responsibility, using ITIL as a standard model for an ICT department would the Service Delivery Manager or Development Manager? The Service Delivery Manager needs to keep things running, but when moving forward with new versions of software does the Development Manager get controlling vote in what to purchase? As it's not just about delivering the service it's about improving it.


How to define complex business rules using User Stories?

A quick and dirty definition of User Story:               "As a <role>, I want <goal/desire> so that <benefit>"      In this commonly accepted definition there is little space for defining business rules, constraints or user input. Trivial example just to illustrate: > >     As a <librarian>, I want to <register new books> so that <students >   > > can find their availability online> In this silly example, where would one define the fields needed when registering a book? Should it be written anywhere? Or should the required business rules be passed as word of mouth by the Product Owner?


What do you call a "cell" in database terminology?

With "cell" I mean the value of a particular column in a particular row. I'm not sure if its called just "cell" or this is a spreadsheet thing.


What are the best monitors for programming?

From time to time I have tried some monitors. My main work is coding (work, phd, etc). At work I have an LG Flatron L246WH which I highly recommend. However at home I have an LG W2363V with which I feel pretty uncomfortable when coding. Fonts, subpixels or whatever mess with my minds when using smooth fonts. Currently, what are the best monitors out there, to best fit our needs?


Should I change language to stop becoming stale?

I'm an ASP.Net/C# programmer using SQL Server as a back end. I am the Technical Director of the company, I'm extremely happy in everything I do and consider the languages and system we use to be perfect for what we do. In the back of my mind though I know that over time programmers can become stale. I remember as a wee youngster that all those "old" developers were past it and couldn't keep up with the youngsters. So considering I'm happy in everything I'm doing. What options are there for keeping up with everything and avoiding becoming stale. One particular idea that I use is to let all the new developers use and showcase the things that they think are cool. If anything catches my eye then absolutely it will be something we all use going forward. Thoughts?


Build functionality around the design, or the other way around?

When you build an application, is it better to design the UI first (in Photoshop or whatever), then implement the functionality following the UI you just designed, or do the programming and build the design as you go? Advantages I see using UI as reference:   * the app will end up very UI-friendly :)   * like pdr mentioned, if working for a client, he gets exactly what he imagined Disadvantages:   * the programming will get more complicated, so development time increases any others? :D


What's the difference between working at a software company and a company whose focus is in another field?

Recently, I was approached by a local ad agency with a job opportunity. They are bringing all web/interactive development in-house and adding to their development team. I'm growing sick of my cushy, yet boring corporate job, and am intrigued by the position. Having only worked for software shops where the primary business was making software, I worry that they may not put emphasis on quality software practices, since development is not the focus of their business. Could anyone with experience at both compare/contrast working at a software company with working at a company that just happens to have an in-house software development team or department?


Do programmers at non-software companies need the same things as at software companies?

There is a lot of evidence that things like offices, multiple screens, administration rights of your own computer, and being allowed whatever software you want is great for productivity while developing. However, the studies I've seen tend toward companies that sell _software_. Therefore, keeping the programmers productive is paramount to the company's profitability. However, at companies that produce software simply to support their primary function, programming is merely a support role. Do the same rules apply at a company that only uses the software they produce to support their business, and a lot of a programmer's work is maintainence?


Will working in IT limit your career prospects as a programmer?

I took a job working as an IT guy (SQL programming, helpdesk, etc.) because I had need of a job (to pay back student loans accumulated from school). I'm very happy to have a job, but I eventually want to be a c++ programmer. I'm studying my c++ textbooks in my spare time and starting to do some projects with my newly acquired SQL skills. But the question that keeps rolling around in my head is "will I be a SQL programmer for the rest of my life now?" In your experience, will spending a year or two at my current job be a detriment in getting into C++ programming?


Is it a bad practice to stop providing support for outdated software if updates are free and easy?

Providing support for outdated software is both unexciting and expensive. If people are still using the version which was sold ten years ago, it means that they will find bugs which do not exist in next versions, their software may not work as expected on a new hardware or operating system, etc. The support people must also be trained to use this old version. This is unavoidable in several cases:   * When every next version of the software is paid, you can't force everyone to spend their money every two years to buy the next version. Example: Microsoft has still to support Windows XP, since it is understandable that people don't want to pay hundreds of dollars for Windows Vista, then Seven, then Windows 8.   * When the update is complicated. Example: when you know that installing SP2 of Microsoft SQL Server 2008 may render your server completely unusable, you may want to postpone installing updates and stay with and outdated version which has one strong point: it _works_.   * When legacy systems or security considerations are involved. Example: auto-updating a space shuttle software every week may have some disadvantages. In the same way, you can't update hardware if the legacy software requires the old hardware to run. Now, let's say that the update process is as well done as in Google Chrome. The user doesn't have to bother with the updates; there are no security or legacy reasons to not to update, and the updates are free. In this case, is it a bad practice, for a company, to stop providing any support for the versions outdated for a few months, and ask their customers to update their software first, then contacting the support if the problem persists?


How do you diagram global or shared state?

Say you're building an FSM for something like a game and you've got states like:   * MainMenu   * Options   * SinglePlayer   * MultiPlayer Your state diagram might look something like this: ![enter image description here](http://i.stack.imgur.com/vjxus.png) Now say you have a shared state, `DevConsole`, (shows the console when tilde is pressed and receives KB input etc. I'm sure you've seen it before) such that no matter what state you're in, this state applies. How do you diagram that? _edit_ * An example of how it would function would be like this:               public class StateMachine     {         protected State sharedState;         protected State previousState;         protected State currentState;              public void Update()         {             if(this.hasSharedState)                 this.sharedState.Update();                  if (this.previousState != null && this.previousState.IsExiting)                 this.previousState.Update();             else                 this.currentState.Update();         }              // called by individual states         public void ChangeState<StateType>()         {             // creates a new state adn sets its state machine owner to this machine             this.previousState = this.currentState;             this.previousState.Exit();             this.currentState = StateBuilder.Build<StateType>(this);         }     }


C programming in 2011

Many moons ago I cut C code for a living, primarily while maintaining a POP3 server that supported a wide range of OSs (Linux, *BSD, HPUX, VMS ...). I'm planning to polish the rust off my C skills and learn a bit about language implementation by coding a simple FORTH in C. But I'm wondering how (or whether?) have things changed in the C world since 2000. When I think C, I think ...   1. comp.lang.c   2. ANSI C wherever possible (but C89 as C99 isn't that widely supported)   3. `gcc -Wall -ansi -pedantic` in lieu of static analysis tools   4. Emacs   5. Ctags   6. Autoconf + make (and see point 2 for VMS, HP-UX etc. goodness) Can anyone who's been writing in C for the past eleven years let me know what (if anything ;-) ) has changed over the years? (In other news, holy crap, I've been doing this for more than a decade).


Protobuf design patterns

I am evaluating Google Protocol Buffers for a Java based service (but am expecting language agnostic patterns). I have two questions: The first is a broad general question: > What patterns are we seeing people use? Said patterns being related to class > organization (e.g., messages per .proto file, packaging, and distribution) > and message definition (e.g., repeated fields vs. repeated encapsulated > fields*) etc. There is very little information of this sort on the Google Protobuf Help pages and public blogs while there is a ton of information for established protocols such as XML. I also have specific questions over the following two different patterns:   1. Represent messages in .proto files, package them as a separate jar, and ship it to target consumers of the service --which is basically the default approach I guess.   2. Do the same but also include hand crafted wrappers (not sub-classes!) around each message that implement a contract supporting at least these two methods (T is the wrapper class, V is the message class (using generics but simplified syntax for brevity):              public V toProtobufMessage() {         V.Builder builder = V.newBuilder();         for (Item item : getItemList()) {             builder.addItem(item);         }         return builder.setAmountPayable(getAmountPayable()).                        setShippingAddress(getShippingAddress()).                        build();     }          public static T fromProtobufMessage(V message_) {          return new T(message_.getShippingAddress(),                       message_.getItemList(),                      message_.getAmountPayable());     }      One advantage I see with (2) is that I can hide away the complexities introduced by `V.newBuilder().addField().build()` and add some meaningful methods such as `isOpenForTrade()` or `isAddressInFreeDeliveryZone()` etc. in my wrappers. The second advantage I see with (2) is that my clients deal with immutable objects (something I can enforce in the wrapper class). One disadvantage I see with (2) is that I duplicate code and have to sync up my wrapper classes with .proto files. Does anyone have better techniques or further critiques on any of the two approaches? * * * *By encapsulating a repeated field I mean messages such as this one:               message ItemList {         repeated item = 1;     }          message CustomerInvoice {         required ShippingAddress address = 1;         required ItemList = 2;         required double amountPayable = 3;     }      instead of messages such as this one:               message CustomerInvoice {         required ShippingAddress address = 1;         repeated Item item = 2;         required double amountPayable = 3;     }      I like the latter but am happy to hear arguments against it.


WebSockets current state on security and browser support

I found many things when searching, but nothing that seemed both updated and complete. In last quarter of 2010 I remember reading what were very sad news for me, as WebSockets were disabled in most (if not all? can't remember) modern browsers that supported it by default due to security concerns in the proxy protocol the WSP uses. I wonder what's the current state of the issue and if there's any known plans from the next version of browsers to start enabling WS by default. I know that in Chrome 13b I get it enabled and I don't think I enabled it myself, but the same does not happen in the other browsers I use. Also, what draft is being used in the current versions? I will be giving a presentation on HTML5 for a group of developers next month and this is the topic I think I'm the least updated on. I need to implement current protocol to at least feel certain I know what I'm talking about and have no problem answering questions :) As many technical and specific details as possible will be greatly appreciated.


Marriage of Lisp and LaTeX - has it been done?

I like `LaTeX`, but I find its macro system and logic both complex and weak. languages such as Schem/Lisp/Clojure are very good at macros. I imagine the entire document written in a lisp family language, which, when run, would emit LaTeX code and produce a document. Has this been done before? Any links?


Is using '{}' within format strings considered Pythonic?

I just learned you can write               '{}{}'.format(string_a, string_b)      instead of               '{0}{1}'.format(string_a, string_b)      in Python, i.e. you can omit the numerals for the string format parameters when you want things to slot in one by one in order. Is this considered Pythonic? NOTE: "Pythonic" is a commonly used term among Python programmers to mean idiomatic Python code. Within Python culture, there tends to be clear consensus on style questions, especially for very specific ones like this one, given the language's explicit design philosophy of "There should be one -- and preferably only one -- obvious way to do it." This is quoted from "The Zen of Python," a set of aphorisms which goes a long way towards defining what is "Pythonic" and which is included with every distribution of Python (at any Python interpreter command line, enter `import this` to see it).


Starting a new startup/web application, how to choose a hosting provider?

When creating a new startup related to a web application, how to choose a hosting provider ? Assuming the code of the web application is oriented DDDD (Distributed Domain Driven Development) to handle large deployment scenario, the idea is to avoid too much cost for hosting. Basically, the launch of the web app, with its very users will be able to fit on a "single" box (DB + APP), maybe two for redundancy. Eventually the apps will grows progressively to more and more users (I hope:)). How can I choose wisely the hosting ? Today, I see three options :   * hosting ourself : not actually an option today as it requires a lot of administrative skills and related task   * hosting on virtual/dedicated servers : maybe a good options as virtual dedicated hosting is quite cheap, but I fear this will quickly limit us in term of scalability   * hosting on cloud (amazon or azure) : probably the best option in the long term, but with a higher cost to start (having to adapt a bit the application, cost of instances) Does anybody have feedback/advise about such requirements ? PS: FYI, the web apps will probably be written with ASP.NET MVC as web framework, and Ncqrs+NServiceBus to target the DDDD pattern in a CQRS style Edit: as a backend, MongoDB is today our probable choice, as NoSQL is marrying well with event-sourcing + CQRS (no need for joins, etc.). However, finding VPS with asp.net AND mongodb can be challenging. I may have to use some traditional RDBMS found on all providers (MS SQL SErver or MySQL)


How to create an extendable web application?

How would you implement an extendable web application? What I'm thinking about is a web application similar to Jenkins or Hudson which provides plug-in support. While it's obvious to me how plug-ins can be located and loaded, I don't know how they can be integrated within the overall architecture. I'm especially uncertain about the following points. **How can a plug-in change the view, e.g. add input elements to a form?** My first idea would be that a plug-in can register partials / fragments for a certain form. Example: Newsletter plug-in which registers a typical newsletter checkbox fragment which will be rendered in the user registration view. **How can a plug-in react to incoming requests?** Again, a direct approach would be to provide listeners for certain requests or actions, e.g. POST request to /user. **How could a plug-in persist data?** I'm assuming this is a situation where NoSQL data storage solutions would be superior to relational databases. I would appreciate any comments, ideas and experiences (maybe there is even a design pattern) that you have regarding extendable web applications.


Using assembly to write to a file

I am working with a trading application (reading data from the exchange) which generates a bucket load of data on a per second basis. We have different "log- levels" but even the minimal log-level generates so much data ! This process of log creation is quite I/O intensive. Since I can write assembly using __asm__ , I was wondering if the operation of writing to the files is coded in assembly, will there be a speedup ? The rest of the code is C++. Also, what are the caveats of doing such a thing ?


How should an administrating web application control a WCF service's entities?

We have a WCF Service (self-hosted) which can receive several types of calls from the outside, each call encapsulates a business logic procedure. We need to construct a web application which will act as an administrating app, for all users of the service. So we need to have access to all inner-entities of the service and not just the business calls. How should this be done the most effective way? **EDIT:** I wasn't too specific because I see this as a general issue. our Customers are retailers which have clients of their own, so when I say Customer, it's our client and when I say Client - it's our client's client. **Example:**   * Service X allows registered clients of Customers to commit transactions.   * there are several transaction types.   * the service receives the transactions from several different devices.   * The service is a WCF self hosted service. The Customer, needs to register devices for use, register different configurations for different devices and many other registering and administrating which needs to be done. All of this is done in a website. **The website users are the Customers, the Retailers, not the end clients** So as I see it I have these options   1. Reference the dll which holds all service-related entities - this is ok now because the website and the service are on the same machine, but what if this changes? is this a good approach?   2. Make service calls for all of this registering and administrating, which I'm not even sure how it should be done. So, I need your help in understanding the best way to do this...


Localization in php, best practice or approach?

I am Localizing my php application. I have a dilemma on choosing best method to accomplish the same. Method 1: Currently am storing words to be localized in an array in a php file               <?php          $values = array (                             'welcome' => 'bienvenida'                     );           ?>      I am using a function to extract and return each word according to requirement Method 2: Should I use a txt file that stores string of the same?               <?php     $welcome = 'bienvenida';      ?>      My question is which is a better method, in terms of speed and effort to develop the same and why? Edit: I would like to know which method out of two is faster in responding and why would that be? also, any improvement on the above code would be appreciated!!


Can a single simple language such as Clojure replace Html + JavaScript + CSS + Flash + Java Applets ...?

Please do not dismiss the idea right away. I know that it is hard to compete with a mainstream approach that already works (mostly), so my question is partly "academic". I also am aware that ClojureScript exists and is very cool, but it is a patch on an existing ugly thing, a useful abstraction. Disclaimer: I am a programmer but not a web developer, and this is why I am soliciting other's feedback. Being a developer and using the web every day and reading up on various topic and viewing the html source of a page from time to time I think I have some idea about web development. Anyhow, the problems as I see them:   * The web started out quick and dirty and noob-friendly, but now it takes a great deal of skills to make a good modern interactive web page, and you just have to be good at it in order to be competitive today. This often means that quick and dirty "learn web in 21 days" just does not cut it at all.    * Html started out quick and dirty, as a noob-friendly protocol. It is currently a mess.   * JavaScript language is not without its flaws, but ok.   * CSS appears to be a decent attempt to clean things up. It is worth keeping, at least the idea of it - that you can style the appearance in a separate file.   * Putting it all together - JavaScript + Html + CSS becomes rather dirty. There have been good ideas/tools that mitigate the problem such as: AJAX libraries abstract away the specific flavors of the JavaScript. Powerful libraries such as JQuery, Node.js, etc. allow doing cool things in JavaScript as imperfect as it is. Google Web Kit does a very good job of translating a GUI design into a web page. Web MVC frameworks such as ASP.Net, RoR, Django abstract things away and do a lot of leg work for you, **HOWEVER** , these are all abstractions on top of a crappy base.   * The demand for what the web could do today is ever-increasing; Google's ChromeBook is a manifestation of that. You run a browser full screen and everything that you might want to do - keyboard/mouse interactions, sound, video, games, text, images, power point presentations - everything is happening inside of it. Thanks for the fast browsers and fast computers and "the cloud", but it could be a lot better! From a graphics point of view, a browser is just a rectangular canvas that you can paint anything on. Currently the browser executable weighs many megabytes because it has to know how to parse Html, JavaScript, CSS and display all of it. If you start from scratch and realize that it is pretty much just a canvas to be painted, then I think the browser can be much smaller and simpler. The price to pay is having to write a valid program for everything in a funky syntax such as Lisp or Clojure, even for the simplest of things such as displaying a label. That used to be the cool part of the html - if you wanted just to type the paragraph, you would type it verbatim. This rarely happens anymore. If all you want is to just type the paragraph of text, you still have to think about inline or CSS styling, placement. The following piece of HTML (found on the front page of this site)               programming-languages learning      is not that much easier to craft than some alternative Lispy syntax (and I have not put that much thought into it):               (create-link :target "/questions/tagged/programming-languages" :class "post-tag" :title "show questions tagged 'programming-languages'" :rel "tag" :content (text "programming-languages"))      This might not be a valid Clojure syntax; I sort of made it up. It does not have to try to mimic html - in fact that is the point of starting from scratch. The huge advantage here would be that `(text ...)` and `(create-link ...)` are not part of the core language that a browser would have to understand. The browser would only need to understand a "safe" Clojure (one that cannot wipe your hard drive clean) and be able to draw and play music and listen to keyboard and mouse and similar things, and everything else - drawing text, playing a video, displaying a combo box and interacting with it would be all done in a carefully designed library. Why did I choose Clojure? It is a tiny language that can accomplish a lot, plus the philosophy of building complicated programs out of simple building blocks is very attractive. I do think that being able to support a single powerful language such as Clojure would be enough to accomplish everything that Html and Html5 and CSS and JavaScripts and Silverlight and Flash can accomplish. Somewhat of a tangential discussion - I think the same is true for LaTeX - it could be redone with Clojure as an underlying language, and a source file would be a full-blown program that spits out a PDF or a ps as it executes. I understand that starting from scratch is VERY HARD because a modern browser has lots and lots of useful features. Starting with a clean base can pay off though. What are your thoughts on this crazy idea? I realize that the answers would probably be subjective due to the nature of this question, but I still am curious what you think of this.


What is the easiest and cheapest way to distribute apple iOS enterprise app?

I work as a developer in a company, The company I work with has to deploy the app I made to their client. Number of clients are 3 and each client has around 100 iPads. Now my question is,   * What different ways we can use in order to deploy and distribute app seamlessly?   * How good is AppCentral to distribute applications?


My organization is relatively small; how can I follow ISO9000/1 as a matter of best practice?

I work for a company of <60 people. I understand that larger companies typically are ISO9000/9001 certified, as a matter of quality assurance. I also understand that for a company my size, such certification is not cost- effective. However, one could still make a case that as a matter of QA best- practice, I think it makes sense to try to follow the ISO standards anyway, at least insofar as reasonably practical. Am I correct in all these beliefs? If all the above is correct, are there any "high points" that would be particularly beneficial for a company my size to follow, or any parts of the standards that seem less relevant?


Can someone explain how a GUI works and when I should start using one?

I've been learning C++ for about a month now, and before I go any further, I'd like to clear up this tedious question I keep on having. I know what a GUI is, but I don't really know how it works, and maybe examples of popular ones? Although I know command line programming is the bare fundamentals, I think it'd be fun messing around with a GUI. Although I have around 3 million other questions, I'll save them :D


Is Interactive the term for web application that respond quickly to user?

Just a quick question on Web Application attribute, if responsive (which mainly stems from web design) means website that adapts to different screen size, then the closest term I can find for Web Application which is highly 'responsive' to the user input (click, touch, etc.) is interactive? One might call it 'native-like' experience, or great user experience but I find these still too vague. Well here is what I have at the moment: **Responsive Web Application** refers to web applications which adopt responsive design, i.e. changes it layout on different screen sizes to increase user experience (supposedly). **Interactive Web Application** refers to web application which has a lot interactivity to it, i.e. elements that can receive user inputs and reacts accordingly. **Native-like Web Application** refers to web application that offers the same speed and performance as native application (either desktop software or mobile native apps). I might have missed the right term, would love input on this?


Rejecting time bound programming exercises in interview

I have come across a few hands on programming scenarios at recent job interviews.   1. Implement a queue in C# only using arrays. Call to get an item will take first item out from the queue(write on paper in 15 minutes) Approach: Implemented on time.Take items from index 0 with remaining items pushed up.Put items at lastindex.   2. Implement a program to create a folder tree which has an options for adding nodes to it and display tree to console.console. Shouldn't use any inbuilt collections/library(code on computer in 45 minutes). Approach:Implemented on time with tree implemented with List and traversal is done through recursion. In both scenarios, my solutions were not up-to the mark and I was rejected. I understand the flaws in the solution as I would have done it differently if given ample time. The first solution should not shuffle the array, and the second should not do recursion(subjective). But I am not sure if that was fair to me. It was both pressure situations because it is time bound, and the problems were like "new" to me (not really, but I haven't come across such problems at work in the past 10 years, we always use inbuilt collections). In agile development, we estimate our work with lot of focus on quality and all, I am not sure what exactly the point of time bound tests. I would have given a problem with no time limit to the candidate. Would like to know the community's opinion. How to tackle this at the next instance. What about denying to do any time bound tests in interviews offering to do it if it is not time bound?


I'm making a report generator, how should I run it?

So I've started a project to generate reports for our system. These are reports that we deliver to our end customers and they are so specialized that no existing system can generate them. This is not the problem however, the generator is working just fine. For simpleness I've based it on an ASP.NET-solution that generates HTML that I squeeze through phantomjs to generate PDFs of the result. This also works fine. However, this is a one-shot operation. Right now I have a .BAT-file that runs phantomjs with a specific url, and this generates my PDF. However, I need to make some kind of queue-system, so the generation of reports is automatic when they are ordered. The ordering-system is part of a legacy-system that is scheduled to be renewed, but "Not Right Now"(TM). So right now the orders are put in an SQL- table, with a "status"-column saying if it's generated or not. What I'm looking for are ideas for a system to run these reports, and maybe in the future even easily switch for a "real" queue based system (RabbitMQ or such). I'm not locked to any language/framework as long as it's stable on windows, and can communicate with SQL Server. (I know C# and JS best). I was thinking of just making it with C#, but I'm not quite sure about the robustness of shelling out to phantomjs.. (I'm not sure about the robustness of shelling out to anything as a critical business operation ;) )


What source code organization approach helps improve modularity and API/Implementation separation?

Few languages are as restrictive as Java with file naming standards and project structure. In that language, the file name must match the public class declared in the file, and the file must live in a directory structure matching the class package. I have mixed feelings about that approach. While I never have to guess where a file lives, there's still a lot of empty directories and artificial constraints. There's several languages that define everything about a class in one file, at least by convention. C#, Python (I think), Ruby, Erlang, etc. The commonality in most these languages is that they are object oriented, although that statement can probably be rebuffed (there is one non-OO language in the list already). Finally, there's quite a few languages mostly in the C family that have a separate header and implementation file. For C I think this makes sense, because it is one of the few ways to separate the API interface from implementations. With C it seems that feature is used to promote modularity. Yet, with C++ the way header and implementation files are split seems rather forced. You don't get the same clean API separation that you do with C, and you are forced to include some private details in the header you would rather keep only in the implementation. There's quite a few languages that have a concept that overlaps with interfaces like Java, C#, Go, etc. Some languages use what feels like a hack to provide the same concept like C# using pure virtual abstract classes. Still others don't really have an interface concept and rely on "duck" typing--for example Ruby. Ruby has modules, but those are more along the lines of mixing in behaviors to a class than they are for defining how to interact with a class. In OO terms, interfaces are a powerful way to provide separation between an API client and an API implementation. So to hurry up and ask the question, from a personal experience point of view:   * Does separation of header and implementation help you write more modular code, or does it get in the way? (it helps to specify the language you are referring to)   * Does the strict file name to class name scheme of Java help maintainability, or is it unnecessary structure for structure's sake?   * What would you propose to promote good API/Implementation separation and project maintenance, how would you prefer to do it?


.Net Best Practices : Common Bugs Introduced By Refactoring, Carelessness, and Newbies

What are the common bugs introduced by refactoring, carelessness, and newbies? I would like to request the experienced programmers here to share their experience and list the bugs they used to introduce when they were inexperienced. In your response, please write a headline mentioning **the kind of bug in bold text** , followed by few linebreaks, and then an explanation, cause of the bug, and finally the fix.


Literate programming, good/bad design methodology

I have recently found the concept of literate programming. And I found it rather intriguing. Yet I have not been encountered with claims that it is a bad way to structure a program. It seems not covered many places. Not even here could I find any questions regarding this. My question is **not** about its flaws or ways of handling documentation. I consider the documentation a side-effect of what it would mean for the flow of literate programming. I know that the design was originally intended for easy documentation as well as the concept of _forward_ programming flow. The concept of dividing the problem into small sentence based problems seems to be really a brilliant idea. It will thus ease the understanding of the program's flow. A consequence of the literate design method is also that the number of functions required will be limited to the imagination of the programmer. Instead of defining a function for a certain task, it could be created as a `scrap` in the literate method. This would yield automatic insertion of the code, instead of a separate function compilation and subsequent requirement of an inter-procedural compilation optimization step to obtain the equivalent speed. In fact Donald E. Knuth first attempt showed an inferior execution time, due to this very fact. I know that compilers can be made to a lot of this, however this is not my concern. So I would like to get feedback of why one should consider this a bad/good design methodology?


Is having public constants "bad"?

Is this:               public MyClass     {         public const string SomeString = "SomeValue";     }      worse than this:               public MyClass     {         public static string SomeString { get{ return "SomeValue";}}     }      Both can be referenced the same way:               if (someString == MyClass.SomeString)          ...      The second however, has the protection of being a property. But really how much better is this than a const? I have learned over and over the perils of having public fields. So when I saw some code using these constants on public fields, I immediately set about refactoring them to properties. But halfway through, I got to wondering what benefit it was to have the static properties over the constants. Any ideas?


Do C library functions generally mimic the Intel assembly language style?

I'm looking at the basic strcpy function. It is               char *strcpy( char *dest, const char *src );      Which reminds me of assembly language: `MOV DEST, SRC`


How do you avoid being the victim of a syntax pedant on StackOverflow?

Either I just have bad luck, I am wrong a lot, or there are an increasing number of pedants trolling on StackOverflow. We know that programmers are pedantic (this question), especially toward non- programmers. But as a programmer, when you are trying to help others by answering questions on StackOverflow, what do you do to avoid being called out in comments, voted down, or engaged in a useless argument because of a minor oversight, or worse, something you purposely didn't address to prevent confusing the asker with too much information? **Example** : I recently had someone argue with me about my choice of escaping in a regular expression: I chose `(?<=\=)` (a look-behind) when apparently `(?<==)` was all that was needed. I felt my answer was more safe (I didn't have a good reference to immediately find out whether the escape was unnecessary or necessary in all regular expression variations) and I thought it was less confusing to someone new to regular expression look-aheads. Should I:   * Be less thorough so that there are less possible points of contention in my answer?   * Burden the asker with more information than they might need at that point in time?   * Just ignore it? _**Note** : I didn't ask this question on meta.SO because I am not talking about the workings of SO, I'm interested in how to improve answers to programming questions in general, for everyone involved--the asker, and other experts who might also be answering or reading my answer._


Why different testing methods are so contradicting topic?

There are a lot of very smart and experienced people, who claim that if you don't write unit tests then your code will be buggy and God will kill all kittens. On other hand, another bunch of smart people will say that unittesting is counterproductive. So if you will write unittest then kittens will be damned too. Also, I heard very good arguments on both sides for and against integration testings, for and against TDD. Also, there are lot of popular open source projects. Some of them use some automated testings and some of them not. So, why different testing methods are so contradicting topic? _Update 1_ I wrote couple of examples of anti-unittesting sentiments in comments. However, just to be clear there are A LOT of very successful open source projects which doesn't have unittests. This implies that not everybody thinks that unittests are useful. _Update 2_ As soon as we start discussing some particular piece of testing (as example mocking, which came up in the comments), we immediately try to distinguish between being a core value or a mean. However, testing by itself isn't a core value. It's just a way to decrease support cost, which in it's turn, just a way to increase profitability. So, as I see it - unittests are something like 4 connections aways from a profit. _Update 3_ It's interesting that amount of people in "balanced" camp is quite small. Most of people have really strong opinion on this topic.


How can I build a C# project (installer) for multiple environments

I would like to propose a solution to our companies problem with building consistent installers for different environments. Our current process is to build an installer for test, perform testing, update app config, build installer for production. Unfortunately this has lead to issues in the past where the installer was not properly updated etc. What can I suggest as a best practice to mitigate this problem?


Should I point out spelling/grammar related mistakes in someone's code?

While reviewing a coworker's code, I came across some spelling mistakes in function names and also grammatical errors like 'doesUserHasPermission()' instead of 'doesUserHavePermission()' in function and variable names. Should I point these out to him? Or am I being too pedantic to notice these ?


Shipping my first class library. Any gotchas I need to be aware of?

I'm a Web Developer about to unlock the "First Class Library Published" achievement in my career and I'm sweating bullets (literally - I was up all night stressing out). I'd love to tap the experience of the community to see if anyone has any suggestions or recommendations for making sure this goes as smoothly as possible. Are there any specifics or gotchas I need to be aware of? Anything special about the build process that can come back to bite me? Here's where I'm at:   * Library is unit tested and has approx 97% code coverage   * API is well documented and xml docs for intellisense support have been created   * I've ensured that public/private class accessors are accurate and correct. The same goes for all getters/setters   * Error handling isn't as graceful as I'd like it to be, but I'm up against a deadline and have accepted that its an "as good as its going to be" for now   * No friendly logging. Debug.Writeline was used extensively...I've learned recently that this is a reflection of my inexperience :( Your advice is greatly appreciated! The library will be used to generate reports. Standard hat -- connects to readonly database, performs calcs, formats and outputs data to response stream. * * * I was tapped as a fringe resource to fill in for one of the programmers that quit, and this task was given to me as a "cut your teeth" project. The class library is going to be released for other programmers in the company to use while they write production code.


Picking Core Language For Large Scale Web Platform

Now I have work with PHP and ASP.NET quite a bit and also played around few other language for web development. I am now at a point where need to start building a backend platform that will have the ability to support a large set of applications and I am trying to figure out which language I want to choose as my core language. When I say core language I mean the language that the majority of the backend code is going to be in. This is not to say that other languages won't be used because my guess is that they will but I want a large majority of the code (90%-98%) to be in 1 language. While I see to benefit of using the language that is best for the job, having 15% in php, 15% in ASP.NET, 5% in perl, 10% in python, 15% in ruby, etc… seems like a very bad idea to me (not to mention integrating everything seamlessly would probably add a bit of overhead). If you were going to be building a large scale web platform that need to support multiple applications from scratch, what would you choose as your core language and why?


Is a request for a code sample after a job offer common?

I was verbally offered a job and the manager insisted that I start the day after the following day from the interview; so two days after the interview. I left the interview unsure of the offer the manager called me later that day and I agreed to take the position. At this point, I was told that I would get an offer letter the following day and would start the day after that. Later that evening I was asked for a code sample. I have yet to receive the offer letter. I've been mostly contracting and usually answer technical questions or show samples at the beginning of the process and find this situation somewhat odd. Is this a common practice?


Database History Table / Tracking Table

Currently I want to structure a tracking/history table like this:   * PrimaryKey - ID   * OtherTableId - fk   * fieldName - name of the field its tracking   * OldValue   * NewValue   * UserName   * CreateDateTime So basically I want to have a table that will track another tables history, store the column name of the changed field with the new and old value. My question is can anyone poke holes in this? Also, what is the easiest way to ensure that only a column name from the tables its tracking is entered into the fieldName column? Currently my options are to have a enum in the service I'm building, or create another status table and make the fieldName an fk. Any better ideas? **Edit** Goal: There are currently only 2 fields that we care to track. One field will be shown on a web page to display history, the other field will only be accessed by one department and they have access to a view of the database which they’d be able to query. They’d be querying just this one field to get information on who changed the field and what to. This is the reason we wanted to set it where a database field defines the table column rather than having an exact copy of the table record history. We only want two fields tracked with the possibilities of adding or removing fields in the future. Thanks!


in Objective-C, value of type double/float can only be NAN, INFINITY, & normal number?

I knew double or float value can be not only normal value(-1.3, 0, 1.0, 2.3) but also NAN and INFINITY in Objective-C.   Is there other special values except for NAN and INFINITY for double/float value in Objective-C?


Being relevant and hireable outside of my domain.

I'm a recent college graduate and have been hired to work for a business software giant. The job by itself is great with amazing perks and a decent pay. Also there is the joy of working in core product development, building something which will be used by millions of people. However a huge problem is that we do most of our development in a proprietary language which is not used in any other product development company outside of here. The only other companies using this language are our partners and customers who would like to implement/customize the software in their business/clients' businesses. Im afraid that working here for a length of time could make me irrelevant as a developer outside the company. While ideally one could say that software development is software development and the language does not matter, the fact is that most companies hire based on past experience, and in this context, my experience would be 0. My apprehensions are supported by the fact that that the attrition rate in this company is much less than the others, so you could find a lot of people who have not changed their job in the past 10-15 years. This is great from the company's perspective and they take a lot of pride in this. However I'm sure that most people do not leave cause they are tied up, since their skills are irrelevant outside of the company. I really love programming and want to remain a programmer in product development rather than being a manager. What should I do to be hireable in a new company if and when I choose to leave my current job? Thanks in advance.


Why do so many namespaces start with com

I've noticed that a lot of companies use "reverse domain name" namespaces and I'm curious where that practice originated and why it continues. Does it merely continue because of rote practice, or is there an outstanding architecture concept I might be missing here? Also note questions such as: http://stackoverflow.com/questions/189209/do-you- really-use-your-reverse-domain-for-package-naming-in-java that sort of answer my question but not 100% (If it makes you feel any better, I'm really curious if I should be using it for my javascript namespacing efforts, but I'm more curious about then when and why, and that should help guide me on the javascript answer, nota bene: "window") Example of this practice extending to folders and files: ![http://imgur.com/jtdXo](http://i.imgur.com/jtdXo.jpg)


Looking for a freeware NoSql key-value database to offload a Java HashMap

I have a Java HashMap with a String key and POJO value in a long-running application, and it's taking up a large chunk of memory (over 500mb, and this number is expected to grow - I'm guesstimating that it will exceed 2GB in two to three months); this is used to memoize the results of an expensive calculation (typically 2-4 seconds, but up to 20 seconds), so I'd like to offload the HashMap to the hard drive rather than replace it with a [Soft/Weak]HashMap with the expectation that external lookup will be less expensive than recalculation; I'd also like to make the map persistent in case the app crashes. My only experience with NoSql databases has been with DynamoDB, but I'd like a freeware database rather than trying to restrict myself to DynamoDB's free tier.   * The app is written in Java, so I'll need a Java API for the database   * The app runs on a single machine, with no expectation of migrating to a distributed architecture   * I prefer the database be strongly consistent, but eventual consistency is acceptable   * The machine has a traditional (non-SSD) hard drive   * The map's keys are strings (length < 40), and its values are POJOs; if need be I can serialize the POJOs to strings with Jackson before persisting them, though I'd prefer the database handle this   * The POJOs belong to several different subclasses with a common abstract parent class; all of the fields are in the parent class (the subclasses only add/override methods, any fields they add are transient)   * There aren't any security requirements - the data I'd be storing doesn't need to be password-protected or anything   * The values in the database won't expire (I'll take care of stale values in application code - if POJO.someProperty != someOtherProperty then I recalculate the POJO)


Why is Google blocking users from accessing their local file system in Chromium?

The question is based on this issue in Chromium. It is marked as `Won't Fix`. Do you see any reason to block a local html file from accessing another local html file located in the same folder?


Should there be more scientific study of the effectiveness of various hyped-up ideas in software development?

Everyone seems to implicitly assume that the free market of ideas will eventually converge on the "right" solutions in software development. We don't assume that in medicine - we recognise that scientific experiments are needed there - so why should we assume it in software development? I am not arguing for regulation of programmers. It is far too early to even talk about that. Before healthcare could be effectively regulated, there was a need for scientific experiments to establish which treatments worked and which didn't. Software engineering doesn't even have this scientific evidence base to back up touted methodologies such as Scrum or Agile, or programming paradigms like functional programming or MDA. As (a) large software projects are responsible for many government project failures (with the UK government being a really good example) (b) Agile and Lean are being used outside of software development, including in the public sector [of course, Lean originated outside of software development] this is increasingly politically relevant. Government project failures may be influenced by a failure to use a best practice, or even by using something that is considered by some people to be a best practice, but which actually makes things worse, or just costs money without really helping very much. The question is, why is this scientific evidence base (for all intents and purposes) nonexistent? There is a large open source community from which research participants could be drawn. My fear is that the closed-source and in-house software developers would treat with suspicion any research based on this community, fearing (perhaps rightly) that the results would not translate over. And companies that develop closed-source and in-house software would probably not be willing for their developers to participate in any scientific studies. For one thing, it would probably take time away from getting work done; for another, the results could be embarrassing to the company or to senior managers.


How to create a code generation tool for Visual Studio

I'm working on a tool that will generate some C# code, which I hope could prove useable to a wider audience. This tool will read an assembly and a text file containing some data and then generate a bunch of C# classes. The easiest way to do this is of course to simply create a console exe that can be associated with the file type, in the same vein as the code generation tool for XSD files. But I fear that this will be a bit difficult to integrate. I'd much rather have something that feels better integrated. I'll still make the console app anyway, since it's practically a free byproduct and it might be useful for continuous integration. The assembly in question will typically be the **current** assembly that will be generated when the code is compiled, which I suspect normally also will be the assembly where you want the generated files to be hosted. Is there a way of making these kinds of tools? Am I looking into writing a visual studio extension just for this? If the simple exe version is the way to go, is there any way to make it easier on the user by offering installation help along the way, to make it as easy as possible.


Dealing with awful estimates

A recent project I worked on was proven to be severely underestimated by the architect. The estimate was out by at least 500%. Unfortunately I was brought onto the project after the estimate had been signed off with the customer. As senior dev, I quickly realised that the functional and technical spec. contained some huge gaps and uncertanties. As a result I felt compelled to call an emergency meeting with the business and technical directors to let them know the reality. As first and foremost a developer, I found this a very stressful and difficult situation. The "business" accused IT of being incompetent and being the messenger I received a few "bullets". The customer threatened to cancel the account, however to date the project is still unfinished and I am no longer directly involved with it. The architect was a nice guy socially, but based on this episode was either simply incompetent or there were large sales/business pressures influencing his estimate. So, as programmers, what is your experience of this sort of situation and how would you advise dealing with it?