121

Releasing a project under the MIT license is giving people permission to fork the project. Part of the philosophy behind free software is to give users and developers the right to use, modify, and release the software in ways that wouldn't normally be allowed. If you don't want people to do this, then don't use the MIT license. You can't really complain when ...


73

Was Xamarin's action and the way the action was done ethical or not? Well, let's ask an expert - The Open Source Initiative's listing of the MIT License itself, with the license quoted in it's entirety: The MIT License (MIT) Copyright (c) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ...


18

I wouldn't call it unethical. I would call it unsportsmanlike. There's an unwritten expectation that you will give a good faith effort to improve the original version before deciding to fork, and it seems the original author feels that good faith effort wasn't made. That being said, the best way to avoid your software being forked is to be responsive to ...


16

Fail fast is a great design approach, and perhaps it can be counted as a pattern: http://en.wikipedia.org/wiki/Fail-fast I've also found a number of principles to be useful: Consider exceptions as part of the interface to each function / modules - i.e. document them and where appropriate / if your language supports it then use checked exceptions. Never ...


11

As a general rule, problems are worth fixing when the expected benefit exceeds the expected cost. Thread safety is no exception from this rule, it's just that the way of calculating the risk that determines the expected cost is particularly complex and ill-understood by many. To begin with, threading safety is not on many people's radar. They will simply ...


11

Why designed natural languages are not common There are three reasons why you learn a natural language: Your parents or environment speak a language, and you naturally try to understand what they are talking about. Your school requires you to learn a couple of foreign languages. ohmygosh {Esperanto,Quenya,Klingon,Lojban} is awesome because I am {interested ...


11

Was Xamarin's action and the way the action was done ethical or not? A lot of people are conflating the legal and ethical situation. The X11 license allows anyone to "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so", so this is definitely legal....


10

He doesn't mean little IDE utilities that create boilerplate for you, which you must modify. He's referring to more comprehensive code generation that you shouldn't have to touch. You make changes to the higher level and regenerate. The canonical Unix example would be Yacc, which uses a high-level grammar to generate complex parsing code. Other examples: ...


10

What Xamarin did is legal and ethical... almost. Let's have a look at the commit fixup of the license and misc typo fixes in the readme: LicenseAndCredit.txt (diff) -Copyright (c) 2010-2012 cocos2d-x.org - -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2011-2012 openxlive.com -Copyright (c) 2012 Totally ...


8

Hard code and refactor when you need it. Time is money, yadda-yadda, is it worth the time/money to have the unused feature? Also, it's not hard to do later as much as it is tedious. Pawn that task off to a junior developer when the need arises. Finally, when the time comes, some automated tools may get you most of the way there. Such as Eclipse's string ...


7

As Anders says, its partly about performance and partly about locking down poorly-thought designs down to reduce the scope of trouble caused later by people blindly inheriting things that were not designed to be inherited. Performance seems obvious - while most methods wont be noticed on modern hardware, a virtual getter might cause quite a noticeable hit, ...


6

Making applications multi-language does take some additional development effort. You can either invest that effort right from the start, every day a bit. Or you can invest that effort afterwards, when you have written >100K lines-of-code. Fact is, the sum of the needed efforts in both cases is not so very different as you might think. The first approach ...


6

There's two elements to your question, so I'll try and address them in turn: Why aren't .NET methods virtual by default? Inheritance, in practice, has many problems. So if it is to be used as part of a design, then it should be carefully considered. By making methods non-virtual by default, the theory is that it encourages the developer to think about ...


5

I believe that participating to some C++ free software project with a living community will increase your skills. I also think that learning a very different language (like Ocaml, Haskell, Common Lisp, Scheme, Clojure, Smalltalk) will change your way of thinking (even on plain C++ code). And first-class books or courses like SICP could learn you a lot. ...


5

Having worked with exceptions in Java and .NET AND after reading a lot of articles about how/when/why catching exceptions, I finally came up with the following steps that I go through in my head whenever I see a potential exception happening, or an exception I must catch (Java)... even if it never happens (sigh...). And it seem to be working, at least for me:...


5

For a good start to reading see this wikipedia list. Ideally, you are looking at separation of concerns. While a more general solution has advantages for reuse between projects, there is a problem. The database is concerned with storing the data, and so it is the job of the database to know what the data is. You don't want a table that can store anything ...


5

As usual, the answer is: it depends. There are lots of issues to consider, including: first and foremost, what the customer wants and is willing to pay for the difference in implementation and maintenance cost and risks between the alternative solutions the expected lifetime of the product the expected scope of future changes (i.e. is it reasonably expected ...


5

What you described is achievable via Aspect-Oriented Programming (AOP). It won't be as straightforward as in your example, but you can get the requested behaviour. AOP has implementations in different languages; AspectJ being one of the most mature one. I will give you an example using AspectJ even though I don't want to go to in too much detail. To ...


4

YAGNI is often in opposition to other established principles and/or best practices. Other examples include several of the SOLID principles, which are largely about structuring your code to make certain kinds of change easier in future. But what if you don't ever need to make those changes? Then the extra work involved in, say inverting the dependencies ...


4

It would be shady to allow people to draw incorrect conclusions about the authorship of whatever code the fork ships, even if the legalities are covered by providing the necessary notices and revision history for anyone who chooses to look closely. So maybe Xamarin's presentation is unethical, maybe it isn't, but I think that's the basis on which to judge it:...


4

My advice: keep it simple. Approach every task by splitting it up into pieces and then combine those pieces together in an designed way. (ie design the pieces knowing they'll be working together). For daily work, real-life problems are always a mixture of all kinds of things. Having problem getting your app to work, maybe its the code... but maybe its the ...


3

In C# you just do: void InterfaceA.doWork() { } void InterfaceB.doWork() { } So there are no real shenanigans involved. The calling function needs to identify which doWork() is intended: Instance io = new InstanceSubclass(); ((InterfaceA)io).doStuff(); See this page for more details.


3

The main difference between a device driver and a library is that the purpose of a device driver is to control some hardware component. Device drivers can either directly control I/O pins of the processor (like the SPI driver in your example is likely doing), or they can use the services of a lower-layer device driver to communicate over a communication ...


3

My answer ultimately is similar to Péter Török's in that I believe it depends on the additional effort and complexity of implementing the Generalized solution. Framing this as a implementaiton argument though is a mistake, and labeling the two opposing sides by programming language and defining that in the way they think is dangerously close to creating the ...


3

I would fix this bug, not just because of the race condition, but also because the version where you call Now once at the start and save it is much easier to reason about in general. Basically, the more predictable a function is, the easier it is to understand. Now is, in a way, very unpredictable (it might return different values every time you call it), ...


3

In basic networking you have end to end. That is what I would call connected. TCP is an end to end protocol. You get a delivery receipt. That is nice but there is overhead with an end to end communication. You also have connectionless communication such as UDP or IP. You send it but do not get a delivery receipt. A good book is Computer Networks and ...


2

With just a few exceptions, code, data and configuration should be separated. Hard-coding is generally considered a bad practice. You should put UI text into separate file just so you know where to find it, not because you might need i18n. This will not take much longer than hard-coding, but maintainability will be better. Also with external resource file ...


2

An expansion of the trademark topic: At the Apache Software Foundation, all the code is AL. And, as with the BSD license under discussion here, it's perfectly clear that the AL permits forks. Period. End of discussion. In fact, as discussed in other answers, all true open source licenses permit forks. All they control is the license / usage of the forked ...


2

There is a quote attributed to Einstein (probably a variation on a real one): “Everything should be made as simple as possible, but no simpler.” And that is more or less the approach I take when confronted with the SOLID vs YAGNI tradeoff: apply them alternatively, because you never know if a program is 'throw-away' code or not. So, just add a layer of ...


2

Because reducing the feature set of a language requires a compromise. Taking a feature out of the language means either: the language no longer has that feature, so people who need/value that feature will not want to use that language (aside: this is the reason I've never tried golang... while I like some of their ideas I find exceptions too useful to ...


Only top voted, non community-wiki answers of a minimum length are eligible