title: Am I deluding myself? Business analyst transition to programmer

text: Current job: Working as the lead business analyst for a Big 4 firm, leading a team of developers and testers working on a large scale re-platforming project (4 onshore dev, 4 offshore devs, several onshore/offshore testers). Also work in a similar capacity on other smaller scale projects. Extent of my role: Gathering/writing out requirements, creating functional specifications, designing the UI (basically mapping out all front-end aspects of the system), working closely with devs to communicate/clarify requirements and come up with solutions when we hit roadblocks, writing test cases (and doing much of the testing), working with senior management and key stakeholders, managing beta testers, creating user guides and leading training sessions, providing key technical support. I also write quite a few macros in Excel using VBA (several of my macros are now used across the entire firm, so there are maybe around 1000 people using them) and use SQL on a daily basis, both on the SQL compact files the program relies on, our SQL Server data and any Access databases I create. The developers feel that I am quite good in this role because I understand a lot about programming, inherent system limitations, structure of the databases, etc so it's easier for me to communicate ideas and come up with suggestions when we face problems. What really interests me is developing software. I do a fair amount of programming in VBA and have been wanting to learn C# for awhile (the dev team uses C# - I review code occasionally for my own sake but have not had any practical experience using it). I'm interested in not just the business process but also the technical side of things, so the traditional BA role doesn't really whet my appetite for the kind of stuff I want to do. Right now I have a few small projects that managers have given me and I'm finding new ways to do them (like building custom Access applications), so there's a bit here and there to keep me interested. My question is this: what I would like to do is create custom Excel or Access applications for small businesses as a freelance business (working as a one- man shop; maybe having an occasional contractor depending on a project's complexity). This would obviously start out as a part-time venture while I have a day job, but eventually become a full-time job. Am I deluding myself to thinking I can go from BA/part-time VBA programmer to making a full-time go of a freelance business (where I would be starting out just writing custom Excel/Access apps in VBA)? Or is this type of thing not usually attempted until someone gains years of full-time programming experience? And is there even a market for these types of applications amongst small businesses (and maybe medium-sized) businesses?


title: In what order are rows fetched absent ORDER BY clause?

text: One programmer is testing and comparing the same application which uses the same database structure, and the same data, only in two separate databases, one with Oracle 8 and one with Oracle 9. The app runs a query with **no** `ORDER BY` clause. **He pretends the ORDER-BY-less query should return the rows in the same order in both databases.** I tell him there's no warranty of the same row order **unless you explicity provide an ORDER BY clase.** The database has the same indexes and keys. But the explain plan shows that in one of the databases the engine is using the key or one of the joined tables whereas in the other database it's using another's. He insinuates that the two DB environtments are not equal, which is so because they have different statistics, different rdbms engines, etc., but not because I failed to replicate every index the original database has. I tell him he must explicity provide an `ORDER BY` clause if the order is really that important. ## The question So I can explain him better: **In what order does a query fetch rows when you don't explicity write an ORDER BY clause, and why doesn't that query return the rows in the same order ?**


title: Debugger for file I/O development?

text: Okay, the question title may be a bit cryptic. But it aptly describes what I'm looking for: I think every experienced coder went through this numerous times: You get a binary file format specification, you implement the reader for it, and… nothing works like expected. So you run your code in the debugger, go execute through the code line by line, every header field is read in seemingly correct, but when it comes to the bulk data, offset and indices no longer match up. What would really help in this situation was a binary file viewer, that shows you the progress of your file pointer, as you step through the code, and ideally would also highlight all memory maps. Then you could see the context of the current I/O operations, most notably those darn "off-by-one" mistakes, which are even more annoying when reading a file. Implementing such a debugger should not be too hard. traces on the process' file descriptors/handles and triggers on the I/O functions, to update the display. Only: I don't know of such a kind of debugger to exist. Do I just lack knowledge about the existance of such a tool, or is there really no such thing?


title: How to verify that all files are intact prior to install?

text: I'm working on my CMS (in PHP platform) for a long time now. The main program is done and I'm currently developing the Installer part. Installation itself will be fairly simple:   1. Upload all files   2. Verify that the "content/" dir has correct permissions   3. Check if ALL files are intact and not modified [This is the subject of this question]   4. Insert the config data and first settings   5. Run install (Generate all DB tables and insert sample data etc.) Now the question-mark is at step 3. How do I verify ALL files? Verification itself should compare all CMS root-directories files against a list from remote location. List should contain filename, filesize and filetype. This way the user can check, that there are no unnecessary or corrupted files, that could indicated a breach in the software. I have seen some software installers do that, but I cannot find any right now and there for I'm clueless on the most optimal method for this. Of course there always is a simple `array` trick, but there surely must be a better and faster method?!


title: Using Dynamic LINQ to get a filter for my Web API

text: We are considering using the Dynamic.CS linq-sample included in the "Samples" directory of visual studio 2008 for our WebAPI project to allow clients to query our data. The interface would be something like this (In addition to the normal GET- methods):               public HttpResponseMessage List(string filter = null);      The plan is to use the dynamic library to parse the "filter"-variable and then execute the query agains the DB. Any thoughts if this is a good idea? Is it a security problem?


title: Why would one prefer C# (ASP.NET MVC) or Java (JSP) instead of PHP for web applications/projects

text: I'm wondering, why would one (consider it not just a single developer, but a company) prefer C# or Java for web applications? What's their considerations regarding the question. I mean, a company, has an assignment to make a web- site for customer, or online game, or web-portal, how does the project management or/and the software architect (and the core team) came to the conclusion - "we will do it in ASP.NET MVC" for example? I know it's specific, but what are the common reasons? Especially, why instead of PHP? As PHP is purely designed for web. Maybe if it is for a single web-site, there are much CMS's where the customer is familiar with, but let's say PHP also has a lot of CMS's, and most of the ASP.NET ones are as spaghetti as wordpress is. Also, as I'm aware, the common webserver is a windows webserver, back in the days I started with computers, everyone was saying the administration in windows is worse than in unix-based platforms. I really don't see the point. For me is just like waste of resources, I think you will need twice better machine running on Windows for the same achievements. C# for desktop - thumbs up, but for web - why? Same for JSP. Its common server is cross platform, so no need of Windows, but still isn't it also waste of resources? And the question is the same as the paragraph - how a company would decide to use JSP. The question was raised, because of lots of the sites rising in ASP.NET nowadays. To be honest, I have seen too few sites in JSP. P.S.: Sorry, I didn't find the relevant tag for this, so I tagged the languages and the involved stuff


title: How to avoid errors and not miss anything

text: I have a problem that is more serious than it might seem. I've been programming for about three years , and I have learned and improved a lot , I read the code easily to others, understand the problems and transform them into code, I easily adapt to new technology and I love to learn how it all works . That's all fine . The problem I have is that I often forget small details , which then turn out to be critical . For instance , yesterday, after changing a database query to retrieve some data filtering by twenty fields , forgot to load all the data ( the query returned only the data of the primary key of the whole object ) . Other times are smaller things that do not make the whole process fails, but still I am afraid to fail at something serious , that my superiors grow weary of my mistakes , etc. . I would like to know how I can schedule the job to not forget anything or at least soon realize that I have forgotten something or have missed something ...


title: Why is Feature Driven Development considered an Agile methodology?

text: In several places Feature Driven Development (FDD) is called an Agile methodogoly - e.g. the Wikipedia entry on FDD. Yet in general, to be considered FDD it seems the following requirements have to be satisfied:   * Coloured UML **has to be used** (but documentation isn't necessary);   * Instead of pair programming the team is divided by software features;   * **refactoring is discouraged** or, at least, isn't a task with explicit scope;   * **unit testing is discretionary** , the team leaders can decide;   * the work flow has to pass through the five FDD phases; On the flip side it seems to me that Agile is   * UML is an **optional** tool   * Tests are documentation   * Tests are **obligatory**   * **refactoring** is a consequence of the change requests of the customer and it **isn't discouraged**. Am I wrong with my understanding of either concept?


title: Practice examples

text: I hold a bachelors in CS, but generaly, i call myself a beginner in programming. With an emphasis in focusing on learning to code and make Android Apps. I have gone through this common (http://developer.android.com/training) tutorial. Read through, and close to the end so as to get a general understanding. Done their example of Hello world. The next i want is a set of codes that i can go through, practice with them so as to build my skill to a harder level. I really want this so bad, and i want to do App development as a carrier. I appreciate any advice given.


title: Converting an empty string to a number

text: If you are designing a function which should conver a string to an integer, how would you convert an empty string? The question is only about this one particular input value (empty string). Between throwing an `ExcStringIsEmpty` exception and converting to `0` options I prefer the first. It seems more logical to me. Because when you perform an opposite conversion from integer `0` you will hardly convert it to an empty sting but to a string `0` instead.


title: What is a good way to share internal helpers?

text: All my projects share the same base library that I have build up over quite some time. It contains utilities and static helper classes to assist them where .NET doesn't exactly offer what I want. Originally all the helpers were written mainly to serve an internal purpose and it has to stay that way, but sometimes they prove very useful to other assemblies. Now making them public in a reliable way is more complicated than most would think, for example all methods that assume nullable types must now contain argument checking while not charging internal utilities with the price of doing so. The price might be negligible, but it is far from right. While refactoring, I have revised this case multiple times and I've come up with the following solutions so far:   1. **Have an internal and public class for each helper**   The internal class contains the actual code while the public class serves as an access point which does argument checking.   Cons:     * The internal class requires a prefix to avoid ambiguity (the best presentation should be reserved for public types)     * It isn't possible to discriminate methods that don't need argument checking     2. **Have one class that contains both internal and public members (as conventionally implemented in .NET framework).**   At first, this might sound like the best possible solution, but it has the same first unpleasant con as solution 1.   Cons:     * Internal methods require a prefix to avoid ambiguity     3. **Have an internal class which is implemented by the public class that overrides any members that require argument checking.**   Cons:     * Is non-static, atleast one instantiation is required. This doesn't really fit into the helper class idea, since it generally consists of independent fragments of code, it should not require instantiation.     * Non-static methods are also slower by a negligible degree, which doesn't really justify this option either.  There is one general and unavoidable consequence, alot of maintenance is necessary because every internal member will require a public counterpart. A note on solution 1: The first consequence can be avoided by putting both classes in different namespaces, for example you can have the real helper in the root namespace and the public helper in a namespace called "Helpers".


title: Programming Challenges for a beginner

text: > **Possible Duplicate:**   >  How can I teach a bright person, with no programming experience, how to > program? I'm in an unusual situation. A colleague of mine wants to "learn programming" and, being a developer I have been tasked with teaching him "programming". Personally, I am self taught, and have never taught any sort of skill to anybody else before so I am not quite sure where to start. Also, I still have a heck of a lot to learn myself (although don't we all)! I write in C# but is C# a good language for a beginner? I was thinking that Visual Basic .Net would be a better starting point, so was considering getting him setup with Visual Studio Express 2010, teaching him a few basics (variables, functions, classes etc) then finding some programming challenges and asking him to work through these. Does anybody have a good source of these sorts of challenges? Also is this a good strategy? Finally, what are your experiences of teaching programming to somebody else and what advice would you give?


title: What is the best way to teach beginners?

text: > **Possible Duplicate:**   >  How can I teach a bright person, with no programming experience, how to > program? I was recently asked by an older friend working on the city council if I would be willing to teach a summer programming course, targeting middle school to high school aged students with either minimal or no prior programming experience. I'm a senior in high school, but I've been programming since a young age, and I've worked locally with my city on various projects requiring programming. The first thing is, I don't want to teach something that can easily be learned anywhere online. If I spent all day over two weeks teaching only basic HTML with bits of CSS, I'd feel like I'm ripping them off (since the class is planned to be $30.00 per person, although I won't receive any of the money). Furthermore, there's actually already a web design class being taught, and I got the impression that I wasn't meant to focus on web development. If it was all up to me (which it's not, I have to create a plan and present it in front of the summer programs board for approval), I would spend the first week teaching Haskell, and the second week using it to solve math problems (like those seen on Project Euler). Unfortunately, I'm probably the only one who would be interested in taking such a class, and I should probably focus more on programming rather than mathematics. I've seen in this thread that Java was not well liked, and I've seen in virtually any other thread that people loved Lisp dialects (especially Scheme, and I suspect this is somewhat related to the love of books like SICP). I have the problem of trying to make the course interesting and engaging, while educational. I don't necessarily need to "sell" programming to them, since they should be somewhat self-motivated applicants, but I also don't want to bore them and "ruin" programming for them. What should I do? What should I teach?


title: How do I know how much to ask for in salary?

text: I'm heading into my first job (i.e. they're bringing me on for a full position) in Software Development and am quite nervous about how the whole salary negotiation thing goes. Glassdoor.com says that my position for my (lack of) experience offers something ridiculously high like 85k. Salary.com says that Software Developers with no experience in my location get about 65k. From some research, I know I shouldn't say a number before they do. But let's say they offer me _Xk_. What should I counter with? Do I say things like "My research shows that people around my experience level for this position at this company earn much more...", etc?


title: Recompiling a java project while it is running

text: I have a Java program that takes about an hour to run. While it is running, if I change the source code and recompile it, will this affect the above run?


title: Where do I start to build this?

text: I'm a real estate professional and part of my job is to scan a database day in and day out searching for properties for a prospective investor buyer to purchase. I am pretty sure a program can be made that will scan this database for me, and alert me when one pops up that I should look at. I make the decision on what they buy based on a few pieces of data. Things like square footage, beds baths etc. Basically what I do is compare a prospective distressed property to properties that match criteria to determine how close they are, and then come up with a likely after repair value based on the other sold nearby houses. I theorize that my program should be able to scan the DB, gather all new properties added. Take each property. determine which other sold properties are most comparable and come up with a likely after ARV. Then compare that ARV to the list price, if it is within a certain range, alert me. So far I've gone and confirmed that I can get a feed for this data. I think it will be in xml but won't know the structure of the data until i apply for a feed license. My problem is I have no idea where to start on this. I've been tinkering around with little website building and very basic html and php for about 10 years but never really became a master of it. Is this too much for a newb to build? should I pay? or suck it up and learn?


title: How can I improve my productivity in Linux?

text: I have been mostly using Windows but I know my way around a Linux system but I am not as productive as in Windows. I am looking for some "survival" guidelines on what should I focus to be able to improve my productivity in Linux (mainly, being more efficient with the command line interface).


title: How many `malloc` calls is too many? If any?

text: I'm implementing a system in C, implemented partially as a library. The library does most of the memory management itself, with the application layer just having to call `*_destroy` functions on the top-level objects. While checking for memory leaks, I noticed that the number of calls to `malloc` seemed quite high, relative to the size of the application code. The performance of the code seems fine, but I've been bitten by "fast enough" code before when trying to scale. The number of allocations roughly matches the number of objects created, including child objects of the top-level ones. So creating a single top-level object might trigger 7 malloc calls, since it needs one for itself and then a couple for it's children that may also need a few children. Unfortunately, I'm relatively new to C programming, though generally experienced as a programmer, and have no idea whether or these numbers are normal or not. So what would a good rule-of-thumb be for number of allocations? I know that less would generally be better, but changing the code to allow it would introduce complexity that I'm not willing to add without a significant increase in performance. Also, should I worry about the performance of `malloc/free` or is that the realm of real-time performance (games etc.)?


title: A good C Variable Length Array example

text: This question got rather a freezing reception at SO, so I decided to delete it there and try here instead. If you think it does not fit here either, please at least leave a comment on suggestion how to find an example I'm after... **Can you give an _example_ , where using C99 VLAs offers a real advantage over something like current standard heap-using C++ RAII mechanisms?** The example I am after should:   1. Achieve an easily measurable (10% maybe) performance advantage over using heap.   2. Not have a good workaround, which would not need the whole array at all.   3. Actually benefit from using dynamic size, instead of fixed maximum size.   4. Be unlikely to cause stack overflow in normal use scenario.   5. Be strong enough to tempt a developer needing the performance to include a C99 source file in a C++ project. * * * Adding some clarification on the context: I mean VLA as meant by C99 and not included in standard C++: `int array[n]` where `n` is a variable. And I am after an example of use case where it trumps the alternatives offered by other standards (C90, C++11):               int array[MAXSIZE]; // C stack array with compile time constant size     int *array = calloc(n, sizeof int); // C heap array with manual free     int *array = new int[n]; // C++ heap array with manual delete     std::unique_ptr<int[]> array(new int[n]); // C++ heap array with RAII     std::vector<int> array(n); // STL container with preallocated size      * * * Some ideas:   * Functions taking varargs, which naturally limits item count to something reasonable, yet is without any useful API-level upper limit.   * Recursive functions, where wasted stack is undesirable   * Many small allocations and releases, where heap overhead would be bad.   * Handling multi-dimensional arrays (like arbitrarily sized matrices), where performance is critical, and small functions are expected to get inlined a lot.   * From comment: concurrent algorithm, where heap allocation has synchronization overhead. Wikipedia has an an example which does not fulfill my criteria, because the practical difference to using heap seems irrelevant at least without context. It is also non-ideal, because without more context, it seems item count could very well cause stack overflow. Note: I'm specifically after an example code, or suggestion of an algorithm which would benefit from this, for me to implement the example myself.


title: Preparing to release code as open-source

text: I have developed a fully functional tool which I would like not only to share with anyone interested but also get support from the community. This tool is cross-platform, written in C++ with Qt, the code is well commented but I still lack any documentation. There are also some small issues and improvements to be made before I can call it a stable, final version. What are the first steps that I have to take to release code as open-source and attracting people interested in contributing? This is my first serious attempt to release open-source code and I really don't know where to start. Should I just push it to Github put together a small wiki and pray for the best?


title: How to deal with pointers from child to parent?

text: I have a class that represents a file in specific binary format on disk (the parent in the title) and another class that represents an object inside that file (child). When the object changes, it sometimes needs to relocate to a new position in the file and the file class has to be notified about this new position. To do this, I have added a `weak_ptr` field to object, which points to the file. Except that means there has to be a `shared_ptr` for file, so I'm using a `static` factory method instead of public constructor for it. And object now can't be initialized in the constructor, so I'm using `unique_ptr` for it. In code, it looks something like this:               class File;          class Object     {     private:         std::weak_ptr<File> file;          public:         Object(std::weak_ptr<File> file)             : file(file)         {}              void modify();     };          class File     {     private:         std::unique_ptr<Object> object;         std::shared_ptr<File> self;              File()         {}          public:         void setObjectPosition(std::uint64_t newPosition);              static std::shared_ptr<File> create();     };          void Object::modify()     {         std::uint64_t newPosition = …;              file.lock()->setObjectPosition(newPosition);     }          void File::setObjectPosition(std::uint64_t objectPosition)     {         // store objectPosition     }          std::shared_ptr<File> File::create()     {         auto file = std::shared_ptr<File>(new File());              file->self = file;         file->object = std::unique_ptr<Object>(new Object(file));              return file;     }      Is this this the right approach to do this? Or is there a better/more idiomatic solution? I feel like I'm using `*_ptr` too much, but I can't think of anything better.


title: How can web development bootcamps deliver on their promise?

text: I came across the concept of web development bootcamps, these 9-10 week intensive crash courses claim to teach beginners web development and help them get 80k starting salary jobs. Many of you might have heard of these. Is what the bootcamps promise feasible? Is it possible for web technologies like Ruby on Rails, HTML5, CSS, and Javascript to be taught from scratch in such a short period? And to people without a technical background?


title: Python -- when should a class have-a rather than be-a?

text: This is related to "Extends is evil" vs. OCP? but separate because the idea of "implement the interface" doesn't exist in Python. I'm writing a class to pull some data off a webpage. It's going to need to hold on to a cookie for authentication, so I'm going to use a `requests.Session` object in some form. I'm never sure how to approach this -- what's the appropriate choice here?               class FooFetcher(requests.Session):         def __init__(self):             super.__init__()      or               class FooFetcher(object):         def __init__(self):             self.session = requests.Session()      ? The former seems to end up with `FooFetcher` having way more public methods than it needs to. The latter looks like it might be unnecessarily convoluted, since pretty much every method of `FooFetcher` is going to involve a call to a method of that `Session` object, plus maybe some parsing of JSON that it finds.


title: Should a repository be passed in to the User Interface

text: In Mark Seeman's Dependency Injection in .NET he injects a repository into his UI layer. I believe that he is doing this so that he can store everything in the UI configuration, however this just strikes me as bad design. Wouldn't it be better to pass the service reference into the UI? What is to stop a future developer from using the repository directly? Also, he says that he is building this as an n-tier architecture. But, he has now coupled the data layer to the UI layer (no matter if DI is used or not). What if he wants to host all three layers on different self-contained servers. While his approach COULD work, it just seems wrong to me. So, I wanted to see what the general community has to say. Am I right in my thoughts, or am I missing something? Simplified version of the code:               public class UI     {       IRepository _repo;       public UI(IRepository repo)        {         _repo = repo;       }            public stuff UIMethod()       {         var svc = new Service(_repo);         return svc.GetStuff();       }     }          public class Service     {       IRepository _repo;       public Service(IRepository repo)       {         _repo = repo;       }            public stuff GetStuff()       {         var persistenceStuff = _repo.GetStuff();         //Do some business logic here         return persistenceStuff.ToServiceStuff();       }     }


title: Differences between TypeScript and Dart

text: Microsoft recently unveiled Typescript, a new JavaScript-like programming language. Some time ago, I heard about Dart, a new programming language created by Google to solve problems related to Javascript like performance, scalability, etc.. The purpose of both new languages seem the same to me.. What do you think? Are the purposes of the languages the same? What are the real differences about them?


title: What is beautiful code in C++, and why do most programmers care that much?

text: As most projects use a C++ API, they deal with constraints of the API and constraints of the project itself. I'm a beginner at programming, I don't like to use OOP at all because nobody clearly managed to explain to me WHY it's is so important to restricting yourself with private scope to prevent others programmers to break data organisation consistency of some kind. I still can be ok with OOP, since it still allows to make some great things like Qt and Ogre3D, but those are only APIs, not applications, and those codes need to be perfect so nobody can criticize the work. I don't understand why do most programmers, since they make apps and not APIs, want to do perfect code like they design some genius piece of code, and waste time on this.


title: Great companies using FPA as cost estimation

text: Anyone know if great enterprises (Google, Oracle, SAP) uses Functional Point Analysis to estimate software building effort?


title: How to write a very basic compiler

text: Advanced compilers like `gcc` compile codes into machine readable files according to the language in which the code has been written (e.g. C, C++, etc). In fact, they interpret the meaning of each codes according to library and functions of the corresponding languages. Correct me if I'm wrong. I wish to better understand compilers by writing a very basic compiler (probably in C) to compile a static file (e.g. Hello World in a text file). I tried some tutorials and books, but all of them are for practical cases. They deal with compiling dynamic codes with meanings connected with the corresponding language. How can I write a basic compiler to convert a static text into a machine readable file? The next step will be introducing variables into the compiler; imagine that we want to write a compiler which compile only some functions of a language. Introducing practical tutorials and resources is highly appreciated :-)


title: What would be the best way to learn about compilers, and executable formats?

text: I want to write my own compiler for my own language. Yes, it's going to be hard, and it will take long, but I think it will be worth it. I have looked into OSDev.org, and read about executable formats there, but they aren't much help. I am looking for information beyond what they have there. So, anything will help. Books, websites, PDFs, anything. I am looking into 32-bit, not 64- or 16-bit.


title: Implementing a first basic interpreter: what should I learn first?

text: I'm about to implement my own very simple programming language, and an interpreter to execute code in that language. The language will be very basic. Example code:               var x = 3     if x > 2 print x     if x < 2 print "hello"      The language wouldn't feature anything more complex than single-line `if` statements. This is because it's the first time I'm attempting something like this, so I'm starting small. The interpreter will be written in Java, and thus execute the code with Java operations. My question is this: I know that the topic of creating compilers and interpreters is very complex. But since I'm new to this, I believe I should start with basic techniques and approaches. **What should I learn before starting to work on this project? Especially what kind of knowledge regarding parsing and interpreting should I learn before starting?** Is it enough to just 'break down the text into substrings, and then more substrings', or should I learn more advanced techniques and apply them? **The knowledge and experience I acquire are meant to allow me to later build more knowledge on top of it when I continue learning and implementing interpreters. But shouldn't be 'too much' for a first attempt.**


title: What is "the refactoring method" for understanding code wrote by someone else?

text: I wrote code, but I myself many times don't even understand the code i wrote. I heard people using "refactoring method" to help them to understand others' code. I just knew a very little about refactoring. That is using the combined key **Alt Shift R** in eClipse, but it will automatically change all the related code & thus does not make any benefit for understand code. So, what is "the refactoring method" (for understanding code wrote by someone else) that people talk about?


title: In Git, is the use of a 'PRODUCTION' branch necessary and/or would it be feasible to have more than one of them?

text: **A short summary of how we do branch managing** : From the MASTER branch one or many feature branches can be made (for mid to long term development), when deploy-able changes have been merged to MASTER then release branches are made. Release branches are kept for maintaining deployed version until the next release occurs and they are merged to PRODUCTION in order to build TAGS which are deployed to Live Environments. **First verse of the question** : Is it actually necessary to have the PRODUCTION branch step? Surely TAGS can reliably be created off a Release Branch at the same point that it would have been merged to the PRODUCTION branch? If they are worth having then the **second verse of the question** : Would it be a suitable source control to have more than one PRODUCTION branch while having just one MASTER? **The motivation** : We will soon have an internal project starting that will (hopefully) be a "white-label" product we can use to replace three separate internal applications we use currently (as well as for any future applications). It would be one back-end, one library, one API but three teams using it and managing their own User Interfaces and adding reusable functionality to the back-end. A thought was the project could be one repo with one MASTER, various feature branches for any of the teams as they need to develop things (mid- to long term). But should we then have a PRODUCTION branch for each of the three 'versions' of the product or just TAG off from the respective Release branches? So that they could deploy independently from each others' sprints and requirements (as long as they do not break the shared infrastructure). PS: Each of the three applications deploy to independent Live environments and used by different departments in the company. PPS: If you know of any other versioning-flows which would be better suited please tell me! [EDIT - After reading jhr's answer] Think of this as one BIG project/application. But instead of having one BIG team working on the sections used by 3 departments (each with their own required UI flows and features etc) we may be split into three teams, each working on a department's features, on the same code base (repo). This is not a technical spec question per-say but rather one for opinion, experience or preference etc.


title: Boss is afraid to use a version control system for new project, should I anyway?

text: See Superior refusing to use subversion My question is similar, but here are the main differences in my scenario:   * We are starting a new project from scratch, using PHP and web tech. There would be no down time in development as we would be adopting it from the beginning, if I have my way.   * My dev team consists of me, and my boss. We are the "IT" Department of a relatively small firm. There is another IT worker who does desktop support but no development.   * My job title is Programmer; my boss's is IT Manager. The upper echelon of management likes my boss. They like me too, but probably not enough to give me the authority to override him. The web app will replace a legacy FoxPro application with absolutely no source control. In fact, due to legal requirements, the decision was made (before I was hired) to fork the app into 7 completely separate programs - not just the files that calculate things which can vary by state - but I mean the entire directory was copied, 7 times, and different states were given to different developers. Things diverged from there. My boss's idea of version control is to copy and paste entire source files from the state he's working in, into all the other states, thus overwriting those files. Small tweaks are recorded in text files manually, and must be copied and pasted by the developer for the target state. This doesn't always work so nicely. I get blamed for changing things and causing it to break when these files are pasted over. My boss's proposal, directly pasted from an email:   * Updates should be submitted as packages in the SUBMISSIONS folder. The package should contain all relevant files as well as an ‘UPDATE.NFO’ file that contains a description of the update, a list of all new files included (with descriptions), and a list of all modified files with modification details.   * Update packages should focus on an individual element and not stray from its intended purpose. Code should be designed to be modular and reusable whenever possible.   * All submitted packages should be installed in each developer’s test environment soon after submission. Each developer is to review the new addition and voice any concerns over its installation to the production environment. A standard package update should be held for a minimum of 3 business days for this review process before being loaded into the production environment. High priority updates/fixes can skip this requirement. (end email) The reason source control was invented is to make all that automatic, right? I suggested subversion, because that's what I used in college. Boss doesn't like subversion because "It makes a mess of the code" and people on the internet told him it was bad. (Where is he looking???) I don't know whether he dislikes only subversion, or all source control products (he hasn't replied to that question yet). I am not asking for a compare/contrast of different systems like svn vs git, I can do that myself. I am looking for a third party who can present a logical argument for the use of SOME form of version control. Please, fellow coders, help me. If something you can say, addressed to my boss, would have an affect on my plight, I beg you to come forth. My boss can be reasoned with if a logical argument is presented. I am putting forth my own effort on the side to convince him, through research and demonstration, but if people from the development community are overwhelmingly on my side, I think he might reconsider. To be fair, I must also ask those opposed to version control to speak up. RSVP. Or am I wrong altogether? Is source control really necessary in my situation? This is our main business-critical software we're talking about, so it will end up huge no doubt. But there's only 2 developers (now). MY ACTUAL QUESTION: If I can't convince him, would there be any point to me using it only for myself? I am speaking as someone with very limited experience actually using svn; all I really know is checkout and commit. What are the features of source control (may include other products than svn) that would aid in my individual development effort? And please no "Get another job" comments. I know, people, believe me I know. Before it even comes up, you may assume that I am insane. Maybe I'm just a sucker for challenge or a plain old masochist. But just consider it not an option.


title: How does an online game continue after the host leaves?

text: **Note:** This is a question about networking, not gaming. I'm using StarCraft merely as an example. The game _StarCraft_ (not StarCraft 2) supports online play. One person hosts, and other people join. If the host leaves during the game, the game can continue indefinitely without the host. How does that work? Consider the following scenario:   * I host a 3 versus 3. Note that, for people to be able to join, my router has to be configured to port forward 6112, TCP and UDP (see Blizzard Support).   * Five people join. Everyone (myself included) is behind a router. I start the game.   * Three minutes into the game, about twenty zealots pour into my base. Nobody helps me.   * My base is eliminated, so I leave (the game doesn't give you a choice).   * The game continues without the host (the home team has two players left). How do the remaining five clients (who didn't need 6112 forwarded) remain connected? If I understand correctly: if two programs want to talk to each other, one of them has to be a "server" and listen for connections on a port, while the other has to be a "client" and initiate a connection request on that port. They can't simply start sending packets to each other (and I don't even know how they would, if both are behind routers). Someone hosting a game is a server, while those joining it are clients. It's easy to see how the clients can start communicating with the server. What I don't get is: how do the clients start communicating with each other without going through the server? Does the Internet Protocol allow a server to initiate connections between clients? It's entirely possible that, in the case of StarCraft, game traffic goes through Battle.net servers. StarCraft does maintain a connection to Battle.net during games (for messages from friends, etc.). However, I doubt game traffic goes through it, because if it did, why would hosts need to port forward 6112? My question is: can a server, with multiple clients connected to it, initiate connections between them?


title: Organisation GitHub account. Secure to use for personal projects?

text: So a large client of mine gave me access to their Organisation GitHub account.   With it came a login for myself (on github.companyname.com) and of course access to certain repos on their company account (by switching the user to the company via the button in the top left). Now I was wondering, since I can create private repos for myself, is it safe for me to use these for non-related projects or can the company administrators access my user's repos despite being private? My understanding of Github is limited as it is, so this extra layer of complexity from the organisation account isn't helping too much. Thanks,   Mike **UPDATE:** Thanks to all of you who posted answers and wrote comments, all were really helpful. I have decided to no host any personal projects on their enterprise account as suggested, and again, as recommended I now host my repos on a private provider like bitbucket. Mike


title: For asp.net mvc is this a three tiered solution?

text: I am a asp.net mvc programmer and if I want to start a project I do this:   1. I make a class library named `Model` for my models.   2. I make a class library named `Infrastructure.Repository` for database processes   3. I make a class library named `Application` for business logic layer   4. And finally I make a MVC project for the UI. But now some things are confusing me. Am I using 3-tier programming? If yes so what is n-tier programming and which one is better? If no so what is 3-tier programming? Some where I see that the tiers namings are DAL and BIZ. Which one is correct according to the naming convention?


title: Is there much difference between X86 Assembly language on Windows and Linux?

text: I'm a complete beginner at Assembly, and my aim is to learn as much as I can to do with Assembly to one day I can reach expert level (I know I'm way off right now, but you never know). My only problem is this: I've got two books which both teach assembly, one on a Linux and the other on Windows. They are Jeff Duntemann's Assembly Language Step By Step (the linux one) and Introduction to 80x86 Assembly Language and Computer Architecture (the windows version). If I want to get the best out of assembly, should I do this on linux and windows? Also, is the syntax the same on Windows and Linux or will I have teach my self again when learning on the other OS( which is my main concern, I want to be able to use assembly on windows and linux).


title: Are companies in certain locations (big city vs small town, etc) more likely to offer telecommute contract programming work?

text: I'm interested in taking on more contract projects for programming and, although it'd be nice to find clients just in my area, I want to expand my search a bit to other areas where a company may allow me to telecommute. I'm wondering if anyone who has experience with this has noticed that whether a company would be more likely to be open to this based on if they are in a bigger city vs a smaller town. I would think that companies in smaller areas may have trouble finding programmers for some things and therefore would be more willing to outsource but maybe I am wrong. Any info is appreciated, I'm just trying to get an idea as to how to concentrate my efforts with networking with people form different areas, etc.


title: Industry has no place for passionate programmers?

text: I've been interning at a place where my manager believes that if you are in a,   * _product company_ , then you generally spend time tweaking the product and sometimes adding some features, or   * _service company_ , then you keep doing repetitive things which makes me feel industry is no place for someone who likes to do create news things and solve difficult problems. So is the industry not a place for a passionate programmer? Does this change from country to country? * * * **Update to clear some things that can be understood differently than what they were meant.** Tweaking here is making sure your product has tables with the number of rows and columns the client wants, etc. Customize it for the customer. New "feature" isn't new functionality here. Just aesthetic-level changes. And it's sometimes. I'm not sure what he meant by repetitive though. He was like, you have to make the UI again and again every time. (I see no repetition there though. If a different UI is needed then a _different_ UI needs to be designed. If you can use the old one then you don't need to do much anyway.)


title: Is it a bad idea to use mutable for pre-allocated temporaries?

text: Let us assume I have the following C++ class:               class MyFastMessageEncoder     {     public:         MyFastMessageEncoder() :             m_fieldEncoder(ENCODING_STYLE_DEFAULT)         {         }              void set_encoding_style(const EncodingStyle encodingStyle)         {             m_fieldEncoder.set_encoding_style(encodingStyle);         }              EncodingStyle get_encoding_style() const         {             return m_fieldEncoder.get_encoding_style();         }              void encode(const UnencodedFieldList &unencodedFieldList, Message &message         {             for (UnencodedFieldList::const_iterator it = unencodedFieldList.begin(), end = unencodedFieldList.end(); it != end; ++it)             {                 m_fieldEncoder.set_raw_data(*it);                 message.add_field(m_fieldEncoder.encode());             }         }          private:         FieldEncoder    m_fieldEncoder;     };      The `MyFastMessageEncoder` class is required to be extremely efficient (encoding will be performed on tens of thousands of messages per second), the time required to instantiate the `FieldEncoder` object is a non-negligible cost, so to solve the issue, I have defined the `FieldEncoder` object as a class member, and initialized it inside the constructor just once. My issue is that `FieldEncoder::SetRawData()` is a non-const method, which means that the `MyFastMessageEncoder::encode` method must also be non-const. _However_ , if I were to make the FieldEncoder object a temporary inside the method, `MyFastMessageEncoder::encode` could be flagged as const. This means that every object that calls `MyFastMessageEncoder::encode` is also non-const, which (to me) just starts ruining the program's const-correctness. Now I understand how the `mutable` keyword works works, and how I could use it to solve this problem, but my question is: **Would doing so be considered bad form, since the internals of the object are technically being modified?** Other considerations:   * Thread-safety is not a concern, this is guaranteed to only run in a single thread (although the `MyFastMessageEncoder` may be created on multiple threads)   * The `set_raw_data` method does not impact the `FieldEncoder` class outside the `MyFastMessageEncoder::encode` method. Any data that is set is cleared or overwritten the next time the `set_raw_data` method is called.


title: How much can I charge for this a little job?

text: I started doing freelancing. I got my first job to create a set of reports. The business team has provided me with the sample reports and also some sample codes. My job is to query the database and generate output as pdf using iText. There are around 25 such reports with different complexities. I am not sure how much to charge them. Can some one please help me in this?


title: How can I transition to a job using the Microsoft stack?

text: I graduated from university with a computer science degree (BSc), having done some C, C++, Java, Python, and Oracle along the way. I did some freelancing while I was at university and carried this into a full time job when I graduated, and I've been working full time for a year now. PHP isn't really what I want to do, and I think it's limiting my opportunities the longer I stay along this path. It's not a language I like to use on a daily basis, and I would like to work in a larger organization, where it doesn't seem PHP has much use. I want to stay in web development, and there seems to be plenty of jobs for the Microsoft stack: C#, SQL Server, and ASP.NET MVC. But beyond a half semester writing common-line C++ in Visual Studio, I have no experience with Microsoft technology. Where do I start to make the transition to landing a job in a Microsoft shop? Are there any specific certifications I should be focusing on, or university courses I should be taking? What are employers or recruiters looking for? What can I do besides creating a pet project in my spare time?


title: How do objects fit into modern C++ (stl, policy-classes, functional) style?

text: I'm a bit confused so the question is a bit confusing. TL;dr: how to mix STL and OOP? From the comment to Best overview to modern C++ paradigms? and http://www.boost.org/community/generic_programming.html there isn't much about objects-oriented programming. (boost guidelines mention object generators). When planing a program, it seems that STL and objects should fit well together. You think of an algorithm and how to do things, then you think of what are the things you want to work with and what properties/characteristics they have. You express those things in terms of tuples and containers and you apply algorithms to them. From my understanding, that's STL style of thinking. Now this is where objects come in. They are things that you do stuff with that contain data, algorithms that change that data and interfaces. But that overlaps with idea of stl where you separate data and algorithms. In OO you combine data and algorithms and in STL you separate it. Although mathematically and generically STL make more sense (when you can apply the algorithm to anything), it is easier to think conceptually in OO style when you have a lot of different objects and algorithms -- you get a better organization. For example, qt-style advocates using minimal and orthogonal interfaces specific to a class as oppose to general algorithms. I said specific because their objects are different and they ask for minimal interfaces meaning objects won't share the same interfaces. So the question is: "can you get away with STL in modern C++ or should you use objects? and if you have to use objects then how?" Other relevant questions at Stack Overflow:   * What is so great about STL?   * C++: Alternative to STL and Boost?


title: Calling blocking functions and execute code when result is ready, but without callbacks

text: I am designing an application that has some scripting capabilities: the host application may call the scripts to perform some operations when some events occur. To keep it easy and newbie-friendly, there is a single thread for everything: this means that if the script calls something blocking, the entire application hangs. So, I either use callbacks or polling to wait for a result of a blocking call to be ready. What is ugly in this approach, is that a function that happens to call a blocking function, has to be split in parts. For polling, I'd have               function do something part 1         blabla         launch something lengthy         schedule do something part 2     end          function do something part 2         if result not ready then schedule do something part 2         use result         blabla     end      Callbacks are only slightly better:               function do something         blabla         launch something lengthy, when done call callback     end          function callback         use result         blabla      end      If one has several blocking calls, and each one depends on the result of the previous, code gets uglier and uglier. What I'm looking for is for some programming language that have some builtin support for this pattern. Something like               function do something         blabla         launch something lengthy         when done:    //fictional keyword         use result         blabla         ....          //more and more blocking calls     end      Of course if there are better solutions I'm glad to listen.


title: How can I say that programming language compiles to other languages?

text: How can I say in english, that programming language can be compiled to other programming languages? The example can be Haxe. On the website the language is decribed as "Multiplatform": > Multiplatform: Haxe can be compiled to all popular programming platforms > with its fast compiler – JavaScript, Flash, NekoVM, PHP, C++, C# and Java > (soon) but multiplatform can be misunderstood as hardware or software platforms (win, mac, linux). So what is the most suitable word describing this ability?


title: XAML code styling

text: > **Possible Duplicate:**   >  What's the recommended control naming convention for XAML markup? Because the old answers now doesn't apply any more as Google Group(s) no longer exists I'm looking for some other resources about this topic. I usually do it like this   * Location (where I place the control)   * Look (how it looks beside its position)   * Behaviour (other bindings like commanding etc.) And this worked fine for me but still I was wondering if there was an actual standard or even recommended guidelines I could follow.


title: Summary of C# naming conventions (official Microsoft conventions)

text: I am struggling with naming convetions in C# I do not know when to use PascalCase or camelCase. I have read Microsoft's naming convention, but I got lost ther http://msdn.microsoft.com/en-us/library/ms229045(v=vs.110).aspx As far as I know this is correct:               public int Number;     private int number;     public void Method();     private void method();     int number;//for any local variable      But in context of that above how should I name components in XAML: `x:Name="Button"` or `x:Name="button"`. They seems to be private field so I should use camelCase, but on the other hand everywhere on the examples I see PascalCase for `x:Name` I do not ask about one's habits, but orthodoxic/official/C# guru style.


title: Program design with multiple data sets, algorithms and results

text: I have a question regarding the design of my software. There are four different data sets and three consecutive algorithms operating on the data sets and on the results from the previous algorithm runs. Let D1 - D4 be the set of data sets, A1 - A3 the set of algorithms and R1 - R3 the set of results from the respective algorithms. A1 uses data sets D1, D2 and D3 and has to run on n different parameters. A2 uses data sets D1 and D3 as well as R1_1 - R1_n. A3 uses data sets D1, D2 and D4 as well as R2.                 D1    D1    D1       D2    D3    D2       D3          D4            |     |     |       v     v     v          n*A1    A2    A3          _     _       |  /| |  /| |       v /   v /   v          R1_1    R2    R3     ...     R1_n      Each of the results R1_1 - R1_n, R2 and R3 should have some output functionality. So my question is how to organize the program and its classes. I guess I would want to create separate classes for each of D1 - D4, A1 - A3 and R1 - R3 and make the data and result objects attributes of the algorithm objects? Are there any reasons for or against creating n objects R1_1 - R1_n instead of one object R1 containing an array of n results? Should the data classes include their own respective 'readFromFile' functions or would it be better to have a global utility class that reads all data from file and generates the data objects? The same goes for output functions, should they be placed in each of the result classes or should they be globally organized? Kind regards!


title: .NET Dependency Management Systems

text: I have some .NET projects that are starting to get large enough to merit looking into Dependency Management solutions, so we don't have to copy binaries from one project to another. Here's what I've found so far:   * NPanday is based on a port of Maven. I can't tell how recently it was worked on, but the last release was in May 2011.   * NuGet seems to be under active development, and it appears to have support directly from Microsoft. Some people complained that it "only addresses dependency resolution," but I don't know what else it should address, or whether it has added more features since that point. It does appear to have recently added the ability to import binaries as part of the build process so we don't have to commit them to our repositories.   * Refix appears to still be in Beta, after having received no attention since Sept 2011. Would somebody with recent experience using any of these dependency management tools (or any others that work well) share your experience? Is NuGet mature enough to use it for dependency management? If not, what does it lack?


title: In MVC, why can't a model create a view?

text: I have a web application written in Perl with a controller, some "views" and some "Models". Each "Model" is corresponding to one "View". The controller (one file) creates an Model object corresponding to each view (view is a CGI argument) then retrieve the view from the module it has just created. Indeed, this should be bad thing but can you argue a bit more about it. My first idea was that since the object "Model" depends upon the "view", then the "model" is actually a view. But also the fact that ALL the cgi parameters are passed to the Model causes the "Model" to become not truelly a view but to loose all interest, since it is only related to the current implementation of the web apps. On other words, that the "Model" keep model but loose its "comprehensiveness" ("Model" is not easily understandable). I'm am quite new in project analysis, so please do not be too harsh. Why is this bad? I have made a prototype with the main structures I have understood of this web application, made as short as possible.               #Model.pm     package Model;     import {         # this requires an attribute called "view"         # and this require an argument which is the cgi params     }     ...          #View1.pm     package View1;     ...          #Model1.pm     package ModelView1 ;     base Model;     use View1;          sub new {         my $class = shift;         my $arg   = shift;         Model::DoSomething($arg);         $self->view = new View1($arg);         ...     }          #controller.cgi     my $model = 0;     ...          $model = new Model1( cgi_param => params() );          #there is severall models here     ...     print $model->get_view()->get_html();


title: Git-based storage and publishing, infrastructure advice

text: I wanted to get some advice on moving a system to "the cloud" ... specifically, I'm looking to move into some of Windows Azure's managed services, as right now I'm managing a VM. Basically, the system operates on some data stored in a github git repository. I'll describe the current architecture: Current system (all hosted on a single server):   * GitHub - configured with a webhook pointing at ...   * ASP.NET MVC application - to accept the webhook from git. It pushes a message onto ...   * Azure service bus Queue - which is drained by ...   * Windows Service - pulls the message from the queue and ...    * Fetches the latest data from the git repository (using GitLib2Sharp) onto the local disk and finally ...   * Operates on the data in git to produce a static HTML website hosted/served by IIS. The system works really well, actually ... but I would like to get out of the business of managing the VM, and move to using some combination of Azure web and worker roles. But because the system relies so heavily on the git repository on the local filesystem, I'm finding it difficult to figure out how to architect in the cloud. I know you can get file system access, so in theory I could just fetch the repository if there's nothing on disk ... but the performance/responsiveness of the system sort of depends on the repository being available and only having to fetch diffs, which is relatively quick. As opposed to periodically having to fetch the entire (somewhat large) git repository if the web or worker role was recycled, or something. So I would love some advice on how you would architect such a system :) Ultimately, the only real requirement is to be able to serve HTML content that's been produced from the contents of a git repository (in a relatively responsive manner, from a publishing perspective) ... please feel free to ask any clarifying questions if there's something I omitted. Thanks!


title: Is node.js a good fit for background processing?

text: I'm slowly learning `node.js` and have a small project I want to start. The project will have a lot of background processes (downloading data from external sites, parsing CSV files, etc.). A big "win" for me and node is the fact it uses JavaScript for both client and server. I code in Java and JavaScript in my day job but am also pretty good at Ruby. But, like I said, it seems attractive to use one language everywhere and JS seems to fit that bill. However, I haven't had much experience in using JS for running background jobs. Ruby seems to excel at this. And I'm not opposed to using it. So what are your thoughts on going 100% JS for this? I realize very large projects require custom solutions. I'm just wondering if it's worth the effort. Or, should I just stick with Ruby on those kind of chores? Opinions appreciated. Thanks


title: Black box or white box testing - which do you do first?

text: On a very small team, where the black box and white box testing is done by the same person, which should the tester do first?


title: How to decide on a price for the project as a freelancer

text: I have seen similar question on this SE site but none comes close to a sure shot answer and many are rather subjective. So i am taking a website as an example to be more objective for you to decide its development price i should quote for the complete work.I would like to have specific figures. In past I have developed many projects for my classmates (Computer science and few .net) when i was in college and there i just arbitrarily quoted the price i will take depending on my mood and customer's ability to pay.. usually ranging from Rs.500 (about $10 USD) to Rs. 1500 (about $30 USD). I have also developed few websites but that was open-source and free. But this time impressed by my work i have got a client that wants to get a website developed similar to this: [ http://www.jeetle.in/ ]. So taking this website as an example tell me how much should i charge for complete work from designing to payment gateway implementation (Excluding the charge the payment gateway provider will take). * * * Few information you might like to consider. I am the only developer on this project if that makes any difference. And i would be using ASP.Net and MSSQL Express for server side processing and jQuery on client. Time period for development offered is about 4 to 6 Weeks. * * * Its like i know my work but not how much I'm worth


title: Naming Rules: Standards, Reserved, and what do they depend on?

text: I want to know the rules of naming (AlwaysCapitalize, _underscore, firstSmallLetter, etc...) for each of Namespaces, Classes, Interfaces, Exceptions, Data Members, Methods, Variables, etc.... also I would like to know:   * Are they standards?   * Do they differ According to the access modifiers? (public, private.....)   * What about compiler and library reserved formats?   * Also are they Language, IDE, or Framework relative? I only know that these rules exist, but don't actually know any. Any help would be appreciated. * * * **EDIT:** OK, if the question is really wide, then I have to narrow my question: What are the naming rules of Classes, Interfaces, Data Members, and Methods in C# (and Java if possible). Also, inspired by Renesis's comment, I've created a wiki to write Coding Conventions, here's the link: http://codingconventions.referata.com/


title: How do you define, organize, and document your data?

text: Please feel free to suggest a better name or way of explaining this question - I wasn't quite sure what to call it. The situation is one that may just come under the heading of "be organized" but I often find myself passing around either big blobs of data or many smaller sub-blobs (blob in the non-technical meaning of the word =o), to be used in various parts of my web apps. For example, building a small task manager that allows someone to create a task that ends up being represented like this:   * With a title, initial date, user, client, etc. (simple attributes).   * Zero or more temporal expressions that represent "schedules" for when the task must be done - periodically, by day of week, by day of month, etc.   * A tree-list of sub-tasks that can be nested to any level. This is all easy enough to represent in the database with a few tables. It's also easy enough to pack into a series of arrays and pass around (for example, passing an array of a task template, subtasks, and schedule data via JSON to a jQuery object that will build a tasklist on the client side. Between creating, updating, displaying, etc., the tasks, tasklists, etc., there are any number of places where I might find myself passing a big collection of data from one place to another (especially working with AJAX with much client-side processing), and it often looks pretty much the same - just a big array that says "here is the data for your task and related 'stuff'". How do you (or would you) keep this organized? For example, below is an array that has been pulled out of a "Task Template" object, and will be passed via JSON to a JS object that will dynamically build and display a list of tasks on the client side. I guess the question is whether and how you define the structure of such an 'object' outside the database, code, etc., and how you document it. For example, while the nested subtasks are pretty explanatory (and duplicate data, available only for convenience), it's not readily apparent that the "SubTasks" array MUST have each subtask appear in the array AFTER (higher index than) it's parent subtask, and BEFORE (ie: with lower index than) any child subtasks, so that they arra can be processed in order with the assurance that each subtask can be appended to it's already existing parent subtask. There are a number of rules like that here, and if a "relatively" similar array is used in 9 different places, documenting in comments/class documentation, etc sort of ends up sucking.                [43] => Array         (             [Meta] => Array                 (                     [SubTaskCount] => 6                     [TemporalExpressionCount] => 3                     [NumInstances] => 0                     [OutOfSync] => 0                 )                  [Fields] => Array                 (                     [UserID] => 1                     [ClientID] => 1                     [StatusID] => 1                     [Title] => Keep Testing                     [Body] => How are you?  Because I am a potato.                     [UserName] => Wheatley                     [ClientName] => Wheatley Laboratories                     [BodyHTML] => Etc.                 )                  [Sched] => Array                 (                     [TemporalExpressions] => Array                         (                             [0] => Array // Every Monday every month                                 (                                     [type] => dw                                     [ExpressionID] => 1                                     [ord] => 0                                     [day] => 1                                     [month] => 0                                 )                                  [1] => Array  // Every Tuesday every month                                 (                                     [type] => dw                                     [ExpressionID] => 2                                     [ord] => 0                                     [day] => 3                                     [month] => 0                                 )                                  [2] => Array  // The last of every month                                 (                                     [type] => dm                                     [ExpressionID] => 3                                     [day] => -1                                     [month] => 0                                 )                              )                          [TaskInstances] => Array                         (                            // This would have data on "complete" status of tasks by date...                         )                          [InitialDate] => 2011-12-02                     [DueTime] => 14:55:00                     [SchedDates] => Array                         (                             [1322812800] => 2011-12-02                             [1323072000] => 2011-12-05                             [1323244800] => 2011-12-07                             [1323417600] => 2011-12-09                             [1323676800] => 2011-12-12                             // ... List of dates between externally defined date range parameters...                         )                      )                  [SubTasks] => Array                 (                     [1355] => Array                         (                             [SubTaskID] => 1355                             [ParentST] =>                              [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                          [1356] => Array                         (                             [SubTaskID] => 1356                             [ParentST] => 1355                             [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                          [1357] => Array                         (                             [SubTaskID] => 1357                             [ParentST] => 1355                             [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                          [1358] => Array                         (                             [SubTaskID] => 1358                             [ParentST] => 1355                             [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                          [1359] => Array                         (                             [SubTaskID] => 1359                             [ParentST] =>                              [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                          [1360] => Array                         (                             [SubTaskID] => 1360                             [ParentST] =>                              [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                      )                  [SubTasksNested] => Array                 (                     [1360] => Array                         (                             [SubTaskID] => 1360                             [ParentST] =>                              [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                          [1359] => Array                         (                             [SubTaskID] => 1359                             [ParentST] =>                              [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                         )                          [1355] => Array                         (                             [SubTaskID] => 1355                             [ParentST] =>                              [RootT] => 43                             [UserID] => 1                             [Title] => New Subtask Title                             [Body] =>                              [DueDiff] => 0                             [UserName] => Eli                             [SubTasks] => Array                                 (                                     [1358] => Array                                         (                                             [SubTaskID] => 1358                                             [ParentST] => 1355                                             [RootT] => 43                                             [UserID] => 1                                             [Title] => New Subtask Title                                             [Body] =>                                              [DueDiff] => 0                                             [UserName] => Eli                                         )                                          [1357] => Array                                         (                                             [SubTaskID] => 1357                                             [ParentST] => 1355                                             [RootT] => 43                                             [UserID] => 1                                             [Title] => New Subtask Title                                             [Body] =>                                              [DueDiff] => 0                                             [UserName] => Eli                                         )                                          [1356] => Array                                         (                                             [SubTaskID] => 1356                                             [ParentST] => 1355                                             [RootT] => 43                                             [UserID] => 1                                             [Title] => New Subtask Title                                             [Body] =>                                              [DueDiff] => 0                                             [UserName] => Eli                                         )                                      )                              )                      )                  [TemplateID] => 43         )


title: Functional Low-Level language that can use a webkit view

text: # TL;DR: I need to develop an app which should look kind of the same on desktop and as a website incarnation. Since I am a web dev and have never developed for desktop, I want to use a language that can embed a webkit view so I can use the same HTML/JS front-end for both usages, and minimize the learning curve for GUI at least. C++ and Java can both use webkit, however, I am looking for alternatives where functions are first-class citizens, because I prefer prototype-based languages by far. # Long Version I am mainly a web developer; I'm at ease with js/as3/php/python. Lately however, I had ideas that need other languages to get done. Namely, I have an idea for a software that is part custom-database and part GUI. So I began tackling desktop oriented languages such as Java and C++. I discovered Java is basically super-easy and C++ kind of ok (though it gets complex when I try to use GTK and the docs are sparse and dispersed). I can use this; one thing bugs me though: As fond as I am of PHP as a project and as a community, I've grown a dislike for imperative languages and find myself much more at home with ECMA-style languages. I was happy in web dev lately with the rise of node.js and how I could begin developing server-side functionality with javascript. # My question I need a language that has the following features:   * Functional. By "functional", I mean a large definition. This includes any language where functions are first-class citizens (where "actions" are more important than "actors").   * Portable: I picked C++/GTK or Java because of easy portability and no license restrictions. So portability here means _os-independent_ (with realistic limits) as well as _open license_.   * Can use a webkit view:(like in GTK,or in Java) or similar; I intend to leverage my knowledge of web apps to build a beautiful, usable, gui in html5. The same interface will be used in the online version of the app. Therefore, I need the language to have a way to embed and interact with HTML5   * Can use JS: ideally, through V8, although rhino or a similar tool is ok. If a _window_ js object could be exposed to the js code (so I can use standard libs such as jQuery), it would be perfect.   * Low-level: I need the database part to be fast. Could code my db in C and my GUI in whatever-language-it-will-be, but ideally, I'd like to use one toolset for both   * Less important, but: if the language could be a derivative of ECMA script, so I can leverage my js skills, it would be cool. **My Current Options**   * Titanium, which has all the above features and uses js as it's primary code; However, I dislike being tied to a particular SDK and I'd rather use independent open-source libs that I can read.   * Your suggestion?


title: Planning relational database - one or two tables?

text: I'm currently planning the database structure of a used car's advertisements site. Each advert contains information about a vehicle, and a vehicle can be advertised multiple times over its lifespan (granted, quite unlikely). I'm unsure which approach to take - a single table, or two separate relational tables, each has their pros and cons. Schema 1               Adverts Table:     -------------------     id            int     make          varchar(255),     model         varchar(255),     year          int,     transmission  varchar(255),     fuel_type     varchar(255),     body_type     varchar(255),     engine_size   int,     colour        varchar(255),     doors         int,     location      varchar(255),     price         int,     owners        int,     mileage       int,     description   longtext      Schema 2               Adverts Table     -------------------     id            int     location      varchar(255),     price         int,     owners        int,     mileage       int,     description   longtext     vehicle_id    int          Vehicles Table     -------------------     id            int     make          varchar(255),     model         varchar(255),     year          int,     transmission  varchar(255),     fuel_type     varchar(255),     body_type     varchar(255),     engine_size   int,     colour        varchar(255),     doors         int      Personally, I'm thinking taking the second approach will benefit in the future, but it's proving tricky to work with. I'm using Laravel, a PHP framework. Because most of the "search" options are applied to the vehicle (parent), rather than the advert (child), a lot more code is required, which is starting to seem counter-intuitive. Schema 1 is far simpler to work. Am I missing any extensive benefits of going with schema 2? In a nutshell, the first approach requires much less code, but isn't relational. The second approach is relational, but it's requiring far more code (and time), reducing the brevity of my adverts controller in particular, which is actually querying the vehicle's attributes more than the advert's. It's also making "sorting" quite tricky, as user's can sort by "make", "model", "location", "price", etc - attributes which jump between model.


title: Duplicating documentation on interface implementations/overrides good or bad?

text: So we have an interface like so               /// <summary>     /// Interface for classes capable of creating foos     /// </summary>     public interface ICreatesFoo     {       /// <summary>       /// Creates foos       /// </summary>       void Create(Foo foo);       /// <summary>       /// Does Bar stuff       /// </summary>       void Bar();     }      Recently, we played a documentation story which involved generating and ensuring that there is plenty of XML documentation like above. This caused a lot of duplication of documentation though. Example implementation:               /// <summary>     /// A Foo Creator which is fast     /// </summary>     public class FastFooCreator : ICreatesFoo     {       /// <summary>       /// Creates foos       /// </summary>       public void Create(Foo foo)       {         //insert code here       }       /// <summary>       /// Does Bar stuff       /// </summary>       public void Bar()       {         //code here       }     }      As you can see the method documentation is a straight rip from the interface. The big question is, is this a bad thing? My gut tells me yes because of duplication, but then again maybe not? Also, we have other similar documentation duplication with `override` functions and `virtual` functions. Is this bad and should be avoided, or not? Is it at all worthwhile even?


title: "Enterprise" version of GPL'd code?

text: I know that there are a number of discussions about the GPL on this site but I just ran in to an interesting case of apparent misuse that I (surprisingly) haven’t seen discussed anywhere. The CFEngine configuration management program is apparently distributed under the GPL (it even appears to be an FSF project) but the original author also distributes an “Enterprise edition” which is blatantly non-free. This appears to be an obvious violation of the GPL. The official response to this question (from the CFEngine FAQ) is: > As copyright holders we are free to license CFEngine under any terms we > choose. The files that belong to both the community edition and enterprise > editions are consequently licensed under both sets of terms. The licensee of > the Enterprise edition is therefore free to choose the terms that are deemed > most desirable. Which, as I understand the issue, is just not true. As copyright holders they are of course free to **change** the license (for future releases), but distributing code with **both** licenses is contradictory at best and illegal at worst. Am I missing something here or does this seem wildly hypocritical?


title: Where can I read the original C# introduction paper by Microsoft?

text: When Microsoft presented .NET Framework and C# language in 2002, what was the first article to introduce C#? I'm looking for some paper published on MSDN or Microsoft website that would explain the need for another language, talk some background and maybe have some code samples. Also, I'm interested in the original C# introduction, not in a generic .NET Framework document. I remember that early .NET papers were rather foggy and while it is a fair share of fun to re-read them, I aim for a language-centric document.


title: In agile development, should I try persistence in flat file before database?

text: Somebody explained to me that since in agile development, policy and the application logic should be more important than details such as persistence method, persistence decision should be taken at the end. So it might be a good idea to start with simpler persistence such as flat files, until we reach the point the weakness of this method become apparent, and only then we change the persistence, e.g. by using relational database. Is this true, or did I misunderstood the concept? Is this how agile team usually build application? What are the rationales for it and when I should not take this approach?


title: Hardware key removal on a test system

text: One of my company's applications still requires a hardware key to run, but we're currently in the process of removing that requirement and replacing it with an online check. The issue we are having is that we allow our customers to set up test systems with copies of their live databases. With the hardware keys, that isn't a problem as they get a special key that tells the software it is a test, but we're trying to figure a way to do this with a software only check. Our only idea so far is to check the hardware against a registered list in the database, but before we implement this, I want to ask how others have solved similar problems?


title: Where do the responsibilities of build tools end and those of CI tools start?

text: In the delivery of software, and within the sense of the deployment pipeline, where do the responsibilities of build tools, like Maven, end, and the responsibilities of CI start? As a rough _example_ of a problem that arises; should build tools have any responsibility to the configuration and execution of acceptance tests when they are further down the pipeline than actually building the artifact? I'd like an answer that addresses in the sense of deployment lifecycle phases rather than in specifics, like my example. Although examples would help bolster the answer.


title: When job hunting, what grabs your attention about a job posting

text: The small company I work for is currently looking for a few good programmers. We have posted job listings in a few places and hit up the local user group boards, but haven't really gotten anything back on any of that. As a developer what elements of a job posting would make you respond:   * Company Name (i.e. Microsoft, Oracle, or in our line of work BAE, Boeing, Lockheed Martin).   * Type of work (This seems kind of obvious, but would be like ROR or Java, etc.)   * Work Environment   * Computers used (MacBook PRO for everyone)   * Salary range   * Other It's a little hard to believe that given the overall job market that we don't even get resumes. We are in a hot market (DC area), but it still seems a bit hard.


title: Organizing a code retreat

text: I am keen on organizing a code retreat in my city. It's actually at my home with around 4-5 people. I have read some good inputs here, but I have some questions.   * Should I think of some programming samples/puzzles or should it be a small proto/poc of an idea?   Ex: Creating a twitter client, working with oData, etc.   * Should all the people present there by aware of the programming language being selected? Or is it expected that they'll come there, browse the net and learn and code?   * Should the end result be something that can be showcased/demoed or can it be some piece of code that we can forget about?   * Time duration for the code retreat: Is one day good enough or should I keep it for two days? Will two days become overkill?


title: How to handle workload in a better way

text: I am a fresher working in a software company. I am working on a project all alone. Though I studied CS, I dont seem to grasp things (concepts, code, etc.) easily. Most of what I read is forgotten!!!!:(:( I want to improve but it seems like there are too many things to learn and there's less time... One more factor is that I am handling a project on my own which adds to my tension, when things don't work and my mind is unable to troubleshoot or look for alternatives... Also, I can't go to others for doubts as they are busy with their work and they don't know about my app... It's really stressing me out... I have to do everything on my own. I feel bad at the end of the day since I don't meet the expectations of my peers as well as myself... How do I improve myself and handle things effectively? Suggest to me books on not just coding but also on designing. Also how can I effciently manage my work as well as practice more to get the concepts more clearer?


title: What is the proper way to do REST?

text: Everybody nowadays does SOA, even if some don't actually understand what is all about. So they do it wrong. Using that as an analogy I know what REST is (or at least I think I do) and want to do some of it. **But I want to do it right.** So my question is what's the proper way to do REST? I'm open to any resource, the path to follow, a REST bible book or something.


title: Working with Linux for Job Requirements

text: It is seen on many Job Qualification Requirements about being familiar with Linux(*nix, as the way its posted). With so many variants of Linux, which one should one focus on. From what I know, the Big Organizations use their own Hacked version of Linux, so one could not be familiar with the exact System used at the Industry by different organizations. Should someone just select one of the Variants and work with it, trying to acquire deep knowledge about it and should be able to adapt with a different variants with little effort.


title: MIT licence copyright notice for derived works

text: We're thinking of using some open-source MIT-licensed software in one of our web projects (a jQuery datetime plugin). The first line of the MIT licence is: > Copyright (c) [year] [copyright holders] If we include the plugin as-is (without making any changes), I understand we need to include the licence with only the original author (though the actual copyright notice at the top of the js file doesn't specify a year): > Copyright (c) 2013 Keith Wood If we make changes to the plugin, what does the copyright notice become? > Copyright (c) 2013 Keith Wood, 2013 [My name/Company name] Do you need to include all previous authors or is there another way of handling such a notice?


title: As a senior project manager, should I still keep learning new skill in programming?

text: If I'm a senior project manager, should I still keep learning new technology? For example, every month every year, most language updates themselves, and a lot of new programming concepts become popular. Many new frameworks and patterns are created and make things easily. But you have to spend a lot of time to keep up with. If there's language which is proved more efficient and you aren't familiar with it, will you plan to learn it and let team members take this language to develop the project? If there's new framework, most people say that it's helpful to our project, but you know nothing about it, would you learn it and decide it? But as a PM, you should be a senior level or maybe busier than before. Are you willing to learn something 'not so senior'??


title: Boolean properties in Class A control availability of members in Class B: Design Pattern?

text: Given the following code:               class AnimalDescriptor {         String species;         boolean hasLegs;         boolean hasTeeth;         boolean hasHair;              public AnimalDescriptor(String species, boolean hasLegs,                                  boolean hasTeeth, boolean hasHair) {             this.species = species;              this.hasLegs = hasLegs;              this.hasTeeth = hasTeeth;              this.hasHair = hasHair;     }          class Animal {         AnimalDescriptor control;         String name;         int numberOfLegs;         int numberOfTeeth;         String colorOfHair;     }          class doStuff {         public void go() {             AnimalDescriptor dog = new AnimalDescriptor("dog", true, true, true);             AnimalDescriptor pirahna = new AnimalDescriptor("pirahna", false, true, false);                  Animal fido = new Animal();             fido.control = dog;             fido.name = "Fido";             fido.numberOfLegs = 4;             fido.numberOfTeeth = 42;             fido.colorOfHair = "black"; //All good here                  Animal bob = new Animal();             bob.control = pirahna;             bob.name = "Bob";             bob.numberOfTeeth = 42; //So far so good             bob.numberOfLegs = 2; //This should pass compilation, but fail                                    //validation at run-time, since it is                                    //nonsensical     }      Is there a pattern name for what I'm doing here? I've tried searching variations on my question title but haven't gotten anywhere. Obviously, this is an extremely simple and abbreviated example, AnimalDescriptor should have a `bool .validate(Animal a)` method, as well, and Animal should have an `.isPropertyAvailable(String propertyName)` method, among other additions. I didn't want to bog everything down with a 500-line minimal-case example. There's no way that I'm the first or only person to do this, and I'm mainly looking for something I can latch on to for further research into best practices, implementation pitfalls, etc. EDIT: To provide a little more clarity, in my system, there are ~20 booleans in the "control" class (AnimalDescriptor). I'm tracking ~106 items (Animals) in ~103 categories (AnimalDescriptors) that share a pool of common properties, but each item only has the properties that are designated by its "control" configuration. Plus, the system should be able to expand to, say, 104 categories (AnimalDescriptors) over the next 5 years. We have a functional (if ugly) implementation, so I don't need validation or exception how-tos -- I'm more interested in how this problem has been approached in other domains/applications, benefits of implementation in a functional (as opposed to object-oriented) context, best practices, etc. It seems like there should be a name for this, but I don't know what it is.


title: Idea to develop a caching server between IIS and SQL Server

text: I work on a few high traffic websites that all share the same database and that are all heavily database driven. Our SQL server is max-ed out and, although we have already implemented many changes that have helped but the server is still working too hard. We employ some caching in our website but the type of queries we use negate using SQL dependency caching. We tried SQL replication to try and kind of load balance but that didn't prove very successful because the replication process is quite demanding on the servers too and it needed to be done frequently as it is important that data is up to date. We do use a Varnish web caching server (Linux based) to take a bit of the load off both the web and database server but as a lot of the sites are customised based on the user we can only do so much. Anyway, the reason for this question... Varnish gave me an idea for a possible application that might help in this situation. Just like Varnish sits between a web browser and the web server and caches response from the web server, I was wondering about the possibility of creating something that sits between the web server and the database server. Imagine that all SQL queries go through this SQL caching server. If it's a first time query then it will get recorded, and the result requested from the SQL server and stored locally on the cache server. If it's a repeat request within a set time then the result gets retrieved from the local copy without the query being sent to the SQL server. The caching server could also take advantage of SQL dependency caching notifications. This seems like a good idea in theory. There's still the same amount of data moving back and forward from the web server, but the SQL server is relieved of the work of processing the repeat queries. I wonder about how difficult it would be to build a service that sort of emulates requests and responses from SQL server, whether SQL server's own caching is doing enough of this already that this wouldn't be a benefit, or even if someone has done this before and I haven't found it? I would welcome any feedback or any references to any relevant projects.