What are the biggest differences between F# and Scala?

F# and Scala are both functional programming langugages that don't force the developer to only use immutable datatypes. They both have support for objects, can use libraries written in other languages and run on a virtual machine. Both languages seem to be based on ML. What are the biggest differences between F# and Scala despite the fact that F# is designed for .NET and Scala for the Java platform?


What skills (technologies) get outdated slower?

It's a common knowledge that since the IT industry develops very quickly, most of the skills get outdated fairly rapidly: jQuery, .NET, Ruby on Rails, etc. They change all the time so that it is difficult to keep track of them and especially learn them. Once I learn Ruby on Rails 3.2, Ruby on Rails 4 has appeared; the same thing for other frameworks and libraries. What skills (or rather, **technologies** ) get outdated slower and, at the same time, pretty useful in terms of being able to find a job? I figure these are knowing networks and algorithms. What else?


Browsing Prog.SE etc instead of paying attention to my degree

I've just realised that I've spent more time browsing Programmers.SE than actually doing the exercises I should be doing for my Computer Science degree this hour - they aren't coursework, just timetabled, supported, lab sessions - this time basic SQL SELECT statements. I already know SQL, but I have trouble writing syntactically correct statements first time. The exercises are along the form of "Write a query to get the names of all the pets born more than 10 years ago sorted by owner surname". Is it bad that I'm doing this? I think this is more useful than those exercises, but I'm not too sure.


Addressing a variable in VB

Why doesn't Visual Basic.NET have the _addressof_ operator like C#? In C#, one can               int i = 123;     int* addr = &i;      But VB has no equivalent counter part. It seems like it should be important. **UPDATE** Since there's some interest, Im copying my response to Strilanc below. > The case I ran into didnt necessitate pointers by any means, but I was > trying to trouble shoot a unit test that was failing and there was some > confusion over whether or not an object being used at one point in the stack > was the same object as an object several methods away.


block access to area/controller's methods but allow inherited controller to run methods, asp .net mvc5

I am trying to find out how to block a whole area/controller from being accessed by typing url website.com/area1/basecontroller/method1 (this area also contains the views that will be displayed) , while still being able to inherit said controller and use the method from original controller like so website.com/area2/extendedbasecontroller/method1. There would not be a method1 in the extendedbasecontroller, it would just perform method1 from the basecontroller Is it possible or could it be achieved in a different way?


Is MapReduce anything more than just an application of divide and conquer?

Dividing a problem to smaller ones until the individual problems can be solved independently and then combining them to answer the original question is known as the **divide and conquer** algorithm design technique. [See: Introduction to Algorithms by CLR] Recently, this approach to solve computational problems especially in the domain of very large data sets has been referred to as **MapReduce** rather than divide and conquer. My question is as follows: Is MapReduce anything more than a proprietary framework that relies on the divide and conquer approach, or are there details to it that make it unique in some respect?


Sometimes, people really have a bad day...   I think it's interesting to learn why that day was bad and learn from our mistakes made on that day. So... What was your worst software development day like?


"Testing Plan Lite" for web project

How do you draft a quick & easy "Testing Plan Lite" for a medium-sized web project (70k lines, 2 developers)? I've seen many tutorials/articles on methods of testing, but all seem cumbersome. For us, the goal is to be able to be able to divide up and delegate testing instructions to our friends for different project segments, browsers, etc. What's the quick & easy way to write test plans for web apps? (the 20 of the 20/80 rule) Thanks!


Feature organization / authentication?

Let's say I have a product that has different features, or different feature access depending on things (i.e Premium User, Beta, Demo, Logged-in User, etc..). What's the best way to organize a system to where it's not a set of static checks (i.e a bunch of if statements, for example)? The platform isn't important, I'm precisely asking for design principles / general design.


Why is Python written in C and not in C++?

In Python's tutorial one can read that Python's original implementation is in C; > On the other hand, the Python implementation, written in C, (...) I'm very curious why was Python written in C and not C++? I'd like to know the reasoning behind this decision and I'm looking for references to historic data.


Difference between sending a message and emitting it

Halfway through the RabbitMQ tutorial, I noticed that the tutorial stops referring to producers "sending" messages and starts using the verb "emit" instead — and pretty consistently, too; after the second tutorial, the verb "send" is no longer used to describe a producer transmitting messages. Example: Second Tutorial > The main idea behind Work Queues ... encapsulate a task as a message and > **send** it to the queue. A worker process running in the background .... Fourth Tutorial > We'll use this model for our logging system. ... Let's focus on **emitting** > logs first. What is the difference between sending a message vs. emitting one?


Enterprise application with lots of SQL queries

**Context:** I'm working on a fairly large Access database (which I inherited) that has its interface and tables separated. In order to make this work together, we have a lot of SQL queries (dozens). Some pointing to that database and some pointing to our datamarts. The code at this moment is somewhere around 12k-14k lines which is not huge by software development standard but not so short that I can just rewrite it. Additionally, that database is fed by a form which is distributed to all our internal clients. **My question:** I'm wondering what's the best way to deal with this. I'd like to know if there is a better way to manage all those queries than to have them in code in string variables. I'm sure it's possible to use files but then we have to distribute those files and that can't happen (i.e. I don't want users to have SQL queries wide open to them). Is there some clean (in terms of design) way to manage SQL queries that still has a decent amount of security (access to those queries) ? Just to be clear, we are using Access 2007 with VBA.


Is there any way to get faster app reviews?

I am trying to build a business around an iPhone app. The app will be our main sales channel, and being able to adapt the sales channel faster than the 9-10 days delay cause by the app review times is crucial. Therefore, I was wondering whether there is anything I can do to improve the speed of reviews. I am thinking that the publishers of Angry Birds, surely would not have to wait in line for reviews on the same terms as some obscure free app. So what can I do? Some things I am considering:   * Would Apple prioritize apps that they earn money on?   * Could I in some way pay Apple directly? I already know of the possibility of requesting an expedite review, but it seems like one can get punished for supplying a non-technical reason.


How significant are Spring and Hibernate in software development?

I am a software professional with about 1.6 years of experience in Java. Due to personal reasons, I had to quit my job, and now after 5 to 6 months, I am about start my career again. I am planning to attempt to take the SCJP exam, but some of my seniors suggested that I should learn Spring and Hibernate. I am totally new to Spring and Hibernate, but I am good in core Java concepts, servlets, and JSPs to some extent. Which option would help me securing a job fast? Do software companies not use Java and JDBC alone, without advanced concepts like EJBs, Struts, Spring, Hibernate, servlets, JSPs, etc? Is it enough for an individual to possess skills in Java alone by attempting to obtain the SCJP certification, or do you need advanced Java skills to secure a job?


How much pressure should programmers be under?

I have been blessed with an amazing workplace and my colleagues are really understanding.. However this is my first programming "gig" and i know some people aren't so lucky, Especially those who run their own company! (I've seen my boss work unhuman hours and go way beyond out of his way to make a customer happy.) The ugly truth is when your contracted by a big corporation, as we have been, you learn quickly that corporations don't care for clean readable code, programmer happiness, best practice or maintainability.. And they will call you on weekends.. At 3AM.. with 1 weeks worth of work they need for a meeting at 7AM!   1. How much pressure is normal for a programmer?   2. How much pressure should a programmer be under?


Bugs vs. Nonexistent Features

Is it fair to refer to a feature that has not yet been coded as a "bug"? For example, I am working on a project that involves three distinct features. If I only start one of them, is it correct to refer to the other two as bugs? Or do bugs only apply to features that have been coded and tested?


Design decision for implementing the cache re-arrange logic

I'm working on a webapp which has an existing framework to cache values from the database. I have a requirement which needs multiple values from the database and the values have to be rearranged/restructured so that it's easy for the UI framework to handle them. I'm unable to decide where to put this 'complex re-arranging' logic. Should I do it from the database queries itself? or   Should I create a combined cache i.e read values from other caches, rearrange data, then store the result in a new cache? or   Put the rearranging logic in the UI?


What functionality does dynamic typing allow?

I've been using python for a few days now and I think I understand the difference between dynamic and static typing. What I don't understand is under what circumstances it would be preferred. It is flexible and readable, but at the expense of more runtime checks and additional required unit testing. Aside from non-functional criteria like flexibility and readability, what reasons are there to choose dynamic typing? What can I do with dynamic typing that isn't possible otherwise? What specific code example can you think of that illustrates a concrete advantage of dynamic typing?


AS2 vs AS3 communication protocol difference. Server requirement

I'm researching what's needed for EDI as far as protocols and server/application setup. This is transportation industry and I'm interested in X12 format for transactions like 204, 210, 214. Specific question is: Do BOTH trading partners have to run servers? With AS3 it seems like SFTP server and it seems like one partner can run it and another partner can push/pull. What about AS2? Can it have server only on one side? Or both partners should be able to push?


Why are data structures so important in interviews?

I am a newbie into the corporate world recently graduated in computers. I am a java/groovy developer. I am a quick learner and I can learn new frameworks, APIs or even programming languages within considerably short amount of time. Albeit that, I must confess that I was not so strong in data structures when I graduated out of college. Through out the campus placements during my graduation, I've witnessed that most of the biggie tech companies like Amazon, Microsoft etc focused mainly on data structures. It appears as if data structures is the only thing that they expect from a graduate. Adding to this, I see that there is this general perspective that a good programmer is necessarily a one with good knowledge about data structures. To be honest, I felt bad about that. I write good code. I follow standard design patterns of coding, I do use data structures but at the superficial level as in java exposed APIs like ArrayLists, LinkedLists etc. But the companies usually focused on the intricate aspects of Data Structures like pointer based memory manipulation and time complexities. Probably because of my java-ish background, Back then, I understood code efficiency and logic only when talked in terms of Object Oriented Programming like Objects, instances, etc but I never drilled down into the level of bits and bytes. I did not want people to look down upon me for this knowledge deficit of mine in Data Structures. So really why all this emphasis on Data Structures? Does, Not having knowledge in Data Structures really effect one's career in programming? Or is the knowledge in this subject really a sufficient basis to differentiate a good and a bad programmer?


Am I going to damage my career if I switched to a completely different route?

I have been in the Java programming for the last 4 years, basically doing Java web development and JEE. I have spent the last 7 months investing in learning Objective-C and iOS development for fun. Now I'm considering to scout a professional iOS development career. My question is does iOS development career considered a serious profession (like Java or .NET)? Am I going to hurt my career in the long term if I switched to iOS development after four years in the popular platform?


Are There Any Examples of Uncle Bob's High-Falutin' Architecture?

I just finished watching this presentation by Uncle Bob (as well as his "Architecture" section of his "Clean Code" videos), but I'm left wondering: Are there any examples out there of applications that implement this Entity- Boundary-Interactor (or Entity-Boundary-Controller) structure? At one point I downloaded the source code to FitNesse (the acceptance testing project he mentions often as an example of not only high test coverage but good architecture, since they were able to defer the decision to not use a database until the very end), and based on a quick glance of it it appears even this project doesn't seem to fit this pattern. **Are there any nontrivial examples of this architecture out in the wild, or should I not bother even looking into it and chalk it up as "it would be great if you could get there, but nobody really does"?**


Uploading files(code) on a web server?

I have a very small and basic web site on a web server. Usually I'm doing the changes on a localhost where the development version is, and after that I upload it to the server with FileZilla. That's the very obvious way, but it's not the most convenient. I've worked with SVN, but I've never needed to set anything - just checkout, commit, update. Reading some tutorials I wonder is this the easier way to upload the files to a server? Or are there any easier?


Should we rename overloaded methods?

Assume an interface containing these methods :               Car find(long id);          List<Car> find(String model);      Is it better to rename them like this?               Car findById(long id);          List findByModel(String model);      Indeed, any developer who use this API won't need to look at the interface for knowing possible arguments of initial `find()` methods. So my question is more general : What is the benefit of using overloaded methods in code since it reduce readability?


Why are developer commit statistics harmful?

I have long believed (and heard from others) that keeping track of commit statistics, such as how many commits each developer makes per day, is harmful to the development process. The reason seems obvious - developers will commit in smaller increments, maximising their commit-per-day number, but making it harder to bisect (perhaps all their intermediate patches won't leave the repo well formed) and harder to work with the commit history (a change will suddenly be in multiple commits, instead of just one, reverting a patch is harder etc). Are there any studies that show commit statistics are harmful? Any elegant and well-argued article on the topic? Equally applicable would be anything about why measuring the wrong thing leads to people optimising the wrong thing, which this problem is just a special case of.


If you could ask one technical interview question, what would it be

First off, there are equally important questions for a candidate that are non- technical (do they work well with others, can they imagine a better approach, etc.). But to evaluate the technical skills, what would be your one question? I ask because I have one. I have no idea why this question works so well. I don't even have a good theory. All I have is an incredible correlation between answering this question correctly and being a really strong programmer. The question was suggested to me by someone I respect a lot. I replied that it seemed too easy but he suggested I try it. He's a smart & imaginative guy so I started asking it of people I interview. The interview process at virtually every company I have worked at has been 3 – 4 hours long. We ask basic programming, we ask brain teasers, we have them bring in some code they are proud of and spend 45 minutes having them take us through what they did and why. And 99% of the time, getting this question right or wrong predicts if they will pass the 3 – 4 hour process. Question: For the integers between 0 and 100 (i.e. 1, 2, 3, …, 100) – how many have the digit 7 in them? Answer at The Best Programming Interview Question – ever! (so you answer it yourself before seeing the answer).


Using the system tray / notification area app in Windows 7?

Many dekstop apps have this, such as dropbox (windows version). You right- click the dropbox systray icon and there are shortcuts to the features of the main app. Right now, I want to keep it simple and just want to run a exe(?) and have a custom icon appear in the system tray notification area. How do I build this?


Session management in a Service Oriented Architecture

Where should you manage a users session in a SOA? Should you manage it in the Web Service or in the client and why? My application is SPA (Considering that this will be the stacked that will be used Apache CXF for Web Services AngularJS for making REST calls)


Is there a canonical reference on GUI programming in Java?

I'm practicing Java in Netbeans. Is there a reference out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on GUI programming in Java? What about that reference makes it special?


The correct choice of tools for a new Deep Zoom application

I want to create a new application. It will basically be a Deep Zoom application that users can draw annotations on (that will save to a DB so other users can see those annotations.) At first it will just simply run in a browser. However, the app would be useful if it could be used by enthusiasts in the field, so ability to run on smartphones or other handheld devices would be massively beneficial. 3G/4G signal is likely to be practically non existent in those places, so having the ability to download all the images and info for an "area" would be good. I can't decide on which technology to use. Silverlight Deep Zoom apps look really nice in browsers, but I have heard that it is not a widely supported technology that MS might be ditching anyway and the only smartphones that would be capable of running Silverlight would be Windows phones = a very small share of the smartphone market. Flash will probably never run on iPhones/Apple products in general. So should I use HTML5? HTML5 all seems a little confusing to me at the moment, would it even be possible to make a HTML5 Deep Zoom application that users could annotate? Any thoughts and advice would be really handy, thanks for reading.


Computer Science graduate. Master or full-time job?

> **Possible Duplicate:**   >  Is a Master's worth it? I have just gotten my Bachelor's Degree in Computer Science and I have to make choice. Whether to continue with my full-time job I just got or put the job slightly in the background and concentrate on getting a Master's degree. I am currently working as an embedded C developer in a small company. The cool thing is that, because the team is quite small, my engineering ideas really play a part in the final product. Not to mention that I get to work on very different areas of embedded programming: device drivers and development of a Real Time OS. I am very enthusiastic about my job and what I do. On the other hand, in my country there isn't really a master's degree that focuses on embedded development so my gain from getting this degree will mainly in the field of general computer science knowledge. That being said, is it worth giving up all my spare time which I now use to study different areas of embedded devices and work mainly to get a degree rather than pure knowledge and experience in the field I want to work in?


Should developers be expected to compile an internal library before the actual program?

Recently a senior developer that I work with made a case for requiring that developers get the latest version and compile as part of their project a major internal library. This stands in contrast the the counter argument that project teams should be working off a stable version that they get from an internal Maven repository to which the developer argued that having the source code available on the developer machines saves time as they can read the libraries source code to determine if required functionality is available. Does the senior developer have a valid argument? Or is requiring developers to read the libraries source code run counter to the basic philosophy of encapsulation and even having the library in the first place?


How useful are compile-time functions?

How useful are compile time functions? Personally I haven't worked in any language that supports them but they seem nifty in some cases. For those who don't what I mean, a compile-time function is evaluated at compilation rather than at runtime, so if you have for instance in your code               int i =   Pow(4,34);      you could instead do something like this               int i =   Pow<compilation>(4,34);      and the actual runtime code would be                int i =   295147905179352825856;      Naturally there are some restrictions on what functions could be run at compile time, they pretty much have to be pure/static but I can also see some instances where it could be used to fetch data into something from a file or database (even though in most cases those things shouldn't be compiled into the code) What do you think, is a feature like that actually useful or just "cool"? :)


How do I approach fixing an unreproducible/randomly occurring bug?

We have a multilingual website in which a bug was discovered some days ago. It was displaying other language data in other language and also the mixture of data like English language was selected but it was displaying other language data as well in the page and vice-versa. It is doing it infrequently but is present in the website. Going through the code also doesn't help because this is not always occurring. Any suggestion in finding the issue in a timely manner? I am asking for strategies here.


What are the roles of singletons, abstract classes and interfaces?

I am studying OOP in C++ and, even though I am aware of the definitions of these 3 concepts, I cannot really realize when or how to use it. Let's use this class for the example:               class Person{         private:                  string name;                  int age;         public:                  Person(string p1, int p2){this->name=p1; this->age=p2;}                  ~Person(){}                       void set_name (string parameter){this->name=parameter;}                                   void set_age (int parameter){this->age=parameter;}                       string get_name (){return this->name;}                  int get_age (){return this->age;}                       };      1.Singleton **HOW** does the restriction of the class to have only one object work? **CAN** you design a class that would have **ONLY** 2 instances? Or maybe 3? **WHEN** is using a singleton recommended/necessary? Is it good practice? 2.Abstract Class As far as i know, if there's only one pure virtual function, the class becomes abstract. So, adding               virtual void print ()=0;      would do it, right? **WHY** would you need a class whose object is not required? 3.Interface If an interface is an abstract class in which all the methods are pure virtual functions, then **WHAT** is the main difference between the 2 of them? Thanks in advance!


How do I transparently cache data in intermediate stages of processing?

I am working with MATLAB on a model reduction algorithm. It is basically a data processing pipeline.               ckt = generate_ckt(ckt_properties);     freq = generate_fpoints(fconfig);     result = freq_dom_sim(ckt,freq);     red_ckt = run_PRIMA(ckt, red_order);      Each of these are potentially time consuming activities, being that the data I work with is pretty big (10000 × 10000 matrices). So in a previous implementation I had all of these as separate scripts that I had to execute one by one (manually or run a master script). Each of these stored the data in `.mat` files. The next program would read from this and write its own result in another directory. And so on. What I would like to use is a framework that can store the dependencies between various pieces of data, such that at any point of time I can just ask it to generate the output. It should :   1. Check if the variable is present in the workspace.   2. If it is, check if its consistent with the expected properties (check with the `config` data)   3. If not, load from file (the exact path to the file will be pre-specified).   4. Check if its consistent with the expected properties.   5. If not, compute it from the command associated with it. (pre-specified) I would like this to be recursive, so that effectively I run the last module and it automatically runs checks and actually computes only those pieces of data that are not already available and consistent. Can you give some suggestions on how to design this? If it is already called something (I assume it must) please point me to it.


Using the mouse as a multi-tool creates heavy conditional logic for executing commands, how do I change this?

The feature is in many different types of editing programs where a mouse click may have completely different commands to execute (using the Command Pattern) Currently I have an overarching `determineClickCommand(clickFocus)` function. The body essentially looked like this:               var command = null;     var args    = null;          if (clickFocus == x) {         if (x.state == state) {             args = // Code to detemine args             command = new CommandA(args)         } else {             command = new CommandB()         }     } else if (clickFocus == y) {         args = blahablah;         command = new CommandC(args)     } else if (clickFocus == z) {         command = new CommandD()     } ...etc..etc...etc...          command.execute()      Which was fine when I was prototyping, but I'd like a more elegant solution. Particularly since at some point, I'm going to want to take advantage of right-click/middle-click, which could add a third nested if statement My first idea is to create a `AbstractClickScope` class with a `determineClickCommand()` method to be overridden in each concrete scope subclass. This breaks the problem into more maintainable classes, but the extensive conditional logic is the exact same. And if I were to decide to have many 'scopes' then a new class each time would be very annoying. Or maybe have some sort of command factory class as opposed to a method? This isolates Command creation to a very specific part of the code. Any other ideas? Or known implementations? Just throwing ideas out there and looking for more info as I think through this.


Is there a way to track data structure dependencies from the database, through the tiers, all the way out to a web page?

When we design applications, we generally end up with the same tiered sets of data structures:   1. A persistent data structure that is described using DDL and implemented as RDBMS tables and columns.   2. A set of domain objects that consist primarily of data structures, usually combined with business-rule level logic, that are implemented in a programming language such as Java.   3. A set of service layer interfaces that directly support use case implementations (which use the domain data structures as parameters), implemented as EJBs or something equivalent in another programming language.   4. UI screens that allow users to **C** reate, **R** etrieve, **U** pdate, and (maybe) **D** elete all manner of data structures and graphs of data structures, with numerous screens and with multiple UI widgets, all structured to support the same data structures. But if you want to change the data structures in any of these tiers, it always seems _extremely_ difficult to assess the impact(s) the change will have across the application. UML can help, but tracing through diagram after diagram is not a real solution to this problem. The best I have ever seen was a homespun data tracking spreadsheet document that listed all of the data structures and walked the relationships from tier-to-tier. Is there a tool or accepted approach that makes it easy to identify a data structure in any tier and easily obtain a list of all dependent:   * database table and column data structures   * domain object data structures   * service layer interface methods and parameter data structures   * screen & UI component data structures


How do I know if I have enough unit test coverage to remove an integration test?

I'm working on a legacy system (by that I mean it was written without tests). We've tried to test some of the system by writing integration tests that test functionality from the outside. This gives me some confidence to refactor parts of the code without worry about breaking it. But the problem is these integration tests require a deploy (2+ minutes) and many minutes to run. Also, they are a pain to maintain. They each cover thousands of lines of code and when one of them breaks it can take hour(s) to debug why. I've been writing lots of unit tests for these functional changes I've been making lately, but before I commit I always do a new deploy and run all integration tests, just to make sure I didn't miss anything. At this point I know my unit tests and some of the integration tests are overlapping what they test. How do I know when my good unit tests are adequately covering a bad integration test so that I can delete that integration test?


How can I convince a team member to use a web framework?

The question is this and the detail follows: **is there anything I can say/bring up, as a programmer, to bring him to my side?** I'd love to hear valid arguments for both sides on this one, but mostly suggestions for how to talk him around. * * * My situation is this: I'm working on a team project on my degree course, building a mid-sized website as a prototype for the university. All are considered equals in the group and there is no one appointed leader so the answer to this problem can't be "pull rank". All are equals, however there is a huge gap in knowledge between members. The team member in question and I are both capable developers, though he holds no industry experience. The other three members are less capable, and two have opted out of development entirely. All three have declined to comment on the situation due to lack of knowledge. As as a group, we are coming to decide on what technologies to use in the implementation of the website; specifically, whether to use a PHP framework (Code Igniter) or not. I am arguing in favour, citing:   1. Not reinventing the wheel   2. Well written and tested code base to work from   3. Getting going (the deadline is closer than we'd like)   4. Speed of development   5. Sound and maintainable design patterns and good practices He is arguing in favour of working in the way he's used to:   * Writing bespoke, one-time functions in to a "library" file as when he needs them      * Functions for data access and rendering that data the page, getting/setting to and from session and get/post data etc   * Having 1 file per page (resulting in no separation of concerns amongst control, presentation and data) His reasons against using are framework are mostly based on him not being able to see the point: he can do all those things already. The framework doesn't change that, it just makes it harder because he has to learn the framework; he doesn't want to use code he hasn't personally written. He has also said that it "doesn't matter the quality of the code base, since the project is only a prototype and will never be maintained". For me, that is _no excuse_ to write unmaintainable code. I can see why he makes those arguments, but I hold issue with his "lack of concern over maintainability" and his "disregard for good design", or even separation of concerns. However, I suspect he has never studied design patterns, so I don't know how effective demonstrating why his method could prove unmaintainable would be. I want to get going on this project, but I don't want to do it without regard for everything I've learnt over the years. As I said before, there is no possibility of pulling rank here, nor are other team members willing to pitch in. Should I just back down and do things his way? Is he too stubborn and inexperienced to know better? Or am I being the stubborn one here? TL;DR Inexperienced team member is being stubborn, how can I win him over?


What questions should I ask on a work environment survey?

As a result of reading Peopleware, I'm thinking of sending a survey out to our programmers to determine how they feel about their office environment. One obvious question is whether the office is too noisy or not. **What other questions should I ask our programmers about their work environment?** I'll post the final survey I put together onto this thread.


Are high office partitions as effective as private offices?

I'm currently reading DeMarco and Lister's Peopleware, and I've been struck (as everyone is) by their comments about noise reduction via using private offices, and the effect this has on productivity. Private offices are probably not going to happen at my workplace, but I'm wondering if high cubicle partitions (say, 6 feet) might be nearly as good? I imagine they wouldn't deflect quite as much noise, but they would have _some_ effect. One down-side is that the center cubicles would have less natural light. That seems quite a big downer to me. I'd be interested to hear what peoples experiences are.


How to port cli c++ program with GNU libraries from windows to Linux

I need to implement some graph partitioning algorithms for my thesis. I have mostly Windows experience. I would like to know if it is hard to migrate c++ console program to Linux. I want to program it on Windows but I want to test and compile it on Linux as well. It will be pure cli application, with no use of windows APi or anything. I just need to use some external libraries. Specifically GNU linear programming kit and GNU scientific library GSL. I found out, there are windows versions of these libraries, what does it mean for me?, should I compile it on Windows with windows version package and on Linux with linux package. I would like someone to bring a bit clarity to this, I am really not very experienced programmer, so any advice will help. Also I would like to ask, if there is diference if I use Visual Studio for programming or some other IDE in matter of portability issues. Thanks in advance for any help.


Annexes in Ada95

I want to know the differences between normative and informative annexes in Ada 95. I am just able to find a list of each of them but not the differences. What are the differences?


Does JMF have support with Xuggler

i am working on a project consisting of sending and receiving streaming multimedia.So,i have installed JMF, but i have seen that JMF has 32 bit library as mine is 64 bit so i wanted to use Xuggler for streaming videos. Can anyone clarify me about the support of Java Media FrameWork with Xuggler..


Branch vs decision coverage question

ISTQB does not distinct between these (it reads "Branch/decision coverage") but some sources do say it is different. I would have two question. The essential one is about the difference. And the other one - does this whole concept belongs under the unit testing? Or white box testing? Thanks From the ISTQB: > branch coverage is closely related to decision coverage and at 100% coverage > they give exactly the same results. Decision coverage measures the coverage > of conditional branches; branch coverage measures the coverage of both > conditional and unconditional branches. The Syllabus uses decision coverage, > as it is the source of the branches. Some coverage measurement tools may > talk about branch coverage when they actually mean decision coverage. (c) > ISTQB foundation book.


The most unusual aspect of Python is that whitespace is significant   instead of block delimiters (braces → "{}" in the C family of languages), indentation is used to indicate where blocks begin and end.   how can python interpreter recognize code block ?


String Formatting with concatenation or substitution

This is a question about preferences. Assume a programming language offers these two options to make a string with some variables:   1. `"Hello, my name is ". name ." and I'm ". age ." years old."`   2. `StringFormat("Hello, my name is $0 and I'm $1 years old.", name, age)` Which do you prefer and why? I have found myself using both without any clear reason to pick either. Considering micro-optimizations is not within the scope of this question. **Localization** has been mentioned as a reason to go with option #2 and I think it's a very valid reason and deserves to be mentioned here. However, would opinions differ based on aesthetic viewpoints?


What language should I seek to learn if I would like to develop for Windows? Not command-line stuff (obviously, I guess) but with Windows Forms and such? I've used C before (when working with Rockbox), but that's it. Up until now, I've used Autoit (for basic, simple stuff), but I'm looking for something that has more flexibility and is popular inside of the PC software industry. Plus, I didn't like how easy it was to crack Autoit programs. I'm also a web developer/designer, just to throw that out there. Thanks in advance!


Weaknesses with different types of NoSQL databases

Here's my question: What are the weaknesses with different types of NoSQL databases? Specifically, what're the weaknesses of key-value stores, graph data stores and document stores? I've had an easy time finding strengths, but documents on weaknesses seem to be scarcer. Edit: In comparison to each other, and to relational databases.


How do I use programming experience at a non-programming position on my resume for a programming position?

I currently work in tier 2 support for an ISP, but don't want to remain here indefinitely. My overall ambition is to be a programmer as it is what I really love to do. The problem is that I came to this conclusion later in my career path and have had only the chance to go back to school to earn an AS in Computer Science and have had no positions as a programmer. Being out of college for a long time now makes it very hard to go after a low level position as I don't have a BS (and realistically at this point, it won't happen for a while, if at all) and employers only seem interested in fresh graduates. I have had the opportunity recently to work on some special projects at my current position that involve coding in my preferred languages to solve various problems. I have now written various tools using a multitude of languages to solve these problems. Now I am not necessarily what I would consider competent in these languages, but I can get around them and I know all the fundamentals (autoit, vb.net, python, perl, pascal, c#, php, batch, bash). I am also very good at finding a way to code what I need when I don't know upfront how to do it. I have some code samples for all these languages that I have used to solve problems at work. How do I incorporate this experience into my resume to be a more viable candidate for an entry level position?


Best approach to designing multi-client applications

I was wondering how you guys start out if you need to design a multi-client project where multiple clients can interact with a server. In specific how do you go about dealing with different states and message handling, how do you start designing and considering all these cases? For example a video webchat application where it is possible that you call another client, while that client is already in a call, or is stuck in a modal dialog such that the calling dialog does not come through.


The rule of 5 - to use it or not?

The rule of 3 (the rule of 5 in the new c++ standard) states : > If you need to explicitly declare either the destructor, copy constructor or > copy assignment operator yourself, you probably need to explicitly declare > all three of them. But, on the other hand, the Martin's "Clean Code" advises to remove all empty constructors and destructors (page 293, _G12:Clutter_ ) : > Of what use is a default constructor with no implementation? All it serves > to do is clutter up the code with meaningless artifacts. So, how to handle these two opposite opinions? Should empty constructors/destructors really be implemented? * * * Next example demonstrates exactly what I mean :               #include <iostream>     #include <memory>          struct A     {         A( const int value ) : v( new int( value ) ) {}         ~A(){}         A( const A & other ) : v( new int( *other.v ) ) {}         A& operator=( const A & other )         {             v.reset( new int( *other.v ) );             return *this;         }              std::auto_ptr< int > v;     };     int main()     {         const A a( 55 );         std::cout<< "a value = " << *a.v << std::endl;         A b(a);         std::cout<< "b value = " << *b.v << std::endl;         const A c(11);         std::cout<< "c value = " << *c.v << std::endl;         b = c;         std::cout<< "b new value = " << *b.v << std::endl;     }      Compiles fine using g++ 4.6.1 with :               g++ -std=c++0x -Wall -Wextra -pedantic example.cpp      The destructor for `struct A` is empty, and not really needed. So, should it be there, or should it be removed?


Making sure nobody has created an app for something before?

I've an idea for a smartphone game app. I want to make sure nobody has made an app like this before; how can I check that? I don't want to remake something that already exists now.


Does async/await makes simple thing unnecessary complicated?

After exposing to Windows App Store development for a month, I begin to feel that `async` / `await` programming model does more harm than good. **It makes simple thing complicated.** Take an example, folder creation. In Java or Desktop .NET, I can simply do ## Java               public Constructor()     {         new File("c:\\folder").mkdirs();         System.out.println("I am pretty sure c:\\folder is ready now");     }      ## Desktop .NET               Constructor()     {         System.IO.Directory.CreateDirectory("c:\\folder");         Console.WriteLine("I am pretty sure c:\\folder is ready now");     }      But when comes to ## Windows App Store .NET               Constructor()     {         // Damm it! Another async function? I don't need aysnc!         Windows.Storage.ApplicationData.Current.LocalFolder.CreateFolderAsync("c:\\folder", CreationCollisionOption.OpenIfExists);         // I am not sure c:\\folder is ready right now!         // OK. I know I can use ContinueWith. No no no. I don't want.         // Why I have to use ContinueWith with such a simple operation?     }      So, my question is, do you find the newly introduced `async` / `await` programming model in Windows App Store,   * Improve your productivity?   * Make programming life easier? **For me, I don't!** Perhaps I have been missing out certain useful techniques. I know, Microsoft says, it helps us to write responsive UI code. But I would say, **No thanks! Hey look, my code is already in non-UI code!** Most of my current operation code is fast enough and doesn't block UI. When my operation code is not fast enough, I am pretty comfortable in making those slow operation code run in separate Thread/ Task. Forcing me to use `async` / `await` which I do not need, only makes my code more complicated. **Message to Microsoft** : May I beg to you, besides async functions, can you provide a same set of non-async functions, please? I already build up my habit of running code in non-UI thread. I promise I will continue make your Windows App perform as smooth as iOS :)


When connecting to a server using the DRDA protocol, is it true that the first Client-To-Server command MUST be EXCSAT chained with ACCSEC? I found 2 different answers when I googled it. If you look at The Open Group web site (https://collaboration.opengroup.org/dbiop/) it can be understood that the answer is NO. However, if you look at the IBM website (http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.ims11.doc.apr%2Fims_ddm_excsat.htm) you can understand the answer is YES. So which is it?


If you have several SCRUM teams working on one backlog, how do you divide story point estimation between those teams?

I'm asking because approach in my company looks as follows:   * stories in the backlog are not estimated   * team that picks the story estimates it in story points during sprint planning part two


Best Practices for Corporate Sponsorship of Open Source Project

We are preparing to OpenSource our ASP.NET MVC multi-tenancy CMS. We currently use BitBucket.org to host our source repository and we are considering best approaches to repository naming. In terms of the user/host of the repository, We are debating using our company name which is the sponsor of the project versus the project name itself. The company name is JoyaTech Solutions, the project name is JoyaCMS. Do people think that having a company name as the user/owner of an open source project is a turn off or is there value in displaying that relationship?


Storing passwords for usage in scripts

There are few situations that require users to provide their password while automating things during development process. Site deployment is only one of the common situations. Creating dmg files under OS X requires password as well. Most of the command line utilities used in scripts has an ability to receive a password via stdin. Providing password each time the script is run kinda defeats the purpose of "automatic". Storing it plain text in the script defeats the purpose of "password". What is the most optimal approach to providing passwords to scripts that requires them?


What tools or way to start a web project

I am a sandwich training student in a company that has a little informatics service who develop web app Until today, they work with simple php, a little CSS and no version control. So, the code becomes unmaintainable. The project manager would like to use php object, and i am the only one with some knows in it. But i am still a beginner with no experience in web dev, and after some search i am afraid to building a php MVC alone. So my question is : Should i convince the team to start using a framework like symfony ( i'm feeling ok to use it ) with the big change it impose to the team, or simply bring a better work structure with version control and tools like an ORM ? Thanks for your help EDITED : with the hope it's now understandable


Why are there so few comments in C/C++ code?

I'm a web developer primarily, and I've been learning C/C++ and trying to get involved in some open source projects. Something I find very unusual is the lack of comments in C/C++ source code (I've looked at big projects like Linux, Varnish, and HipHopVM). In web development, I'm used to seeing a **lot** of comments in source code, and I tend to comment a lot as well. I assume it's a culture/attitude thing, as I posted some C code for review and a couple people said I had too many comments.


When the ScrumMaster is a technical leader, it's a good or a bad practice?

I know that the ScrumMaster should be a leader, but it's a good practice to have a technical leader as a ScrumMaster. For example: a coordinator.


Entity Translation Should be in the Data Layer or Business Layer

From my understanding I though the data layer should isolate the Data Technology from the rest of the application, for me this also include the schema in this case the data entity. Recently I've been looking at the Silk project from Patterns & Practices http://silk.codeplex.com/, and noticed that data entities are translated in the business layer rather than in the data layer. I think the advantage is that it avoid the data layer to reference an assembly containing the business model. However the fact that it expose data entities publicly is from my understanding a disadvantage because external components may be dependent of the data schema. I would like to understand why they translate data entities in the business layer and what are the advantages? I know that they use code first entity framework, so that the entities doesn't have data technology related dependency, however there responsibility is still to structure the data model not the business model. Thanks


What are the proper terms for desk/user testing?

Is there a common and accepted term for the manual tests done by programmers or users on software in lieu of or in addition to automated testing? For example, in a progression as follows:   1. "Desk Test" for the non-automated testing a programmer does while writing code.   2. "Unit Test" for an automated test for a particular class/method/function.   3. "Integration Test" for an automated test of multiple components working together.   4. "System Test" or "Acceptance Test" for application-wide tests that would be meaningful in conversation with the end user.   5. "User Test", for when we hand it to the user and ask them to find bugs. Are there better terms for #1 ("Desk Test") and #5 ("User Test")? (And I know that TDD would say write #2 before #1... but making that point is exactly why I want to know the right word for #1.)


Do I include third party classes in my UML class diagrams

I'm developing a system which involves 2 Android applications and a Java web application. For my UML class diagrams I have not included third party classes I use e.g. observer type interfaces. Should I include them? If so how can I differentiate between my entities (classes, interfaces, enums etc) and their entities? Thank you.


Can and do compilers convert recursive logic to equivalent non-recursive logic?

I've been learning F# and it's starting to influence how I think when I'm programming C#. To that end, I have been using recursion when I feel the result improves readability and I can't envision it winding out to a stack overflow. This leads me to ask whether or not compilers could automatically convert recursive functions to an equivalent non-recursive form?


Which of these old criticisms of common lisp still apply today?

In _A Critique of Common Lisp_ written by Rodney A. Brooks and Richard P. Gabriel from Stanford in 1984, some design decisions retained by the normalizing committee of Common Lisp are discussed. While most of the discussion remains valid, there are two statements that refer to the technology available at the time and may be false today. These two statements are: > Too many costs of the language were dismissed with the admonition that ‘any > good compiler’ can take care of them. No one has yet written—nor is likely > to without tremendous effort—a compiler that does a fraction of the tricks > expected of it. As I am a Common Lisp novice, or even an apprentice, I am not able to be more specific than the authors are. They seem to state that a great generality and flexibility has been built into several aspects of the language, which makes writing a good compiler quite difficult. > In COMMON LISP a little too much control was placed on floating-point > arithmetic. And certainly, although the correct behavior of a floating- > point-intensive program can be attained, the performance may vary wildly. As far I understand, it seems that writing efficient numerical code in Common Lisp is possible but more challenging than it has to be. This was thirty years ago. How should I regard these statement today if I am willing to write Common Lisp programs for one of the common free software implementations (CLISP, SBCL et al.)?


Which is the best book to learn Facebook App development and Facebook Graph API?


Conditional checks against a list

I was wondering how computers do this. The most logical way I can think is that they are iterating trough all elements of the list until they find one that matches the condition :) For example if you call `function_exists()`, PHP should iterate trough all defined functions until it meets the one that matches the name you're looking for. Is this true that this is the only way? If it is, it sounds like it's not very efficient :s


Prolog parallelism

Are there any prolog interpreters that can functionally decompose your 'programs' in order to improve efficiency? I know there's been research on prolog interpreters that reach near-C speeds through parallelism (the kind that a typical C programmer can't "see"). Does anyone know more about this topic?


try-catch in javascript... isn't it a good practice?

There is a provision for **try-catch** block in **javascript**. While in java or any other language it is mandatory to have error handling, I don't see anybody using them in javascript for greater extent. Isn't it a good practice or just we don't need them in javascript?


Synchronous vs. asynchronous for publish subscribe communication between JavaScript objects

I implemented the publish subscribe pattern in a JavaScript module to be used by entirely client-side oriented JavaScript objects. This module has nothing to do with client-server communications in any way, shape or form. My question is whether it's better for the publish method in such a module to be synchronous or asynchronous, and why. As a very simplified example let's say I'm building a custom UI for an HTML5 video player widget: One of my modules is the "video" module that contains the VIDEO element and handles the various features and events associated with that element. This would probably have a namespace something like "widgets.player.video." Another is the "controls" module that has the various buttons - play, pause, volume, scrub, fullscreen, etc. This might have a namespace along the lines of "widgets.player.controls." These two modules are children of a parent "player" module ("widgets.player" ??), and as such would have no inherent knowledge of each other when instantiated as children of the "player" object. The "controls" elements would obviously need to be able to effect some changes on the video (click "Play" and the video should play), and vice versa (video's "timeUpdate" event fires and the visual display of the current time in the controls should update). I could tightly couple these modules and pass references to each other, but I'd rather take a more loosely coupled approach by setting up a pubsub type module that both can subscribe to and publish from. SO (thanks for bearing with me) in this kind of a scenario is there an advantage one way or another for synchronous publication versus asynchronous publication? I've seen some solutions posted online that allow for either/or with a boolean flag whereas others automatically do it asynchronously. I haven't personally seen an implementation that just automatically goes with synchronous publication... is this because there's no advantage to it? I know that I can accomplish this with features provided by jQuery, but it seems that there may be too much overhead involved here. The publish subscribe pattern can be implemented with relatively lightweight code designed specifically for this particular purpose so I'd rather go with that then a more general purpose eventing system like jQuery's (which I'll use for more general eventing needs :-).


How are open-source projects able to sustain themselves?

I always had this question in mind but couldn't find a proper place to ask. There are some really nice and great open source free software available on the net. How do these products sustain themselves financially? It is one thing writing a small utility which does something nice but writing a complicated product with whole lot of features is a totally different ball game. So to repeat myself again, how do they work financially?


Can a programmer renounce ownership of source code?

I came across this license:               /**      * The author disclaims copyright to this source code. In place of      * a legal notice, here is a blessing:      *      * May you do good and not evil.      * May you find forgiveness for yourself and forgive others.      * May you share freely, never taking more than you give.      */      Would this have the same legal bearing as the WTFPL license?


UML diagrams for small projects

All of a sudden the need for proper formal documentation has become a thing in our organization. A lot of work I do are enhancements and addition to an existing system. Generally a quick fix or a new method, etc. I am just not sure what kind of diagrams I should/could use for small projects. For instance I am adding a new functionality to an existing system that verifies format of a field and they want proper "Component design description with diagrams" for a simple regex that verifies format of one field. In the past we only did pseudocode and that was enough for such projects as the system is somewhat legacy with very little original documentation.


What does Google or Microsoft get by hosting JS files on their Content Delivery Networks (CDN)?

As you know Google, Microsoft and jQuery.com offer JS files on their CDN. To do this, they must need to operate significant servers which must come at a cost to them. Why do they do this and what do they get from it?


.NET CQRS Frameworks nCQRS vs Lokad.CQRS

For the last couple of weeks I've been reading up and watching any resources I can find on CQRS. I really like the concept and am keen to start delving deeper. I have only found 2 major .NET frameworks for CQRS and I am trying to evaluate the differences between them. I am looking to implement CQRS on a noSql db, most likely RavenDB. Lokad seems very focused on windows Azure, not sure if it supports Raven. It has extensive documentation but not a lot of activity in the community. nCQRS has a lot of activety and supports Raven. I was wondering if anyone has any experience working with these two frameworks and what the major differences are between them.


Must OpenCL code be compiled for a specific GPU?

Most OpenCL Tutorials give a nice introduction to OpenCL, yet I have not found information on the question of interoperability of the compilation targets. It seems that I have to compile OpenCL code for the target GPU. Now when making a binary distribution of an application using OpenCL, does one have to make several builds for the vendor-platforms?


Java exception redundancy

To what extent should one make exceptions redundant or atomic to a method. For instance, suppose I have a method `public void authenticate(String username, String password)` that calls `private void invokeServer(String username, String password)`. Both methods require those params to be non-zero length, and as such I would raise a `NullPointerException` if needed. Should I sanity check in `invokeServer` as well as `authenticate` on the basis that it could potentially be used independently at a later date?


Can we develop ASP.NET MVC application with MySQL as the database?

I have mostly seen ASP.NET websites using MSSQL as database. Even I developed one some time ago. Why only MSSQL, when MySQL, a free alternative is available. So, the question is, IS it possible to integrate a MySQL database as easily as MSSQL with ASP.NET application or we need to use some API for doing so ??


How do you decide between putting the code in the database or putting the code in the application?

For the sake of argument:   * Let's assume the application we are building is an amortization schedule.    * Let's also assume that the database has a table called tblAmortizationPayments that stores the information about each monthly payment in a separate row.    * Let's further assume that the database language can support the math calculations needed to perform the calculations. If you were to build this amortization schedule for a 30 year mortgage, how would you decide between placing the code for performing these 360 calculations inside the database (I'm assuming this would be a stored procedure) or inside the application? I'm more interested in your thought process for making this type of decision or any similar scenario that might come along.


Rationale behind C library functions never setting errno to zero

The C standard mandates that no C standard library functions shall set `errno` to zero. Why exactly is this? I could understand it being useful for calling several functions, and only checking `errno` after the last one - for example:               errno = 0;     double x = strtod(str1, NULL);     long y = strtol(str2, NULL);     if (errno)         // either "strtod" or "strtol" failed     else         // both succeeded      However, is this not considered "bad practice"? Since you're only checking `errno` at the very end, you only know that one of the functions _did_ fail, but not _which_ function failed. Is simply knowing that _something_ failed good enough for most practical programs? I tried looking for various C Rationale documents, but many of them don't have much detail for `<errno.h>`.


Difference between DevOps and Software Configuration Management

What is the difference between Development Operations and Software Configuration Management? For me it seems to be the same as long as both DevOps and Software Configuration Management are focused on:   1. Establishing **development infrastructure** \- being in charge of version _control, build management, deployment management, dependencies management, continuous integration and delivery_ , etc.    2. Using best practices for organizing **developers environment**.   3. **Quality Assurance** of development processes - gathering metrics of development effectiveness, working on eliminating bottlenecks of development process (running unit-tests, evaluating unit-tests coverage, running inspections, etc)   4. **Infrastructure management** \- target platforms and its specifics.   5. **Release management** \- making sure release has been delivered to customer/client in time. Maybe I'm missing something? This link shows that usage of term 'Software Configuration Management' prevails. But still, what word combination would you rather use to describe listed range of activities: **Development Operations** or **Software Configuration Management**?


JQuery / JSON + .Net Service Layer - to WCF or Not to WCF?

I Recently had a discussion with a colleague of mine about the pros / cons of WCF. He mentioned about how much code is generated to support WCF, and also the overhead required. It was mentioned that a simple jQuery /Ajax post to a .aspx page (or a handler for that matter) that returns JSON would work more efficiently and takes much less code to implement. I am also aware of the new WCF Web API and feel that technology may solve the "bloated"-ness required in attaining a proxy etc... by just outputting JSON. So when developing a relational DB (MSSQL) storage model, with a fairly complex Business Layer (C#) and Data Access Layer (EntityFW).. what's a good technology for creating a "service layer" which will spit out View Models represented in JSON, with a CQRS(Command Query..) approach in mind.. The app would use the service layer to support it's required UI, as well as provide an available subset of services (outputting JSON data) for service subscribers.. In other words an admin panel to support the admin UI, and service endpoints that return JSON to access the configurations made from the administration UI. What are some potential technologies to use as the transport / communication layer. I'd like to use a pure RESTful approach, but am not against doing some URL rewriting with IIS. Obviously some of the available technologies are: WCF   WCF Web API (should this even be separate?)   Straight request / response (query string to .aspx / handler)   Would using MVC .Net solve this entire problem? maybe their single page app approach? any suggestions / feedback from developing this type of application? Thanks,


Do you have any techniques to help you get started in the morning?

I'm not a morning person. I got into the habit of working from 10 to 7/8, sometimes 9. Nevertheless, many of the places I've worked for have asked for something more like 8 to 6 or 9 to 6. Honestly, I have a real tough time getting my brain going in the morning and getting into the code. Once I do, I can concentrate for a long time and be quite productive. It's getting into the code and starting to get going with it that I have trouble with. Sometimes I will waste time in the morning just because I can't focus on the problem (yes, I am writing this in the morning). I've put all my busy work in the morning, but as a developer, I don't have a lot of busy work. It kind of becomes a self reinforcing thing; because you don't get things done in the morning, you have to stay later. Because you have to stay later, then its harder to get started the next morning, etc. Do other people have trouble with this? If so, any techniques you've learned? Thanks!


Understanding Cyclomatic Complexity

I've recently come across Cyclomatic Complexity and I'd like to try to understand it better. What are some practical coding examples of the different factors that go into calculating the complexity? Specifically, for the Wikipedia equation of `M = E − N + 2P`, I want to better understand what each of the following terms means:   * E = the number of edges of the graph   * N = the number of nodes of the graph   * P = the number of connected components I suspect that either _E_ or _N_ may be the number of decision points (if, else if, for, foreach, etc) in a block of code, but I'm not quite sure which is which or what the other signifies. I'm also guessing that _P_ refers to function calls and class instantiations, but there isn't a clear definition given that I can see. If someone could shed a little more light with some clear code examples of each, it would help. As a follow-up, does the Cyclomatic Complexity directly correlate to the number of unit tests needed for 100% path coverage? As an example, does a method with a complexity of 4 indicate that 4 unit tests are needed to cover that method? Finally, do regular expressions affect Cyclomatic Complexity, and if so, how?


When using membership provider, do you use the user ID or the username?

I've come across this is in a couple of different applications that I've worked on. They all used the ASP.NET Membership Provider for user accounts and controlling access to certain areas, but when we've gotten down into the code I've noticed that in one we're passing around the string based username, like "Ralph Waters", or we're passing around the Guid based user ID from the membership table. Now both seem to work. You can make methods which get by username, or get by user ID, but both have felt somewhat "funny". When you pass a string like "Ralph Waters" you're passing essentially two separate words that make up a unique identifier. And with a Guid, you're passing around a string/number combination which can be cast and made unique. So my question is this; when using Membership Provider, which do you use, the username or the user ID to get back to the user? Thanks all!


Date as software version number

Software developers don't typically use date as version number, though YYYYMMDD format (or its variances) looks solid enough to use. Is there anything wrong with that scheme? Or does it apply to limited 'types' of software only (like in-house productions)?


Is HTML5 usable for syncing data between devices?

I work for an insurance company. They have a contact database that gets pushed to the field agents by Lotus Notes. We're trying to move away from Lotus Notes, but we first have to remove our dependency on it. It has been suggested that a HTML5 solution could provide offline access to agent contacts and be used to sync changed from the server down and the client up. It is my understanding that the SQL storage capabilities of HTML5 aren't fully implemented (IE and Firefox apparently don't support yet per one site I read.) LocalStorage may not be robust enough for the data we need to sync since the size limit is relatively small. Is HTML5 a feasible solution to this issue or should we track down some kind of syncing solution? (I've been reading about one from the Ubuntu folks and Microsoft's, as well.) Thanks!


Should one avoid or be careful with C99 features in C code?

Some seem to say that one should avoid C99 features in C code as compilers don't really support those features. C99 is a standard from 1999, shouldn't these features be quite widespread now? Should one avoid using C99 features in new code? In legacy code? I happen to use some C99 features quite often, should I stop doing that or be more careful with the use of those features?


problem with High Cohesion - DRY principle across components

In our company we have to follow a rigid cycle of:   1. Requirement Analysis Document(Use Case Document).   2. Design Document (first High level then Low level)   3. Coding according to the document.   4. Unit Testing.   5. QA team then does testing **Abstract:** It all started when we developed a component in the initial lifecycle of project. The component consisted of its own domain layer/business layer, data layer, interfaces ... etc. After say around a month we had to create a new component due to some other given requirements, it also consisted of its own domain layer/business layer, data layer, interfaces ... etc. There is a Common Component in our solution where we keep all common methods/classes in the entire solution. We kept on developing second component as the requirements were coming and we were providing new features in that component, as a result the design also started evolving in this component. The first component was kept untouched, with old design. There were however some classes/interfaces that were mostly similar but duplicated violating DRY. * * * **Question:** Is it ok to just add reference of the business layer, data layer or "other relevant components" of Component2 in Component1, does this approach adhere to any **architecture/ software design best practices**? Or The common classes/methods should be promoted to common component where they could be used by other components (following DRY principle)? * * * With first approach it seems that my component/ solution will be in a danger of Big ball of mud. With second approach it seems that if a class is used in more than one component it should be promoted to Common component. Doesn't this violate High cohesion principle So, long story short **I am asking for any expert advice on the two mentioned approaches or may be another one from software professionals/ architects**. Since this is a common problem which every software product faces, so how to tackle it?


What is this variation of MVC in JavaScript?

I am working on sorting out my **Javascript** code. Currently I have views implemented without any Model or collection. Now I working on separating Model from View. So for this transformation, I am planning as follows:                        View --->  X  <--- | ---> Server               <  Client side  >      Assumptions:   1. View will not have any data that is to be loaded form server.   2. X will talk to server and get the required data. Then X will fire event.   3. View will listen to events and update themselves accordingly.   4. X is not an exact replica of some entity on server. X will just take those entities/ data from server and then View can request this data from X.   5. There will be exactly one X for each View. Now question is -- What is X called?   Options -- Model, Controller, ViewModel, Presenter, or anything else.   Or Is this very crude thing which can not have terminology?


Which class to start TDD of card game application? What's the next 5-7 tests?

I have started to write card game applications. Some model classes:   * CardSuit, CardValue, Card   * Deck, IDeckCreator, RegularDeckCreator, DoubleDeckCreator   * Board   * Hand and some game classes:   * Turn, TurnHandler   * IPlayer, ComputerPlayer, HumanPlayer   * IAttackStrategy, SimpleAttachStrategy, IDefenceStrategy, SimpleDefenceStrategy   * GameData, Game are already written. My idea is to create engine, where two computer players could play game and then later I could add UI part. Already for some time I'm reading about Test Driven Development (TDD) and I have idea to start writing application from scratch, as currently I have tendency to write not needed code, which seems usable in future. Also code doesn't have any tests and it is hard to add them now. Seems that TDD could improve all these issue - minimum of needed code, good test coverage and also could help to come to right application design. But I have one issue - I can't decide from where to start TDD? Should I start from bottom - Card related classes or somewhere on top - Game, TurnHandler, ... ? **With which class you would start? And what would be the next 5 to 7 tests?** _(use the card game you know the best)_ I would like to start TDD with your help and then continue on my own!


Portfolio Snippets

I just got out of school. And was about to make my portfolio.... but really all my code looks so simple that I wonder what are good enough code snippets to add to a portfolio ??? Or is my view of grandeur so high that I am just over thinking this.... And I say snippets because well no one wants to look at a project right ? and there is also all those nda's which are a pain... Please if you can include examples, would be great, especially portfolio snippet examples as I can get at a look at how they present it. thanks...


Why is using classic for loops as iterators in stl considered bad?

I've read a couple of articles (example) that consider the classic `for (int ...... size() .... i++)` loop bad practice when iterating through for example vectors in stl. Instead the recommended why is to use vector iterators, i.e. `begin, end`, etc. Why is that?


When are RPC-ish approaches more appropriate than REST?

After watching this talk on REST, Reuse and Serendipity by Steve Vinoski, I wonder if there are business cases in _greenfield_ projects for (XML-)RPC-ish setups, that REST could not solve in a better way. A few RPC-Problems he mentions:   * Focus on language (fit the distributed system to the language, not the other way around)   * "Make it look local" (and cope with failure and latency as exceptions rather than the rule)   * intended to be language-independent, but still has "function calls" across languages as main ingredient   * IDL boilerplate   * Illusion of type safety   * and a few more ... * * * Just to dramatize it a bit, some Google Instant result for RPC vs REST: ![RPC](http://i.stack.imgur.com/jkIJ3.png) ![REST](http://i.stack.imgur.com/F9C2z.png)


Are there published guidelines, standards, or references that propose more than 80 chars per line?

Despite increases in screen size and resolution, many sources still suggest that code be limited to 80 characters per line. I realize than there are many different opinions on this subject, but I wonder whether there are any standards bodies or influential firms that use other limits (120 characters is a common alternative). For example, are any standards bodies considering "enlarging" the suggested limit? Are there large scale software projects (e.g. at NASA or ESA) that use larger limits? > Note: This is not yet another question about what individuals do, or about > related opinions, though I'd welcome such information as _comments_. This is > a specific question about whether there is any indication that standard > practice or recommendations (in the form of specific examples) is likely to > change soon.


How do you price your work?

Well, let me explain : This has really been an issue for me, for such a long time. And what is worse - since coding is something I simply _ADORE_ (I would definitely do it, even if there was no payment involved whatsoever..) - is that I always end up feeling somewhat awkward... Anyway... **So, here's the deal :** You start working on a project, you may have something in your mind, and even if you're lucky enough and the client needs no " **cost estimates** " beforehand, sooner or later you'll face the ultimate dilemma of pricing your own work. * * * **So, how do YOU do it?**   * By estimating the **time** you put into it? _(obviously, this is not exact, 'coz perhaps a more capable coder will need much less time for the very same thing than a not-so-competent coder + even the very same coder may not "perform" equally at all times)_   * By the **Lines of code** you've written? _(obviously, this is not a measure either : a 10-line script that does exactly the same with a 1000-line script is, at least for me, "better")_   * By taking into account the level of **complexity** of the project and, perhaps, how specialised the subject is?   * By taking into account other factors? _(e.g. the **value** of the project for your customer)_


Are developers expected to have skills of business analysts?

Our business analyst has left the team. We are now expected to do the work which was previously done by the business analyst, and the management thinks that a task which is done in three months by a business analyst can be done in one month by a developer. My experience is in programming only, and I'm not familiar to the business intelligence tools. To me this seems like maybe an unfair comparison or expectation, and might even trivialize the role of a business analyst. Has anyone else encountered this situation? How to deal with it?


C++ 'using': Should I use it or should I avoid it?

I realize there are subtly different semantics for some of these, because of ADL. In general, though: Which one should I prefer (if any), and why?   (Or does it depend on the situation (e.g. inline header vs. implementation?) Also: should I prefer `::std::` over `std::`?               using namespace std;          pair<string::const_iterator, string::const_iterator> f(const string &s)     {         return make_pair(s.begin(), s.end());     }      or               std::pair<std::string::const_iterator, std::string::const_iterator> f(const std::string &s)     {         return std::make_pair(s.begin(), s.end());     }      or               using std::pair;     using std::string;          pair<string::const_iterator, string::const_iterator> f(const string &s)     {         return make_pair(s.begin(), s.end());     }      or               std::pair<std::string::const_iterator, std::string::const_iterator> f(const std::string &s)     {         using std::make_pair;         return make_pair(s.begin(), s.end());     }      or               std::pair<std::string::const_iterator, std::string::const_iterator> f(const std::string &s)     {         using namespace std;         return make_pair(s.begin(), s.end());     }      or something else? (This is assuming I don't have C++11 and `auto`.)


Is using unit tests to tell a story a good idea?

So, I have an authentication module I wrote some time ago. Now I'm seeing the errors of my way and writing unit tests for it. While writing unit tests, I have a hard time coming up with good names and good areas to test. For instance, I have things like   * RequiresLogin_should_redirect_when_not_logged_in   * RequiresLogin_should_pass_through_when_logged_in   * Login_should_work_when_given_proper_credentials Personally, I think it's a bit ugly, even though it seems "proper". I also have trouble differentiating between tests by just scanning over them (I have to read the method name at least twice to know what just failed) So, I thought that maybe instead of writing tests that purely test functionality, maybe write a set of tests that cover scenarios. For instance, this is a test stub I came up with:               public class Authentication_Bill     {         public void Bill_has_no_account()          { //assert username "bill" not in UserStore         }         public void Bill_attempts_to_post_comment_but_is_redirected_to_login()         { //Calls RequiredLogin and should redirect to login page         }         public void Bill_creates_account()         { //pretend the login page doubled as registration and he made an account. Add the account here         }         public void Bill_logs_in_with_new_account()         { //Login("bill", "password"). Assert not redirected to login page         }         public void Bill_can_now_post_comment()         { //Calls RequiredLogin, but should not kill request or redirect to login page         }     }      Is this a heard of pattern? I've seen acceptance stories and such, but this is fundamentally different. The big difference is that I'm coming up with scenarios to "force" the tests out. Rather than manually trying to come up with possible interactions that I'll need to test. Also, I know that this encourages unit tests that don't test exactly one method and class. I think this is OK though. Also, I'm aware that this will cause problems for at least some testing frameworks, as they usually assume that tests are independent from each other and order doesn't matter(where it would in this case). Anyway, is this an advisable pattern at all? Or, would this be a perfect fit for integration tests of my API rather than as "unit" tests? This is just in a personal project, so I'm open to experiments that may or may not go well.


Which useful alternative control structures do you know?

Similar question was closed on SO. Sometimes when we're programming, we find that some particular control structure would be very useful to us, but is not directly available in our programming language. **What alternative control structures do you think are a useful way of organizing computation?** The goal here is to get new ways of thinking about structuring code, in order to improve chunking and reasoning. You can create a wishful syntax/semantic not available now or cite a less known control structure on an existent programming language. Answers should give ideas for a new programming language or enhancing an actual language. Think of this as brainstorming, so post something you think is a crazy idea but it can be viable in some scenario. It's about imperative programming.


Which of these OOP examples demonstrate proper OOP concepts?

I'm still trying to wrap my head around OOP. All of the following examples work, of course, but is there one (or possibly another) that best exemplifies OOP concepts?               /**      * For the following examples the Image class queries an image      * and associated info from a database, which is passed on      * instantiation via dependency injection.      */          $image = new Image(new Db());      **Example 1:**               if ($image->setImageId($id, $size)) {         header('content-type: ' . $image->content_type);         header('content-length: ' . $image->length);         echo $image->getBytes();     }      **Example 2:**               if ($image_info = $image->getImageInfoByIdAndSize($id, $size)) {         header('content-type: ' . $image_info->content_type);         header('content-length: ' . $image_info->length);         echo $image->getImageBytesByIdAndSize($id, $size);     }      **Example 3:**               $image->setImageIdAndSize($id, $size);          if ($image_info = $image->getImageInfo()) {         header('content-type: ' . $image_info->content_type);         header('content-length: ' . $image_info->length);         echo $image->getImageBytes();     }


Does map-reduce transmit the data and executable instructions?

When map-reduce divides a task and sends the data to each worker process, does it also transmit the instructions for how to operate on the data? For example, let's say Google has some huge array of computers that use map- reduce to index webpages. If they wanted to temporarily use that same array of systems to do something else, would they have to reconfigure each system manually, or does map-reduce handle transmitting the new executable instructions to the workers?


Company wants to write custom project management tool, rather than use third party product

At the company I work, we are really wanting to get into the agile methodology for developing software. One thing that I'm not excited about is the fact that management wants us to build a custom project management feature inside the company's Intranet. I think this is a total waste of time. There are many great third party tools available (e.g. Axosoft OnTime) that can do everything we need, and more. For how much development time it would cost us to build our own project management module, we could buy numerous licenses for a third party product. One concern is that, whilst we are writing code for a client, and using our custom Intranet project management module, we find bugs in the module that need fixing ASAP. That means having to stop work on the client code to fix the Intranet. That just puts shivers down my spine. Another worry I have is lack of functionality. This custom module is going to be so basic, that it will just feel really crap to use. That might sound a bit snooty, but for goodness sake, many third party tools are so feature rich, that the idea of having to write our own tool makes feel very uneasy. In fact, I can't be bothered. What do you guys think? I'm going to raise this issue with my boss, since I feel it's such an important topic to talk about. EDIT: Thanks for the great responses, much appreciated. To summarize some of them: **Money** Naturally my boss does want to save money, by not forking out a few hundred £'s for licenses. However, for us to write a custom tool, it will take x number of days, multiplied by approx £500, which is our costs. I don't see the business value in this. Management have mentioned that they want to sell the Intranet as a product in the future, but it's so custom to our needs (and downright basic), that in order to give it to another client, I can see us having to fork a version of the code and rebuild the majority of it anyway. So it's not like we're gaining anything there in reuse. **Features** Having our own custom module means not feature bloat - only the functionality we require will be in the product. My issue is that there are plenty of free, open-source project management tools out there with minimal features already. So even if cost is an issue, we could look into open-source. Again it all boils down to the fact that I don't see the point in writing a project management tool in this day and age. It's a bit like writing your own web browser - why?, what's the point? Although management are asking for this tool, just because they are, it does not mean I'm going to please them and do it just because they asked for it. If something does not make sense, then I will raise it as a concern. At the end of the day, it's the developers who write the code, it's the developers who make money for a business. Thus, as far I'm concerned, the devs have a very big role in deciding how a company should manage projects and what tools are used. "I am Spartan, argh!" :) Hmm, I've not been able to make this question a wiki for some reason, thus I'm going to have to pick an answer to accept. Edit: I had a meeting with my boss today. I told about my concerns on us writing a custom tool from scratch. I even showed him OnTime 2010, plus I ran an OnTime SDK example project which showed we could write our own custom code to interact with the data and do whatever we want. I showed all the lists, features, I could think of. But he wasn't convinced. Un-f@king-believable! :( So we will have to write everything from scratch, knowing full well that we could just buy a tool of the shelf to do the job. There's a lot of swear words I could use right now to describe how I'm feeling!


What does a student do at Microsoft Developer Community

I am studying Software Engineering and I am currently in 4th semester. I was asked represent my college as a Microsoft Student Partner. I refused because it was mostly organizing event. Later I was selected by Microsoft to be in Microsoft Developer Community. I know little about my role, if I have any, and do not know what I have to do or learn for this selection. I know that I was selected because of my GPA. I have been told to excel at Microsoft technologies by my professor and nothing much information is yet made available. Also I have been told that Microsoft has my information! I am asking here in advance because I do not want to get caught in a situation where Microsoft comes asking me to compete at a programming event or show up some relevant work and I am still not prepared for such a event. What is the role or expectation from students who are selected in Microsoft's Developer Community. Can I contact Microsoft directly to ask about it, how can I do that. Also do I get an account or some ID from Microsoft to access some website?


How to process large files in NetLogo?

I am running into problems in NetLogo with large *.csv / *.txt files. The documents can consist of about 1 million data sets and I need to read them (to eventually create a diagram based on the data). With the most straightforward source code, my program needs about 2 minutes to process these files. How should I approach reading such large data files faster in NetLogo? Is NetLogo even suitable for such tasks (as it seems to be designed more for teaching and learning)?


Developing a dynamic site with Node.js

I'm trying to get some pointers on what the best methodology to follow for a web application would be. First, some background: I've built two different APIs using Node.js where Node serves the data to clients using a JSON interface. The clients have both been iOS applications, making heavy use of Socket.io and Express. Now, I'm trying to get into the world of website development- I'd like to be able to create a single-page application that is run in the browser, again using Socket.io and Express. However, I'm hung up a bit on what exactly I should do.   * Should I host my site out of Nginx/Apache and use Node as simply a "data" server, funneling data through JavaScript on the client to update the site HTML?   * Should I host it all through Node, adding routes for files as I go?   * Should I attempt to create some form of "send a command via Socket.io to the client JS to build the page dynamically" type of framework?   * Should I do something else entirely? Basically, I'm an iOS and API developer unused to web technologies overall, trying to figure out how best to use what I know about Node's data serving methodology and apply it to a client side web app. I've been reading tons of information online and, while helpful, it seems that everything seems to assume that I know a lot about web development already and am just trying to adapt it to Node, whereas instead the opposite is true: I know about Node but not about web development. I've looked into the MEAN stack, for example, and while I love the concept it doesn't appear (at first blush) that Angular is any more suited to Node than, say, jQuery (I'm sure I'm wrong here- there must be some reason 'MEAN' is a thing). Any input is greatly appreciated!


Is script grouping and minification counter-productive?

On a web page I have 1 script tag that contains all my minified JavaScript (I use SquishIt for .NET). However I see that a few people prefer to load their scripts in parallel using something like requirejs or headjs. I was wondering which is better for performance and whether combining and minifying all my JavaScript is worth the effort?


Problem understanding what "Exporting functions means"

I cannot understand what the following means "ISAPI applications can be written using any language which allows the export of standard C functions, for instance C, C++, Delphi." What is "allowing export of C/C++/Delphi functions" ? P.S. I am very very new.


Is there a pattern or best practice for passing a reference type to multiple classes vs a static class?

My .NET application creates HTML files, and as such, the structure looks like               variable myData     BuildHomePage()     variable graph = new BuildGraphPage(myData)     variable table = BuildTablePage(myData)      BuildGraphPage and BuildTablePage both require access data, the myData object. In the above example, I've passed the myData object to 2 constructors. This is what I'm doing now, in my current project. The myData object, and it's properties are all readonly. The problem is, the number of pages which will require this object has grown. In the real project, there are currently 4, but the new spec is to have about 20. Passing this object to the constructor of each new object and assigning it to a field is a little time consuming, but not a hardship! This poses the question whether it's better practice to continue as I have, or to refactor and create a new static class for myData which can be referenced from any where in my project. I guess my abilities to use Google are poor, because I did try and find an appropriate pattern as I am sure this type of design must be common place but my results returned nothing. Is there a pattern which is suited, or do best practices lean towards one implementation over another.


Managing DLL files, deployment, and ease of use for the end user

I've been thinking recently about being an end-user who wishes to download one of my own projects and use it on a perfectly average machine. Having an equal background in Unix as well as Windows, I know that package management on Unix makes it FAR easier for the programmer to make it easy for the end-user. If a package is required, it's simply required, and all the required libraries are just there. However, it's a different story on Windows. I have a project that I store on GitHub that is basically a C++ GUI application to interface with the Wii Remote. Nothing much. However, early on, I separated some of my initial project into a separate library project, because I could foresee that it would be useful to do so. The end result of all this is that I have the actual application project on GitHub, which requires both some wxWidgets DLL files and the DLL from my separate library project, which in turn requires a boost DLL file (threading) and the wiiuse DLL file, none of which the normal user is going to have on their computer, much less their PATH. I could take ALL those DLL files, zip them up, and put them with the application, but I'd have to remember to replace my separate library DLL file whenever I did work on the library. Anyway, what is the common approach for dealing with this on Windows? Are there installer tools that can help me with the kind of issues described above?


How to deal with OOP design problems in interviews?

This is a question where I seek guidance from fellow/senior developers to get into my dream company - it's a pioneer in OOP and Agile. I've already failed once to clear an interview. One part I feel most challenging is to come up with a proper Object Oriented design(classes, interfaces, methods, interactions etc.) in a very short time for certain situations like Pacman, Game Of Life and so on. As the problems are unprecedented ones - my approach is mostly to try different things and then make decisions - which they feel is not clear and not what they expect from a developer with 5+ years of experience. I've already studied a few books on patterns, OOP - it didn't help me much and I think it'll take a bit more than that. Could some one please guide on what specifically shall I practice so that I can do better at design problems as above. I want to refine my approach and have a better thought process.


ASP.NET vs ASP.NET MVC

I just started learning the ASP.NET MVC framework and it's very different in architecture from regular ASP.NET development. Transitioning from windows forms to WPF was nice, and seemed a way forward in technology. But, while learning ASP.NET MVC, I don't feel the same, I am unable to convince myself that MVC is better than WebForms. It just seems that they made some tweaks to the already available web framework and adopted the MVC architecture from some other language. Is ASP.NET MVC the step ahead in development? Should I learn and develop my future projects based on this platform and architecture? To me, it just seems like Microsoft is throwing a new architecture just along with WPF or copying Ruby on Rails. WPF seems promising and great while ASP.NET MVC just makes you crumb-some _[sic]_. They have removed the controls, thrown a new control system and data-packaging, and it's all together an extreme change to WebForms. I realize that with MVC you have great freedom in the testing aspect, but I don't believe that this makes a lot of difference in small website or projects. If you ignore the value of testing, What are your takes on this?


Why is C++ still "hybrid"

On a related question, it has been clarified why C++ is not compatible with C in many aspects. However C++ is still a "hybrid"* language. And unfortunately, many programmers still consider C++ as a "C with streams and built-in strings". That results in really bad written code, that it's neither C++ nor C. IMHO, it would be better if the language/compiler forced to some extent programmers to write more elegant code. So is there a rationale for keeping modern C++ (for instance C++0x and future versions) hybrid? * By hybrid I mean that it's up to the programmer to decide if he/she will use: standard strings and streams, classes, namespaces other than the default, etc.