GPL vs plugin interfaces not designed with a specific application in mind

_I am not seeking or in need of legal advice, but an interesting though experiment came to my mind._ Imagine the following situtation (I cannot really think about a concrete example and I am unsure if a real manifestation even exists): there is a free (libre) api A licensed under some permissive license or even LGPL. Non-free application B implements this api in order host plugins, but there are other free software doing the same thing. Moreover, there is plugin C acting as a plugin under api A. It links to library D, that is under GPL, so C is also under GPL. Plugins using A are loaded into hosts via a `dlopen`-like mechanism and use complex data structure for host-plugin communication. Neither B nor C distribute any files that may be required for A to function properly (like headers containing the structure definitions of A or dynamic libraries containing helper functions for A written by the authors of A), but such things may exist. Now some user installs application B and plugin C on his machine, along with anything that may be required for api A to function properly. Then he proceeds and loads C into B and creates some intellectual property with B which is not a piece of software. Did a GPL violation happend at some point, and if so, who violated GPL and why?   * The authors of C violate D's license by making C possible to be used in non-free host B? This is a possibility because they can't give and exception of GPL (like one described in http://www.gnu.org/licenses/gpl-faq.html#GPLPluginsInNF or http://www.gnu.org/licenses/gpl-faq.html#LinkingOverControlledInterface) due to D's license terms.   * The authors of B violate C's and D's license by making C possible to be loaded in B? This is a possibility because http://www.gnu.org/licenses/gpl-faq.html#NFUseGPLPlugins disallows the mechanisms A uses for communitation between the free and non-free modules.   * The authors of A, because the api may be used (and in this case, was used) for communication between GPL'd and non-free software. This would be extremely absurd.   * The user, because at the moment of loading B into C, he made a derived work of C. I think this is impossible, because he does not distribute it. But would the situation change is he decided to release a configuration file of B which makes B load C as a plugin?   * Nobody, because A counts as a 'system library', and both B and C directly interact only with A, not eachother. In a sane world, this would happen... A concrete example of A could be some kind of audio (think LADSPA) or image processing api. However, I could find no such interface (that is free software, generic and is also implemented by commercial tools). A real-world example could also be quite enlightening.


Learning Test Driven Development

If I want to learn TDD on my own, where would I start apart from the usual Google Search? Are there any books that you would recommend or any method that you followed to learn it on your own? I am a C# Developer if in case that made a difference.


What should I be looking for when evaluating unit testing libraries and tools?

I'm in the process of choosing new unit testing tools for soon to be started project. There are plenty of them! The basic requirements I have would be that it can run tests on at least Windows and Linux, it is C++/C++03 compatible, it can execute tests in parallel (e.g., to take advantage of multi-core processors), and it is able to be run from the command line. But these are pretty broad requirements, and haven't narrowed down the field. To try and do that, I'm looking into potential gotchas and pitfalls of different types of implementations. For example, if I wanted to use a unit testing engine in higher level language like Python, would it still produce output formatted like C unit tests? My main intent here is to use the same storage and report tools for both C++ and Python results tests. I'm also wondering if it's necessary to have a specific engine to run the tests, or is it enough to have them integrated into our continuous integration engine (buildbot). Are these two concerns above valid? What else should I be concerned about when evaluating unit testing engines?


Young C++ student lacking direction

I was hoping for some direction or guidance regarding my C++ learning experience. I have now read two books, from cover to cover, twice. The first was Ivor Horton's Beginning Visual C++ 2010 and Starting out with C++ Early Objects (7th Edition). At this point and after several months I feel like all I know how to do in C++ is create a basic class, define some methods, use the STL, and read and write info to and from the console buffer (cin/cout). But simple things like saving data to a file, reading from a file, printing, connecting to an FTP site, doing some basic graphic manipulation on the screen (not even DirectX/OpenGL), and so-on I can't do or don't even know where to start. I feel I still haven't learned C++ thoroughly. I think you guys get where I'm going with this. I tried downloading SFML and compiling it in Visual C++ 2010 Professional. After quite a bit of time, I got it, but then I was lost. I followed the tutorials and one didn't work. I kept getting an error regarding a missing symbol and after an hour or so on Google, I couldn't figure it out. Can anyone point me in a direction of where one goes from here? I would imagine others have been at this point sometime during their early days.


What's the HTML5 3D canvas? How is it different with WebGL?

I heard about _3D canvas_. It's strange for me. Because I know there's already a industrial standard 3D API _WebGL_. What's that? How is it different with WebGL?


How to represent an agile project to people focused on waterfall

Our team has been asked to represent our development efforts in a project plan. No one is unhappy with our work or questioning our ability to deliver, we are just participating in an IT cattle call for project plans. Trouble is we are an agile team and haven't thought about our work in terms of a formal project plan. While we have a general idea of what we are working on next we aren't 100% sure until we plan an iteration. Until now our team has largely operated in a vacuum and has not been required to present our methodology or metrics to outside parties. We follow most of the practices espoused in Extreme Programming. We hold quarterly planning meetings to have a general idea of the stories we are going to work on for a quarter. That said, our stories are documented on 3x5 cards and are only estimated at the beginning of the iteration in which they are going to be worked. After estimation we document the story in Team Foundation Sever. During an iteration, we attach code to stories and mark stories as completed once finished. From this data we are able to generate burn down and velocity charts. Most importantly we know our average velocity for an iteration keeping us from biting off more than we can chew. I am not looking to modify the way we do development but want to present our development activities in a report that someone only familiar with waterfall will understand. In _What Does an Agile Project Plan Look Like_ , Kent McDonald does a good job laying out the differences between agile and waterfall project plans. He specifies the differences in consumable bullets: >   * An agile project plan is feature based >   * An Agile Project Plan is organized into iterations >   * An Agile Project Plan has different levels of detail depending on the > time frame >   * An Agile Project Plan is owned by the Team > Being able to explain the differences is great, but how best to present the data?


Why is 'void' not allowed as a generic type in C#

What were the design decisions that argued in favour of `void` not being constructable and not being allowed as a generic type? After all it is just a special empty `struct` and would have avoided the total PITA of having distinct `Func` and `Action` delegates. (C++ allows explicit `void` returns and allows `void` as a template parameter)


What are the things that you consider in reviewing an iOS source code?

We're going to do some peer reviews for our iOS projects. We're kind of inexperienced at reviewing each other's codes. The iOS developers attending the reviews will be from other projects, since generally one person handles one client project in the company. I know there are some questions on SO about the things you're looking for when you're reviewing someone else's code. I want to ask this question specifically for iOS projects. I mean, besides the general points for code quality, what are the things that you consider when reviewing an iOS code?


Distributing cron-like tasks over multiple servers

Currently I'm using something like a master-cron server, which starts the tasks on the slave-worker servers. But there are so many tasks, that the timing gets lost entirely. Is there a an algorithm, which eliminates the single master?


creating simple states for a stateless input

Given an input device (basically a keyboard) that reports keyup and keydown, how may I most efficiently store and retrieve information about _which keys are currently depressed_? My first thought was a dynamic array, but maintaining and searching a dynamic array seems like a serious drain on resources. Many thanks in advance for any help Joe


UML diagram for an existing implementation

I have some code, which I want to present in UML, but I've stuck at one point. Let me tell you something about code's functionality. I have a workspace in which I can place some `Component`s, select them, delete, add new, move etc. I can also connect them according to some rules (there are different types of `Component`s available). In order to determine if a group of `Component`s can be connected or not, I've implemented some easy mechanism. In this mechanism the following parts appear: **`ConnectionRule`** \- get the type of connection, and checks if a collection of `Component`s given as a parameter can be connected according to this `ConnectionRule`. **`ConnectionRulesSet`** \- has many rules inside. Client asks a set with rules like this: "according to which rules definied in a set, components given as a parameter, can be connected"? `ConnectionRulesSet` gives a list of `ConnectionRules` as a response. A concrete Connection rules set are exposed only throug interface - Client cannot create an instance of a concrete RulesSet. **`RulesSetFactory`** \- depending on many circumstances, application can use different `ConnectionRulesSet`s. That's why I've created a factory which gives a proper implemetation of `ConnectionRulesSet` interface depending on specified circumstances. And now let's take a look at the Client's code:               // list of components which should be verified in terms of connection plausibility:     List<Component> selectedComponents = ... ;     // Get set of rules for normal conditions:     ConnectionRulesSet setOfRules = RulesSetFactory.getRulesSet(NORMAL_SET);     List<ConnectionRule> fulfilledRules = setOfRules.getFulfilledRules(final selectedComponents);     // Do something with fulfilled rules:     for(PlausibilityRule rule : fulfilledRules){        addToAvailableRulesList(rule.getConnectionType().getName()); // display names of connetion types...     }       My problem is, that I'm not sure how to create an UML class diagram for such solution from Client's perspective... How to expose relationships between presented solution and a Client. Client uses actually all: ConnectionRule, RulesSet, RulesSetFactory... There is one of my ideas below... What do you think? Have you got any better solution? ![Sample UML class diagram](http://i.stack.imgur.com/gyPMc.png)


How to conceptually consider and implement user interface rules for numerous controls and data inputs?

I have a user interface with numerous controls and data inputs on it. Buttons, text fields, and checkboxes, etc. Imagine the following "rules" exist for a sample UI with 2 of those controls:   * B2 cannot be used until TF1 and TF2 both have values   * TF2 cannot be entered until TF1 has a value   * CB2 cannot be checked unless TF1 has a value   * CB2 cannot be checked unless CB1 is checked These rules are arbitrary here, but I have a variety of business rules which will ultimately govern the UI functionality. I would like to implement logic for this in my UI code to enforce these rules. However, I am having a hard time determining a good way to do so. I can think of two primary ways but I'm not really a fan of either. ### Method 1 - adding logic to each control callback One way to do this would be to add the logical check(s) to each method callback. So for the first rule, in the code associated with B2, include hard coded checks like `if TF1 == ""` and `if TF2 == ""`. I am not a fan of this idea because I'm going to scatter any sequencing/logic everywhere in my UI and it seems inevitable sometime this process will result in obscure and impossible to track down bugs. Also seems like maintenance will be impossibly complex. ### Method 2 - build collection of all rules The way I'm leaning towards is building a collection of rules. The first step would be defining a set of rules for "passing" for each type of control and its associated lookups, such as:   * For checkboxes, "passes" check for true, "fails" if false   * For textboxes, "passes" if not empty, "fails" if = "" I can then create a collection of all the prerequisite pass/fail checks for each UI component and its associated components. This can be abstracted into a single check method called in each UI action like:   * myChecker(mControlName) where myChecker is a method which iterates through the list of all matching rules, checks them, and returns true/false based on whether the rules pass. This method could be called from each UI control before any control-specific logic takes place. This is nice, but it seems creating the rules and not forgetting any might be even more complex than the first method. Additionally, all control types have to have a "pass/fail" criteria or the myChecker method might become ridiculously complex with lots of hard to read if statements. * * * Am I missing something? There has to be a more clearly defined pattern or some better strategy for incorporating these sorts of validation/rules into a UI.


Is there a way to efficiently allow a user to upload multiple content at once for e-commerce type sites?

Sellers on large sites like Amazon and Newegg need to provide names, descriptions, and images for their products to be displayed on the e-commerce sites. These sellers could have 10000+ products to sell, each with their own unique name/descriptions/images. I can't imagine that e-commerce sites would have their sellers upload each product individually through some standard HTML form. Especially when a product can have multiple images, this method of uploading just seems too inefficient. I'm guessing these sites allow sellers to upload via an API that the e-commerce site provides so that the uploading task may be automated with a script, but how exactly is this accomplished? Through JSON? JSON works great with text strings, but JSON doesn't allow for file uploads (so images can't be uploaded?).


Multitasking in C#

I would like to use a timer in my C# program with millisecond accuracy to keep a camera in sync with some events and keep shooting a picture every 250ms (or 1/4 sec, or I might adjust it to even shorter times like 200ms or 100ms). The normal timer event can be used for this. But I wonder what would be the best way to do this. Also I think I should NOT write the whole capture routine in it, but instead just raise another thread (multi-threading) to process the image with some vision logic on it, as my vision logic takes about 1 seconds, so I will get some queue here. If my vision algorithms would take 1 seconds per thread, would this mean that on a multicore (12 cores) PC that such code thread would go to the next available free processor or am I thinking to easily about multitasking?


C++ code navigation on OS X

Other than using Emacs / Vim with ctags or cscope or both, are there alternatives to C++ code navigation of an existing code base? I used to use Source Insight on Windows and it worked for me fairly well. The main functionality I am looking for is quickly find definition of macros, variables and functions and places a function is referenced.


Lazy Processing of Streams

I have the following problem scenario:   * I have a text file and I have to read it and split it into lines.   * Some lines might need to be dropped (according to criteria that are not fixed).   * The lines that are not dropped must be parsed into some predefined records.   * Records that are not valid must be dropped.   * Duplicate records may exist and, in such a case, they are consecutive. If duplicate / multiple records exist, only one item should be kept.   * The remaining records should be grouped according to the value contained in one field; all records belonging to the same group appear one after another (e.g. AAAABBBBCCDEEEFF and so on).   * The records of each group should be numbered (1, 2, 3, 4, ...). For each group the numbering starts from 1.   * The records must then be saved somewhere / consumed in the same order as they were produced. I have to implement this in Java or C++. My first idea was to define functions / methods like:   * One method to get all the lines from the file.   * One method to filter out the unwanted lines.   * One method to parse the filtered lines into valid records.   * One method to remove duplicate records.   * One method to group records and number them. The problem is that the data I am going to read can be too big and might not fit into main memory: so I cannot just construct all these lists and apply my functions one after the other. On the other hand, I think I do not need to fit all the data in main memory at once because once a record has been consumed all its underlying data (basically the lines of text between the previous record and the current record, and the record itself) can be disposed of. With the little knowledge I have of Haskell I have immediately thought about some kind of lazy evaluation, in which instead of applying functions to lists that have been completely computed, I have different streams of data that are built on top of each other and, at each moment, only the needed portion of each stream is materialized in main memory. But I have to implement this in Java or C++. So my question is which design pattern or other technique can allow me to implement this lazy processing of streams in one of these languages.


How to explain that full automation of a spreadsheets data sources isn't a good idea?

Have an Excel spreadsheet that summarizes various key metrics for the business. The source data for these metrics comes from various sources including other spreadsheets, and web/ERP systems. A suggestion was made to completely automate the whole data retrieval/population into the spreadsheet. For this type of tool (only a few users) I prefer a copy-paste approach so that the users are actually looking at the data and making sure it is correct. What reasons can I give that a full automation is not a good idea?   * linking Excel spreadsheets requires that the source spreadsheet doesn't change   * Excel can export CSV files from the ERP system but this would require a macro -> can the users maintain the macro   * ? **UPDATE1:** Forget to mention that this process is a stop-gap until a data warehouse is built later this year. Following the suggestion of the accepted answerer it appears that the full automated answer would take weeks more effort then the few hours per month that the copy-paste method would take.


Gitlab workflow, forcing code review or merge request on branch

I'm working towards implementing Gitlab at my company with a workflow strategy. My idea is that developers will be given access to repositories but, anytime they try to commit, their code must be reviewed. I know I can have them create a branch before committing, and then create a Merge Request after it's been pushed to the repo. I'm still unclear about certain things... The idea that we rely on people to create a branch and then a merge request seems faulty, is there a solution that forces some sort of policy that the master branch can stay clean unless an "admin" approves the code that's about to merge into it. I've read "github team workflow" but it doesn't seem to offer a viable solution. Any advice about process or your own best practice is appreciated. Thanks!


Fixing a bug that has never caused a problem until now

I recently made a change that caused some code to be run far more often than it used to. This lead to the discovery of a bug. This bug had the potential to happen any time that code was run but because it was run so seldom it never surfaced. When I brought this to the lead developer's attention he wanted me to undo the change that exposed the bug rather than fix the bug quoting the adage, "If it ain't broke, don't fix it". Its clear to me that we were just lucky up until now but he won't listen to reason. Should I fix it anyway? **Update** The lead technically doesn't have any authority over me. Just tenure. He's been the sole developer on the project for a number of years until a year ago and I think he doesn't take constructive criticism very well. For what's worth, I didn't criticize him. I just pointed out that just because the bug never showed up didn't mean it wasn't there.


Is writing software in the absence of requirements a skill to possess or a situation I should avoid?

I find that some software developers are very adept at this, and often times are praised for their ability to deliver a working concept with abstract requirements. Frankly, this drives me crazy, and I don't like "making it up" as I go. I used to think this was problematic, but I've started to sense a shift, and I'm wondering if I need to adjust my thought (and programming) process when given very little direction. Should I begin to acquire this ability as a skill, or stick to the idea that requirement's gathering and business rules are the first priority?


Why is it an issue that it takes 2 digits to represent the number 10 in decimal?

So we use hexadecimal which has the advantage of going up to 15 in single digits A-F, but why is it an issue that it takes 2 digits to represent the number 10 in decimal? I was reading up about hexadecimal and I came across these 2 lines: > Base 16 suggests the digits 0 to 15, but the problem we face is that it > requires 2 digits to represent 10 to 15. Hexadecimal solves this problem by > using the letters A to F. My question is, why should we care how many digits it takes to represent a number? - Is it slower for the computer to deal with a number with 2 digits compared to 1?


Is personal branding necessary as a programmer?

I work as a Ruby developer/dev lead at a small startup company. I end up splitting my time between writing code, helping the team use more agile methodology and working with the product manager to get stories ready for the dev team. I enjoy my work and generally rate my enjoyment of work on these criteria:   * Good boss (no pointed haired managers)   * time is allowed to maintain the codebase (refactor code/write unit tests/etc.)   * get paid competitive salary   * no stupid deadlines   * work normal hours I am in no hurry to change jobs, but at least in the Ruby community it seems that everybody and their brother has their own blog, open source projects, or some other form of personal branding. I can just not get into these things. I really enjoy my work but when I go home I am ready to do something else and not spend hours writing blogs or writing more software. Is a requirement to write, blog, or engage in other forms of personal branding to keep myself marketable?


Do MVC web frameworks favor anemic domain model in order to avoid duplication?

Binding directly the form to your model helps a lot to get rid of boiler plate code, but that means that your model must have a getter/setter for each property otherwise it wouldn't be possible. Another choice would be to create another layer (DTO) only to carry the data to/from the form and then you can have a rich domain model not necessarily with getter/setter for each attribute but that means duplication of fields and validation code. For instance, right now I'm doing a web mail application. We know that we already have the Java Mail API, a good rich domain model. However, the way it is designed makes it impossible to bind my web form to that model. I am forced to create a DTO to capture the data and then pass it to the Java Mail API. Just like this example if my domain model would be like this one, the same would happen. From Spring MVC documentation: > Instead, it is often preferable to bind directly to your business objects. > > Reusable business code, no need for duplication. Use existing business > objects as command or form objects instead of mirroring them to extend a > particular framework base class. Do MVC web frameworks such as **Spring MVC and Struts 2** , favor anemic domain model in order to avoid duplication?


C Equivalent of Perl Unpack & Pack

I have some perl code that uses pack and unpack to transform the data in a way that I don't understand.               $unpacked_data = pack('b*', join('', unpack('(b7)*', $packed_data)))      Where $packed_data = a Byte Array of say, 2341 bytes, and with the above perl statement, unpacks to 2048 bytes of data. Can someone explain this statement to me in terms of C? So far, I know this:   * b = A bit string (ascending bit order inside each byte, like vec()).   * If the repeat count is * , the offset is relative to the start of the packed string.


Maintaining log stream after file name change

I'm trying to log to a file and move it about every 30 seconds. I'm using the os.rename function (which I do from a supervisord process) in python to move the current log to a timestamped log (which will then be processed by another python script) and then I continue to log to the old stream from my uwsgi server. I've also tried the RotatingFileHandler and the timed version, but they don't seem to work properly. I wasn't sure if that was a function of using it with the uwsgi server or not. My question is, what is the simplest and most efficient way to continue logging to the same file name after the file it was "pointing to" has been moved?


Can anyone suggest a project for me write to help me understand threading

I am currently a C# developer with a pretty shaky understanding of threading. Both of these links have been suggested in other posts: http://www.yoda.arachsys.com/csharp/threads/ http://www.albahari.com/threading/ Should I go back to basics and maybe look at some computer science texts on the subject? I really feel that if I jump in and use the c# libraries I won't really have a solid foundation of knowledge to build on. I think I need to learn this subject from scratch like a com sci student, then use the C# libraries. Can anyone suggest an approach to learning threading, maybe some links and or project ideas? Thanks in advance! Edit, thanks for all the replies. Some people have mentioned that a book might be a good idea, can anyone suggest one? I'd prefer something language agnostic. Does anyone know what class would this stuff be covered in in a Computer Science degree? I'm trying to google for some free online notes and assignments.


How should I refactor so that responsibility for a geocoding service is shared appropriately?

First, some background. I have an application that requires the use of several external geocoding providers which I don't control. It uses a central service layer inside the application to dispatch to the appropriate provider. I have a number of classes that are arranged in this way:   * **GeocodingService** : Responsible for dispatching a request to geocode something to an appropriate provider.     * Has one public method, `geocode`, that accepts a **GeocodingService::Request** and returns a **GeocodingService::Response**.     * Each response includes: the latitude of the geocoded query, the longitude of the geocoded query, and a list of address components for the address where the query was found (e.g., an address component for "123", one for "Main Street", one for "Paris", and so on).   * **GeocodingService::AddressComponent** : A single segment of an address that contains the segment's name, its abbreviation, and its kinds. For example, France has a name of `France`, an abbreviation of `FR`, and is a `country` and a `political` segment.     * AddressComponent is responsible for checking that the types an instance is set with are not outside the boundaries of certain tracked types.   * **Address** : Domain model for addresses, containing both a preferred mailing address (a list of string lines) and a list of address components (a list of GeocodingService::AddressComponents). My question is: **where should AddressComponent live -- as a service class (like it does now), or with my other domain models?**   * If it lives **in the service** , then life is straightforward. But that seems wrong, because now a domain model has to depend on a service's definition of an address, and it seems like they should be independent.   * If it lives as a **full-fledged domain object** , then doesn't that mean that the service is now coupled to a domain object? That also seems undesirable. How do I resolve this impasse?


Do programmers need computer eyewear

I am an programmer with great eyesight who stares at multiple computer screens 8-10 hours a day, usually in deep concentration. A day would not go by that I my eyes did not burn and have redness in them. I knew it was from the daily exposure to lcd monitors that caused the issues because on the weekends I would not have the same experience. Does any one try computer glasses? Is that work?


Java or Python for Google App Engine not knowing either language?

I have a few project ideas that I'd like to deploy on GAE. I'm interested in developing a logging application for amateur radio contacts, shortwave, and utility monitoring. More complex projects include satellite tracking, audio streaming from multiple radios, and radio remote control including transmitting and receiving. I'm taking Java and Python languages through my local junior college, so I don't know which language is suitable for these projects. What are the strengths and weaknesses of each language for developing on GAE specifically, especially audio and number crunching for the tracking app? I'm not asking for a general comparison between the two languages, only as they are used on GAE. The end result is to tie them into my website which is hosted on Google, with some of the apps publicly available, some privately available to friends. If it helps, I have the most experience with Perl, bash, followed by C.


Learning Arlgorithms particularly graph algorithms (java)

I have a hard time learning algorithms (Particularly graphing algorithms). Do you know of any good free resources that make some of the more harrowing algorithm concepts such NP-Complete, Traveling salesman, and other algorithms, A* heuristics, particularly graphing algorithms, simpler to learn?


What percent of your college course work is unit-tested code?

As a college student do you write unit-test for the project code you write? Do you know how to properly use TDD? Have you been taught to use testing frameworks (jUnit for example)? I've just recently heard that a major company's project team was delivering software to User Acceptance Testing group that had only 7% line code coverage for unit testing. While that shocks me, it just tells me that this company's software engineering practice are immature. However I wonder if they could just hire a few recent graduates and raise the bar on the teams practices - assuming that these newly minted programmers were trained in the best practices. Are you 2008 - 2010 CS graduates using best practices of unit testing your code?


Resolving equivalence relations

I am writing a function to label the connected component in an image (I know there are several libraries outside, I just wanted to play with the algorithm). To do this I label the connected regions with different labels and create an equivalence table that contain information on the labels belonging to the same connected component. As an example if my equivalence table (vector of vector) looks something like:               1:    1,3     2:    2,3     3:    1,2,3     4:    4      It means that in the image there are 2 different regions, one made of elements that are labelled 1,2,3 and an other made of elements labelled 4. What is an easy and efficient way to resolve the equivalences and end up with something that looks like:               1: 1,2,3     2: 4      that I can use to "merge" the different connected regions belonging to the same connected component? Thanks a lot for the help!


Is it bad form to change multiple tables in a single Rails migration file?

I wrote a migration file with the following code:               class AddScheduleIdToPlayers < ActiveRecord::Migration       def change             add_column :players, :schedule_id, :integer             add_column :schedules, :coach_id, :integer       end     end      Is it bad form to not create two migration files, one for each change, or is this fine?


So, "Are Design Patterns Missing Language Features"?

I saw, here on Programmers, the answer to this question: How does thinking on design patterns and OOP practices change in dynamic and weakly-typed languages? There I found a link to an article with an outspoken title: Are Design Patterns Missing Language Features. But where I found snippets that to me seemed very catchy and that can be probably verified against experience given there is an incentive for that , like: > PaulGraham said "Peter Norvig found that 16 of the 23 patterns in Design > Patterns were 'invisible or simpler' in Lisp." or another sentence that confirms what I recently seen with people trying to simulate classes in JavaScript: > Of course, nobody ever speaks of the "function" pattern, or the "class" > pattern, or numerous other things that we take for granted because most > languages provide them as built-in features. OTOH, programmers in a purely > PrototypeOrientedLanguage? might well find it convenient to simulate classes > with prototypes... I am also taking into consideration that design patterns are a communcation tool. Because even with my limited experience participating in building applications I can see as an anti-pattern(ineffective and/or counterproductive) for example, forcing a small PHP team to learn GoF patterns for small to medium intranet App. I am aware that scale, scope and purpose can determine what is effective and/or productive, but still I didn't managed to find an technical overview about that. I saw small commercial applications that mixed functional with OOP and still be maintainable, and I don't know if many would need for example in python to write a singleton , but for me a simple module does the same thing. ### So are there studies, exhaustive articles or other form of exposition that takes into consideration design patterns vs. workarounds vs. simpler ways to do it, or replacements by language features ?


Metrics for architecture complexity

Just like we can measure complexity of code and algorithm, are there any metrics for measuring architecture/design/solution space complexity.


How to earn team members respect as team lead

If you were hired into a new company as a team lead (say a team of 10) one of the important things to do is to earn the respect of the members of the team. In the early days the new team lead may know nothing of the team culture, code base and business domain: in other words, is a complete neophyte. How does one go about this? What are the do's and don'ts?


ORM Tools and advantages of circular references in entities

Let me demonstrate a simple example, > Class Organization > >   * ID type Number, >   * Name type String, >   * HAS A -> Collection > > > Class Facility > >   * ID type Number, >   * Name type String, >   * Location String , >   * HAS A -> Organization > I am demonstrating a simple circular reference between two objects of an anemic data model. Assuming they are mapped to an ORM tool, a collection of Facility can be fetched lazily from an Organization, and likewise an Organization can be fetched lazily from a Facility. I understand the convenience of this, at least on the middle tier. With a single Facility I can immediately obtain information about its Organization from code. My question then is: _Are there ANY other advantages to circular references in ORM mapped entities?_ Despite my intense emotions on this subject right now, I am trying my best to not load the question... The prime infuriating disadvantage I am sufferring through at this moment is when I am trying to serialize these objects into XML and send them across a web service, far from the lofty comforts of its benevolent ORM session. I can't serialize them as is because the ORM proxies cannot be sent, I must either eagerly fetch the child entities and send a MASSIVE object tree, or strip out the proxies from the graph. Fair enough, so I wrote a utility to simply remove proxies, Great! It serializes and performance is salivatingly good, however when I get this object back from an UpdateEntity web service, it is missing the rest of the object graph, and now if I were to update this entity through the ORM, it thinks I have deleted all of these objects missing from the tree. No good. I can't help but feel that circular references present a massive disadvantage in this scenario and I can't really seem to think of a good way to overcome this problem and the crippling performance problems I am tasked with solving without a data model redesign and massive refactoring. What are your opinions on this? Is this indeed a design-smell?


What are some ways to reliably test for browser support for HTML5 features such as Geolocation?

HTML5 introduces a wide variety of tools such as Geolocation. Many browsers support them, but some do not yet. Should web developers rely on them to build professional applications for industry? The features are powerful, but not all browsers support these features. What are some ways (perhaps Javascript libraries?) to reliably test for browser support for HTML5 features such as Geolocation?


GPL and closed-source licensing for selling my script

I am working on a PHP script that I plan to sell without giving the user the ability to distribute it to anyone else. I have heard about GPL being viral and I have quite a few libraries that are being used in my script that are under the GPL. (for example : jquery, phpthumb etc) Does this mean that if a user who has bought my code can freely distribute it because a part of my code is under GPL so it becomes viral and my whole project becomes GPL ? **Can i not use any GPL code in my project ?** Thanks for any help.


What precautions should be taken when joining a software company?

I am joining a software company very soon as a fresher. But I am afraid that no one knows me and also every one there will be professional. So I want to know, what precautions should be taken in communication, behavior and other things?


Why do programmers use or recommend Mac OS X?

I've worked on both Mac and Windows for awhile. However, I'm still having a hard time understanding why programmers enthusiastically choose Mac OS X over Windows and Linux? I know that there are programmers who prefer Windows and Linux, but I'm asking the programmers who would just use Mac OS X and nothing else, because they think Mac OS X is the greatest fit for programmers. Some might argue that Mac OS X got the beautiful UI and is nix based, but Linux can do that. Although Windows is not nix based, you can pretty much develop on any platform or language, except Cocoa/Objective-C. Is it the applications that are only available on Mac OS X? Does that really make it worth it?   Is it to develop iPhone apps?   Is it because you need to upgrade Windows every 2 years (less backwards compatible)?   I understand why people, who are working in multimedia/entertainment industry, would use Mac OS X. However, I don't see what strong merits Mac OS X has over Windows. If you develop daily on Mac and prefer Mac over anything else, can you give me a merit that Mac has over Windows/Linux? Maybe something you can do on Mac that cannot be done in Windows/Linux with the same level of ease? I'm not trying to do another Mac vs. Windows here. I tried to find things that can be done on Mac but not on Windows with the same level of ease, but I couldn't. So, I'm asking for some help.


Long term plan of attack to learn math?

I am a web-developer with a desire to expand my skill-set to mathematics relevant to programming. As 2nd career, I am stuck in college doing some of the requirements while working. I was hoping the my education will teach me the needed skills to apply math, however I am quickly finding it to be too much easily-testable breadth-based approach very inefficient for the time invested. For example in my calculus 2 class, the only remotely useful mind expanding experience I had was volumes and areas under the curve. The rest was just monotonous glorified algebra, which while comes easy to me, could be done by software like wolfram alpha within seconds. This is not my idea of learning math. So here I am a frustrated student looking for a way to improve my understanding of math in a way that focuses on application, understanding and maximally removed needless tedium. However I cannot find a good long term study strategy with this approach in mind. So for those of like mind, how would you go about learning the necessary math without worrying too much about stuff a computer can do much better?


Mobile Development- Obtaining development hardware - best practices?

I'm looking to get into smartphone development, but there a quite a few options out there for platforms right now. (iOS/Android/WebOS/Bada/Symbian/MeeGo/WindowsMobile/JavaME) I'd like to have development hardware to test my code and the overall functionality of the devices. What is the best way to obtain and/or borrow hardware for development and testing? Are there rules of thumb to follow which apply to all companies and platforms? In this situation, I'm a single developer. Does this process change for a startup? A hackerspace? A small business? A large business?


Store Arbitrary values related to mysql record

I have created an app that manages a Data cleansing workflow. Each row imported needs to store an arbitrary number of key value pairs in addition to our standard mysql schema. The key values need to be searchable. I am using rails + mysql currently. What are my options? As of now, I am just adding a new fields to the rails schema as new requirements arise, I need a way to store extra data for each row that might not apply to any other rows.


MVC, WCF, EF, LINQ - Is it just me?

...or are things getting more complicated? It seems to me that you need to know a lot of stuff to 'properly' develop an MS web app these days. In the bad old days when we didn't know any better we had database tables, ASP.NET, ADO.NET and you constructed a web app using relatively simple concepts. These days there seems to be a lot of framework around to 'help' you do it 'right', but I'm not convinced this makes it all easier and better. I've got a feeling I'll be in a pretty small minority with this sentiment, but is there anyone else out there who thinks that things have gone a bit mad?


Nulls in every type and checked exceptions in Java?

I know that null being added to every type in Java is a source of much frustration regarding the language's type system. At the same time I generally hear complaining about checked exceptions - that they clutter interfaces, encourage exception swallowing, etc. It seems to me like null inhabiting every type is a way around the language - like I want the type of this to be `X`, but it's actually `X or null`; it just doesn't look like that and is easy to forget. Don't checked exceptions provide a way for the type of something to be `X or throws Exception` instead of it appearing to just be `X`? It provides an in-code way to specify how something can fail. Nulls in every type and unchecked exceptions seem like they are dual concepts, but one is scorned and the other praised. Why is that?


What to learn to become freelancer?

I have around 8 years experience in software development. I have worked on application development all these years using C++ /win32. I few years from now I want to become a freelancer . I tried to look into some freelance sites and I am not able to find any projects on C++/win32. I feel C++/Win32 wont help me much and I need to learn new skills . But my job require me to still work on C++ , so I cann't learn any new skills. I can still learn some new skills but without good project , it won't make any sense. I have shortlisted few skills   1. php   2. jquery   3. perl   4. python   5. android I am still confused which one to start and how to get expertise in them.Any suggestions?


Keeping tech support on the latest software version

I'm the only software developer maintaining a subset of products at a small company. The main product I'm concerned with here is a web app which is installed on various clients' machines, with a database and background processes. I make changes on a need-to basis for this program. It's not the company's flagship product, it's not my main project, but it needs maintenance. I have 2 and a half support technicians who take in questions from customers. When they don't know how to fix things, I'm their support. Because I do some maintenance here and there, I release updates irregularly. However, the idea is that I'm fixing the software, and on a client's request, the support technicians can update said software to fix an issue or as good measure (there's no built-in update function). The support technicians also keep a copy on their machine, or rather, various copies of past versions. This is where it gets ugly. I get, irregularly, reports of bugs for things I might have already fixed on previous versions. When they find a bug, the support techs spend a lot of time going _backwards_ in versions, trying to get to a version where the bug isn't there. At this point they either throw it in my face ("Why did you break this?") or install older versions at the clients'. **Which can obviously break other things**. In order to resolve this I've:   * pleaded with them   * pleaded with their supervisor   * pleaded with the CEO   * refused to work on older versions until new versions are installed, even if they demonstrate the bug is still present   * threatened to remove support altogether (which is moot, since it's still my job) No dice. The last option I see is to setup something with SVN where they can only get the latest version and not revert (if that's doable)... And hope they don't learn to make copies. Is there some other approach, human, organizational, technical, or otherwise that can help me and keep these guys on the latest version?


Is it bad habit not using interfaces?

I use interfaces rarely and find them common in others code. Also I create sub and super classes (while creating my own classes) rarely in my code.   * Is it a bad thing?   * Would you suggest changing this style?   * Does this style have any side-effects?   * Is this because I have not worked on any large projects?


How secure is localstorage?

The question says it all really. I want to provide a service but I do not want to store any of the data myself in a database. With all the recent news of hacking etc it seems to me that it is nicer that clients have complete control over their data. The problem is that the data stored is potentially sensitive. What I was going to do was... when a client visits the website there would be a question asking 'are you on a personal computer or a public computer'. If they are on a public computer the site would refuse access. If they were on a personal computer it would then prompt them to set a password. All their data would then be encrypted with this password. Now obviously this is not too secure. The encryption method would be in JavaScript and their password in plain text so I assume it would be possible for a savvy user to locate the password in the localStorage and access the data. I feel though that this isn't too much of a problem. If you are using a personal computer the chances of this happening are remote as... someone else would need access to their specific user account on the computer, someone else would need to know about the site... someone else would need to understand localStorage and how to access it. The sensitive data isn't any that will compromise their identity or much else. It just records something most people wouldn't like publicly published. So really the question is, is localStorage secure enough? Additional question.. how difficult is to wipe your localStorage? I wouldn't want users to accidentally wipe their data. Finally - is it even worth encrypting / decrypting their data as if you have the password you can access the site..


Which algorithms typify Lisp's power?

Similar question here (but not the same) because I am interested in which specific algorithms work particularly well in Lisp. Lisp tutorials always give the example of finding factorials, but wanting to find factorials is not a good enough motivation to use Lisp. I've heard that Quicksort has a particularly elegant implementation in Lisp. Can you give examples (and code samples too) of examples of algorithms that are best implemented in a language like Lisp?


Where to save something between invocations?

The 2nd time I run this program I'd like it to start in the same HDD location as the previous instance. How should I save, or remember, where I was so the program starts in the same place? I'd like to persist my previous location the same way across MAC, Linux, Windows, ... Where is a good place to save my location so it's available to me the next time I run?


hosting website from home

If I want to host a website from my home, I buy a domain name. Then, I get a static IP from my ISP. Next, I point it to the IP address of my home system. I can even use the SQL server installed in my system and not worry about the size. I am not talking about piles of servers here. Just one server. I was wondering if it is that easy, why not do it? Is there something that I am missing here? I am talking about moderately simple website. But does it matter?


Databinding to an Entity Framework in WPF

Is it good to use databinding to Entity Framework's Entity in WPF? I created a singleton entity framework context:   1. To have only one connection and it won't open and close all the time.   2. So I can pass the Entity around to any class, and can modify the Entity and make changes to the database. All ViewModels getting the entity out from the same Context and databinding to the View saves me time from mapping new object, but now I imagine there is problem in not using the newest Context: A ViewModel databinding to a Entity, then someone else updated the data. The ViewModel will still display the old data, because the Context is never being dispose to refresh. I always create new Context and then dispose of it. If I want to pass the Entity around, then there will be conflicts between Context and Entity. What is the suggested way of doing this ?


Is Node.js correct choice for JSON parsing and IO driven

My program should perform following task: It listen on http port after getting request it does following things.   1. Connect to gearman    2. Parse gearman payload to JSON (Upto 100 bytes)   3. Connect to Redis    4. Parse redis payload to JSON (256 bytes to 10KB. 80% cases it will ~256 bytes)   5. Put some data in MySQL   6. Put data in Redis server  As my program seems to be IO driven. I have chosen nodesjs for developing. But after developing I am facing CPU hike related issue with nodejs. My program taking 70%-100% cpu with 20 parallel clients. First I thought JSON parsing could be the issue. I was targetting near about 1K-3K request. As my redis server is able to process that may request in one second. But for profiling I have started with one sample http server in node Example code:               var http = require('http');     var url = require("url");     http.createServer(function (req, res) {         var uri = url.parse(req.url).pathname;                   var body = "";              req.on('data', function (chunk) {             body += chunk;         });              req.on('end', function () {                  res.writeHead(200, {'Content-Type': 'text/plain'});                                 res.end('hi vivek');         });               }).listen(9097, "127.0.0.1");      **Now my concern is with this hello world http server. Node CPU usage is spiking b/w 17%-20%.**               My node version is v0.10.0     My OS is ubuntu 12.04      My cpu information is               processor   : 0     vendor_id   : GenuineIntel     cpu family  : 6     model       : 23     model name  : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz     stepping    : 10     microcode   : 0xa07     cpu MHz     : 2992.491     cache size  : 6144 KB     physical id : 0     siblings    : 2     core id     : 0     cpu cores   : 2     apicid      : 0     initial apicid  : 0     fpu     : yes     fpu_exception   : yes     cpuid level : 13     wp      : yes     flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dtherm tpr_shadow vnmi flexpriority     bogomips    : 5984.98     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:          processor   : 1     vendor_id   : GenuineIntel     cpu family  : 6     model       : 23     model name  : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz     stepping    : 10     microcode   : 0xa07     cpu MHz     : 2992.491     cache size  : 6144 KB     physical id : 0     siblings    : 2     core id     : 1     cpu cores   : 2     apicid      : 1     initial apicid  : 1     fpu     : yes     fpu_exception   : yes     cpuid level : 13     wp      : yes     flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dtherm tpr_shadow vnmi flexpriority     bogomips    : 5984.96     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:      My questions are:   1. Is node correct choice for my problem description?   2. If nodejs is not correct choice for my problem description. What will be better alternative? As thread based approach will not scale for IO driven application.    3. How to find out what is causing that much CPU hike in complete integrated application and simple http program?   4. According to some node blog, I can support upto 10K parallel request with nodejs. But with if with only simple http server node is spiking b/w 20% cpu. How I will be able to support 10K user?


how to convince team and project manager that post-launch deployments are okay for new features

We have a site that launched and is "feature-complete", we've done all that the client has asked for and fixed a few bugs post-launch. However, I noticed that our site's home page is using 100 SQL queries, and there's _no_ caching. I took half a day to add caching and did it in a branch. Now I'm wondering how I can convince the project manager and other team members and gain support for a post-launch deployment of this optimization. What reasons can I give that it won't harm the project to do this? Or do I just wait until the next project launches to make these sorts of improvements? More details:   * I can't very well tell future employers that I implemented caching and saw an increase in performance without actually deploying it and capturing the improvement (through google analytics or Page Speed or some other method), or can I?   * This is an agency environment, none of our projects use any caching or any other performance optimization   * The site has 50k visitors   * The site is only live with full functionality for 1 month, around the end of May it will be replaced with a static page (marketing campaign site)   * local testing reducing page load from ~3 seconds to ~700ms


Creating Set Subclasses or Allowing Outside Configuration

I have a `TriggerCaller` and a `TriggerAction` class. The Caller "calls" the `do()` method on the action, which is set with the `TriggerCaller`s `setAction()` method. The rest of the program should deal with the `Trigger` class, which contains the caller and the action. I have two options: 1) Give the `Trigger` class the methods `setAction` and `setCaller`. This seems to make sense because it means I won't have to redefine things for each subclass (see option 2) and I won't favor one object over the other (see option 3). 2) I can define `Trigger` subclasses for each Caller-Action combination. This seems to "feel" better for some reason I can't articulate, but is impractical. There are simply too many combinations of TriggerCallers and TriggerActions to make. 3) Define a `Trigger` subclass for each `TriggerCaller`, for instance `TriggerMIDI` for the `MIDICaller` and give that class a `setAction()`. This seems to make sense from a GUI perspective, because in the interface people select the `TriggerCaller` type from a "Create" menu and then config it with an action in a dialog (along with other things). I feel that (1) makes the most sense, but somehow it just feels... wrong. I think that I'm exposing too much of the classes inner workings. I'm also putting the burden on the GUI code of setting the class up (sort of). Is there a better solution? Which one should I choose?


Building a company and want to know how ethical to put samples from projects I did before on the new company website

I built a lot of websites and applications during my life, I can put them under the following categories:   * Did all the project as a freelancer -> For other companies    * Did part of the project as a freelancer -> For other companies    * Did all the project my self while was working for another company    * Did the project with team members while was working for another company    * Did all the project my self and for my self Now I am creating a company with a new brand and have my own employees, My question is: Is it ethical, and normal to put on my new company website, screenshots and info about these projects I created my self before? which to put and which not put from the previous categories?


Verification of requirements in a closed system

I'm on my first real software project following the whole SDLC and am a bit confused. We have a requirement that states something like "The battery will be monitored each second" which needs to be verified. This is something that can't really be checked in the system since it happens "inside", i.e. there's no output that would show that the battery was checked each second. It is my understanding that at this phase the verification is done on a closed system, so you can't just use a debugger to verify something like this. Is this assumption wrong? Or can the requirement be considered to be ambiguously defined.


In what areas of programming is algorithm run time actually an important issue?

Sometimes I hear people say that because of the speed of processors and the amount of memory available, algorithm efficiency and runtime aren't, in practice, of major concern. But I imagine there are still areas where such considerations do remain of paramount importance. Two that come to mind are in algorithmic trading, where thousands of transactions must be conducted in fractions of a second, and embedded systems programming, where memory and power are often scarce. Am I right about these examples ? and what other areas would also be examples?


Database Schema for Pricing Products (packages, promotions, qty based, limited time offer...)

I'm working on a new point of sale for a company that products for different prices depending on the product mix. All products have a base price. To explain my problem, I will use the following info:               Product         Category        Price     A               1               45     B               1               70     Q               2               20     R               2               27     S               2               15     X               3               17     Y               3               22     Z               3               16      The company has Packages, for example Package "Combo": for product A or B, if you choose 1 of Q or R and 1 of X, Y or Z you get a $20 discount. **Case A:** Sometimes customers add on to a base product when placing an order, for example: They wan't one of Product A, and they add Product Q and Product P to that to create a package that has a discounted price. Then they might add that they want 1 of product B with 1 R and 1 Z. **Case B:** Sometimes customers will add 1 A and 2 B, 2 Q, 1 S, 2 X and 1 Z. According to the rules set forth by "Combo" Package, only 2 combos would apply because S is not a combo item. Other promotions are dependent on quantity, so if you buy 2 of B you get 20% off and/or dependent upon time, it is only valid after 5 PM or before 10% off if before 10am. Another promotion might depend on when your last purchase occured or if you have purchase more than $X in Y timeframe. **My Problems:** 1) How do I structure the tables so I my create the different packages or promotions in a way that is very flexible to add different types of promotions with different requirements? 2) When they order like Case B (or a mix of Case A and Case B) how do I structure my query so that I can test to see what product mix(es) are in the order, and update the prices/descriptions accordingly? Ultimately, the best result for this query would return which packages and promotions have requirements fulfilled in order of which gives the most benefit to the customer (i.e. maybe what they ordered fulfills requirements for promotion 1 and 3, but promotion 3 is less expensive. This must work with multiple promotions). Thanks in advance for the help! **UPDATE #1** To better describe the problems at hand and to update the work done thus far to solve them I'm incluiding an ERD of the Product Model limited to the entities and attributes that affect the issue (i.e. inventory is not at play here, so no inventory entities are present). ![enter image description here](http://i.stack.imgur.com/JaKxi.png) I'm also including sample data from the entities and attributes that affect this question (to simplify reading the data, I'm putting in name/descriptions in place of Foreign Keys): Here is a link to a flow chart giving an example of a combo, a fast and visual way to understand the table structure.               PRODUCT     ---------     ID  Name     ================================     1   Hamburger     2   Cheeseburger     3   Bacon Hamburger     4   Bacon Cheeseburger     5   Orange Juice     6   Apple Juice     7   Coffee     8   Coke     9   French Fries     10  Onion Rings     11  Soup du Jour     12  Hamburger Combo     13  CheeseBurger Combo     14  Bacon Hamburger Combo     15  Bacon Cheeseburger Combo     16  Combo Side     17  Combo Beverage     18  Small Orange Juice     19  Large Orange Juice     20  Small Apple Juice     21  Large Apple Juice     22  Add Extra Patty     23  Add Avocado          PRODUCT COMPONENT     ------------------     productFrom                 productTo            ===================================================     Hamburger Combo             Hamburger     Hamburger Combo             Combo Side     Hamburger Combo             Combo Beverage     CheeseBurger Combo          Cheeseburger     CheeseBurger Combo          Combo Side     CheeseBurger Combo          Combo Beverage     Bacon Hamburger Combo       Bacon Hamburger     Bacon Hamburger Combo       Combo Side     Bacon Hamburger Combo       Combo Beverage     Bacon Cheeseburger Combo    Bacon Cheeseburger     Bacon Cheeseburger Combo    Combo Side     Bacon Cheeseburger Combo    Combo Beverage          PRODUCT FEATURE     ----------------     ID  Description     =======================     1   Combo Side Option     2   Combo Beverage     3   Juice     4   Orange Juice Size     5   Apple Juice Size     6   Extras          PRODUCT FEATURE APPLICABILITY     ------------------------------     product                     productFeature  ProductFeatureApplicabilityType     ============================================================================     Hamburger Combo             Combo Side      Required     Hamburger Combo             Juice Flavor    Required     Cheeseburger Combo          Combo Side      Required     Cheeseburger Combo          Juice Flavor    Required     Bacon Hamburger Combo       Combo Side      Required     Bacon Hamburger Combo       Juice Flavor    Required     Bacon Cheeseburger Combo    Combo Side      Required     Bacon Cheeseburger Combo    Juice Flavor    Required               PRODUCT FEATURE APPLICABILITY     ------------------------------     productFeature  product             ProductFeatureApplicabilityType     ============================================================================     Combo Side      Hamburger Combo             Required     Combo Beverage  Hamburger Combo             Required     Extras          Hamburger Combo             Optional     Combo Side      Cheeseburger Combo          Required     Combo Beverage  Cheeseburger Combo          Required     Extras          Cheeseburger Combo          Optional     Combo Side      Bacon Hamburger Combo       Required     Combo Beverage  Bacon Hamburger Combo       Required     Extras          Bacon Hamburger Combo       Optional     Combo Side      Bacon Cheeseburger Combo    Required     Combo Beverage  Bacon Cheeseburger Combo    Required     Extras          Bacon Cheeseburger Combo    Optional                         OPTIONAL FEATURE     ------------------     productFeatureFrom  Product             ProductFeatureTo             =============================================================     Combo Side Option   French Fries     Combo Side Option   Onion Rings     Combo Side Option   Soup du Jour     Combo Beverage                          Juice     Combo Beverage      Coffee     Juice                                   Orange Juice Size     Juice                                   Apple Juice Size     Orange Juice Size   Orange Apple Juice     Orange Juice Size   Orange Apple Juice     Apple Juice Size    Small Apple Juice     Apple Juice Size    Large Apple Juice     Extras              Add Extra Patty     Extras              Add Avocado      So, with the research and support provided by the community up until know, I have been able to solve Problem #1. In fact, I have done so with more flexibility than I thought I could do in the first deployment of the system. All though there have been advances with Problem 2, it is not solved to satisfaction. There have been some ideas on how to do this, Neil McGuilgan asked a great question leading towards a possible solution using Relational Division (dba.stackexchange.com/questions/45829/what-is-the-name-of-this-type- of-query-and-what-is-an-efficient-example) and this book (www.amazon.com/books/dp/0471380237) helped a lot. However this solution at present, and as I understand it, only works with "one" record (combo) at a time. If a customer Walks up and says he wants 2 cheeseburgers, 1 hamburger, 1 small Apple Juice, 1 Coke, 1 French Fries and 2 onion Rings, I need a way to detect that there is only one combo in the mix and add the other products at base price. If there are multiple combo combinations, I'm looking (ideally for an sql query) that can prioritize combo combinations by largest savings. One idea I've come up with to solve problem two is to add and attribute to PRODUCT COMPONENT flaggin the main product for the combo (i.e. hamburger). Then when running the pricing process, query what products in the order are main products in a "package", relating the query to the discount given by the PRICE COMPONENT table and ordering by that value (descending), and in that order of packages check to see if you can create a "package" with the remaining non-main products with a query and loop the process until there are no more main products or there are no more non-main products in the remainder.


Moving from a CVCS to a DVCS in a big company, what is the right way to do it?

**Major Edit: Added more info about how the devs are setup and how a DVCS would help, so you don't have to second guess the DVCS (but you are still welcome to do it =P).** I just started a new job and I'm currently at the process of trying to introduce a DVCS (mercurial, but the actual DVCS is not really a matter of discussion at this point, it could also be git) to the company (big, multinational). So far I've gotten nothing but positive attention, even at managerial and directive level, but I want to make sure I'm not at all disruptive to the organization or anyone's jobs. **The way the developers are setup is in a team room, so there's a lot of communication going on. There is also an integrator, that communicates on a daily basis two or three times with the team leader. Also, there are more dev teams on other parts of the world, maybe 20 offices in 6 or 7 countries.** Company culture is open and there would be no problem pilot testing the tool (thanks for the answer below, already +1d)... but **the real question is** (in capital letters): **HOW DO YOU CONVINCE MANAGEMENT _AROUND ALL THE OFFICES OVER THE WORLD_ THAT ITS A SANE THING TO DO AND WILL ACTUALLY BRING HAPPINESS AND PRODUCTIVITY TO DEVELOPERS?** (say pilot testing and showing it works is just one part of the answer). Elaborating on the context... Does it make sense to make the switch?, yes (note: current SCM is Perforce). I've witnessed several sources of frustration classic to centralized source control management, including:   * People accidentally breaking other's builds or stepping on each others' toes while submitting code revisions.  **This is not often as the responsible must wear a pink hat (hilarious stuff) until the build is fixed, but the hat is still there, and when builds get broken it affects the other offices around the world.** **DVCS to the rescue** : Builds are now broken in a single office, people lose the fear to use version control and can actually second-guess themselves after or check with a peer by sharing their changes easier and not necessarily with the rest of the group.   * Unnecessary bureaucracy when it comes to granting access (e.g. looks like everyone is granted access to most of the code). **There is a dedicated group of admins who take 1 to 3 days to grant access to the code, meanwhile other devs must ask their peers for the code just to look at it... but AFAIK, the often wait instead.** **DVCS to the rescue:** Administration does not have to be centralized on a little group of overwhealmed people, new employees get the code from the project's responsible (1st level) or a peer with repository access (2nd level) who could even review their code and submit it along with his/her changes.   * Complaints with regards to slowness due to network latency. **Not that directly, but sometimes a) The perforce server is down, b) Internet is down, c) Internet or perforce server is slow. Yes, not that often, but it is annoying enough to kick you off your train of thought sometimes.** **DVCS to the rescue** : When using the DVCS you obviously don't need a network connection. Worst case scenario?, share your changes over LAN or sneakernet (with patch queues).   * Trouble when trying to collaborate with external providers that do not necessarily belong to the organization. **This happens often enough and security is a concern here AFAIK, and clients suffer from the access bureaucracy**. **DVCS to the rescue** : So granting access to a subrepo here would be the ideal solution here... also, clients themselves could use version control among themselves without needing to setup their own server and they would be able to integrate better to the internal workflow as currently Perforce access access to the local network, and thus more bureaucracy which is not necessarily security here, as external collaborators still have access to thumbdrives and email. Actual security would be having externals work in situ... in a dungeon or something, and grope them à la TSA on their way out to make sure they are not getting the code out.   * Workaround to integrate modules from other repositories. Requires additional maintenance/effort from the developers. * _These guys actually wrote themselves (I think) a plugin to make perforce fetch files from other repositories in other parts *_ **DVCS to the rescue** : Their solution looks a lot like the mercurial subrepo feature, wich uses a file (.hgsub) to indicate what code goes where, but they have to maintain the other repositories' states in the same file (which is done separately and automatically by mercurial in the .hgsubstate file).   * Working with the source code requires to mark files for edit in advance. This adds an annoying extra step IMHO. **If you don't do this the file will be in read only mode and you will not be able to edit it on your IDE, also, this IMHO makes the local copy prone to low integrity. This trait of perforce makes me think there was a lazy developer that didn't want to make the client check the files against the repo before versioning the changes. It also makes me think/personify Perforce as an idiot paranoid that says** _**"DONT CHANGE THE FILES WITHOUT TELLING ME OR THE SQUIRRELS WILL COME AND EAT ME!!!"_**.  **DVCS to the rescue** : Well... I guess any other SCM software knows there are no carnivore squirrels.   * Little project integrity in developers' machines (see previous point; its harder to add changes without previously indicating them to Perforce). **You don't need a DVCS for this... but if you make changes locally and for some reason forgot to add them, you are going to have a hard time detecting it**. Once you detect it there is a two step command line instruction thing I saw somewhere to detect changes you did without telling Perforce. Given that context **what would you say is the best way to... ?** :   1. Know/demonstrate if the migration would actually benefit the employees and the company.   2. Ease the embracement of change, or at least make it look like its worth the effort   3. Not complicate others' jobs.   4. Convince management worldwide.   5. Avoid making the integrator's job a royal pain. My second question (and focusing on the last point) I've always been a DVCS evangelist mainly because it eases the work and collaboration between developers... but up to this point I've never been faced with having to consider the integrators' perspective (the one in charge of coordinating teams' source code, creating and releasing the builds... from across the globe) who at some point might have to face two SCM sources or at least the migration itself. Then, **how can the migration process affect integrators the least?**.


Develop secureness first or as a later step?

The question Do you actively think about security when coding? asks about security mindset while programming. Obviously, a developer does need to think about security while coding -- SQL injection, password security, etc. However, as far as the real, fully-formed security, especially the tricky problems that may not be immediately obvious, should I be concerned with tackling these throughout the development process, or should it be a step of its own in later development? I was listening to a podcast on Security Now and they mentioned about how a lot of the of the security problems found in Flash were because when Flash was first developed it wasn't built with security in mind (because it didn't need to) -- therefore Flash has major security flaws at its core. I know that no one would want to actively disagree with "think security first" as a best practice, but many companies do not follow best practices. **So, what is the correct approach to balance between needing to get the product done and developing it securely?**


Should my small software library avoid using other libraries?

I've just released a small Java library that offers only a few classes and methods. Since I built the project with Maven, I immediately used several third-party libraries to achieve my goals, specifically:   * **commons-lang3** (for some general Java stuff)   * **slf4j-api** (for logging)   * **commons-io** (for a tiny bit of file stuff - literally reading a file once, I think) I don't want my library to appear bloated in the eyes of others. Should I be trying to remove my reliance on these libraries to minimise my footprint? Any advice on what types of libraries would be best to avoid when considering using more in the future?


In MVC, can/should basic data retrieval from the Model be done in the View?

Given the concept of _'skinny controllers, fat models'_ and the general acceptance that Views can directly call on Models when requiring data for output, should one consider handling the 'get and display' parts of requests within the Views and not the Controller? For example (attempted to keep code fairly generic): **Controller**               <?php          class Invoice extends Base_Controller {              /**          * Get all the invoices for this month          */              public function current_month() {                  // as there's no user input let's keep the controller very skinny,             // DON'T get data from the Model here, just load the view                  $this->load->view('invoice/current_month');              }          }      **View**               <?php          // directly retrieve current month invoices here          $invoices = $this->invoice_model->get_current_month();          // get some other display-only data, e.g. a list of users for a separate list somewhere on the page          $users = $this->user_model->get_users();          ?>
This month's invoices

     <?php foreach ($invoices as $invoice) { ?>
<?php echo $invoice['ref']; ?>
          <?php } ?>
      To me, this makes at least some sense in the cases where a request is essentially just a View. Why should the Controller have to collect and pass on the data to the View when it can just retrieve it itself? This leaves the Controller open for purely 'Application level' processing (e.g. handling GET/POST requests, managing access rights and permissions etc.) as well as keeping the Models reusable and all the other good stuff. If this example was extended to allow a user to filter the results, the Controller would just handle the POST from the form and pass the filters to the View, which would then request the data again, this time with the filters. Is this a valid approach to developing an MVC application? Or am I overlooking an important part of the role a Controller should play?


How to move ahead in Project/Product Management after 3 yrs of Programming Experience?

For being a better programmer there are ways to get started like:   1. Get some open source project and start contributing to it.   2. Solve some `Project Euler` or `Yodacode` Excercise. But if someone wants to move in the direction of `Project/Product Management` then in what direction he/she should move and what available options are out there to get started in that direction. Background: I mid level Programmer with 3 yrs of Programming Experience and I want to get started in `Project Management/Product Management` Role but my resume shows programming experience and so my question is how to break into Project/Product Management line with 3 yrs of Programming Experience. Do we have similar options available for `Project/Product Management` as we have for Programming like one's mentioned above ? _I know it's`chicken and egg` situation but what is the best way to get out of it ?_


Liskov principle: violation by type-hinting

According to the Liskov principle, a construction like the one below is invalid, as it strengthens a pre-condition. I know the example is pointless/nonsense, but when I last asked a question like this, and used a more elaborate code sample, it seemed to distract people too much from the actual question.               //Data models     abstract class Argument     {         protected $value = null;         public function getValue()         {             return $this->value;         }         abstract public function setValue($val);     }     class Numeric extends Argument     {         public function setValue($val)         {             $this->value = $val + 0;//coerce to number             return $this;         }     }     //used here:     abstract class Output     {         public function printValue(Argument $arg)         {             echo $this->format($arg);             return $this;         }         abstract public function format(Argument $arg);     }     class OutputNumeric extends Output     {         public function format(Numeric $arg)//<-- VIOLATION!         {             $format = is_float($arg->getValue()) ? '%.3f' : '%d';             return sprintf($format, $arg->getValue());         }     }      Why would this kind of _"violation"_ be considered harmful? So much so that some languages, like the one I used in this example (PHP), don't even allow this? I'm not allowed to strengthen the type-hint of an abstract method but, by overriding the `printValue` method, I _am_ allowed to write:               class OutputNumeric extends Output     {         final public function printValue(Numeric $arg)         {             echo $this->format($arg);         }         public function format(Argument $arg)         {             $format = is_float($arg->getValue()) ? '%.3f' : '%d';             return sprintf($format, $arg->getValue());         }     }      But this would imply repeating myself for each and every child of `Output`, and makes my objects harder to reuse. I understand why the Liskov principle exists, don't get me wrong, but I find it somewhat difficult to fathom why the signature of an _abstract_ method in an _abstract_ class has to be adhered to so much stricter than a non-abstract method. Why I'm not allowed to hind at a child class, in a child class? The way I see it, the child class `OutputNumeric` is a specific use-case of `Output`, and thus might need a specific instance of `Argument`, namely `Numeric`. Is it really so wrong of me to write code like this, when I _am_ allowed to write this:               abstract class Output     {         public function printValue(Argument $arg)         {             echo $this->format($arg);         }         public function(Argument $arg)         {             throw new RuntimeException(__METHOD__. ' Has to be overridden by child class');         }     }     class OutputNumeric extends Output     {         final public function format(Numeric $arg)         {             $format = is_float($arg->getValue()) ? '%.3f' : '%d';             return sprintf($format, $arg->getValue());         }     }      This sort of acchieves the same thing, but it's just hacky and, to my eye, horrid code...


Generally speaking, is it better to make all the functional parts or get UI working first - or a mix of the two? Assuming you're working on something large, is it generally accepted practice to get all the functional data harvesting blobs working before any UI, get all the UI working one piece at a time as you go, or something in the middle? We all know to break work down in to manageable pieces, but the question is ultimately whether UI is included in manageable pieces I suppose. For the case of the example, consider a GUI application with one root window, but over a dozen tabs in various docks to separate different data components. Each individual tab has a relatively complex set of moving parts behind it from a functional units perspective. The example application in this particular question is here with the accompanying blog and the original commercial product.


How to explain why design choices are good?

As I've become a better developer, I find that much of my design skill comes more from intuition than mechanical analysis. This is great. It lets me read code and get a feel for it quicker. It lets me translate designs between languages and abstractions much easier. And it let's me get stuff done faster. The downside is that I find it harder to explain to teammates (and worse, management) why a particular design is advantageous; especially teammates that are behind the times on best practices. "This design is more testable!" or "You should favor composition over inheritance." go right over their heads, and lead into the rabbit hole of me trying to clue everyone in to the last decade of software engineering advances. I'll get better at it with practice of course, but in the mean time it involves a lot of wasted time and/or bad design (that will lead to wasted time fixing it later). How can I better explain why a certain design is superior, when the benefits aren't completely obvious to the audience?


Is it possible to keep only one Database for both web and desktop applications?

I'm experiencing a trouble with my business model, let me explain better. I'm developing a software for 1 year and few months, it's for the food industry, more exactly a software to: _Delivery, Take Way, Table Reservation, POS, Accounts Payable and Receivable, Prints(receipt), Kitchen Monitors Orders, Customers Orders Control and Fiscal Area._ Well, I had separated the software mainly in two areas, one is web area and the other is desktop area (Used by Admins only) and local installed. 1 - Web Area (Basically do the follow:)   * Show Catalog with the products   * Customers Make Orders   * Customers Pay for the Orders   * etc ... as mentioned above 2 - Desktop Area   * Manage Orders   * Manage Customers   * Manage Suppliers   * Manage Accounts Payable and Receivable   * etc ... as mentioned above The web area is hosted in an online web server (scripts and database are online). The Desktop area is hosted locally in a Linux machine with a local database and local scripts files. My question is: Is it possible to keep **only one Database** for both applications? If YES, please what is the best approach? ## Follow my technical specification environment _Database: Actually I have two databases working and I would love to keep only one._ Operating System: Linux (Kernel 2.6.X and above) or Windows (XP and above) For the Web Area   * Apache, PHP, Python, Java Script, Shell Script and MySQL. For the Desktop Area:   * PHP-GTK2, Apache, PHP, MySQL and Shell Script. * * * ## Addtional Information about the system [EDITED] The main purposes to have a Desktop environment is:   1. I need to print and give out Tax Coupon on each new order.    2. I have the drawer.    3. I have a serial reader (Bar code).    4. I have a terminal to query for information.    5. and few other stuffs that is so hard if not impossible to do in the web environment. **Desktop relational schema: 104 tables. Web relational schema: 42 tables.**   1. Permissions is assigned based on: Deny all by default, and assigns as needed.    2. (Validation / Sanitization) has already been done in the web application.   3. Until now performance is not a problem, since every fiscal year part of my database will be archived. (Also customer, suppliers and all related data about them will be archived after 3 years of inactivity).  My real problem is I have 2 environments today and I would love to have only 1. Then "merge" the both worlds into one is an option, but not sure about. I would love to read here a lot of ideas about this matter. **Observation about the process:** Today it is in operation and it works fine, but I feel like waste time in some process. Take a look in the scenario:   1. The order is made in the internet, then stored in my Web database.   2. The "order" is sent to the kitchen and prepared.   3. Print a receipt (Tax Coupon), put it with the order and delivery to the customer.   4. A Tax Coupon is generated by my Desktop Environment and it need a call to the orders table, but it is not the Web Order Table but a Desktop Order Table. _In few words I need to generate again the order to fill up the Tax Coupon. The same happen to Customer Register, Supplier Register and few other stuffs._ I hope this information turn my question more readable. Thanks Again!


Will hand-written assembly disappear?

Last week I was wondering, with compilers getting better and better at optimizing, will there be a point when there is no need for hand written assembly? Are there still specialized fields where the compilers aren't smart enough to produce code that rivals hand-written assembly?


How can Scrum be adapted to allow for support obligations?

Scrum's great for new development and proactive tasks. But I've never been sure how to use it when the department's obligations also include analyzing/answering/fixing customer support questions, which come in unpredictably, typically have high enough priority to interrupt what we planned on doing, and whose complexity ranges from trivial to major. The books I've seen so far don't seem to cover that situation. So how are other folks handling it?


Is where a link goes part of a view use case?

Say I got a minimal use case such as "view home page" or "view banner ad". Should it be included or exluded in the use case actually following the link? What I mean is that whether it belongs to the use case "view page 1" if a report is that "The link from page 1 to page 2 is not working" in the common case of a "link not working".


What is the value of OOP in ASP.NET MVC?

As a C++ developer from the 90s during the great OOP wars, I put high value to OOP as a basis for hiring new C# developers into the company. However, there are plenty of frameworks today like ASP.NET MVC that handles most of the OOP heavy lifting. Programmers without deep knowledge of OOP can just as easily follow the paradigm and still be able to complete their projects. OOP may not be as compelling as it was before for us application developers, especially with a framework like MVC. I can see a few instance where OOP will be really handy, like for example developing a workflow type of a project. Or those with state-machine requirements. But really, most projects that really come by (at least to us here anyway) are just CRUD functionalities. Below is my list when hiring. Is it fair to have OOP there as the number one item?   1. OOP and Design   2. Server side programming: C#, ASP.NET MVC and EF   3. Client side programming: JQuery, CSS, HTML, etc.   4. Database design


HTML5 canvas performance and performance monitoring tool for Javascript

I have made a program in Javascript and HTML5 canvas and I am wondering what happens when you draw a shape on a certain location of canvas then draw another shape on top of that same object. Does it consume more memory because I am drawing new object on top of each others? (Currently, rendering process of my program is not that fast, I am assuming it is due to I am drawing new object on top of old object, is that right?). Also, I want to know what kind of performance monitoring tools available out there for Javascript programs. I want to figure out which fragment of my program consumes the most memory so I can optimise that particular process to be faster. Thank you.


Is there an analogue to "FizzBuzz" for choosing clients?

This is for the freelancers. In my past life as a full-time employee, I was involved in hiring and interviewed a good number of developers. I learned that it was much more valuable to see a developer work through a problem, however small, than to talk about experience, etc. Now I'm working as a freelancer/consultant. One of the nicer things is the freedom to choose what I want to work on. But now, a few years in, I've learned (the hard way) that some clients are not worth the money. They can be fickle, unreasonable, demanding, and difficult to work with in a very demoralizing way. So I've been wondering: is there a better way to "interview" clients? Obviously any method would have to be subtle, as the client probably isn't expecting to be tested. But is there an analogue to "FizzBuzz" that will tell me whether I should sign on, or back away slowly?


Can we illustrate a CPU pipeline with a UML sequence diagram?

I study multicore pipelining and the diagrams are not UML sequence diagrams for instance ![enter image description here](http://i.stack.imgur.com/WQrP1.png) Why not remake this diagram like an UML sequence diagram, would not that be more clear so that we can see both how time progresses as well as the data paths since I do not think it is clear distinction between data path and time? In UML time goes downward and the data path goes right and left. Can you comment or answer why pipelining generally is not illustrated with UML?


How does one meaningfully measure maintainability?

Context: I'm an enterprise developer in an all-MS shop. Can anyone recommend a good way of **objectively measuring maintainability** of a piece of code or an application? **Why maintainability** : I'm tired of "quality" metrics in my group revolving only around number of bugs and code coverage. Both metrics are easy to game, especially when you're not measuring maintainability. Shortsightedness and deadlines result in huge amounts of technical debt that never really get addressed. **Why the ability to measure objectively** : I work in a big enterprise group. If you can't objectively measure it, you can't hold people accountable for it or make them get better at it. Subjective measurements either don't happen or don't happen consistently. I'm looking at VS2010 code metrics, but I'm wondering if anyone has any other recommendations.


Interesting or unique types in programming languages?

We have all seen integer, floating point, string, and the occasional decimal type. What are some of the most strange or unique or useful types you have encountered, useful or not?


Code reviewing in the presence of strong type inference and basic editors

I’m curious to know how folks deal with comparative code reviews (version x against y of a file) in the presence of strong type inference, that is when ‘var’ (in C#) or ‘auto’ (in C++ 0x) is used in place of the older more verbose (explicit) type declaration. When IntelliSense is available one can just float the mouse over the keyword to determine (if necessary) the inferred type – but what do folks do when viewing such sources in Notepad or Code Collaborator etc. Of course strong type inference predates C# and C++ by decades, so how do folks in other languages that have had the feature for years cope? I’m inclined to think that the right hand side of the assignment expression is where most bugs are to be found.


Ambiguous program requirements

it seems that most of the programming exercises that I am currently doing, are a little bit ambiguous when it comes to specifying what should I do. When programmers work with clients, are the clients ambiguous as well about what they want and I should learn to guess?


Is there any place to find real-world usage-style tutorials for programming languages?

Let's face it. When you want to learn something completely new, be it mathematics or foreign languages, it's easiest to learn when you get real world scenarios in front of you, with theory applied. For example, trigonometry can be extremely interesting when applied to creation of 2D platform games. Norwegian can be really interesting to learn if you live in Norway. When I try to look at a new programming language, I always find these steps the hardest:   1. What tools do I need to compile and how do I do it   2. Introduction-step: Why is this programming language so cool? Where and how is it used? (The step I am looking for, real-world scenarios) The rest, deep diving into the language, pure theory and such, is often much easier if you have completed step 1 and 2. Because now you know what it's all about, and can just read the specification when you need to. What I ask is, do you have any recommendations for places I can find such material for programming languages? Be it websites or companies selling books in this style, I'm interested. Also, I am interested in all languages. (If I had found a "real-world usage" explained for even INTERCAL, I would be interested). In some other thread here, I found a book called "Seven Languages in Seven Weeks". This is kind of what I am looking for, but I believe there must be "more like this".


Small refactorings on a poor codebase?

In the last two years I have worked with a poorly written codebase of nearly 40K lines of code. Over that time I have made many small refactorings to improve it and made some bigger, as time permits. Unfortunately, I still view the codebase as poorly written. What's your experience? Do you think many small fixes can take me somewhere, or I have to stop and allocate a big chunk of time to fix things (of course, management won't be happy if I do this while we're working on the current "very important" new feature).


What's the best Open Source code you've ever seen?

Part of the value of Open Source is to provide great example code to people getting started with a new platform or language. What's the best Open Source code you've encountered, and why do you like your choice? Any language will do, but I'm particularly interested in the best examples of Objective-C you can point out. Obviously this is an open-ended question, so I'll leave the question open for a while and see what kinds of answers we get. Thanks! EDIT: For "best" I was thinking of code that follows the idioms in the given language or platform, as well as including the parts that make code "professional" - good documentation, a testing suite, etc. Code that is concise, but not overly clever is preferred to very terse or chatty code.


What are you thoughts on GWT?

Since I'm learning Java in this period and I just finished with the tutorials I think I'm ready to start contributing to a project (since I know from experience this is the best way to really learn). I've seen GWT, looks interesting so I thought I should give it a try. I'm thinking however, since GWT deploys Java applications in JavaScript why should I learn GWT when I could learn the actual thing instead (this being JavaScript). My question: is it worth it? Wouldn't someone be better of learning JavaScript if they want to build JS applications, instead of using Java and GWT? I realize that it might be easier to build certain things with GWT but in the end is it worth it? Thanks.