Junior Programmer Looking for Project Management Advice & Experience

I am a programming intern at a company in Australia. Is it normal for a programmer to be given a project that has to be completed within a week? For example, I have been given a task to create a Facebook app for one of the companies we have, I have 2 years experience at University in a Bachelor of Computer Science & my boss knows I have never developed an application using the Facebook Graph API & its IFrame version of apps. He would like me to finish the app in a week; its an interactive calendar that displays different looks based loosely on the facebook users likes (if no likes are present then a default look is shown) & to charge the user credits if they wish to enter a competition. Plus I am the only person in the software development team, the other people in the company do trading, real estate etc. In my 2 months I have been at this job I have developed a website updater (a java applet & a javascript one), 2 websites(css, javascript, html) & am halfway through a mobile application(using the Moync API & C++). Am I working under the typical Agile Software Development or are these kinds of timetables unrealistic for a one person team? Is this kind of thing normal? I dont believe I can introduce myself to the facebook Graph API & develop the app in a week, but I do believe I could get this done in 2-3 weeks. Is a one week timetable something other software developers would assign to a junior programming intern?


How to train junior programmers for today's (complicated) web environment?

Currently our company develops applications consisting, most of the time, in Ruby on Rails web servers and a bunch of different REST clients, from kiosk systems in Java to embedded devices in C/C++ (besides the interfaces for standard web browsers). We need to expand our team and, having failed at finding good senior programmers, we decided to put some effort into training junior programmers who would grow together with the company. We've already given them some Ruby and Rails books and asked them to build some toy programs, but I'm now realizing how steep the learning curve for the current state of web programming is. When I started programming 15 years ago I used only Delphi and Source Safe and was able to produce usable software right from the beginning. They were both simple tools and it was easy to delve into the inner workings of the environment. Slowly I started using third-party frameworks, have switched to CVS, SVN and finally Git, learned the pieces which make today's web, like HTTP, JavaScript, CSS, REST etc. Today, even after years of experience, I don't know as much about how Ruby on Rails works inside as I did in the past about Delphi, and for me that was important so I could connect the basic learning blocks to the tools I was using. It seems to me that the programmers I'm hiring will take a long time to integrate with the team and produce something usable, because there's so many things to learn to use a single framework (Rails): Ruby, HTML, CSS, JavaScript, REST, test-cases, database access (with SQL magically built inside the framework!), MVC, three different package managers (apt for Ubuntu, gem and bundler for Ruby), ssh, git, Apache and Phusion Passenger for deploying, etc. I'm feeling lost since it's the first time I need to deal directly with junior programmers. What is the best way to train junior programmers in today's best practices for web development when there are so many choices?


Monopoly game 3D graphical interface

I have created a Monopoly game with a 2D Graphics in Java for my final exam at college. I feel that the game doesn't look very good and I want to add a 3D Graphics. My problem is that I have never done 3D programming and I don't know how to create 3D objects. Can someone tell me where can I create 3D objects and what library to use for 3D programming that will allow me to create a 3D graphic interface fast? I have only two more weeks to do this. Can this be done?


Python multiple inheritance or decorators for composable behaviours

I recently discovered (or rather realised how to use) Python's multiple inheritance, and am afraid I'm now using it in cases where it's not a good fit. I want to have some starting data source (`NewsCacheDB`,`TwitterStream`) that gets transformed in various ways (`Vectorize`,`SelectKBest`,`SelectPercentile`). I found myself writing the following sort of code ( _Example 1_ ) (the actual code is a bit more complex but the idea is the same). The point being that for `ExperimentA` and `ExperimentB` I can define exactly what `self.data` is, by just relying on class inheritance. Is this really a useful way of achieving the desired behaviour? I could also use decorators ( _Example 2_ ). Using the decorators would be less code. Which approach is preferable? I'm not looking for arguments of the "I like writing decorators better" kind, but rather arguments about   1. readability   2. maintainability   3. testability   4. pythonicity (yes it's a word). * * * ### EXAMPLE 1               class NewsCacheDB(object):         """Play back cached news articles from a database"""          def __init__(self):             super(NewsArticleCache, self).__init__()              @property         def data(self):             # setup access to data base             while db.isalive():                 yield db.next() # slight simplification here          class TwitterCacheDB(object):         """Play back cached tweets from a database"""          def __init__(self):             super(TwitterCache, self).__init__()              @property         def data(self):             # setup access to data base             while db.isalive():                 yield db.next() # slight simplification here          class TwitterStream(object):         def __init__(self):             super(TwitterStream, self).__init__()              @property         def data(self):             # setup access to live twitter stream             while stream.isalive():                 yield stream.next()          class Vectorize(object):         """Turn raw data into numpy vectors"""         def __init__(self):             super(Vectorize, self).__init__()              @property         def data(self):             for item in super(Vectorize, self).data:                 transformed = vectorize(item) # slight simplification here                 yield transformed          class SelectKBest(object):         """Select K best features based on some metric"""         def __init__(self):             super(SelectKBest, self).__init__()              @property         def data(self):             for item in super(SelectKBest, self).data:                 transformed = select_kbest(item)  # slight simplification here                 yield transformed          class SelectPercentile(object):         """Select the top X percentile features based on some metric"""         def __init__(self):             super(SelectPercentile, self).__init__()              @property         def data(self):             for item in super(SelectPercentile, self).data:                 transformed = select_kbest(item)  # slight simplification here                 yield transformed          class ExperimentA(SelectKBest, Vectorize, TwitterCacheDB):         # lots of control code goes here          class ExperimentB(SelectKBest, Vectorize, NewsCacheDB):         # lots of control code goes here          class ExperimentC(SelectPercentile, Vectorize, NewsCacheDB):         # lots of control code goes here      * * * ### EXAMPLE 2               def multiply(fn):         def wrapped(self):             return fn(self) * 2         return wrapped               def twitter_cacheDB(fn):         def wrapped(self):             user, pass = fn(self)             # setup access to data base             while db.isalive():                 yield db.next() # slight simplification here         return wrapped          def twitter_live(fn):         def wrapped(self):             user, pass = fn(self)             # setup access to data base             while stream.isalive():                 yield stream.next() # slight simplification here         return wrapped          def news_cacheDB(fn):         def wrapped(self):             user, pass = fn(self)             # setup access to data base             while db.isalive():                 yield db.next() # slight simplification here         return wrapped          def vectorize(fn):         def wrapped(self):             for item in fn():                 transformed = do_vectorize(item)  # slight simplification here                 yield transformed         yield wrapped          def select_kbest(fn):         def wrapped(self):             for item in fn():                 transformed = do_selection(item)  # slight simplification here                 yield transformed         yield wrapped          class ExperimentA():         @property         @select_kbest         @vectorize         @twitter_cacheDB         def a(self):             return 'me','123' # return user and pass to connect to DB          class ExperimentB():         @property         @select_kbest         @vectorize         @news_cacheDB         def a(self):             return 'me','123' # return user and pass to connect to DB


Successful examples of commercial recommendation engines

Amazon has been a pioneer in bringing recommendation engines to the mainstream and is still without doubt the biggest name in this area. Netflix has been a more recent successful example, and I can think a few more off the top of my head. What are some others examples of companies that rely heavily on advanced recommendation technology ? Bonus points for companies that have written about their approach, be it on their blog, white papers or other resources.


Separating the UI from its event handlers and database queries

Is it a good practice to separate the handlers and database queries in different classes? There will be a separate class containing all the necessary event handlers, and there would also be another class for database queries?


Toolkit for cross-platform applications in Python

I would like to develop cross-platform GUI applications, which work on both Linux and Windows systems. I am now confused on which toolkit to use. I asked many of them and each one are saying different toolkits. Should I use GTK or wxPython or Tkinter?


Switch / select case etc. compared to If ... ElseIf ... Else

I don't understand why the `switch` or equivalent is so popular in languages. To me, it seems like it had a place back in the days when the alternative was lots of nested `if` statements in the `else` part of other `if` statements. Now that we have `else if`, why do we need it? If we take the following:               switch (expr) {       case "Oranges":         document.write("Oranges are $0.59 a pound.
");         break;       case "Apples":         document.write("Apples are $0.32 a pound.
");         break;       case "Bananas":         document.write("Bananas are $0.48 a pound.
");         break;       default:         document.write("Sorry, we are out of " + expr + ".
");     }      It is clearly more readable than below?               if (expr == "Oranges") {         document.write("Oranges are $0.59 a pound.
");     } else {         if (expr == "Apples") {             document.write("Apples are $0.32 a pound.
");         } else {             if (expr == "Bananas") {                 document.write("Bananas are $0.48 a pound.
");             } else {                 document.write("Sorry, we are out of " + expr + ".
");             }         }     }      But how is it more readable than:               if (expr == "Oranges") {         document.write("Oranges are $0.59 a pound.
");     } else if (expr == "Apples") {         document.write("Apples are $0.32 a pound.
");     } else if (expr == "Bananas") {         document.write("Bananas are $0.48 a pound.
");     } else {         document.write("Sorry, we are out of " + expr + ".
");     }


If-Else V.S. Switch end of flow

I was wondering the if if-else statements, is like a switch statement that **does** have a break statement.               if( boolean_expression_1 )       statement_1     else if( boolean_expression_2 )       statement_2     else        default_statement      Is the same as:               switch( controlling_expression )     {     case: ( boolean_expression_1 )     {          statement_1          break;     }     case: ( boolean_expression_2 )     {          statement_2          break;     }     default:     {          default_statement     }


How is a switch statement better than a series of if statements?

> **Possible Duplicate:**   >  Should I use switch statements or long if…else chains? I'm working on a small program that will conduct an Insertion Sort. A number will be inputted through the keyboard and stored in a variable I called "num." I've decided to use a switch statement in order to obtain the number inputted.               switch( e.getKeyCode() ) {              case KeyEvent.VK_0: num = 0; break;         case KeyEvent.VK_1: num = 1; break;         case KeyEvent.VK_2: num = 2; break;         case KeyEvent.VK_3: num = 3; break;         case KeyEvent.VK_4: num = 4; break;         case KeyEvent.VK_5: num = 5; break;         case KeyEvent.VK_6: num = 6; break;         case KeyEvent.VK_7: num = 7; break;         case KeyEvent.VK_8: num = 8; break;         case KeyEvent.VK_9: num = 9; break;     }      I realized one other course of action could have been to use a set of if statements.               if( e.getKeyCode() == KeyEvent.VK_0 )         num = 0;     else if( e.getKeyCode() == KeyEvent.VK_1 )         num = 1;     etc. for every number up until 9.      I then wondered what the essential difference is between a switch statement and a series of if statements. I know it saves space and time to write, but it's not that much. So, my question is, aside from the space, does a switch statement differ from a series of if statments in any way? Is it faster, less error-prone, etc.? This question really doesn't affect my code that much. I was just wondering. Also, this question pertains to the JAVA language, not any other programming language.


If statements vs switch cases? in a JavaScript game and if to use a function

I am developing a game in JavaScript where you start with a user input, stored in the variable "controller". The options for the user consists of start to start the game or about to learn about the game. I was going to use the following code               if(controller === "start"){         // Game code sitting here     }     else if(controller === "about"){         // All about the Game     }     else{         // Tells the user again to type start to start or about to learn about the game     }      when I realized that I should maybe use switch cases instead... So, my question is when to use switch cases instead of if statements and which I should use in this case. I would also like to know if you think I should store my game code in a function and call it if controller is equal to "start" or just have it sitting inside the if statement/switch case as it is atm?


Should I use switch statements or long if...else chains?

Often when I hear about the switch statement, its put off as a way to replace long if...else chains. But it seems that when I use the switch statement I'm writing more code that I would be just writing if...else. You also have other issues like keeping all variables for all calls in the same scope. Here's some code that represents the flow I normally write (thanks to diam)               String comment;   // The generated insult.     int which = (int)(Math.random() * 3);  //  Result is 0, 1, or 2.          if (which == 0) {         comment = "You look so much better than usual.";     } else if (which == 1) {         comment = "Your work is up to its usual standards.";     } else if (which == 2) {         comment = "You're quite competent for so little experience.";     } else {         comment = "Oops -- something is wrong with this code.";     }      Then they want me to replace that with this:               String comment;   // The generated insult.     int which = (int)(Math.random() * 3);  //  Result is 0, 1, or 2.          switch (which) {         case 0:                    comment = "You look so much better than usual.";         break;         case 1:                    comment = "Your work is up to its usual standards.";         break;         case 2:                    comment = "You're quite competent for so little experience.";         break;         default:                   comment = "Oops -- something is wrong with this code.";     }      Seems like a lot more code in a much more awkward syntax. But is there really an advantage to using the switch statement?


Using a different App-ID, what are the consequences?

The company I work for has recently been given an order to improve an App that is previously developed by a different company. They use a bundle identifier like com.theircompany.appname, however, I cannot register that bundle ID for generating an App ID for APNs. I wonder what the consequences are if I change the bundle ID to, say, com.mycompany.appname?


MSMQ Receive Timeout Even With Items in Queue

Tried posting this on main StackOverflow site, but no replies in 5 days.   I am having ongoing problems trying to implement a very simple MSMQ solution: 2 PCs (not servers) running Win7 and Win8 respectively. Each one monitors data from a hardware system, and periodically saves the data in a local private queue as a DataSet. Old code on a 3rd PC running this code is able to receive or peek the messages fine.               Dim qInfo1 As Object = CreateObject("MSMQ.MSMQQueueInfo")     qInfo1.FormatName = "DIRECT=TCP:192.168.1.123\private$\queue_1"     Dim q1 As Object = qInfo1.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)          Dim qInfo2 As Object = CreateObject("MSMQ.MSMQQueueInfo")     qInfo2.FormatName = "DIRECT=TCP:192.168.1.120\private$\queue_2"     Dim q2 = qInfo2.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)          Dim qMessage1 As Object = CreateObject("MSMQ.MSMQMessage")     qMessage1 = q1.Peek          Dim qMessage2 As Object = CreateObject("MSMQ.MSMQMessage")     qMessage2 = q2.Peek      However, when I try the following .Net code, it doesn't work.               Dim q1 As MessageQueue = New MessageQueue("FormatName:DIRECT=TCP:192.168.1.123\private$\queue_1", QueueAccessMode.ReceiveAndAdmin)     q1.Formatter = New XmlMessageFormatter(New Type() {GetType(XmlDocument)})     Dim q2 As MessageQueue = New MessageQueue("FormatName:DIRECT=TCP:192.168.1.120\private$\queue_2", QueueAccessMode.ReceiveAndAdmin)     q2.Formatter = New XmlMessageFormatter(New Type() {GetType(XmlDocument)})          Dim msg1 As Message = q1.Peek(New TimeSpan(0, 0, 1))     Dim msg2 As Message = q2.Peek(New TimeSpan(0, 0, 1))      Originally I was getting "Access to the queuing system is denied". I researched possible fixes, and implemented the following:   * Made sure all PCs are in same domain.    * Turned off firewalls   * Gave Anonymous Login full privileges.   * Allowed Nonauthenticated Rpc on both machines. The "old" method also required some of the above changes. It works just fine. After the above changes, the "new" .Net method no longer gives me an access denied message, but neither does it retrieve the messages. It always just times out. As I change the timeout parameter, the timeout takes longer or shorter, but always happens, even though there are messages in the queue. During development (with everything on the same PC) either method worked perfectly. Now that I'm peeking remote queues, the .Net method won't work. My work-around is to use the older method, but that is not as robust. There is no timeout parameter, so the receiver program just hangs on the peeks exactly as if there were no messages in the queue. I've made progress, as the .Net method isn't getting access denied errors, but it is not seeing the messages in the queues, hence the timeouts. Any ideas how to solve this?


Is it possible to embed multiple programs into 1

To be more specific, let me explain my end result goal or more of what I would LIKE to have someday and then you can tell me if its even feasible and if not possibly an alternative method. I really would like to have a tool like `smush.it` it is a website Yahoo runs that optimizes images, it is currently one of the best out there. There FAQ page say they use all these programs to do it... **ImageMagick:** to identify the image type and to convert GIF files to PNG files.   **pngcrush:** to strip unneeded chunks from PNGs. We are also experimenting with other PNG reduction tools such as **pngout, optipng, pngrewrite**. Hopefully these tools will provide improved optimization of PNG files.   **jpegtran:** to strip all metadata from JPEGs (currently disabled) and try progressive JPEGs. **gifsicle:** to optimize GIF animations by stripping repeating pixels in different frames. More information about the smushing process is available at the Optimize Images section of Best Practices for High Performance Web pages. So basically you upload an image and it determines it's file type and runs it through the appropriate programs or programs and returns an optimized image and tell the original size and thew new size of the image. If you search across StackOverflow you will see that many people are searching for an all in one program that can do this, mainly from the command line for Build scripts to use. Now I am curious, is it possible to make a program that could be like 1 package that would include all these other programs into it, so on Windows it would be like 1 exe file or even a jar file would probably work as I know Yahoo has a jar file for Javascript compression that my Build script can use. In my searches I have found 1 project that is similar but I am not sure if it is really what I am after, it is http://trimage.org/ it uses uses OptiPNG, PNGCrush, AdvPNG, JPEGOptim. My problem with this 1 is first of all they do not release it for Windows but they say it's may be able to work on Windows, but mainly I saw the source code and it is just a bunch of Python scripts, also the programs it uses, all have to be installed separately. My goal is to be able to not have to install 4-5 separate programs but to have them as 1 Please tell me if this is just a dream or something that's id possible, I only have a PHP background so hardly the knowledge for a project like this


Can unit tests verify software requirements?

I have often heard unit tests help programmers build confidence in their software. But is it enough for verifying that software requirements are met? I am losing confidence that software is working just because the unit tests pass. We have experienced some failures in production deployment due to an untested\unverified execution path. These failures are sometimes quite large, impact business operations and often requires an immediate fix. The failure is very rarely traced back to a failing unit test. We have large unit test bodies that have reasonable line coverage but almost all of these focus on individual classes and not on their interactions. Manual testing seems to be ineffective because the software being worked on is typically large with many execution paths and many integration points with other software. It is very painful to manually test all of the functionality and it never seems to flush out all the bugs. Are we doing unit testing wrong when it seems we still are failing to verify the software correctly before deployment? Or do most shops have another layer of automated testing in addition to unit tests?


How to stand ground when colleagues are neglecting the process?

The problem I am facing:   1. My team members start working on projects without the functional/technical documents ready - even if our company process dictates these should be there before starting.   2. My team members accept cheap, unstructured solutions and will implement **really** bad hacks into software without thinking twice when project management notes they have 'limited time'.   3. My team members start working on projects that work together with an unfinished project from another team - which is untested and unfinished. (causing alot of extra work).   4. Improvements and entire phase(s) of software aren't properly planned, and often result in front-end / design is not finished when the back-end developer has to start work. These problems have been discussed endlessly for multiple times since I have started working here. Everyone agreed and the bottom line was that we **must** enforce the process, that means the back-end developer won't start until everything is taken care of. These issues keep happening - and I am getting really de-motivated up to the point that I am really annoyed with the work itself and some of my colleagues. My team members complain alot - but only towards each other. `They keep on going - whatever the situation is`. The result?   1. I grow insecure, perhaps it's me?   2. Is this just how things are supposed to go? My question? `How can I say no against work ignoring the process if everyone else seems to mindlessly accept?`. That is without looking like some annoying developer who is just looking for something to bitch all the time.


Alternatives to multiple inheritance for my architecture (NPCs in a Realtime Strategy game)?

Coding isn't that hard _actually_. The hard part is to write code that makes sense, is readable and understandable. So I want to get a better developer and create some solid architecture. So I want to do create an architecture for NPCs in a video-game. It is a Realtime Strategy game like Starcraft, Age of Empires, Command & Conquers, etc etc.. So I'll have different kinds of NPCs. A NPC can have one to many abilities (methods) of these: `Build()`, `Farm()` and `Attack()`. Examples:   **Worker** can `Build()` and `Farm()`   **Warrior** can `Attack()`   **Citizen** can `Build()`, `Farm()` and `Attack()`   **Fisherman** can `Farm()` and `Attack()` I hope everything is clear so far. So now I do have my NPC Types and their abilities. But lets come to the technical / programmatical aspect.   **What would be a good programmatic architecture for my different kinds of NPCs?** Okay I could have a base class. Actually I think this is a good way to stick with the DRY principle. So I can have methods like `WalkTo(x,y)` in my base class since every NPC will be able to move. But now lets come to the real problem. **Where do I implement my abilities?** (remember: `Build()`, `Farm()` and `Attack()`) Since the abilities will consists of the same logic it would be annoying / break DRY principle to implement them for each NPC (Worker,Warrior, ..). Okay I _could_ implement the abilities within the base class. This would require some kind of logic that verifies if a NPC can use ability X. `IsBuilder`, `CanBuild`, .. I think it is clear what I want to express.   But I don't feel very well with this idea. This sounds like a bloated base class with _too much_ functionality. I do use C# as programming language. So multiple inheritance isn't an opinion here. Means: Having extra base classes like `Fisherman : Farmer, Attacker` won't work.


How can I structure my code when I have orthogonal arrays of features?

Example: You have a game with different schools of magic (fire, ice, etc). Each school has a set of properties that pertain to independent features of the game, such as:   * strings to be displayed on the GUI (generic data stored in memory)   * graphics, sounds, and other files to be loaded as necessary   * different behaviours (code), e.g. each school of magic has a different interaction with various terrain types I can think of two designs for implementing this, but I don't particularly like either of them.   1. I could make an abstract `MagicSchool` class that contains all the various properties of a given school. This makes the `MagicSchool` class dependent on many distinct features of the game (GUI, SFX, other areas of game logic etc), which seems like an unnecessary mixing of concerns (something of a god class).   2. I could put the GUI/SFX/etc data for each school in the GUI/SFX/etc systems as arrays. But then the code for the magic schools gets scattered all across the project (albeit in very logical places). So in this case, there are two axes along which to structure code: the various magic schools, and the various features in which the schools feature. In terms of clarity and maintainability, which of the above two solutions should I prefer? Or perhaps there's another way I haven't considered yet?


Do bugs from Fuzzing belong in my system tests?

I have recently implemented fuzz testing over one of my projects. Several bugs have come up, generally classifiable as (dare-I-say trivial?) input validation bugs, and I've fixed them. In no case so far have the breakages involved business logic, which I guess is reasonable. My question is in the following: When I get a new feature request for the project, I usually write an automated test to describe the desired behavior (using Lettuce, for instance). Do bugs from fuzz testing belong as part of these behavior descriptions? Myself, I've determined that the advantage of writing explicit test cases is **deterministically verifying against regressions.** Fuzz testing tends not to be deterministic, though in our case our tests don't have a whole lot of surprising randomness in them. At the same time, I've written a few of these, and compared with other tests that describe interesting command sequences and results, **security bug tests are boring, to the point of creating noise for the reader.** Consider the following test shape:               Scenario: Some jerk user doesn't fill in the "home address" form field.       Given an otherwise correctly-filled form on my web page       And a "number of hats" field filled with string "banana"       When the user submits the form       The application should not crash       And the user should be redirected back to the form       And the form should display an error          [repeat for each of 10 fields that could have ridiculous input]      Should I leave this sort of check for the fuzzer which is already catching them through black spells and random opportunity? Or should my regression tests reflect every mistake I've ever made or thought of making?


What problems are Java annotations well suited to?

I've been writing in Java and C# for a while, but I'm having a hard time identifying places where using a custom annotation would be advantageous. I can see that JUnit uses annotations in test classes to identify the order it should run the methods in the test classes, which obviates the need for a configuration of some sort. What are other examples of problems that annotations solve elegantly?


Java without implementation inheritance

In a recent video on Java, Joshua Bloch states at 4 minutes 20 seconds into the video: > And then there's inheritance, and that was a marketing necessity. You know, > we can argue whether you really need implementation inheritance or not. So I wondered: how would Java look like without implementation inheritance? For example, how would `equals`, `hashCode` and `toString` work? Would Java have needed something like mixins instead?


Advantages and disadvantages to using XAML/C# or HTML5/JavaScipt for Metro apps?

I was just wondering if there are any major advantages or disadvantages to using either XAML/C# or HTML5/JavaScript for Metro Apps.


Importance of CS degree when applying for development jobs?

> **Possible Duplicate:**   >  Is a university education really worth it for a good programmer? I'm currently looking for a job as a web developer, and I have ~3 years experience in the field and know PHP and Ruby on Rails fairly well, and HTML/CSS like the back of my hand. I'm also well-versed in jQuery. I'm self- taught in all of these disciplines and I am a voracious learner. I've found several jobs which I think might be good fits, but they all list a BS in Computer Science as a prerequisite to applying, which I don't have. I have a BA in English with an emphasis on Creative Writing. I consider this an asset--not a hindrance--but I'm worried that I won't even be considered since I don't have a BS in CS. How important is a BS in CS when applying for a job for which that is the only prerequisite I don't satisfy? How can I sell myself to these positions not having a BS?


Is a university education worth it for a good programmer?

I've been doing design and programming for about as long as I can remember. If there's a programming problem, I can figure it out. (Though admittedly Stack Overflow has allowed me to skip the _figuring out_ and get straight to the _doing_ in many instances.) I've made games, esoteric programming languages, and widgets and gizmos galore. I'm currently working on a general-purpose programming language. There's nothing I do better than programming. Is a university education really more than just a formality?


Getting first job without a technical degree

How difficult would it be for someone with a college degree in social science to land their first job as a junior developer? This is assuming they have experience with open source projects, have a reasonable amount of small projects of their own written in various languages, and a passion for developing software. Would a degree that is not in computer science, electrical engineering, math etc. harm their chances? Thank you.


Is it better to have file stored as a zip in cloud service?

I am developing enterprise iPad application which contained large amount of different bundle data in terms of group of images. Is it worth to stored as a compressed file format or normal set of individual files? I am not worrying about huge amount of data which is reside in the cloud. My concern is that cloud computing provider only charges depending upon the request not about how much data where stored. If I store single file in cloud then it make more request while using the app. So it will cost so much. Is it better to be stored as a compressed file in cloud?


Which tools to use for Embedded Linux C++ development with a fast compiler and possibly cross platform

I'm not happy with our build environment for our Linux based (Ubuntu 10.04) equipment. It is embedded software we are developing. What I would like is to have the optimal mix of these wishes:   * Use proven tools and libraries   * Be able to develop on both Linux and Windows      * Ideally: use the same tooling on both platforms   * Have a fast development cycles, especially on Windows Note that paying for good stuff is definitely an option. Note also that C++ and Linux are the only two hard requirements, everything else is open for debate. We currently use Boost and STL libraries for obtaining as much platform independence as possible. CodeBlocks is our cross-platform IDE and we use the gcc tool-chain (compiler, linker, debugger, not make). All are excellent open source projects but they have their limitations. Biggest problems with the current environment:   1. Compared with MS Visual C++, I feel gcc is very slow. A lot of time is spent compiling and especially linking. gcc's pre-compiled header support gives you no way near the same performance gain as with VC and with boost you really need it. Also, statically linking a few boost libraries takes forever. (Would using dynamic linking change much?)   2. CodeBlocks has no support for what in VC are property files. This makes it difficult to enforce that build options are the same for all projects in the workspace.   3. Related to build speed: CodeBlocks has no "compile this project only" support like VC has. When changing a single source file, CodeBlocks spends too much time checking for the need to compile files I know haven't changed.  Some of my own thoughts so far:   * Biggest issue is having a fast, reliable compiler and linker on all platforms we develop on. If this is solved what about doing development on multiple platforms? Are Intel C++ compilers an option (we don't really need the performance optimization of those compilers)? Should we consider doing cross compilation?   * Should we use a make based build? It seems a solution when it proves difficult to use the same IDE/build tooling on windows and Linux. I find make difficult so that is holding me back.   * Is there a single product of equivalent maturity as Visual Studio (IDE and tool chain) available for Windows and Linux? Or for that matter, for Linux only?   * How much simpler would life be if we decided develop only on Linux? Right now we all use Windows as it is supported by IT, our non-development software is all windows and we have limited Linux expertise in our company. Your thoughts please.


Sending username and password in every request from iPhone app

I'm writing a mobile app & web service combo that requires user to login. The web service will be using SSL, so are there any reasons against sending the user name and password in every web request? I know some sites generate a token after the user logs in, that they can use for authentication, but the token seems equivalent to the username/password pair - so I'm not sure there's much point in doing that. Am I about to make a big mistake in terms of security?


Design pattern for an ASP.NET project using Entity Framework

I'm building a website in ASP.NET (Web Forms) on top of an engine with business rules (which basically resides in a separate DLL), connected to a database mapped with Entity Framework (in a 3rd, separate project). I designed the Engine first, which has an Entity Framework context, and then went on to work on the website, which presents various reports. I believe I made a _terrible design mistake_ in that the website has its own context (which sounded normal at first). I present this mockup of the engine and a report page's code behind: Engine (in separate DLL):               public Engine     {         DatabaseEntities _engineContext;              public Engine()         {            // Connection string and procedure managed in DB layer             _engineContext = DatabaseEntities.Connect();         }              public ChangeSomeEntity(SomeEntity someEntity, int newValue)         {             //Suppose there's some validation too, non trivial stuff             SomeEntity.Value = newValue;             _engineContext.SaveChanges();         }     }      And report:               public partial class MyReport : Page     {         Engine _engine;         DatabaseEntities _webpageContext;              public MyReport()         {             _engine = new Engine();             _databaseContext = DatabaseEntities.Connect();         }              public void ChangeSomeEntityButton_Clicked(object sender, EventArgs e)         {             SomeEntity someEntity;             //Wrong way:             //Get the entity from the webpage context             someEntity = _webpageContext.SomeEntities.Single(s => s.Id == SomeEntityId);             //Send the entity from _webpageContext to the engine             _engine.ChangeSomeEntity(someEntity, SomeEntityNewValue); // <- oops, conflict of context                  //Right(?) way:             //Get the entity from the engine context             someEntity = _engine.GetSomeEntity(SomeEntityId); //undefined above             //Send the entity from the engine's context to the engine             _engine.ChangeSomeEntity(someEntity, SomeEntityNewValue); // <- oops, conflict of context          }     }      Because the webpage has its own context, giving the Engine an entity from a different context will cause an error. I happen to _know_ not to do that, to only give the Engine entities from its own context. But this is a very error- prone design. I see the error of my ways now. I just don't know the right path. I'm considering:   * Creating the connection in the Engine and passing it off to the webpage. Always instantiate an Engine, make its context accessible from a property, sharing it. Possible problems: other conflicts? Slow? Concurrency issues if I want to expand to AJAX?   * Creating the connection from the webpage and passing it off to the Engine (I believe that's dependency injection?)   * Only talking through ID's. Creates redundancy, not always practical, sounds archaic. But at the same time, I already recuperate stuff from the page as ID's that I need to fetch anyways. What would be best compromise here for safety, ease-of-use and understanding, stability, and speed?


Simplicity-efficiency tradeoff

The CTO called to inform me of a new project and in the process told me that my code is weird. He explained that my colleagues find it difficult to understand due to the overly complex, often new concepts and technologies used, which they are not familiar with. He asked me to maintain a simple code base and to think of the others that will inherit my changes. I've put considerable time into mastering LINQ and thread-safe coding. However, others don't seem to care nor are impressed by anything other than their paycheck. Do I have to keep it simple (stupid), just because others are not familiar with best practices and efficient coding? Or should I continue to do what I find best and write code _my way?_


Do I have to release the code of a MIT licensed software running a GPL library?

Lets say I'm using Node-Webkit, an MIT licensed app runtime. Now, let's say I decide to include a Javascript library which is GPL licensed: while I do not modify the downloaded JS file, I do write my own code making use of the library's functions. I plan to sell the final obfuscated executable and I'm wondering: what's the final license of the complete software? Do I only have to release the GPL library or does the GPL license apply for all the code I wrote? What happens to Node-Webkit's MIT license?


"Programming error" exceptions - Is my approach sound?

I am currently trying to improve my use of exceptions, and found the important distinction between exceptions that signify programming errors (e.g. someone passed null as argument, or called a method on an object after it was disposed) and those that signify a failure in the operation that is not the caller's fault (e.g. an I/O exception). How should these two kinds of exceptions be treated differently? Do you think that error exceptions need to be explicitly documented, or is it enough to document the relevant preconditions? And can you leave out the documentation of a precondition or error exception if it should be obvious (for example, `ObjectDisposedException` when calling a method on a disposed object)


Is there any reason why I should use parentheses when calling new in PHP?

When there are no arguments, we have these two options:               $obj = new MyClass;      vs.               $obj = new MyClass();      I always pick the former, just because. Any thoughts?


When using method chaining, do I reuse the object or create one?

When using method chaining like:               var car = new Car().OfBrand(Brand.Ford).OfModel(12345).PaintedIn(Color.Silver).Create();      there may be two approaches:   * Reuse the same object, like this:              public Car PaintedIn(Color color)     {         this.Color = color;         return this;     }        * Create a new object of type `Car` at every step, like this:              public Car PaintedIn(Color color)     {         var car = new Car(this); // Clone the current object.         car.Color = color; // Assign the values to the clone, not the original object.         return car;     }      Is the first one _wrong_ or it's rather a personal choice of the developer? * * * I believe that he first approach may quickly cause the intuitive/misleading code. Example:               // Create a car with neither color, nor model.     var mercedes = new Car().OfBrand(Brand.MercedesBenz).PaintedIn(NeutralColor);          // Create several cars based on the neutral car.     var yellowCar = mercedes.PaintedIn(Color.Yellow).Create();     var specificModel = mercedes.OfModel(99).Create();          // Would `specificModel` car be yellow or of neutral color? How would you guess that if     // `yellowCar` were in a separate method called somewhere else in code?      Any thoughts?


What level/format of access should be given to a client to the issue tracking system?

So, I used to think that it would be a good idea to give the customer access to the issue tracking system, but now I've seen that it creates less than ideal situations, like:   * Customer judging progress solely on ticket count   * Developers denied to add issues to avoid customer thinking that there is less progress   * Customer appointing people on their side to add issues who don't always do a good job (lots of duplicate issues, insufficient information to reproduce, and other things that distract people from doing their real job) However, I think customers should have access to some indicators or proof that there is progress being done, as well as a right to report bugs. So, what would be the ideal solution to this situation?, specially, getting out of or improving the first situation described?


What are some good Photo and Artwork APIs?

We had an idea for starting a ecards service and were looking into the possibility of populating our site using photo/artwork APIs. Due to legal reasons, Flikr probably won't work, although I've started to scour the web for other options. Basically we just need two functions   1. the user should be able to browse the site's collection and choose a picture    2. we should be able to recall and render a specific picture on our site. From there we should have no problem building our application. The main obstacle is that we're lacking content at the moment. I haven't been able to find too many examples of this being done, so I was wondering if anyone here might know people who have done something similar to what we're trying to do, or know of any leads that might be able to help us out. Suggestions for other APIs that are out there, or forums/communities that might be able to point us in the right direction are also welcome.


Picking the right license

I have some trouble with picking the right license for my works. I have a few requirements:   * Not copyleft like the GNU (L)GPL and allows for redistribution under other licenses   * Allows other people to redistribute your (modified) work but prevents that other people freely make money off my work (they need to ask/buy a commercial license if they want to)   * Compatible with the GNU (L)GPL   * Not responsible for any damage caused by my work Now, I wrote my own little license based on the BSD and CC Attribution- NonCommercial 3.0 licenses, but I am not sure if it will hold in court.               Copyright **< year>** **< copyright holder>**. All rights reserved.          Redistribution of this work, with or without modification, are permitted     provided that the following conditions are met:             1. All redistributions must attribute **< copyright holder>** as the original           author or licensor of this work (but not in any way that suggests that           they endorse you or your use of the work).        2. All redistributions must be for non-commercial purposes and free of charge           unless specific written permission by **< copyright holder>** is given.          This work is provided by **< copyright holder>** "as is" and any express or implied     warranties are disclaimed. **< copyright holder>** is not liable for any damage     arising in any way out of the use of this work. Now, you could help me by either:   * Point me to an existing license which is satisfies my requirements   * Confirm that my license has no major flaws and most likely would hold in court **Edit:** Can you define "compatible with the GNU (L)GPL"? "compatible with the GNU (L)GPL" means that all code licensed under it is able to be imported in a GNU (L)GPL project, but not (necessarily) vice-versa. I used the wording "non-commercial" but I mean it should be illegal to ask for money for a (modified) redistribution unless you bought the "commercial" license. **EDIT** So basicly I'm asking something impossible. In order of importance for me:   1. Not copyleft like the GNU (L)GPL and allows for redistribution under other licenses   2. Compatible with the GNU (L)GPL   3. Allows other people to redistribute your (modified) work but prevents that other people freely make money off my work (they need to ask/buy a commercial license if they want to) The first and second are perfectly compatible, but the last is not compatible with the second, and going open-source is not compatible with the first. RAAH! This is the new license I'll be using. 10 lines, quick to the point and tight (from a IANAL view).               Copyright **< year>** **< copyright holder>**. All rights reserved.          Redistribution of this work, with or without modification, is permitted if     **< copyright holder>** is attributed as the original author or licensor of     this work, but not in any way that suggests that **< copyright holder>** endorses     you or your use of the work.          This work is provided by **< copyright holder>** "as is" and any express or implied     warranties are disclaimed. **< copyright holder>** is not liable for any damage     arising in any way out of the use of this work.


How do you organize a medium-sized team with a very large, older codebase?

There are already few questions here on Programmers about organizing small teams, but we have a bigger (medium-sized?) team, and that's a bit of a different animal. So, my question is this: **How do you organize a medium-sized team with a very large, older codebase**? Or better, let's quantify it a little more clearly: The team has:   * 20 Developers (good mix of senior and junior)   * 7 QA Folks The product is large (2 million lines of code) with 10-12 major modules divided over three major areas (Desktop client, backend server, web). The team needs to do:   * support/maintenance for the existing customer base   * Customize the product to support new sales and existing customers   * Build new features to keep the product moving forward   * provide regression testing for all new features as well as fleshing out regression for technical debt Specific sub-questions:   * What are the thoughts on "Specific support team" vs. "Module teams fix all their bugs"   * How do you maximize development time and minimize admin time (code reviews, other "lead developer stuff")   * How do you integrate/organize the QA people to ensure proper testing and regression suites?    * What non-technical positions (QA Manager, Dev Manager, etc.) might be good for maximizing developer productivity? Your thoughts on the matter are greatly appreciated. EDIT: I should add that I'm not clueless here, I'm just trying to stimulate some ideas. This isn't an easy problem, and so I'm open to the wisdom of you fine people here.


Any examples of using Visio to document software?

I have Visio 2010 and want to learn how to use it to document software. Does anyone have examples of what Visio does well? Are there any things that Visio can do, but there are better tools for the job? What are your experiences?


Identifying Users

We have a site that allows users to generate their own content. If users generate illegal content, we'll be submitting a report to the authorities. In the event that we do have to report a user, we want as much info as possible on that user. With that said, I have two questions:   * Is tracking the user's ip address enough to identify them?   * And, we track the user's ip address in the sessions table which gets wiped clean periodically. Should we archive the sessions data to retain that info or should we put an ip_address field in the our Post and Comments tables instead?


What came first, the compiler, or the source?

I'm curious about the birth of the compiler. How did programming begin? Did people first build hardware that recognized a certain set of commands, or did people define a language and then build hardware around it? And on a related note, what was the first programming language?


Who owns code if project cancelled

The problem: I am working on a freelance marketplace, and I decided to cancel project with one of my clients, because client is impossible to work with with limitless delays and lots of bugs in his backend. I want to give him a partial refund (partial because I worked for two months and there is 3k lines of code, though application still not working due to problems from his backend). The question: who is "owner" of code which I have wrote? We did no agreement about it upon project was started. Can I tell him to not use my code? I understand, that he can ignore my forbid anyway, I just want to know if I have formal "right" to say so.


All around design book for a developer (Javascript dev)

I have begun doing a lot of javascript development recently, mostly front-end but also using node.js. As I am currently in the transition from large company to startup, they expect me as a front end developer to know how to produce semi decent designs (Which I cannot) I am looking for a book (or set of screencasts) to give me some good well rounded advice on design. I know CSS, but my design are always awful looking, I also know nothing about Photoshop (and am on Linux and have no access to it) What are your picks? I am not looking to be a full time designer I would just like to be able to contribute.


Test Interview Question

If you only had time to test 5 features of a product that had 10 features total, how would you decide which features to test? Another Question: When is it okay to ship a product with a bug


When to use typedef?

I'm a bit confused about if and when I should use typedef in C++. I feel it's a balancing act between readability and clarity. Here's a code sample without any typedefs:               int sum(std::vector<int>::const_iterator first,              std::vector<int>::const_iterator last)     {         static std::map<std::tuple<std::vector<int>::const_iterator,                                    std::vector<int>::const_iterator>,                         int> lookup_table;              std::map<std::tuple<std::vector<int>::const_iterator,                             std::vector<int>::const_iterator>, int>::iterator lookup_it =             lookup_table.find(lookup_key);              if (lookup_it != lookup_table.end())             return lookup_it->second;                          ...     }      Pretty ugly IMO. So I'll add some typedefs within the function to make it look nicer:               int sum(std::vector<int>::const_iterator first,              std::vector<int>::const_iterator last)     {         typedef std::tuple<std::vector<int>::const_iterator,                            std::vector<int>::const_iterator> Lookup_key;         typedef std::map<Lookup_key, int> Lookup_table;              static Lookup_table lookup_table;              Lookup_table::iterator lookup_it = lookup_table.find(lookup_key);              if (lookup_it != lookup_table.end())             return lookup_it->second;                          ...     }      The code is still a bit clumsy, but I get rid of most nightmare material. But there's still the int vector iterators, this variant gets rid of those:               typedef std::vector<int>::const_iterator Input_iterator;          int sum(Input_iterator first, Input_iterator last)     {         typedef std::tuple<Input_iterator, Input_iterator> Lookup_key;         typedef std::map<Lookup_key, int> Lookup_table;              static Lookup_table lookup_table;              Lookup_table::iterator lookup_it = lookup_table.find(lookup_key);              if (lookup_it != lookup_table.end())             return lookup_it->second;                          ...     }      This looks clean, but is it still readable? When should I use a typedef? As soon as I have a nightmare type? As soon as it occurs more than once? Where should I put them? Should I use them in function signatures or keep them to the implementation?


Finding right bug tracker web application

I'm looking for a bug tracking system (similiar as http://www.mantisbt.org) with these following requirements: * * * Requirement specifications are:   1. Upload picture and different files without any limitaton of the file's space.   2. If user belong to a specific group or businesss group, the GUI:s logotype should be changed into group's logotype after the user has entered user name and password. All user use the same database with different GUI.   3. Right information of unassigned, modified and resolved bug case will be displayed based on what group or business group that the user is assigned to.   4. All information will display after the user has logged in.   5. Enable to create 1 or more super user (administrator) and regular user.   6. Right user with right group or business group will retrieve right information. Non functional requirement:   1. The bugging tracker take place in a webbapplication.    2. All information must use web browser to view all information. * * *


Communication between WCF service [library] and Self-host [Winform]

**Introduction** : I have a WCF service library and a self-host Winform. Service features is File explorer including _(copy, move, delete, new folder, delete... etc)_ and Task Manager _(run, kill, update list)_. Then now I want to add other features like chatting between self-host and client, send an image from client to self-host so when it received, it is shown in a pictureBox in a new form. Till now I have two endpoints for (Task Manager, File Manager) that runs under one service "MainService". And I set up all the connections using DotNet 4.0 WCF Configuration and Wizards, and I'm using netTcpBinding. **Problem** :   I need to know how to communicate with between WCF service lib and self-host, so I can append a received chat from client on self-host form's textbox `TextBoxChat`. And also call a client callback from self-host when Send button clicked, to send the message from self-host textbox `TextBoxMessage`. Let's say this's self-host ChatForm ![http://i.stack.imgur.com/CWL8H.jpg](http://i.stack.imgur.com/CWL8H.jpg) So is it possible to do that in WCF? I would prefer to run ChatEndpoint under MainService, so all Endpoints use one port.


How to find your path in the programming world

It seems like to become a successful programmer one should choose a single language, technology, platform, field and focus on it. The problem is there are so many interesting things in this area I can't stop choosing, I found myself learning basics of a lot of programming languages/technologies and immediately moving to something else. So I'm spending a lot of time with such a little use. I've been .NET/C#/WPF developer for more than a year now, I'm not a bad programmer, but I could be so much better if I were more focused on my current technology stack though I feel like I'll be stuck with making meaningless business application and GUI this case. May be getting a fulfilling job making something useful would help me, but to get this kind of job one should already be proficient in some field. So I desperately need an advice. How to choose your way and be sure you're not making a mistake? How to stop worrying and start programming?


How to evaluate JNI approaches with Java and Fortran?

Right now we've got about 150k lines of Java broken into two major parts. The first contains an implementation of the algorithms we're hoping to redo in Fortran, and the second has a good chunk of GUI to get them to the point where they can be run. The UI is mostly Swing but new work is JavaFX. The goal is to re-implement (and update) those algorithms in fortran, and tie their current level of integration into the java front-end. The model involves data going both ways accross the bridge between the two languages: configuration data would be supplied from the GUI to the fortran code, and big interesting matrices will be sent back. To complicate things, the configuration data will contain a number of open delegates, typically these delegates take a vector of doubles and spit out a scalar value, but in a number of cases they'll actually perform complex file or network operations which take both time and resources. I've got three thoughts on how we can do it:   1. Create a wide POJO interface into Fortran, use JNI      * The first idea, the simplest, and the fastest to value is to factor out key points in the flow of the fortran code, and have those points issue returns from Fortran through JNI back to java, with result data.      * This is my least preferred option because it will require a good amount of collaboration between the Java front-end and the Fortran back-end whenever we need to change that interface. Further, keeping those critical points in Java might prove impossible as the algorithms in fortran change, and as we want deeper integration with the front-end.   2. Create a callback-based interface into Fortran, use JNI      * This to me is probably the most sophisticated solution since it involves calling familiar object-oriented pub-sub via nasty procedure pointers in fortran. The idea would be fairly typical from the front-end side. Create an interface with a number of "onInterestingDomainEvent" message handles with as primitive a set of arguments as possible.      * We've done a little bit of exploration here and haven't gotten the syntax we need: one of our compilers is consistently complaining about something.   3. Create two processes before app start, read/write from pipes in Java & Fortran     * This seems to me to be a good solution that might be a bit heavy handed. I'm a little worried about the performance of this (especially if I cant get at proper named pipes from Java & Fortran).      * I'm worried about a second process for, well, everything that a second process entails, including synchronization, error handling, and security.      * There's a lot of atypical code that has to be written to make this solution work, but I am confident that it can work and that it gives us all of our requirements, aside from the performance worry.  **Where I need help:** I need help in understanding how to evaluate these three approaches or in understanding what I should be looking at instead. My primary concern is performance or throughput between the two applications as I'm trying to minimize bottlenecks. And I know I need to keep the principles of decoupling in mind as well. * * * To address some of the easier solutions / concerns before jumping to JNI:   * We have already optimized the algorithm implementations while using a performance analyzer. They still aren't fast enough, and we have seen similar algorithms written in Fortran perform much faster.   * We don't control the hardware that our clients will deploy our solution on. So we can't just throw bigger and bigger hardware at this problem.   * The research team that develops these algorithms has a lot of Fortran experience and they will be responsible for maintaining this port.


Books or guides regarding secure key storage and database encryption

I have an idea for a SaaS product I want to create, however, this product will store extremely sensitive data that needs to be encrypted at rest. The trouble is not so much the encryption, but the problem of securely storing the keys so that in the event the server was somehow compromised, the keys couldn't just be recovered and used to decrypt the database. Are there any decent books to guides regarding database encryption, and in particular secure key storage? This seems to be a less than straightforward topic and something that is difficult to get right. I'm seeing multiple ways to attack such a system, but unable to come up with one that is secure enough to store highly confidential information.


What types of positions might involve improving processes using CMMI and Scrum?

I'm an IT student and have been working on team based projects for several years. I've read some papers about CMMI and Scrum; this is really interesting to me and I would like to know what kind of jobs involve improving processes inside an organization. What kind of studies can lead someone towards these jobs? Management? I doubt it's only that, as CMMI/Scrum affect management as well, I think it's something above it all, that will hold together the organization.


What to answer to a customer who asks which one of two equivalent technologies must be used?

As a freelancer, I am often asked by my customers what they must choose between similar elements, neither of which being better than another. Examples: > “Do I need my e-commerce website be in PHP or ASP.NET?” > > “Do I need to host this ordinary web service in Cloud or use an ordinary > hosting service?” > > “Which one is better for my new website: MySQL or Oracle?” etc. There is maybe at most 1% of cases where the choice is relevant, and there is a real, objective reason to use one over another, based on the precise metrics and studies. In all other cases, it doesn't matter at all. It is totally, completely irrelevant, either because there are no implications¹, or because those implications are too small to be taken in account², or, finally, because it's impossible to predict those implications³. If you know one thing and not another one, the answer to those questions is easy: > “You can either write the application in C# or Java, both being probably > equivalent in your case. Note that I'm a C# developer, so if you choose > Java, I would not be able to work on your project and you would need to find > another freelancer.” When you know both technologies, you can't answer that. In this case, how to explain to the customer that the question he asks is subject to flamewar and has no real consequences on his project? In other words, how to explain that you've chosen to use one technology rather than an equivalent one for the reasons related to human resources, without giving the impression to be unprofessional or to not care about the project? * * * ¹ Example: Is MySQL better (worse?), performance-wise, compared to Oracle, for a personal website which will be accessed by, oh, let's be optimistic, two people per day? ² Example: for a given project, I was asked to asset if Windows Azure hosting would be cheaper than the hosting of the same application on a well-known ASP.NET hosting provider. The cost revealed to be exactly the same. ³ Example: your customer have _an idea_ of a future application (the idea itself being extremely vague). There is no business plan, no requirements, nothing at all. Just an idea. You are asked if Java is better than C# for this app. What do you answer?


Performance of Scala compared to Java

First of all I would like to make it clear that this is not a language-X- versus-language-Y question to determine which is better. I have been using Java for a long time and I intend to keep using it. Parallel to this, I am currently learning Scala with great interest: apart from minor things that take some getting used to my impression is that I can really work very well in this language. My question is: how does software written in Scala compare to software written in Java in terms of execution speed and memory consumption? Of course, this is a difficult question to answer in general, but I would expect that higher level constructs such as pattern matching, higher-order functions, etc, introduce some overhead. However, my current experience in Scala is limited to small examples under 50 lines of code and I haven't run any benchmarks up to now. So, I have no real data. If it turned out that Scala _does have_ some overhead wrt Java, does it make sense to have mixed Scala / Java projects, where one codes the more complex parts in Scala and the performance-critical parts in Java? Is this a common practice? **EDIT 1** I have run a small benchmark: build a list of integers, multiply each integer by two and put it in a new list, print the resulting list. I wrote a Java implementation (Java 6) and a Scala implementation (Scala 2.9). I have run both on Eclipse Indigo under Ubuntu 10.04. The results are comparable: 480 ms for Java and 493 ms for Scala (averaged over 100 iterations). Here are the snippets I have used.               // Java     public static void main(String[] args)     {         long total = 0;         final int maxCount = 100;         for (int count = 0; count < maxCount; count++)         {             final long t1 = System.currentTimeMillis();                  final int max = 20000;             final List<Integer> list = new ArrayList<Integer>();             for (int index = 1; index <= max; index++)             {                 list.add(index);             }                  final List<Integer> doub = new ArrayList<Integer>();             for (Integer value : list)             {                 doub.add(value * 2);             }                  for (Integer value : doub)             {                 System.out.println(value);             }                  final long t2 = System.currentTimeMillis();                  System.out.println("Elapsed milliseconds: " + (t2 - t1));             total += t2 - t1;         }              System.out.println("Average milliseconds: " + (total / maxCount));     }          // Scala     def main(args: Array[String])     {         var total: Long = 0         val maxCount    = 100         for (i <- 1 to maxCount)         {             val t1   = System.currentTimeMillis()             val list = (1 to 20000) toList             val doub = list map { n: Int => 2 * n }                  doub foreach ( println )                  val t2 = System.currentTimeMillis()                  println("Elapsed milliseconds: " + (t2 - t1))             total = total + (t2 - t1)         }              println("Average milliseconds: " + (total / maxCount))     }      So, in this case it seems that the Scala overhead (using range, map, lambda) is really minimal, which is not far from the information provided by World Engineer. Maybe there are other Scala constructs that should be used with care because they are particularly _heavy_ to execute? **EDIT 2** Some of you pointed out that the println's in the inner loops take up most of the execution time. I have removed them and set the size of the lists to 100000 instead of 20000. The resulting average was 88 ms for Java and 49 ms for Scala.


Node.js, socket.io vs User Initiated Refresh button and Server Load Considerations

I'm dealing with a situation here on a high volume multi-tenant web app with over 100k users from companies who do not appreciate performance issues. We have a need for "real-time" updates.. we're basically sending out a request to a 3rd party system, and we'd like to see the results real-time, there's about 5 statuses returned, and the first three statuses happen very quickly (within a minute or so).. Our current implementation is to have a refresh cycle which happens every five minutes.. (partial page postback with Jquery), the user can override this by clicking on a refresh button.. The reason we went with this approach is because of the potential server load with "long-polling", or frequent post backs (every 2 seconds), and the burdon it would put on our server (we have a few Databases and Webservers, so maintaining a changelog is out of the question) at the time we hadnt looked into node.js / socket.io, which brings me to my question: if socket.io only works on modern browsers and has to revert to either Flash or Long-polling if the required functionality is not available in the browser, is there really any benefit to using this technology today (as opposed to 2 years from now when the last of the i.e 6 users are forced to update)? the problem is we dont want to bring the server to it's knees because worst case this thing is going to keep the http connections open for an extended duration and really mess up our users experience (our apps on the webserver, i did not design the system)


Why do we have so many flavors of .NET? Is it a good thing?

There are many "flavors" of the .NET Framework:   * Full ("normal")   * Client profile subset   * Silverlight in web browsers   * "Silverlight" on Windows Phone   * Compact framework   * WinRT When C# code is needed on a new platform, it would seem that Microsot prefer to take the full CLR and strip it down to a small subset, creating new assemblies and moving types around, instead of just using existing assemblies such as those in the BCL. Silverlight for example has different classes/methods to WPF (even down to some methods having slightly different signatures or very different implementations), instead of simply referencing the same implementation of `List<T>` as WPF. Is this the ideal architecture, or a sign of legacy? Shouldn't the BCL run on all platforms, with just different presentation/IO libraries on each? Or are the BCL and other libraries too bloated, and splitting them out would create too many backward compatibility problems, to be acceptable? If we started from a blank canvas and weren't worried about backwards compatibility, would the current situation really be the best way to handle multiple platforms?


How can I get started using TDD to code some simple functionality?

I basically have the gist of TDD. I'm sold that it's useful and I've got a reasonable command of the MSTEST framework. However, to date I have not been able to graduate to using it as a primary development method. Mostly, I use it as a surrogate for writing console apps as test drivers (my traditional approach). The most useful thing about it for me is the way it absorbs the role of regression testing. I have not yet built anything yet that specifically isolates various testable behaviors, which is another big part of the picture I know. So this question is to ask for pointers on what the first test(s) I might write for the following development task: I want to produce code that encapsulates task execution in the fashion of producer/consumer. I stopped and decided to write this question after I wrote this code (wondering if I could actually use TDD for real this time) **Code:**               interface ITask     {         Guid TaskId { get; }         bool IsComplete { get; }         bool IsFailed { get; }         bool IsRunning { get; }     }          interface ITaskContainer     {         Guid AddTask(ICommand action);     }          interface ICommand     {         string CommandName { get; }         Dictionary<string, object> Parameters { get; }         void Execute();     }


Do any programmers use a pen and tablet instead of a mouse? Is it better?

I've injured my wrist and looking over at the designer sitting across me using his pen and tablet made me think if that's something a web developer (20-40% time spent in photoshop) could use and maybe even be more efficient in the long term? **Are you a developer using pen / tablet and seriously not missing a mouse anymore? Why?** I did a search and found these but they don't answer my question exactly, or in enough detail:   * Development with a tablet (dated 2008)   * One handed coding with tablet   * One guy using a tablet / pen likes it   * Programming with feet?   * A designer switches to a tablet (good comments) But what I did find I can summarise as follows:   * It is easier on the wrist.   * There is a learning curve.   * For pointing intensive work (ala photoshop) it is superior.   * You get better at keyboard shortcuts if you're not already.   * You might hold the pen while you type if you find picking up / putting down harder.   * Tablet to screen mapping is awesome (absolute positioning, i.e. tablet corner = screen corner) I think I've almost convinced myself here :)


What should I put into my online development portfolio?

Online portfolios are very popular with designers, but what about developers? I'm a Java web developer who also enjoys writing Javascript, and I was thinking of putting up a site with links to a Github repository. What kinds of things do you think would impress a potential employer? Do other programmers put up such portfolios? Can you share links and your experiences?


Dangers of huge monolithic application

The big project I'm working on for a couple years now is a control (and everything) application of an advanced device, heart of its firmware. The device is quite advanced, with more different functionalities than I could say from memory, and 98% of them are handled by this one huge executable. In one hand, the program is quite maintainable, well modularized inside, properly documented, there's a reasonable separation of functionalities by directories and files and so on. But in the end it gets all clustered into one application that does everything from remote database communication, touchscreen handling, handling a dozen various communication protocols, measurements, several control algorithms, video capture, sunrise time and date of easter (seriously, and they are needed for very serious purposes!)... In general, stuff that is very thinly related, often related only through some data that trickles between some far modules. It could be done as several separate executables communicating with each other, say, over sockets, with more specific purpose, maybe loaded/unloaded as needed, and so on. No specific reason why it is made this way. In one hand, it works, and it works okay. The project is more simple, without maintaining build of multiple binaries. The internal structure is easier too, when you can just call a method or read a variable instead of talking over sockets or shared memory. But in the other hand, the size, the scale of this thing just creeps me out, it feels like piloting Titanic. I was always taught to modularize, and clumping everything into one gargantuan file feels wrong. One problem I know is a heavy crash of one (even insignificant) module crashes all - but code quality assures this doesn't really happen in release versions. Otherwise, internal separation and defensive programming assures this will still run mostly correctly even if half of the internal modules fail normally for some reason. What other dangers did I overlook? Why does this creep me out? Is this just irrational fear of unknown? Is making serious big projects this way an accepted practice? Either calm my fears or give me a good reason to refactor version 2.0 into multiple smaller binaries.


Storing session in a static variable?

I'm currently checking a older piece of C# code used to maintain a login session.               public static ZRWebserviceSession CurrentSession { get { return _currSession; } set { _currSession = value; } }     private static ZRWebserviceSession _currSession;               public static bool IsSessionActive()     {         if (_currentSession == null || !_currentSession.IsOpen || !_currentSession.IsLoggedIn) {              return false;         }         return true;     }      I was always told using globals is bad practice and I'm looking for ways to improve this bit of code by at least getting rid of the static field used to maintain the session. The current situation is as follows: When the application starts the session object is initiated with a server address (taken from a config file) it should connect to. The object then retrieves the session data (token etc.) from the server to store within itself and it is then assigned to the static variable for access through the entire application. This is only done at the start of the application run or when the user explicitly restarts the session. While a session is active other pieces of code can then call methods on the session object to retrieve the session data and make calls to the connected webservice. Can this be improved? Is using globals still a bad practice if used for sessions or something akin to that? EDIT: To clarify what kind of application this is: This isn't a web application but a client application that connects to a webservice. ZRWebserviceSession is a library object that represents a login session for the user currently using the client application. Kind of like the the session object of the Fabebook SDK https://developers.facebook.com/docs/reference/ios/current/class/FBSession/.


Limitations of UML?

I'm currently studying for an examination and one of the sample paper questions is to discuss the limitations of UML. Most of the material I'm finding on the net is relating to a specific UML implementation or language. I'm wondering from a generalists point of view what would you consider the limitations of UML to be?


What's the effect of this assignment (whatever the language)?

I think my book (Programming Languages: Principles and Paradigms) is wrong. `a` is a vector, assume a C-like language:               b = 0;     a[f(3)] = a[f(3)] + 1;          int f(int n) {         if(b == 0) {             b = 1;                  return 1;         }         else return 2;     }      > It has the effect of assigning the value of `a[1] + 1` to `a[2]` whenever > the evaluation of the left-hand component of the assignment precedes the > evaluation of the right-hand one. For me, it has the opposite effect, that is assigning the value of `a[2] + 1` to `a[1]`. Because the left-hand component is evaluated first, so `f` returns `1` (because `b` is `0`), thus `a[1]`. Then the right-hand component is evaluated, `f` returns `2` (because now `b` is `1`), thus `a[2] + 1`. Am I right and the book is wrong? Unfortunatly there is no errata...


Where do the parser and service objects fit in MVC?

Do NSURLConnection service objects and XML/JSON parser objects fall within the controller layer or the model layer? Why? Is it OK to have business logic in the controller? Or should it be in the model layer only? Can the model layer be represented by NSArray/NSDictionary objects or should it be strictly structured with custom objects to comply with the MVC pattern, given that my app doesn't require persistent storage.


Architecture/pattern resources for small applications and tools

I was wondering if anyone had any resources or advice related to using architecture patterns like MVVM/MVC/MVP/etc on small applications and tools, as opposed to large, enterprisy ones. EDIT: Most of the information I see on application architecture is directed at large, enterprise applications. I'm just writing small programs and tools. As far as using these architecture patterns, is it generally worthwhile to go through the overhead of using an MVC/MVVM framework? Or would I be better off keeping it simple?


What are the best practices when performing requirements analysis through job observation?

I'm considering sitting with the end-users and observing them while the work for a day to better understand the software requirements. Before I try this, I'm hoping someone can provide a list of best practices, suggestions on when this approach is more/less suitable than simply interviewing the users, and notes from your own experiences using job observation/shadowing. References to other sites or recollections of your own personal experience are both welcome.


At what stage of a project should documentation be done?

I was assigned to fix some issues in a PHP project. Later on, I was asked to implement some new features, which I did. The project neither uses any framework nor does it use OOP. It lacks a proper structure, except for the use of folders (no sub-folders) to organize files. There was no documentation created by the original programmer. Now, the project's almost complete with some simple testing to be done and the client is asking for documentation. I have a few questions actually.   1. I have always considered documentation as a process which is starts before starting the coding part of project and which continues till the end. So, am I wrong about this? Is the documentation done at the end of the project?   2. What should be my way to go on documenting this project. I've kept a basic "log like" documentation on the changes I've made for my personal use. But since there was no initial documentation produced, I didn't bother to create one either.    3. Is there a good documentation template that I could use to reduce my effort? I am talking about or code documentation (not user documentation). Although I'm assuming this since they haven't specified anything.


Ruby on Rails database using static lookup tables or constant strings

In some ruby on rails projects, I have seen instances where strings are used instead of a foreign key reference to a lookup table. I usually code in C#/SQL Server and use lookup tables, but am not particularly experienced in ruby on rails. So my **question** is, should I be using strings instead of lookup tables in my ruby on rails web project (mysql and active record)? Is this something specific to ruby on rails, or to dynamically typed languages? Or for some particular circumstances? Or is it just bad database design? By lookup tables I mean, like the following **UserStatus**               Id    Name     1     Active     2     Disabled      **User**               Id    Username               UserStatusId     1     john.smith@gmail.com   1     1     jane.smith@gmail.com   2      Whereas with just strings **User**               Id    Username               UserStatus     1     john.smith@gmail.com   active     1     jane.smith@gmail.com   disabled


Have you forgotten more than you know, and how much do you make a point of memorizing?

I'm talking about knowing an area of computer science or a language, and then forgetting it over the years. As I approach the 20 year mark, I'm finding myself realizing that I've forgotten more than I currently know. Is this bad? Is this good? Is there a way to solve this? And if not, which things are worth memorizing? For instance, we all know (I think) that Quicksort provides O(n*log n) in average cases, and we know it can balloon to O(N^2) when fed with the wrong inputs. How many of us, if asked without notice, could write a functioning Quicksort on the whiteboard or in their code editor of choice, without blinking? Is this useful? And if we can do it, does it count if it's a naive implementation, and not the optimized version that was engineered by Bentley & Company? I give that as an example, but it could be anything. C++ has many dark corners, that if not used for some length of time, can be easily forgotten. And let's face it, there are many dark corners in C++ that one prefers to steer clear of.


Going further with C for iOS development

I am an experienced iOS developer amongst other things. I have a good mastery of Objective-C and Apple's frameworks in the language. But when it comes to the C-based frameworks I often hit a ceiling with my knowledge, and often have to look up idioms and syntax. I learnt C from K&R but it's been a while. I did try learning from it again and it was a blast; but by Chapter 6, I got a feeling that its C is a bit archaic, at least idiom- wise. Also, I want to learn C mostly for the sake of iOS development and so a Mac/iOS focused learning process would be ideal. What will be a good way to go about doing this?


What FOSS solutions are available to manage software requirements?

In the company where I work, we are starting to plan to be compliant to the software development life cycle. We already have, wiki, vcs system, bug tracking system, and a continuous integration system. The next step we want to have is to start to manage, in a structured way, software requirements. We dont want to use a wiki or shared documentation because we have many input (developer, manager, commercial, security analyst and other) and we dont want to handle proliferation of .doc around the network share. We are trying to search and we hope we can find and use a FOSS software to manage all this things. We have about 30 people, and don't have a budget for commercial software. We need a free solution for requirements management. What we want is software that can manage: Required features:   * Software requirements divided in a structured configurable way   * Versioning of the requirements (history, diff, etc, like source code)   * Interdependency of requirements (child of, parent of, related to)   * Rule Based Access Control for data handling   * Multi user, multi project   * File upload (for graph, document related to or so on)   * Report and extraction features Optional Features:   * Web Based   * Test case   * Time based management (timeline, excepted data, result data)   * Person allocation and so on   * Business related stuff   * Hardware allocation handling I have already play with testlink and now i'm playing with RTH, the next one i try is redmine.


Deployment: Best Practices (and real practices)

One thing that I've learnt in my short dev career is that there are best practices (like TDD) and then there are actual practices that occur under pressure, or through budgetary/time constraints. I'm working in a small PHP dev team on a project using Zend framework. The project has the potential to demand a lot of scalability, and so we are trying to establish a good development environment to promote ease of development long term. Architectural patterns/practices aside, I'm looking at trying to automate deployment, checking code quality through svn hooks, possibly even setting up a CI environment. So I'm interested in hearing people's experience of deployment practices. I've checked other examples as they pertain to other languages - but I'm ideally looking to hear from people who have worked in a PHP/Zend environment To make the question less vague: What are people's experiences of using deployment systems like phpUnderControl and rSync?


I want to write a data processing & analysis programming language that compiles to SAS. How to go about choosing a language to write my compiler in?

As a side project I wrote a simple macro in SAS to add syntatic sugar to SAS code. I hate how verbose SAS is sometimes! So my macro looks like this               %macro md(code);         /* expects a superquoted string */        * append a b;        %if %lowcase(%scan(&code.,1)) = append %then %do;             proc append base = %scan(&code.,2) data=%scan(&code.,3); run;         %end;     %mend;      Instead of writing               proc append base=a data=b; run;      to append two datasets, I can simply write               %md( append a b);      This got me thinking. Since I work with SAS all day and I enjoy programming. Why not (for fun) design a new data processing language that compiles to SAS?! As many of you can guess this idea was inspired by CoffeeScript which compiles to Javascript. I learnt that CoffeeScript was initially written in Ruby? But why? How did the author choose Ruby? What are the things to consider in choosing a language? And what resources are available that might be useful in pursuing this?


Alternatives to Project Euler for improving Excel ability

I've recently been enjoying using the mathematical problems listed at Project Euler to learn Python. My Excel ability is better than my Python, but I think I'd still benefit from the sort of inductive learning that comes with solving a series of increasingly difficult puzzles using a particular tool. I know Project Euler can be completed using Excel, but are there any other puzzle series similar to this or The Python Challenge specifically tailored for people trying to increase their knowledge of Excel and what it can do? I'm not looking for a "tutorial", I know there are plenty of these.


Various programming concepts (from a Python viewpoint)

Ever since I've started lurking on stackoverflow, I keep coming across programming concepts such as abstract classes, virtual functions, contracts, interfaces, etc., from a questions about other languages such as C++, Java, and C#. As far as I can tell, most of these things are related to object oriented programming but aren't typically mentioned in Python tutorials because Python uses a combination of duck typing and magic to make such concepts redundant. Nevertheless, I'd still like to know what they are.   **What are abstract classes, virtual functions, contracts, interfaces, etc. (explained from a Python standpoint?) What other programming/OOP concepts should I know about that Python typically doesn't use or require you to know?**


How do people develop emulators?

I hope this is right area on Stack Exchange to ask this question. People out there have built emulators for every game console but I don't understand how they do it. I consider myself (and have the professional title of) a senior level developer in several languages including Javascript but I don't have the faintest idea about how to begin writing an emulator in Javascript. How do they figure out how to read the ROMs and emulate the game?


Do you dress formally or casually for a programming interview?

For the 4 jobs that I have worked at, I dressed formal twice, business casual once and more casual once. How important is the dressing code to programming interviews these days? Will the employer or interviewer not take you seriously if you come in casually: plain shirt and khaki pants with casual walking shoes(non-sneakers)?


Proper Price Markup Formula

Ok, so this is not the most advanced programming question - and it kind of borders on e-commerce, but it has specifically come up twice in my career - which is only 10 years old, so I figured I would ask it. **Question:** I want to markup a price 10% from its original cost for a website, which is the proper way to do it: **NP = (P * 1.1)** or **NP = (P / 90) * 100** Where P is the original Price and NP is the New Price? **Background:** I am a web developer. I have worked on several e-commerce sites in my time. A few years back, I was building a freelance site for a tool shop. The guy had been in business for years and was moving into online sales. I wrote a script that took his core inventory list, cycled through it and automatically marked up the price 10% before inserting into the Database. I used formula #1. When he reviewed it he said the price was too low and to use formula #2. Using formula #1, a 15 dollar product is now equal to 16.5, using two it is $16.66. His logic was that 15 is 90% of $16.66 and thus 16.66 a 10% markup, by which 16.5 is only about a 9% markup. Flash forward a few years to today and and I hit the same problem. My company has a massive list of inventory that gets marked up and down in a number of ways. Our old DBA was marking up the price for distributors 10%. He was using formula 1. Our new DBA rewrote a stored procedure and started using formula two. A few people flipped out and started saying that the distributor prices were way too high and that the old formula was correct. We sell large quantities of relatively low-cost items, the fear is that our distributors would balk at the cost. Logically it seemed that formula #1 was the proper way to markup, but the experienced business owner told me the other way was. Now I am hearing people say the opposite. EDIT: My Using the original 15 example. It has always seemed to me that 15 is actually a 10% markdown of 16.66 where as 16.5 is the proper 10% markup of 15.


Web hosting deciding to pay for hosting or host your own?

Is there a guide out there on how to choose when to pay for web hosting vs. hosting your own? Assuming that root access is a must I would like to compare things like cost, scalability and personal stress. Here is what I could come up with. Paying for web hosting: Benefits:   * Much cheaper for a small scale. I assume anything under $50 a month would be cheaper than paying for the bandwidth of hosting.   * No stress in dealing with power outages, server restarts or internet going down.   * For the most part less busy work involved with setting up. Negatives:   * Cost goes way up when higher specs are needed (for example monthly cost triples with ability to use 8gb of ram that you can buy for $90 ). This means you have to target a particular ram usage and monitor so your instance stays within the threshold.   * root access for the most part is a premium.   * You may get tied into a vendor specific deployment process. Hosting on own : Positives:   * 100% control of specs and software.   * When you get past paying for the bandwidth you get much more bang for your buck by building your own machine. Negatives:   * Doesn't make financial sense if bandwidth costs are more than web hosting costs.   * Having to deal with power outages, server restarts or internet going down. I think the best of both worlds would be if there was a place that dealt with bandwidth, power outages and server restarts but you provided your own server. Kind of like a 24 hour day care for a server. Does anything like that exist?


Software Developer vs. Project Manager vs. Product Manager

I've been a software developer for 10 years. I like being a developer and no surprise I strive for sense of achievement. However, I normally find myself doing stuff that needs to get done regardles of it's my job or not. My experience of various managers I've worked with shows a terrible score of like 20% of those that I find competent for the work they do. This makes me think that demand must be high for no-nonsense managers. I'm seriously considering a career shift from a developer position to one of those positions, but my question is: -Is it worth it? I'm assuming that it's more or less undestood what each of these positions mean. The question is only if an above average developer normally earns more than an average manager or not?


The Nature of Spring

Is it accurate to say that dependency injection manually using java (without spring) is nothing but implementing the strategy pattern (as per this example)? Furthermore, is it correct to say that Spring just provides a declarative way of specifying the dependency as opposed to manual method whereby the dependency need to be created and 'set' using java code?