title: Good Version Control Guidelines from a Development/Collaboration Perspective?

text: At our company we have started outsourcing some of our development. This has worked somewhat well. However, we are having a hard time getting them to properly use version control. They are familiar with SVN and know how to use it. However, for some reason they don't commit regularly, instead they work with 16 things simultaneously and make a huge commits every 2 weeks, if we are lucky maybe with a few comments. Which makes it very difficult to both following and review their work, collaborate and also fix bugs. I have tried to explain to them to do their work as one small task at a time and regularly commit each of these with appropriate comments. Without much success, either they don't understand the concept or they are lazy. My question is, what would be good guidelines describing how one should work with version control, not from a technical perspective (they know SVN), which seems to be the only thing I'm finding online, but from a development/collaboration/project perspective?


title: call a function and never wait for it in C#

text: I have a controller in my mvc4 web application in which there is an action that needs to call another function. What happens in that function i.e. the return value is not important for my action. How i can call that function and never wait for it to be executed? I think it can be done by async but my point is not to use resources, just call the function and never wait for it what ever happens. Please give me some advise.


title: Looking for a digital developer book service

text: I just started managing a small team of developers for my company and I would like to give them access to a library of books that would help them improve their skills. Before I buy a bookshelf worth of books I was wondering if anyone was aware of any services that would fill this need. Something that anyone with an account could log into and get access to the latest books on programming and software development. Ideally, something like a shared kindle account, but would be happy to hear about other experiences or ideas that would also help fit my need. Or even if you think I am dreaming and should just shell out some money for the books.


title: Where should I include comments in my "self-documenting code"?

text: I'm currently developing a web-app by myself and have made it a point to use descriptive variable and method names (sometimes at the expense of brevity) in order to minimize commenting. The plan was to code each method using this strategy, then comment after I've completed the method I was currently working on. However, I've found that after (more or less) all of the methods I've completed, in-line comments seemed superfluous. I still follow Javadoc conventions for classes and methods, but as of now my code is for the most part, completely devoid of any in-line comments. Fortunately, I'm still relatively early in the development process and all of the methods' workings are fresh in my head, should a situation arise where I need to write in-line comments. Is this a good strategy? If not, where should I include in-line comments? I've included one of my methods below in order to illustrate how self-documenting it currently is. (I'm using Pelops, which is a Java library used to access a Cassandra database. Without going in too deep in to Cassandra's data model, a row basically corresponds to a relational database tuple, and a column corresponds a column in a relation database table). I'd like to think that even without knowledge of Pelops or Cassandra, that one will be able to understand what is going on in the code. Is this the case? If not, where can I insert comments to make it crystal clear? I hope to abstract any suggestions on comment placement in this code in to all the other methods I've written so far.               /**          * Gathers a user's ID and first name from the database, creates a random activation code for that user and stores          * it in the database, and sends an activation e-mail to that user.               * @param eMail                           a String representation of the e-mail of the user that the e-mail is being sent for          * @throws MyAppConnectionException      if any of the queries is unable to be executed or a problem arises because of one, or if a problem arises while sending the e-mail          */         public static void generateAndSendActivation(String eMail) throws MyAppConnectionException, MyAppActivationException         {             eMail = eMail.toLowerCase();                  try             {                 Selector userIDSelector = Pelops.createSelector(pool);                 Column userIDColumn = userIDSelector.getColumnFromRow("Users_By_Email", eMail, "User_ID", ConsistencyLevel.ONE);                 String userIDString = new String(userIDColumn.getValue());                      Selector firstNameAndStatusSelector = Pelops.createSelector(pool);                 SlicePredicate firstNameAndStatus = Selector.newColumnsPredicate("First_Name", "Status");                 List<Column> firstNameAndStatusColumns = firstNameAndStatusSelector.getColumnsFromRow("Users", userIDString, firstNameAndStatus, ConsistencyLevel.ONE);                      char statusChar = Selector.getColumnValue(firstNameAndStatusColumns, "Status").toChar();                      if(statusChar == 'N')                 {                     String firstNameString = Selector.getColumnStringValue(firstNameAndStatusColumns, "First_Name");                          String activationCode = createRandomCode();                     String activationHash = BCrypt.hashpw(activationCode, BCrypt.gensalt());                          Mutator storeActivationHashMutator = Pelops.createMutator(pool);                     storeActivationHashMutator.writeColumn("Users", userIDString,                             storeActivationHashMutator.newColumn("Activation_Code", activationHash)                             );                          storeActivationHashMutator.execute(ConsistencyLevel.ONE);                     sendEmail(firstNameString, userIDString, eMail, activationCode, "sendActivationCode");                 }                 else                 {                     throw new MyAppActivationException("User with ID " + userIDString + "tried to activate an already activated account");                 }                  }             catch(NotFoundException nfe)             {                 MyAppQueryException bqe = new MyAppQueryException("Account for user with e-mail " + eMail + " not found. Cannot send activation code", nfe);                 bqe.accountDoesNotExist = true;                 throw bqe;             }             catch(PelopsException pe)             {                 MyAppQueryException be = new MyAppQueryException("Unable to carry out one of the operations required to generate and store activation code", pe);                 throw be;             }             catch(MyAppMailException bme)             {                 throw bme;             }         }


title: Does directly accessing an applications database break the license agreement?

text: We have purchased a fairly light-weight application that uses a database on SQL Server for its back-end. This application has no API. There is a small web-based feature we need to add, that can easily be added by connecting to the database directly. **Generally speaking, and all issues relating to future schema changes aside, is this typically allowed by the software license?** A co-worker made the argument that in the spirit of the software license, we are reverse-engineering their code. I hold the belief that it is our data in the database that we would be accessing and potentially modifying, no license is required for the actual data. In addition, since we still pay for a license to use the software, that means we also have a license to use its schema, as the schema is part of the software. It is also my understanding that it is common practice (at least, everywhere I have worked) to access an application's database directly for reporting purposes. Which is considered correct? I am interested in input from both a legal standpoint, and an industry commonly understood standpoint. _I also understand that this will vary from license to license. I am looking for a general answer that will apply to most software. Thank you._ * * * **Edit:** Perhaps another way to look at it... What is generally considered acceptable? Throw out the license agreement, since the legal question cannot be properly answered without the license. **As a developer, would you be unhappy with your users accessing the database directly?**


title: What's the best Java equivalent to Linq?

text: Are there any libraries in Java that come close to providing the functionality of Linq?


title: How can I get my startup working with Agile development?

text: In our startup, we've worked until now using the traditional waterfall model, but we want to try our next project using Agile Methodology. We are pretty much alien to the entire Agile process, so considering this, what is the best way to understand Agile (resources and a practical handbook can be of help), decide on a specific methodology (Scrum, etc), and start it in our next project?


title: Which methods should be put in an interface and which in abstract classes?

text: I have seen many frameworks and modules and their standard they follow is like this   1. `UserInterface` which have some predefined methods   2. `AbstractUserClass` which implements `userInterface`   3. Then `GenericUserClass` which extends from `AbstractuserClass`   4. Then other classes extending from that generic Now I have seen that abstract class has additional functions to the interface, and the generic class also has additional functions.   1. So I am confused which methods should go where   2. Sometimes I see `class A extends Abstractuserclass` and sometimes `class A extends Abstractuserclass implements UseraInterface`. What is the difference if `Abstractclass` already impelements `Userinterface`


title: Which professional positions combine Computer Science and Marketing?

text: I would like to find a job that combines Computer Science with Marketing, ideally in a position where you get to meet a lot of people and travel a fair bit. After having worked as a Front/Back Web App Developer I am getting a degree in Management of Technology, which also includes an element of Marketing. How can I combine my two interests, Computer Science and Marketing, professionally, in a sensible way? Which positions should I be aiming for?


title: What is a buffered write scheme?

text: I received this response from Jeff while researching hit counters. He said page hits are incremented in a `buffered write scheme,` and that a views table does not exist. Can you explain what a buffered write scheme is, please? I would appreciate answers not too heavy with technical jargon. In particular I'm interested in how such a scheme can be implemented to track page hits. I'm curious how hit data gets persisted since it is needed to prevent users from simply refreshing a page to increment page hits.


title: Am I a bad programmer, or does everyone have this feeling?

text: I tend to understand things rather quickly, but after 2 years of programming in Python I still stumble across things (like Flask today) that amaze me. I look at the code, have no idea what's going on, and then feel very humbled. I feel like an absolute expert each time this happens, up until the moment it happens. Then, for about a 2 week period I feel like an absolute beginner. Does this often happen, or does it indicated that I have so much more to learn before I can even be considered a "good" programmer?


title: Nested Classes or Namespace

text: Why do need namespaces when we have nested classes. What can be done through namespaces, can also achieved through nested classes. so I don't understand the reasoning of having namespaces ?


title: How to separate sensitive data in database(MySql)

text: I need to design a database that will contains information about personal disease of users. What can be the approach in order to implement the columns of the DB's tables: encrypt the information, separate data within two differents DB, one for sensitive data and another for not sensitive data, or both or another approach?


title: Do you also forget the code after getting the task done?

text: I'm a new programmer and want to ask senior programmers (programmers who have some experience in the real world). I do my work and after coding, my project gets completed but honestly speaking I don't remember the code, classes and frameworks name and their properties. Sometimes even I doubt myself that did I made this? Is this normal with all programmers or am I the silliest programmer who couldn't remember the code and classes/properties names? **Edit:** I think many of programmers are getting me wrong here. I said I forget frameworks names, classes' names, property names but I start remembering my own code once I start working on it again. My question is do you remember syntax and classes/property etc. names?


title: How to correct a junior, but encourage him to think for himself?

text: I am the lead of a small team where everyone has less than a year of software development experience. I wouldn't by any means call myself a software guru, but I have learned a few things in the few years that I've been writing software. When we do code reviews I do a fair bit of teaching and correcting mistakes. I will say things like "This is overly complex and convoluted, and here's why," or "What do you think about moving this method into a separate class?" I am extra careful to communicate that if they have questions or dissenting opinions, that's ok and we need to discuss. Every time I correct someone, I ask "What do you think?" or something similar. However they rarely if ever disagree or ask why. And lately I've been noticing more blatant signs that they are blindly agreeing with my statements and not forming opinions of their own. I need a team who can learn to do things right autonomously, not just follow instructions. How does one correct a junior developer, but still encourage him to think for himself? Edit: Here's an example of one of these obvious signs that they're not forming their own opinions: > Me: I like your idea of creating an extension method, but I don't like how > you passed a large complex lambda as a parameter. The lambda forces others > to know too much about the method's implementation. > > Junior (after misunderstanding me): Yes, I totally agree. We should not use > extension methods here because they force other developers to know too much > about the implementation. There was a misunderstanding, and that has been dealt with. But there was not even an OUNCE of logic in his statement! He thought he was regurgitating my logic back to me, thinking it would make sense when really he had no clue why he was saying it.


title: Selecting the main version of a linux library

text: I am looking to use cracklib library for testing password security in my C/C++ linux applications. But I cannot find the original author, nor the official code that hasn't been forked.


title: GPL - Writing an exception for a plugin interface under section 7 of GPLv3

text: ## The problem I've written a application for Android licensed under GPLv3 which needs to use Google Play Services, a proprietary library, as a plugin to the app. Now I'd also like to add libspotify as a plugin. For all of the proprietary libraries used I'm providing alternative open source plugins but they are not as good as the proprietary ones, not even close. The user should then be free to disable all proprietary parts either at compile or runtime. ## Possible solutions The GPLv3 has a section "7. Additional Terms." under which you can add a "classpath" exception. I'd like to use this exception to do the following. The idea of a classpath exception is explained in the GPLv3 FAQ here:   * Linking over a controlled interface: http://www.gnu.org/licenses/gpl-faq.html#LinkingOverControlledInterface   * http://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs ## The basic idea Implement these interfaces:               interface Plugin {}          interface ProprietaryPlugin extends Plugin {}          interface XYZ_1 extends Plugin {         public void someHook();         public void someOtherHook();         ...     }          interface XYZ_2 extends Plugin {         public void someHook();         public void someOtherHook();         ...     }          XYZ_3, 4, ...      The above interfaces are part of the project and are under GPL. But I'd like to let all code that extend some subinterface of Plugin except ProprietaryPlugin to be able/allowed to be proprietary given that they mark themselves as ProprietaryPlugin. My intention is to make tight plugin hooks that all proprietary plugins must follow and a way to indicate to the user which plugins that we can remove at runtime. Also, I want the "bridge" code, the implementation of the plugin interfaces to be open source and under a GPLv3 compatible license. And the source code must provide at least one GPLv3 implementation, hopefully creating a concrete wall between the GPLv3 and proprietary code. ## Visual explanation ![visual explanation with UML and licenses](http://i.stack.imgur.com/NmkP5.png) Is this possible to do? I know that most guys here are not lawyers, but I find asking developers first enlightening. ## A suggestion from irc.gnu.org#gnu The guys at irc.gnu.org#gnu gave me the following suggestion: https://raw.github.com/qcad/qcad/master/gpl-3.0-exceptions.txt It states that:               As a special exception, the copyright holders of QCAD hereby grant permission      for non-GPL compatible plug-ins and script add-ons to be used and distributed      together with QCAD, provided that you also meet the terms and conditions of the      licenses of those plug-ins and script add-ons.      Is "non-GPL compatible plug-ins and script add-ons" vague / a loophole, or is it clear and does it apply to my case? ## A second suggestion I got a second suggestion at #gnu: http://roundcube.net/license/ It states that:               This file forms part of the Roundcube Webmail Software for     which the following exception is added:      Plug-ins and Skins which merely make function calls to the Roundcube Webmail Software,     and for that purpose include it by reference shall not be     considered modifications of the software.          If you wish to use this file in another project or create a modified version that will      not be part of the Roundcube Webmail Software, you may remove the exception above and      use this source code under the original version of the license.       What do you think about this one? ## My attempt at a "classpath exception" My first idea was to add the classpath-exception to Plugin with something like the following... does it accomplish my intent or is it filled with loopholes, etc.?               Additional permission under GNU GPL version 3 section 7          0. Definitions          "FSF" means the Free Software Foundation, Inc.          "Compatible License" means any license the FSF      considers to be compatible with the GNU GPL version 3.          "Plugin interface" means any interface definition file in the Corresponding Source     containing - in the file's header - the words      "The licensors of this Program designates this particular file as a Plugin interface"          "Proprietary interface mark" means any interface definition file in the Corresponding Source     containing - in the file's header - the words      "The licensors of this Program designates this particular file as a Proprietary interface mark""          "Allowed library" means any library that is linked or combined with this Program,      or any covered work that creates a derivative work of a      subinterface of a Plugin interface not directly linking with the library.     Such a subinterface provides at least the source code      of one working implementation licensed under This License.     The derivative work of the subinterface linking to the      Allowed library implements a Proprietary interface mark.     Such a derivative work is referred to as a "Proprietary plugin implementation".     A Proprietary plugin implementation is licensed under a Compatible License.          1. Exceptions          If you modify this Program, or any covered work, by linking or combining it      with any Allowed library (or a modified version of those libraries),     containing parts covered by the terms of those libraries, the licensors of this      Program grant you additional permission to convey the resulting work.     {Corresponding Source for a non-source form of such a combination shall include      the source code for the parts of any Proprietary plugin implementation     used as well as that of the covered work.}


title: What are tangible advantages to proper Unit Tests over Functional Test called unit tests

text: A project I am working on has a bunch of legacy tests that were not properly mocked out. Because of this the only dependency it has is EasyMock, which doesn't support statics, constructors with arguments, etc. The tests instead rely on database connections and such to "run" the tests. Adding powermock to handle these cases is being shot down as cost prohibitive due to the need to upgrade the existing project to support it (Another discussion). My questions are, what are the REAL world tangible benifits of proper unit testing I can use to push back? Are there any? Am I just being a stickler by saying that bad unit tests (even if they work) are bad? Is code coverage just as effective?


title: PHP best practice in return values

text: For PHP, best practices, I have read somewhere that if you assign your data to a variable it takes almost no memory or resource. So let's say I have this function that return a count.               public function returnCount($array){         return count($array);     }      or if this is better?               public function returnCount($array){         $count = count($array);         return $count;     }


title: Find a "hole" in a list of numbers

text: What is the fastest way to find the first (smallest) integer that doesn't exist in a given list of **unsorted** integers (and that is greater than the list's smallest value)? My primitive approach is sorting them and stepping through the list, is there a better way?


title: Guidance in naming awkward domain-specific objects?

text: I'm modeling a chemical system, and I'm having problems with naming my elements / items within an enum. I'm not sure if I should use:   * the atomic formula   * the chemical name   * an abbreviated chemical name. For example, sulfuric acid is H2SO4 and hydrochloric acid is HCl. With those two, I would probably just use the atomic formula as they are reasonably common. However, I have others like sodium hexafluorosilicate which is Na2SiF6. In that example, the atomic formula isn't as obvious (to me) but the chemical name is hideously long: `myEnum.SodiumHexaFluoroSilicate`. I'm not sure how I would be able to safely come up with an abbreviated chemical name that would have a consistent naming pattern. There are a few problems that I'm trying to address through naming the enum elements.   The first is readability, with the longer names presenting an issue.   The second is ease of picking up the code for new maintainers, and here the shorter names present an issue.   The next issue is the that business owners usually refer to the full chemical name, but not always. The "mouthful" chemicals are referred to by their formula.   The final concern is making sure it's consistent. I _don't_ wan't a mixed naming convention as it will be impossible to remember which to use. **From a maintenance point of view, which of the naming options above would you prefer to see and why?** * * * _Note: Everything here below the line is supplementary | clarifying material. Please don't get bogged down in it. The main question regards naming the awkward objects._ _Atomic Option_               public myEnum.ChemTypes     {          H2SO4,        HCl,        Na2SiF6     }      _Chemical Name Option_               public myEnum.ChemTypes     {        SulfuricAcid,        HydrochloricAcid,        SodiumHexafluorosilicate       }      * * * Here are some additional details from the comments on this question:   * Audience for the code will be just programmers, **not** chemists.    * I'm using C#, but I think this question is more interesting when ignoring the implementation language.   * I'm starting with 10 - 20 compounds and would have at most 100 compounds, so I don't need to worry about _every_ possible compound. Fortunately, it's a fixed domain.   * The enum is used as a key for lookups to facilitate common / generic chemical calculations - which means that the equation is the same for all compounds but you insert a property of the compound to complete the equation.     * For example, Molar mass (in g/mol) is used when calculating the number of moles from a mass (in grams) of the compound. FWIW, Molar Mass == Molar Weight.      * Another example of a common calculation is the Ideal Gas Law and its use of the Specific Gas Constant A sample function might look like:               public double GetMolesFromMass(double mass_grams, myEnum.ChemTypes chem)     {       double molarWeight = MolarWeightLookupFunctionByChem(chem); //returns grams / mole       double moles = mass / molarWeight;  //converts to moles            return moles;     }          //Sample Call:     myMoles = GetMolesFromMass(1000, myEnum.ChemTypes.Na2SiF6);     //*or*     myMoles = GetMolesFromMass(1000, myEnum.ChemTypes.SodiumHexafluorosilicate);                    public double GetSpecificGravity(myEnum.ChemTypes chem, double conc)     {       //retrieves specific gravity of chemical compound based upon concentration       double sg = SpecificGravityLookupTableByChem(chem, conc);       }      So the enum of the compound name is used as a key and to provide consistency in referencing the compound with the related functions.


title: Patterns for ajax-heavy web applications

text: Up until now, I've been a great fan of the MVC pattern for developing web applications. For the web, I've developed mostly in PHP (with the Kohana and CodeIgniter frameworks) and Ruby (RoR). As my applications become heavier on the Ajax side (single-page apps etc) I noticed that I can't help but betray the very basic concepts of MVC: Javascript is doing most of the works; calling controllers just to ask for views or more js/json code seems wrong. After striving for keeping all the routing jobs in the controllers, now I've fundamentally split it between them and Javascript (that is, from the framework's PoV, part of the views). When asking for json the MVC subversion looks even more obvious: the js code doing the request _is_ the controller; the framework's controller is merely acting as proxy for the model's data - what I'm actually asking for. So, what should I look into? I was thinking about pure-javascript applications, for instance with backbone.js and a document-based, json-spitting database (couchDB) as backend, but I love my relational databases. Another option would be the following: I'd just make "routed models" in PHP/ruby/go/whatnot. Those will analyse the request, call the db, give back some json. This approach looks interesting to me but it lacks any substantial documentation or academic analysis, so I'm a little afraid of the leap. Ideas?


title: Where and how to mention Stackoverflow participation in the résumé?

text: I think I have good enough reputation on SO now. Well, this may not be that much as compared to so many other users out there but I am happy with mine. So, I was thinking of adding my profile link on my résumé - just the profile link and not that "I have this much reputation on SO". Those who haven't seen, can see this question Would you put your stackoverflow profile link on your CV / Resume? How would this look like? > **Forums/Blogs/Miscellaneous others** > > No blogging as yet but active participant in Stackoverflow. My profile link > - `http://stackoverflow.com/users/userId/username` I think of putting this section after **Project Details** and **Technical Expertise** sections. Any tips/advice? **Update** MKO has made a very good point \- > do you really want a potential employer to be able to evaluate in detail > everything you've ever written on SO I thought of commenting but it would be too long -   In my questions/answers I put a lot of statements like - "AFAIK ...", "following are my assumptions so far ...", "am I correct to conclude that... ?", "I doubt if it is possible to ..." etc. when I am not sure about something and I rarely involve in fights with other users. However I do argue on topics sometimes if I feel it is necessary and if I have a valid point. I do accept my mistakes and apologize for the same. As we all know nobody is perfect. I must have written many things which may be judged as wrong by a potential employer. But what if the same employer notices that I have improved in the quality of content by comparing old content with new one? Isn't that great? I also try to go back to older questions/answers and put corrective comments etc. when I feel I was wrong or if I can improve my post. Of course there are many employers who want you (potential employees) to be correct each and every time. They immediately remove you from consideration when you say a single incorrect thing. I have personally met such an interviewer few months back. He didn't even care to listen to any good thing I had done after he found a single wrong thing. Now the question is do you really care to work with such people? Or do you like those people who give value to the fact that you are striving to improve every day. I personally prefer the latter.


title: Learning in the Classroom

text: I am currently taking an Assembly programming class, and I honestly find it extremely boring and tedious. While I've programmed some assembly before as part of a C++ program, I find what we are doing to be completely different than actual assembly code I've worked with (we are using a program called MARS MIPS, found here). Since we are using the MIPS architecture, which from what I gathered is hardly used any more, I find what we are learning hardly applicable to anything outside of the class. Likewise, I find myself not retaining the material we cover in class due to detachment from real world applications as well as the classroom setting itself. I've been trying to write my some code outside of the classroom to get familiar with it, but without any obvious real world applications, I find myself unmotivated to do so. **Is there any advice for trying to learn a programming language (such as assembly) for a class when I don't seen any real world application of it?** Or perhaps a more specific question to this problem would be: **Is there any real world application to the MIPS architecture which I am unaware of?** **EDIT:** I found the following information on StackOverflow concerning MIPS: http://stackoverflow.com/questions/2635086/mips-processors-are-they-still-in- use-which-other-architecture-should-i-learn


title: What is the alternative to frequent manual verification?

text: I was thinking, is there a particular time in your coding where you verify that it works? Say, after coding a function, or an entire class, or an entire section of an app, or after every 'significant' block of code? I ask this, because I tend to verify my app too often, sometimes after every 3rd or 4th change. This is a habit which has proven very hard to shake. It appears to be counter productive to do this repeatedly and manually. Is there another solution? It seems to be either be a more competent programmer and essentially 'know' the return of the majority of your code, or have your IDE check the return periodically, or only test the return via TDD.


title: How should a ViewModel be named?

text: While starting work on a brand new ASP.net MVC application we've learned that we should have all of our available data pushed to make it easy to create a full view. While learning this we've started using a concept of a ViewModel, or a complex object full of properties from other basic data transfer objects. Now our problem has been in naming these ViewModels. We've run across the idea of using a name created from the DTO object names like MemberContactViewModel. while this is okay, I feel that names should be more unique or more related to what the complex object will be doing rather than what it's made up of. What are your thoughts. How should a complex ViewModel be named, based on the data it holds, or the view where it will interact with. Thanks for the input.


title: Where can I turn to if I can't fix a bug?

text: I am looking for resources to turn to when I don't have the answer for something. I lead a team of software developers. We have been rolling out new software releases on a monthly basis. When there is a bug that my team cannot fix, it lands on me. Most of the time I can resolve the issue, but there are times when I get stuck. Unfortunately, I'm the top of the line at our company. There is nobody I can ask for help or assistance in figuring something out. Do you happen to have any recommendations or guidance for situations like this?


title: Git submodule vs Git clone

text: I am working on an opensource project on github. It has a subdirectory /Vendor in which it has a **copy** of several external libraries. Original maintainer of the project updated this directory with newer copy of external library once in a while. One developer send me a pull request with idea to replace this **copy** by **git submodule**. And I am considering whether it's good idea or now. Git submodule Pros:   * Submodules were specifically designed for similar scenarios   * It removes possibility of accidental commit to Vendor which will be overwritten while next update Git submodule Cons:   * It looks like git submodules pushes complexity from maintainer to a person who will clone/pull the project (additional steps required after you clone to start working with the project: "git submodule init", "git submodule update" What's your opinion on this? One more thing. This problem is reasonably small size library with very limited external dependencies. I think any build tool would be overkill for it for now.


title: Personal Software Process (PSP1)

text: I'm trying to figure out an exercise but it doesn't really makes to much sense.. I'm not asking someone to provide the solution. just to try and analyse what needs to be done in order to solve this. I'm trying to understand which PSP 1.0 1.1 process I should use. PROBE? Or something else? I would greatly appreciate some help on this one from someone that has experience with the Personal Software Process Methodology.. Here is the question. > For the reference case (“code1.c”), the following s/w metrics are provided: > >   * man-hours spent in implementation phase (per-module): 2,7 mh/file >   * man-hours spent in testing phase (per-module): 4,3 mh/file >   * estimated number of bugs remaining (per-module): 0,3 errors/function, 4 > errors/module (remaining) > > > Based on the corresponding values provided for the reference case, each of > the following tasks focus on some s/w metrics to be estimated for the test > case (“code2.c”): [25 marks] > >   1. (estimated) man-hours required in implementation phase (per-module) [8 > marks] >   2. (estimated) man-hours required in testing phase (per-module) [8 marks] >   3. (estimated) number of bugs remaining at the end of testing phase (per- > module) [9 marks] > > > Tasks 4 through 6 should use the data provided for the reference case within > the context of Personal Software Process level-1 (PSP-1), using them as a > single-point historic data log. Specifically, the same s/w metrics are to be > estimated for the test case (“code2.c”), using PSP as the basic estimation > model. > > In order to perform the above listed tasks, students are advised to consider > all phases of the PSP software development process, especially at levels > PSP0 and PSP1. Both cases are to be treated as separate case-studies in the > context of classic s/w development.


title: Visual web page designer for Django?

text: I'm just starting my Django learning so pardon me if any part of this question is off-base. I have done a lot of web searching for information on the equivalent of a visual web page designer for Django and I don't seem to be getting very far. I have experience with Delphi (Object Pascal), C, C++, Python, PHP, Java, and Javascript and have created and maintained several web sites that included MySQL database dependent content. For the longest time I've been using one of the standard WYSIWIG designers to design the actual web pages, with any needed back end programming done via Forms or AJAX calls that call server side PHP scripts. I have grown tired of the quirks, bugs, and other annoyances associated with the program. Also, I find myself hungry for the functionality and reliability a good MVC based framework would provide me so I could really express myself with custom code easily. So I am turning to Django/Python. However, I'm still a junkie for a good WYSIWIG designer for the layout of web pages. I know there are some out there that thrive on opening up a text editor, possibly with some code editor tools to assist, and pounding out pages. But I do adore a drag and drop editor for simple page layout, especially for things like embedded images, tables, buttons, etc. I found a few open source projects on GitHub but they seem to be focused on HTML web forms, not a generic web page editor. So can I get what I want here? The supreme goal would be to find not only a web page editor that creates Django compatible web pages, but if I dare say it, have a design editor that could add Python code stubs to various page elements in the style of the Delph/VCL or VB design editors. Note, I also have the Wing IDE Professional IDE, version 2.0. As a side note, if you know of any really cool, fun, or time-saving Python libraries that are designed for easy integration into Django please tell me about them. \-- roschler


title: REPL - Do You Find It Useful?

text: Recently I started learning Clojure and downloaded Clojure-Box for Windows which came with SLIME and have been fiddling around with Clojure using the REPL mode. Now, I have starting learning many languages that have REPL available (F#, Python, Haskell) but have never used it until I started with Clojure and I realized how much of a help it is. I was wondering how many people use REPL for the languages that have them available. If you don't use them, what is your reasoning not to? If you do use them, do you use them for testing code or just for learning languages?


title: How to set up Unit Testing in Visual Studio 2010?

text: I'm doing my first big project and I don't have a lot of experience in a professional programming environment. While researching anything programming- related I often see references to Unit Testing, but I am still unclear as to how to set those up or even if it would be beneficial to me. Can someone explain unit testing to me, and how to set it up in a Visual Studio 2010 solution that has multiple projects? Is it something that occurs within your project's solution, or is it a separate solution? And is it something you'd recommend for a small development team or is it just a waste of time to setup? Right now I just run the entire program to test whatever I am currently working on, but occasionally I have run into problems that are not easy to debug and it would be useful to run subsets of the code elsewhere... Sometimes I do setup another project with some of the libraries referenced to test a small part of the program, but I feel more time is wasted setting that up then just running the entire program because of all the dependencies involved


title: When would someone be considered a bad programmer?

text: How would you consider that a programmer is bad at what he or she is doing? If possible... How should he/she improve?


title: Scrum in a consulting environment?

text: Is it possible to introduce scrum to a consulting environment? On any given week I might belong to 4 different teams, each with a different PM, BA and dev team (I am a designer). It doesn't seem feasible, time wise, to be able to be part of that many teams/projects as there would need to be daily stand-ups for each, sprint reviews, etc. I should add these projects are not necessarily software, but mainly ecommerce web projects. Can someone who has done this speak to how you approach it? _Edit_ I think my situation is different and I should have discussed it further. Our dev team is in India, so finding a time in the US morning/India evening for daily stand-ups are hard, especially when we almost always have client calls in the US morning/India evening so dev can be present if necessary. Instead, what our PM's have done is have 1 daily meeting for the US team (BA, Design). However, they go through ALL the projects at once. So, if you're not on that project, you're screwed and have to wait till your project comes up. This can be 30min-75min a day, for me. Insane. This does NOT cancel our weekly status call (30m-1h) with the client (x however many projects you are on). This is obviously not scrum, as there are no devs present during any of this and it's just action items being listed for the US team. However, I'd love to get to a point where our 'scrum-like' dev team (they develop in sprints and have sprint planning meetings) can be part of daily standups with the US team and we transition to an actual scrum framework.


title: Why the ugly keywords in C11?

text: I am currently reading a draft of the C11 specification. The new introduced keywords: `_Bool, _Alignof, _Atomic` all feel like custom extensions, instead of standard reserved keywords like `struct, union, int`. I realize that the standard basically consists of standardized extensions ... but still, this is awful! Maybe we will soon end up with `__Long_Long_Reallylong_Integer_MSVC_2020_t` creeping in the standard! _Is the backward compatibility of nonstandard code the only reason of the new style of the keywords?_


title: Tips for a novice PHP developer to drive down long-term maintenance costs

text: I'm an experienced Java developer who is just starting up a project for an NGO. I will be working on the project for at least 6 months, following which the NGO will have to pay or find a volunteer to maintain the project. Seeing as they already have people working on their website in PHP, I figured PHP was the obvious choice to make sure the skills are still available (it is webby) - eliminated Java because Java devs are typically expensive. Unfortunately I have next to zero experience with proper PHP development (just a few months spending a small percentage of my time on a Drupal project without any real coding). What are some things I can do to ensure that the code I leave behind is maintainable by a relatively low-skilled PHP developer (eg a teenager wanting to make some holiday cash)? Do I go with a CMS? Are Drupal developers cheap? Any other CMS / Framework I should look at? Background: the project is a website that people will search for educational information, with some simple user-management to only allow some users to create content, restrictions to specific content-types etc. The CMS vs write myself question is not the only thing I'm interested in hearing. I'm also interested in any tips about code style, anything you think my Java experience would push me towards that is going to make it difficult for the hypothetical volunteer etc. There's probably things about this scenario that I haven't thought through - so anything related to keeping maintenance costs low would be appreciated.


title: Reading a specific type of input from file

text: I have a software that reads from a file. Each object in the software takes 7 inputs viz.      `string string string float string float int`      I have an input file. It contains a number of input values. If input for one object is like: `hss cscf "serving cscf" 32.5 ims 112.134 124`      (Note: when an object's variable needs multi word string, I used "....", for single word string, it is without quotes) How can I read it using ifstream? (I searched google but didn't find.) I tried to read entire line using getline and but again got stuck when it came to find out whether its a single word or multi word input! I thought to read a line and then search char by char. If its '"', I know its a multi word. But I stuck when it comes to an integer or float. For `char`, you can use      `if(line[i]>='a'&&line[i]<='z')`      but how to go ahead when integer or float is the next value? Please give some suggestions for this.


title: What programming language generates fewest hard-to-find bugs?

text: What language, in your opinion, allows the average programmer to output features with the least amount of hard-to-find bugs? This is of course, a very broad question, and I'm interested in very broad and general answers and wisdoms. Personally I find that I spend very little time looking for strange bugs in Java and C# programs, while C++ code has its distinct set of recurring bugs, and Python/similar has its own set of common and silly bugs that would be detected by the compiler in other languages. Also I find it hard to consider functional languages in this regard, because I've never seen a big and complex program written in entirely functional code. Your input please. Edit: _Completely arbitrary clarification of hard-to-find bug: Takes more than 15 minutes to reproduce, or more than 1 hour to find cause of and fix._ Forgive me if this is a duplicate, but I didn't find anything on this specific topic.


title: Explain Cloud computing to Grandmother

text: Technically I understand what is cloud computing, but I'm having difficulties when trying to explain it to a layman. I am wondering if there are any good examples which could easily explain it.


title: Are there any Phone Interview equivalents to FizzBuzz?

text: I think FizzBuzz is a fine question to ask in an in-person interview with a whiteboard or pen and paper handy to determine whether or not a particular candidate is of bare-minimum competence. However, it does not work as well on phone interviews because any typing you hear could just as easily be the candidate's Googling for the answer (not to mention the fact that reading code over the phone is less than savory). **Are there any _phone-interview_ questions that are equivalent to FizzBuzz in the sense that an incompetent programmer will not be able to answer it correctly and a programmer of at least minimal competence will?** Given a choice, in my particular case I am curious about .NET-centric solutions, but since I was not able to find a duplicate to this question based on a cursory search, I would not mind at all if this question became the canonical source for platform-agnostic phone fizzbuzz questions.


title: Good coding problem/s to use in an interview

text: I've read a lot of different articles on how to locate good programmers, including the Joel Spolsky and Steve Yegge stuff. Overall I feel we have a pretty good interview process. We ask good questions and we have a coding test problem that we give to candidates to help screen out people that can't actually code; this problem takes a little while and is a "take home" where the candidate is given a few days to return a solution. Overall this process has worked fairly well with us, but we have still landed an occasional dud on the programming front. In at least one case I now suspect that the solution provided was not the candidate's own, but there would be no way to prove this out; nor would it matter as such. We are in an environment where once someone is hired it is incredibly difficult to let them go, so this makes it all the more critical we end up with a good candidate. So I would like to add a **coding exercise** into the actual interview and have the candidate work through a solution in a **pairing style environment** with an existing team member. I'm looking for something that is not terribly complex; something any **competent programmer could solve in about an hour** , but also something a little more difficult that the fizz-buzz problem. * * * I've looked at the following questions as well as other similar questions, but most are slightly different in that they are not asking for specific problems that could fit within the time constraints and are well suited to pairing, or I haven't really seen good answers provided. Code During Interview Favorite Interview Question Passionate Programmer? Fizz Buzz, really? And many many others...


title: How to protect yourself from being sued by patents?

text: I've had a few software ideas before that could probably be patented.(decided not to pursue any of them, however). Basically, I don't want these ideas patented though. I don't care if someone else implements them, I just don't want to get sued later by some patent troll who patented the idea I had and implemented 5 years ago. Would posting your idea to public websites, and using the poor man's patent technique ensure that even if someone else patents your idea, you have protection from being sued, and possibly the ability to invalidate their patent?(assuming the reform bill doesn't pass)


title: Component design: getting cohesion right

text: I currently have a set of components named DataValues, ValueParsers, ValueFormatters and ValueValidators. The first one defines an abstract base class DataValue and contains a whole load of implementations. The 3 other components each define in interface similar to their name (minus the "s"), and also contain a bunch of implementations of those. These 3 depend on DataValues. There are no further dependencies. In other words, each component currently contains a whole inheritance hierarchy. I recently re-watched EP16 of Robert C. Martin's Clean Coders, where he points out this is one of the most common mistakes made in package design. This made me realize that this exact thing is going on for the here described packages. The question then is how to best improve upon the current component design. Luckily none of those components have seen their first release yet, so things can still be moved around, and boundaries can still be redefined. Releases for these are on the horizon though, so I better get it right now. What I'm thinking of doing now is to create a new component to hold the mentioned abstract class and interfaces for all these components. It would also contain the Exceptions of these components and perhaps some trivial implementations of the interfaces. This new component would then be needed by all the current ones, and by all the ones needing the current ones. Then again, in this later category, there will be a number components that can just depend on the new and get rid of their current dependency on the much more concrete and unstable ones containing all the interface implementations. This is great for the stable dependencies principle, and equally nice for the reuse release equivalence principle. It's however doing rather bad when it comes to the common closure and common reuse principles. Concretely this means that components that need the ValueParsers interface but don't care about the ValueValidators one will still depend on it as it is in the same package. They can thus be affected by it for no good reason. Then again, considering how abstract/stable this new component ends up being, I don't really see this causing much problems. I'm looking for ideas on how to better draw the component boundaries and concerns or suggestions about the alternative I described.


title: How to deal with people who don't want to share knowledge?

text: > **Possible Duplicate:**   >  How do you deal with an information hoarder? Often, in IT teams knowledge equals power. This is fine as long as (IT-)knowledge is equally accessible by all members of the team and company specific know-how is well documented. Sometimes personnel in an IT department build up a tremendous amount of know-how _without_ documenting it. By doing so they think that they ensure their position. Often these people like it when people specifically have to ask them how to do a job. How do you get these programmers, database administrators or other IT staff to **_DOCUMENT_** their work and make it accessible to the company they work for? EDIT: It's a relief that so many of you _know_ this type of person. That it is not me bumping into them everywhere I do projects. On the other hand it makes me sad, such talented people but in many ways behaving as a child. I have seen the behavior in men and women btw. It is hard to pick one answer as the best and accept. Will do after more re-reads.


title: Architectural Patterns for a Game

text: So I've got a solution that contains a few big projects, which I'm trying to break down into smaller projects with more isolated responsibilities. This is a game I'm tinkering with -- I'm mainly a LOB developer and I think the principles are universal, so I'm hoping to learn something here. The dependencies in some of the objects are a bit too tightly intertwined, and I'm hoping for some help on how to untangle them. Or maybe some sort of pattern or abstraction that might make them more manageable. **Ares.Core.World** has classes in it like Creatures, Items, etc. All of them inherit from Entity, which is aware of what cell on the map it exist at. It accomplishes this by holding a reference to a Ares.Core.UI.MapControls.MapCell... And you can see that the wires are already getting crossed. **Ares.Core.UI.MapControls** contains Map and MapCell, each of which contain Lists of creatures and items that they contain. MapCell also inherits from Ares.Core.World.Entity since that solved a few early problems very elegantly -- for instance, all Entities have inventory. I would like to find a way to split UI and World out into seperate projects ( **Ares.World** and **Ares.UI** ) since UI and the overarching world should probably be seperate concerns. But as you can see, the way it is now the two projects would need to reference each other, and circular references are not allowed. I'm wondering if there are any architectural patterns out there that might help in this situation. Thanks!


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

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


title: Doing localization each Sprint

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


title: Should one time contributors be listed as an Author?

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


title: Why is a linked list implementation considered linear?

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


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

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


title: What does this duration reported by ffmpeg mean?

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


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

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


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

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


title: Do you develop with localization in mind?

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


title: What programming languages have you taught your children?

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


title: Authentication for users on a Single Page App?

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


title: Did jQuery kill the JavaScript discussions?

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


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

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


title: Silverlight - modularity. Best way to physically separate binaries?

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


title: Is Android a language or a framework/platform?

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


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

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


title: Commenting MVC applications

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


title: Self Documenting Code Vs. Commented Code

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


title: /*To Comment or Not To Comment...*/

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


title: XML and Registry

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


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

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


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

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


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

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


title: Who pays for learning curve?

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


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

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


title: Is this an implementation of the promise pattern?

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


title: Interpreting Date formats

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


title: How do I review my own code?

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


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

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


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

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


title: Holding mutable data in a single place

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


title: Are innovative programming languages too dangerous?

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


title: In which order should I do comparisons?

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


title: coding style for If condition

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


title: Boolean condition before variable

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


title: True/false on the left or the right?

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