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

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


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

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


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

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


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

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


XAML code styling

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


Summary of C# naming conventions (official Microsoft conventions)

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


Program design with multiple data sets, algorithms and results

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


.NET Dependency Management Systems

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


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

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


Git-based storage and publishing, infrastructure advice

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


Is node.js a good fit for background processing?

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


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

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


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

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


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

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


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

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


Functional Low-Level language that can use a webkit view

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


Planning relational database - one or two tables?

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


Duplicating documentation on interface implementations/overrides good or bad?

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


"Enterprise" version of GPL'd code?

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


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

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


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

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


Hardware key removal on a test system

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


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

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


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

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


Organizing a code retreat

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


How to handle workload in a better way

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


What is the proper way to do REST?

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


Working with Linux for Job Requirements

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


MIT licence copyright notice for derived works

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


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

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


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

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


Idea to develop a caching server between IIS and SQL Server

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


What's the most important trait of a programmer desired by peer programmers

Questions here talk about most important programming skills someone is supposed to possess, and, a lot of great answers spring up. The answers and the questioners seem mostly interested on qualities related to getting a better job, nailing some interview, things desired by boss or management, or improving your programming abilities. One thing that often gets blown over is the genuine consideration for what traits peers want. They don't much value things like you're one of those 'gets things done' people for the company, or you never miss a deadline, or your code is least painful to review and debug, or you're team player with fantastic leading abilities. They probably care more if you're helpful, are a refreshing person to talk to, you're fun to program in pair with, everybody wants you to review their code, or something of that nature. I, for one, would care that I come off to my peers as a pleasurable programmer to work with, as much as I care about my impression on my boss or management. Is this really significant, and if yes, **_what are the most desirable traits peers want from each other_**.


Why does Clang/LLVM warn me about using default in a switch statement where all enumerated cases are covered?

Consider the following enum and switch statement:               typedef enum {         MaskValueUno,         MaskValueDos     } testingMask;          void myFunction(testingMask theMask) {         switch theMask {             case MaskValueUno: {}// deal with it             case MaskValueDos: {}// deal with it             default: {} //deal with an unexpected or uninitialized value         }     };      I'm an Objective-C programmer, but I've written this in pure C for a wider audience. Clang/LLVM 4.1 with -Weverything warns me at the default line: > Default label in switch which covers all enumeration values Now, I can sort of see why this is there: in a perfect world, the only values entering in the argument `theMask` would be in the enum, so no default is necessary. But what if some hack comes along and throws an uninitialized int into my beautiful function? My function will be provided as a drop in library, and I have no control over what could go in there. Using `default` is a very neat way of handling this. Why do the LLVM gods deem this behaviour unworthy of their infernal device? Should I be preceding this by an if statement to check the argument?


Does this list of management behaviors actually appeal to software developers?

I came across this list of management behaviors (http://suven.posterous.com/dos-and-donts-leading-software-development-te). I think it has some gems, but I'm not 100% on some of them. I've marked those ones with italics and my name. Do you, as a software developer, think that these are appealing? Which three would be your TOP "gotta have 'em" items from your management? **Don't**   * Don't scale teams vertically by adding more people   * Don't create a team with more that 10 people   * Don't call people resources, its not cool and is really offensive   * Don't assume that people in teams are interchangeable   * Don't compare teams to each other when highlighting weaknesses   * Don't pitch teams against each other   * Don't create fake deadlines   * Don't force standardisation of tools and processes across teams _(I think this one can be argued for some situations - Todd)_   * Don't hire product managers who don't have a clue about software development   * Don't exclusively use KPI's to drive your teams _(Not only is it ineffective, but developers will find ways to drive the KPI metrics - "You want lines of code? I've got your lines of code!" - Todd)_   * Don't force your teams to work overtime, even asking is bound to create tension   * Don't assume that double the people equals half the time **Do**   * Do scale horizontally by creating more teams of about 5-8 people   * Do have a vision for the product and team   * Do appreciate that every team is different, so allocate projects appropriately   * Do motivate your teams _(Wow - that is one slippery, hard-to-define one. I agree with the sentiment, but it's like saying "Be effective" with no guidelines. -Todd)_   * Do allow people to move between teams   * Do have sessions to discuss the product vision, strategy, technology and process   * Do involve the team when determining the team/product name   * Do allow your teams to make their own decisions especially if they are the ones with the expertise   * Do involve your team on any decision that impacts how or what they work on   * Do encourage a development methodology that matches the team and the project   * Do pay attention to every individual's personal development plan


Cuda vs OpenCL - opinions

Interested in peoples opinions of Cuda vs openCL following NVidia's Cuda4 release. I had originally gone with openCL since cross platform, open standards are a good thing(tm).   I assumed NVidia would fall into line as they had done with openGL. But having talked to some NVidia people, they (naturaly) claim that they will concentrate on CUDA and openCL is hampered by having committees and having to please everyone - like openGL.   And with the new tools and libs in CUDA it's hard to argue with that. -I'm in a fairly technical market so I can require the users to have particular HW.


Effectiveness of "what is your greatest strength/weakness" interview questions

As someone who is now finding himself on the other end of the interview table, I'm wondering how useful these questions are from an employer's perspective. Some of my coworkers think they're good because you can see "how they respond," but I'm not convinced it tells you anything useful, for several reasons:   * It's not a very comfortable question and can lead people to twist their answers, even if not on purpose   * People may not fully know their greatest strengths or weaknesses (i.e. judge them by their peers)   * Explaining what a strength is isn't as good as showing it   * I still don't know any more about the candidate afterwards The rationale of my coworkers is that it can help weed out people that give ridiculous responses, like one guy that said his greatest strength was "his intellect" or people that try to turn the weakness question into a strength like "I work too hard." But I think there's more effective ways to determine such things. If you want to see if someone's smart, ask them technical questions. If you want to see if someone is productive, look at their work history. If you want to see how someone reacts under stress or change, ask them how they've dealt with it and ask for concrete examples. What are people's thoughts on these questions, from the perspective of an interviewer? What do they really tell you about a candidate, and what are better alternatives? How do I convince my colleagues of this?


Linking against LGPL - How to share the code?

I'm working on an Open Source software project (LGPL) which uses another LGPL- licensed software. To make it easier for users and developers I'm delivering and linking against the compiled thirdparty. As far as I know I have to include the sources and license-statements of LGPL software if I'm delivering and using it in binary form. However this would mean that I have to put the compiled version as well as the code of that thirdparty into my repository. Not only would that make the checkout take ages, it would also be somewhat redundant. Are there any techniques or best practices on how to solve this issue? My project is available on Github if that matters. Update:   * Link to Project   * Link to Thirdparty


Time-complexity of nested for loop

I have loops like this:               for(int i = 0; i < n; i++) {         for(int j = 0; j < i; j++) {             sum += 1;         }     }      It's O(n * ), but I'm not sure what the j < i loop is. I have some tests that I ran,               n = 10, runs = 45          n = 20, runs = 190          n = 40, runs = 780          n = 80, runs = 3160          n = 10, runs = 12720      It seems to be converging onto .5*n^2, but I'm not quite sure.


Scope of VB6 Programmer in todays market

Myself Rameez. Today I successfully complete my 5 years experience in VB6 platform as programmer. I want to know from expert that Is any demand of VB6 programmer remains in market and in future? And also I want to know Which technology I have to switch and Way to change it successfully? More about my technical skill set is I have learned ASP.net,c#, core java in my academic year. I have also knowledge how to write the code in these technologies. But I dont have any industrial project experience in these language. I have faced some interview in earlier for .net developer but can not go further. Because of not having experience in .net. So please show me a right way. Your feedback is very valuable for me. Its really help me in my future. Thanks in advance.


In Object Oriented Programming, we're taught to think in terms of Polymorphism (the idea that the implementation is decoupled from the interface - and that it makes sense to think of the interface first). This is expressed by Eric Gamma (author of Gang of Four Design Patterns Book) > Program to an interface, not an implementation Later we learned that this is a way of solving The Expression Problem. Other languages such as Clojure address 'The Expression Problem' using protocols. Now coming out of Scala (and perhaps influenced by Haskell) we're seeing a design movement that says _"Design your Types First"_. When I heard that - I thought I'd heard it before. My question is: **Is 'design with types first' ultimately the same as 'design with interfaces first'?**


What do I need for Java Socket programming?

I am trying to learn Socket programming in Java to make a game I created playable via network. I have never done much network programming so the subject is a bit confusing. In php I use apache to test my aplications on a local server. What do I need to install to be able to run network applications with Java?


Design: Calling back to the parent class

When modelling an object with children it's common to include the children via composition, as a member of the parent class. Sometimes however the children need to tell the parent something, they need to call a function of the parent. How can this be accomplished using C++? Some options are:   1. Make the parent class global therefore the child objects will be able to call member functions of the parent object.   2. Inject the parent object as a, pointer or reference, into every child object. Then when the child needs to tell the parent object something, it can always do so because it has a member variable that it can use. What are other methods of doing this? Is there a general design pattern or name for this sort of thing? Note that I'm interested in ideas and solutions in C++ because the details are going to be different in other object-oriented languages. For example point 2 above mentions 'pointers or references' and both are only possible in C++. C++ has language features that are not present in other languages therefore implementations of a solution to the problem will potentially incorporate these language features making the solution different from what someone might come up with in another language.


Are there any disadvantages to using the Agile methodology?

It seems most companies are practicing Agile methodologies these days for software development. I'm curious to know if there are any downsides to using Agile, does it have shortcomings, is it always the right methodology to use? Do you any of you have experiences of using Agile and it didn't really work, maybe it was due to the type of project, or the team?


WCF to Java webservices interop seems surprisingly problematic. Any good resources?

With a recent project our .Net based dev team has been tasked with integrating with a whole host of java based web services around the world, and we really have had a surprisingly (well, we are certainly not surprised any more) large amount of issues because the XML generated by WCF is not accepted by the java services. It also seems that there is not really that much good information to find on the subject, we have gotten some good tips from Yaron Nave's excellent WCF blog, http://webservices20.blogspot.com, and also on the MSDN WCF forum http://social.msdn.microsoft.com/Forums/en-US/wcf/threads. Are there anyone here who really feel that they got this down, and know the definitive resource on the subject? Would be interested in tips on books, blogs or any websites. Edit:   I am torn on setting the answer accepted on this thread, because each of the two best answers has some value:   1\. We will probably end up with doing more HTTP Webrequest implementations instead of fighting WCF.   2\. But the WCF Express Interop Bindings 1.0 was also a very sensible tip.


Synchronize Azure SQL (cloud) with Azure SQL Emulator (local)?

We have an Azure service (web role) that heavily depends on the database. For offline development/testing, we'd like to have the app+db run offline within the emulators. Running the webrole itself within the emulator is straightforward but doing so for the Azure SQL isn't so. What is the simplest way to ensure that the cloud Azure SQL database and the emulator/local Azure SQL database are in sync? We can afford some level of staleness for simplicity of sync operation (meaning it's ok for the local copy to be a few hours stale versus mirroring every write as soon as it happens) Thanks


Use a GUI designer or write it yourself for the desktop?

Writing a GUI for a program has always been a daunting, depressing, and frustrating task. It doesn't matter which language, its extremely hard to get what I want. Especially in compiled languages like Java where a change takes a minute or two to build. The result is that I increasingly use GUI designers for some of my project. Sure there is some spagetti code, but as long as I leave the configuration and a note saying "This was designed with X" I have no qualms with doing this. Is this an okay way to design a GUI? More importantly, is this what most people do? Or is the common way to just sit down and write it out?


What are the advantages of using Adobe Flex?

I've used Adobe Flex to develop a web application and I simply don't have an opinion of it, it looks good to the user and the code can't be seen for most users, but, is that it? What other advantage does Flex has?


What procedures or audits should be used to assess the security of a software system?

Are there any standardised security procedures or auditing techniques that can be used to assess the security of a piece of software? I'm specifically interested in auditing software written in Java, but other tips for other languages as well as general practices would be useful to know about as. A list of frequent identified security vulnerabilities would be helpful, as well. I'm looking for things that are specific to software engineering practices, rather than, for example system administrators.


How do you make an open source website and profit?

I'm not asking from a business sense exactly, but for example, both reddit and Twitter are completely open source. It is my understanding that at least the large majority of their profit comes from advertising on their website. So what exactly is to prevent someone from copying their code and making their own website with some small but effective changes? I ask this because I have a website, and I want to make money on it through advertising. I also want the code to be open source, just to be nice, but I don't want this to happen to me. My site is not (and will probably never ben close to) an institution like Twitter or reddit. I'm not sure if they're just so big they're not worried about someone copying their site, or if they actually have some protection in spite of being open source. reddit uses CPAL, and Twitter uses the Apache license -- does this offer the protection they need or is there something else I'm not getting?


What is expected of me as a recent graduate?

I just recently graduated and now work as an entry level software developer. I've been there for 2 weeks. Is it normal for me to feel like I'm the stupidest person in the room? I feel like the interns there know what they're doing better!


Security by obscurity - whats the equivalent for deleting data?

Unsure if I'm asking this in the right place but here goes: **Security by Obscurity** is the process of making data so _obscure_ it therefore becomes _secure_ as no one can read/understand it. My question is what is the "term" for deleting data in order to make sure it is secure (i.e. deleting old e-mails)? I understand deleting could be argued as obscuring the data, but is this the correct term?


Best Practices for Maintaining Uppercase vs Proper Case Data

We have several years of customer data that has been collected over time. I'd guess that 95% of the data (Names, Business Names & Addresses) is in all UPPERCASE format. The data entry tool used within our organization offers an "Export as Proper Case" function. We do not have the ability to modify this data import function. It's an all or nothing switch. We flipped this switch on in January 2013 and since then have discovered numerous data abnormalities:               Original Data          Proper Case Import     -------------          ------------------     McDonald               Mcdonald     MacDonald              Macdonald      O'Neil                 O'neil     My First LLC           My First Llc     my.email@test.com      My.Email@Test.Com     John Smith III         John Smith Iii      Our data is stored within a closed environment on an iSeries. We have a web interface that allows for single record changes to the data. Unfortunately I do not have the ability to run an update database query to update our data and make mass changes. What are the **Best Practices** that you have adopted within your organization with regard to maintaining Proper Case Data vs UPPERCASE Data? I've got two or three people in the organization that are pushing for Proper Case data on the system. The majority of other people want UPPERCASE data on the system. I'm trying to put together a presentation that states how unrealistic it is to move to a total Proper Case data environment. What are some good talking points or arguments that support all UPPERCASE data?


How to show an "or includes" relationship - UML Use case diagram

I haven't come across this issue before and can't find it in my Schaum's Outline UML book and was wondering if someone here could help. I'm making a use case diagram for e-commerce, and in it I want to describe that in order to add a book to your shopping basket, you have to either search products (using the websites search engine) or browse products (using navigation). But the thing is that it can be either one, and not both. Is there a way to show that adding a product to the basket needs to include either this or that? Because otherwise it would look like it needs to include both. Or should I join the two use cases (search products and browse products) into one?


Anyone know about AppDynamics? Does Microsoft already have something similiar? Event viewer? Im confused

We have a big collection of java (80%) and .Net (20%) apps.. And the people in charge want a way to monitor the applications somehow. So they told me they are interested in AppDynamics? I have spent a bit looking into it but I still don't get it. Can someone tell me what its about ? From my understanding it seems like you would someone inject the AppDynamics API in your code to tell about differnt events that occur? So sounds like Event Viewer ? I am on the .NET side of this and seems to me we can just write data to a log and report off of that data.. I don't get what the additional complexity of using'AppDynamics' does. Maybe it is overkill ??


Measuring an enterprises reliance upon software

In bidding a complex project for a client, I wanted a way to determine their reliance upon software. They have many people doing manual entry and Excel spreadsheets power many pieces as well as legacy code and some off the shlef solutions that do not interact in any way. Its one thing to say "You need software to run your business" but how do you create a measure of this to be able to say something like "You are currently 68% reliant upon software" its time to take it seriously before the expanding complexity costs more to maintain than to re-write?


Type Casting variables in PHP: Is there a practical example?

PHP, as most of us know, has weak typing. For those who don't, PHP.net says: > PHP does not require (or support) explicit type definition in variable > declaration; a variable's type is determined by the context in which the > variable is used. Love it or hate it, PHP re-casts variables on-the-fly. So, the following code is valid:               $var = "10";     $value = 10 + $var;     var_dump($value); // int(20)      PHP also alows you to explicitly cast a variable, like so:               $var = "10";     $value = 10 + $var;     $value = (string)$value;     var_dump($value); // string(2) "20"      That's all cool... but, for the life of me, I cannot conceive of a practical reason for doing this. I don't have a problem with strong typing in languages that support it, like Java. That's fine, and I completely understand it. Also, I'm aware of--and fully understand the usefulness of--type hinting in function parameters. The problem I have with type casting is explained by the above quote. If PHP can swap types _at-will_ , it can do so even after you _force cast_ a type; and it can do so _on-the-fly_ when you need a certain type in an operation. That makes the following valid:               $var = "10";     $value = (int)$var;     $value = $value . ' TaDa!';     var_dump($value); // string(8) "10 TaDa!"      So what's the point? Can anyone show me a practical application or example of type casting-- **one that would fail if type casting were not involved?** I ask this here instead of SO because I figure **practicality** is too subjective. ### Edit in response to Chris' comment Take this theoretical example of a world where user-defined type casting _makes sense in PHP_ :   1. You force cast variable `$foo` as `int` \--> `(int)$foo`.   2. You attempt to store a string value in the variable `$foo`.   3. PHP throws an exception!! <\--- That would make sense. Suddenly the reason for user defined type casting exists! The fact that PHP will switch things around as needed makes the point of user defined type casting vague. For example, the following two code samples are equivalent:               // example 1     $foo = 0;     $foo = (string)$foo;     $foo = '# of Reasons for the programmer to type cast $foo as a string: ' . $foo;          // example 2     $foo = 0;     $foo = (int)$foo;     $foo = '# of Reasons for the programmer to type cast $foo as a string: ' . $foo;      ### UPDATE Guess who found himself using typecasting in a practical environment? Yours Truly. The requirement was to display money values on a website for a restaurant menu. The design of the site required that trailing zeros be trimmed, so that the display looked something like the following:               Menu Item 1 .............. $ 4     Menu Item 2 .............. $ 7.5     Menu Item 3 .............. $ 3      The best way I found to do that wast to cast the variable as a float:               $price = '7.50'; // a string from the database layer.     echo 'Menu Item 2 .............. $ ' . (float)$price;      PHP trims the float's trailing zeros, and then recasts the float as a string for concatenation.


Why do some programmers keep values in global variables or member variables but not reused?

I am talking about normal PC applications, memory should be sufficient. They declare global or member variables. In each function/method, they use the same global/member variables. At the beginning of each method, the variables are re-initialized so the old value is never used. Why do they keep the variables but no chance to reuse the old value?               class A     {         List<Car> carList;         public List<Car> M()         {             // always re-init variable             this.carList = new List<Car>();             // ...             // fetch from DB             return this.carList;         }              public List<Car> N(string id)         {             // always re-init variable             this.carList = new List<Car>();             // ...             // fetch from DB             return this.carList;         }     }


Storing plaintext passwords for detecting fraud

I am well aware of best practices for storing user passwords:   * Never store passwords in plaintext   * Never store encrypted passwords; always store password hashes   * Always salt your password hash to deter brute force attacks   * Always use unique salts to deter attacks using rainbow tables. However, I have recently came upon on a potentially legitimate use case for keeping plaintext (or plaintext-accessible encrypted) user passwords: fraud detection. For example, if we have a system that needs to restrict purchases to 1 (or a small number) per person, we have observed that fraudsters often use the same password over and over, so if we have detected fraudulent purchases on one account, we can use the fact that password matches as a useful signal in a fraud detection system. But implementing such a system requires breaking all the best practices for password storage. Question: **If it is determined that the fraud-detection ability of being to retrieve passwords is necessary, what are the best practices for storing passwords securely but in a way that is plaintext-accessible?**


Is it a good idea to take a dev job knowing you'll be leaving shortly?

I'm currently in a very stable, comfortable dev position where most of my growth as a developer is solo. My current team doesn't really discuss software development and not everyone is interested in it enough to grow as a group. Nevertheless, I love the people I work with and we have the opportunity to work on fun projects (most of the time). Through a recruiter, I've been offered a very exciting job with a bunch of super-smart devs that love to discuss, improve, grow. However, (and the employer doesn't know this), I'm planning on leaving the area in **just over a year**. These plans are pretty definite, so the mentality of _"Hey, anything could happen in a year,"_ while true, doesn't feel applicable. There are other factors to consider (a **much** longer commute, longer working hours, etc), but the one that is really bothering me is I don't know how I feel about starting something so life-changing, only to start making plans to leave in ~9 months. Personally, I want to feel like I'm settling into a job, not hopping around. Granted, I also can't help but consider the needs of the employer; I don't want to be the guy that stayed for just a year, forcing them to restart the hiring process. Especially in the field of software development, I feel there's an investment made in the employee that is hired. _(Training in the business domain, training in the specific practices of the organization, training in the tools, etc.)_ I'm the kind of developer that wants to give back on that investment -- otherwise I feel I have nothing to show for myself. So, do you think **a year is enough time to give back on that investment**? **Edit:** I appreciate all of the answers I've received, but I wanted to clarify that I wouldn't be leaving in 9 months, I'd be leaving in 12-13 months. 9 months was just an approximation of how long until I had to start _thinking_ about leaving.


Designing a 3-phase commit web service

We already have a fully operational web service which caters requests from multiple paltform devices. Each device sends only one request at a time and immediately after a response for the request the device sends an applicative ACK, this ack message is like a regular request message, and it's all via http. During a performance/load test we discovered that the following situation happens alot: regular requests gets processed ok but when the ack message is sent, it is thrown because the server can't handle too many requests. We accept the case that the server throws requests because of overload, but we do not accept throwing ack messages. So essentially we want the server to process 2 requests at a time for each device, is there anyway to do it in the current situation? if not, what kind of changes do we need to do?


How do software engineers deploy applications?

Interested to know how people deploy software to their customers I have the following requirements:   1. Customers on various OS's prob. linux and Windows   2. Can't release the source code   3. Ideally want option to develop GUIs not just cmd line stuff   4. Can't assume anything is pre-installed on customers machines   5. Would like to use a nice,high productivity language I've used python for various stuff but am not sure how you could deploy it without releasing source code and without knowing your customers have python installed I know you can make exes but its not really designed for that and your effectively compiling in the interpreter each time Is there another similar high level language that can be properly compiled and distributed as a binary, possibly with a few supporting shared libs or something?


Do you have to be good at math to be a good programmer?

It seems that conventional wisdom suggests that good programmers are also good at math. Or that the two are somehow intrinsically linked. Many programming books I have read provide many examples that are solutions to math problems, or are somehow related to math as if these examples are what make sense to most people. So the question I would like to float is: do you have to be good at math to be a **good** programmer?


How to learn Math to increase Programming skills?

> **Possible Duplicate:**   >  What degree of mathematical knowledge should a programmer have?   >  Where should I start learning math with regards to programming I need an advice. Im a web developer and currently working in an IT Company. PHP is my language of choice. But i dont want to become just a PHP Programmer i want to learn new things i want to learn also Game Programming and Other programming languages that uses Math skills. Im not good in math and honestly forgot important math concepts but im willing to learn it from the scratch. Maybe its takes time month,or years but i want to be (good,better,best) at it. My problem is that i dont know where i should start. I want to know what kind of math i need to know to accomplished this goal. I want to start from the very first if necessary in order for me to know all the things that will be needed in programming that uses math. Please help and thanks..


What does mathematics have to do with programming?

I just started a diploma in software development. Right now we're starting out with basic Java and such (so right from the bottom you might say) - which is fine, I have no programming experience apart from knowing how to do "Hello World" in Java. I keep hearing that mathematics is pertinent to coding, but how is it so? What general examples would show how mathematics and programming go together, or are reliant on one another? I apologize of my question is vague, I'm barely starting to get a rough idea of the kind of world I'm stepping into as a code monkey student...


What kind of maths do I need to become an excellent programmer

I am looking to become a app/video game developer or a website developer. What kind of maths do I need to know and do I have to know it well. Do I need to know calculus, statistics and modeling, what kind?


Can you be succesfull as a programmer without being good in math?

I have never been good in maths at high school. But I started a study app development. And I'm curious if you need to be awesome in maths, if you want to become a professional developer.


Web Developer and Math

I have just learned HTML/CSS and I practice everything I read to make it more understandable to me and I really enjoy it. My goal is to be a Modern Web Developer both front and back-end, so I won't stop learning. I'm planing to jump on JavaScript now but what I would like to know is how important is math to being a Web Developer.   1. Do I need to know math?   2. If so, what kind of math should I know and understand?


How important is maths depending on what your coding?

> **Possible Duplicate:**   >  What does mathematics have to do with programming?   >  How often do you have to solve pure mathematical or algorithmical problems? I heard that math can be very important in programming. I am a confident python programmer, and have started C++. So far I have not encountered anything where I need to use any real math.   I have had to use logic and a bit of problem solving, but that's about it. I also wanted to know: does a particular part of coding (software engineering or game development) use maths more?


Do we have to learn Mathematics to be a good Programmer?


Where should I start learning math with regards to programming

I've created several systems already, a web based menu system, a payroll system and I am currently developing a patient administration system, I know java,C,C++ C#, javascript PHP and other languages. but the thing here is that I feel I lack knowledge of good math. I am still studying in college but it seems to me that I need to know more about math that concerns programming, what or which part of mathematics should I study for me to improve my programming skills? Algorithm designs? Algorithms? What branch of mathematics?


Using Clojure instead of Python for scalability (multi core) reasons, good idea?

After reading http://clojure.org/rationale and other performance comparisons between Clojure and many languages, I started to think that apart from ease of use, I shouldn't be coding in Python anymore, but in Clojure instead. Actually, I began to feel irresponsisble for not learning clojure seeing it's benefits. Does it make sense? Can't I make really efficient use of all cores using a more imperative language like Python, than a lisp dialect or other functional language? It seems that all the benefits of it come from using immutable data, can't I do just that in Python and have all the benefits? I once started to learn some Common Lisp, read and done almost all exercises from a book I borrowed from my university library (I found it to be pretty good, despite it's low popularity on Amazon). But, after a while, I got myself struggling too much to do some simple things. I think there's somethings that are more imperative in their nature, that makes it difficult to model those thins in a functional way, I guess. The thing is, is Python as powerful as Clojure for building applications that takes advantages of this new multi core future? Note that I don't think that using semaphores, lock mechanisms or other similar concurrency mechanism are good alternatives to Clojure 'automatic' parallelization.


Should framework classes (e.g. .NET, Java) be included in UML diagram?

Say in a UML Sequence diagram, I am showing a call to the database using ADO.NET. Do I need to include the SqlConnection, SqlCommand, SqlDataReader object in the diagram? Is it just preference determined by the level of depth/detail?


Should I bother to develop for JavaScript disabled? I feel that my time is better spent developing for the majority.


Bothering to cater to non-JavaScript clients?

Considering that it's April, 2013; do I still need to worry about non- JavaScript capable/enabled clients? Note: This question excludes having helper text with: _JavaScript is required to view this page, upgrade to a modern browser or modify your settings_ BTW: Just to be clear, in order to cater to non-JavaScript capable/enabled clients; I will have to: prerender (cache) a version of my decoupled (JavaScript on the client-side consumes my RESTful API) website. Because of framework limitations this will result in far less functionality for the non-JavaScript user.


How important is graceful degradation of JavaScript?

Should web developers continue to spend effort progressively enhancing our web applications with JavaScript, ensuring that features gracefully degrade, thereby ensuring accessibility? Or should we spend that time focused on new features or other areas of development? The subtext of that question would be: How many of our customers/clients/users utilize our websites or applications with JavaScript disabled? Do you have any projects with requirements that specifically demand JavaScript functionality (almost all of mine do), and do those requirements also demand graceful degradation? For the sake of asking this question, I pulled up programmers.stackexchange.com without JavaScript enabled, and I was greeted with this message: "Programmers - Stack Exchange works best with JavaScript enabled". It was difficult to log in, albeit the site seemed to generally work okay. (I wasn't able to vote up any questions.) I think this is a satisfactory approach to development. Imagine the effort involved in making all of the site's features work with plain old HTML and server-side logic. On the other hand, I wonder how many users have been alienated by this approach. We've all been trained (at least the good developers among us) to use progressive enhancement and to ensure our web applications' dynamic features degrade gracefully. Is this progressive enhancement just pissing into the wind, or do some of our customers actually utilize certain web services without JavaScript enabled?


is GAE an infrastructure capable of hosting an app used by millions of active users?

I would like to know with the restrictions of GAE listed below, is it even possible to build a great social app (like Facebook) by hosting that app on GAE? In other words is GAE an infrastructure capable of hosting an app used by 600 million active users? Restrictions I've dugged out from a couple of forums / blogs (please feel free to add to the list if you find anything missing):   1. HTTP Request/Response     * Max request size: 32 MB     * Max response size: 32 MB     * All requests must respond within 30 seconds otherwise GAE will throw DeadlineExceededException     * Each cron job must be executed within 10 minutes     * Cron jobs cannot utilize map reduce     * Every GET or POST to another site is aborted after 5 seconds. You can configure it to wait till 10 seconds max. (intermediate servers would be necessary to work with Twitter and Facebook many times)     * Client can not connect to GAE through FTP (only HTTP and HTTPS).     * No https for custom domains. Only for your-app-id.appspot.com domains.     * If you get an influx of users, you get "over quota" error   2. Database     * Database behavior is not the same in the local development than in the actual servers.     * GQL. Nothing else.     * No query can retrieve more than 1000 records (sucks seriously if you want to allow your client to have a one-click-go-offline-now button)     * If you need linear access to a massive amount of records to perform an operation, you are out of luck (Google's systems are massively clustered)     * Memcache values max size is 1 MB.     * Can't do simple text search     * You can't join 2 tables.     * Slow (You have to read about how to separate tables using inheritance so that you can search in a table, get the key and then obtain its parent in order to avoid deserialization performance)     * "Too many indexes" runtime exception     * An entity can at most have 5000 property values in an index     * Key names of the form ***** (start and end with two underscores) are reserved, and should not be used by the application.     * Key names are limited to 500 bytes (UTF-8 encoded, I guess)   3. Language     * python or java or Go (or languages that uses the JVM like Groovy, Scala and others)   4. Server Issues     * No static IP (may have throttling and quota problems calling third party APIs)     * Each application is limited to 3000 files     * No control of OS or hardware running the web app


How to Identify Bugs

Sometimes I come across something that doesn't entirely work right or just doesn't make sense to me and I often refrain from thinking it is a bug in the library or code I am using. For instance today I discovered that Java's TrayIcon slightly alters some of the RGB values of the image it displays. It is not enough to alter the image but just an R that is one higher or a G that is lower. I am a self-taught 18 year old (with ~5 years) and so I always think that I am just missing some piece of information of how some part of the computer operates and that is why a given situation does not make sense. So when you do not necessarily know everything about a given area of a computer and how it operates, how can one identify a bug and know it is a bug with absolute certainty?


How do I avoid the complexity concerns of frameworks while keeping my team marketable?

When deciding upon how to design a software project with my colleagues, most suggestions tend to be for using specific frameworks "because it's popular in the job market" or "that's the framework that gets recruiters on the phone," and never what I'm looking for which is, "because it's a good fit for the project as it makes the system more adaptive to future changes and makes life easier for developers." I didn't start looking at projects in this way until I started reading up on domain-driven design. I've found that the actual domain is hidden deep under the frameworks used and it's hard to learn the business processes that have been implemented by the software product. Is there a way to marry the two competing goals: getting exposure as a development team while still being able to avoid complexity? Are frameworks that compromise, or are there other solutions out there?


Steps to ensure important details aren't edited out of technical documents?

Like many here, I'm sure, my company has a person that acts as liason between development and most other areas of the company, as well as our clients. Most communication regarding new releases, fixes, known issues, etc. goes through this person. However, because this person is not a developer and not deeply involved in the development projects, sometimes what developers submit for dissemination is edited for brevity or simplicity, and in the process, key details or subtleties are lost. I've been pushing for a review process that includes the author of the original document, whatever it was, before the material is released. Among other things this would, I feel, allow the person with the greatest technical knowledge about what's being talked about (the one who actually wrote the code for the new program, feature or fix) to weigh in on anything that may have been oversimplified or been given a factual error by the editing process. The person handling the communication, for their part, feels that the problem is education; the person is relatively new to the company and doesn't have extensive experience with all of the software applications and other products that development produces and supports. The person feels that as they gain this experience through training and reading the material that comes through their hands, the problem will resolve itself. They also feel that the back- and-forth would waste time. I think there's merit both ways. What do you guys think?


Is it crazy to develop a TUI today?

I'm starting to develop a new program. It's basically a database interface, run a few queries, show the data in a nice way and be able to easy input new data (like this website). Thinking about which programs I use daily I realise that only my web-browser is a GUI program, the rest is TUI (in this case TUI is Text User Interface, as in ncurses). So I plan to write this in ncurses with a vim/mutt-like interface. This program will only be used by experienced users and speed is much wanted. I've found one study about this: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2655855/ All other studies I've found has only looked at novice users and for them GUI is better. For an experienced user that will work daily with the program what is best? This is sligthly similar but the difference is that this question was about a non-interactive program:   Is the development of CLI apps considered "backward"?


Can we price a software based on its lines count, language, technology and stuff like that?

Recently a friend of mine bought an inventory application from a vendor, who used an statement like " **built based on 10000 lines of codes** " as a marketing slogan to increase its market share. I've also seen other software claiming to being built with a special language (C#, PHP, Java, etc.), or based on a special technology. My question is that, **can we morally and logically price a software based on these factors?** I mean, does it matter to the end user how many lines of code have we written? Or which programming language did we use? A factor like platform seems to be logical in this case, because some users want an application to be executed on Windows, or Mac for example. But what about other factors like technologies used, architecture, lines of codes, programming language, even database?


How do you handle dependant stories in scrum?

In the company I currently work on, we've noticed that sometimes, some stories are bound to each other (as in too coupled). This might be that they belong to the same overall feature, or that they're different features but there are some of them that need to be finished first in order to continue with the next ones, etc. How do you handle this cases, without stopping the workflow of the iteration? Are we doing something wrong?


How much risk is involved to launch a smartphone application initially for non iOS phone? What are the advantages?

I am working on an idea as a hobby project, and I have almost finished it in android and about to finish in Java ME platform, and we are also planning it on other smartphones including blackberry, iOS and symbian phones. But coding on these platform is not started yet. Here are my questions regarding to that **Is it a wise step to release this application for a non iOS device first and wait for good reviews before I start for iPhone and other platform?** I choose this because what android[read a non iOS] version needs is good packaging and some finishing work. But I fear that it will not be that much popularize and even there may be less downloads than expected only because this application will not get attention between too many applications. Or **It's better to develop iOS release first and than release a non iOS version?** I may get better attention because of popularity of apple among developers and users, but I don't feel it good to market an original android [non iOS] application as porting of iPhone one while the reality is reversed. **What are advantage to release a non iOS version first and than port it to iOS?**


HTML text editor with DOM manipulation?

While editing a static HTML file today, I realized, that many things I did using search and replace with regular expressions, would be much easier using JavaScript (and possibly a DOM library like jQuery) and DOM manipulation. I could, of course, load the file into a browser, type some JavaScript into the console and copy and paste the manipulated source code back to the editor. But this would be much easier if the HTML text editor supported this directly, because it could automatically load jQuery, you could store and reuse scripts, the chance that formatting gets lost is smaller, etc. Does anyone know if something like that exists? Preferably for Windows, but suggestions for other operating systems are ok, too.


Correct architecture for running and stopping complex tasks in the background

I'm having trouble working out the correct architecture for the following task. I have a GUI in Windows Forms that contains a `ListBox`, listing certain architectural layouts. One an item in this list is selected, a custom `Control` displays an interactive visualization of the selected layout. Drawing of this interactive diagram is a CPU-intensive task, and can take up to a second on my machine. The kind of functionality I'm trying to achieve is that if a user wants to quickly scroll through the layouts in the `ListBox` (say, holding down the down arrow key), I don't want my computer to sit there thinking about how to draw the layout before it allows the user to do anything else. The obvious answer is, of course, to run the layout calculations in a separate thread. But how do I make that thread return a whole control? How do I make sure I'm not running two layout calculations at once? I'm fairly new to this complex GUI business. So the real question is what is the right architecture to implement something like this? This seems like something people do all the time, but finding any suggestions on how to do it properly is really difficult.


Should I unit test

Most of the logic for my webservice involves talking to our suppliers webservices. (checking availability ordering ect) They dont have a test environment and the majority of calls cant be run arbitrarily (for example a cease would be run once and would actually stop a service). Is it feasable to run unit tests in this environment? I could simulte typical responses but im worried that hardcoding supplier responses would undermine the point of unit tests.