tag:blogger.com,1999:blog-176815212024-03-18T04:03:50.827+01:00Eclipse and Java Blog by Michael ScharfHere I collect interesting links and findings about eclipse and java...Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.comBlogger102125tag:blogger.com,1999:blog-17681521.post-30265646424735029582014-05-29T19:56:00.000+02:002014-10-15T18:13:31.941+02:00How to make eclipse attractive to new communities?<div>
Recently, I had some discussions with different people on how to make eclipse attractive for non-java communities, in particular for web and mobile developers. This is also based on my <a href="http://michaelscharf.blogspot.de/2014/03/evolution-form-emacs-to-eclipse-to.html">experience doing web development</a>. Here are some of my thoughts:<br />
<h3>
The Java mind-set in eclipse</h3>
</div>
<div>
The eclipse IDE is for many people (like me) a super powerful Java IDE, and in fact, it killed pretty much all its competitors (except for IntelliJ). Java is a strongly typed language and this allows for a lot of analysis that can be done statically and we got used to refactorings and an IDE that fully "understands" our code and its dependencies. <b>Eclipse encouraged us to structure our projects in a way that make dependencies much more explicit</b> by having a set of interdependent projects in the workspace. The plug-in concept enforces a modular structure and is a way of organising the workspace. That's all great.</div>
<div>
<br /></div>
<div>
<b>But there is another reality</b>: all the systems and languages that are much less statically defined and that are structured differently than java. It starts with C. CDT essentially started by copying JDT, it still suffers form that, because C and C++ is a <b>different languages with very different mind-sets than java, although there are some syntactic similarities</b>. </div>
<div>
<br /></div>
<div>
Similarly, trying to impose the concepts and mind-set of Java on all those scripting languages and setup-files is probably doomed to fail. <b>I love strongly typed languages</b>, I love modelling. In that area eclipse has so much to offer! <b>But there is the other text based "unstructured" world</b> with a different mind-set, where you "simply add a line to a script to get that cool feature going" (I have to say a lot about frustrations and benefits this "it's really simple" approach can create).<br />
<b><br /></b>
<b>Is eclipse missing this huge opportunity</b> that has opened in the last years with the shift in direction of web technologies?</div>
<div>
<h3>
The "force of intelligence" applied to eclipse</h3>
</div>
<div>
A few weeks ago, I posted a strange and probably hard to understand article about an <a href="http://michaelscharf.blogspot.de/2014/02/a-new-equation-for-intelligence-f-t-s.html">equation that describes the physical force of intelligence</a>. The equation essentially says, that intelligent systems try to move into directions where they are not trapped. If we apply the equation of intelligence to this problem, we have look at eclipse and at <a href="http://www.jetbrains.com/">Jetbrains</a> (the creators of IntelliJ) as two distinct "intelligent systems". Both organisations are "intelligent systems" with a "will to survive". The way those <b>organisations act intelligently, is by moving into a direction that "maximises their future freedom of action"</b>, as I explained in the blog mentioned above.<br />
<br />
In eclipse, nobody has real power to "direct" what is done, instead, the eclipse eco system has to surf the waves that are coming. Its intelligence is a kind of swarm intelligence. And, I think, <b>eclipse has done a pretty good job on this</b>. If the common interest of eclipse (as an "intelligent" system) happens to be in sync with the interest of one or more of its contributors, that is great. But just seeing where eclipse should go, without the power to steer it in that direction, is not "intelligence" according to the equation of intelligence (intelligence requites anticipating possible futures <i>and</i> the power to move into a promising direction) [<i>by that definition this blog entry may not be intelligent, because I have no power to move eclipse</i>].<br />
<br />
Jetbrains, on the other hand, has a pretty clear gradient to follow: it has to satisfy its customers in order to make them to pay for the product, which will give them money to maintain and increase their power of action in the future. <b>I assume the JetBrains has more control over its employees than "eclipse" has over the community to drive the development into a "desired" direction. </b>If they continue to make clever moves they may outperform eclipse in the long run.</div>
<div>
<h3>
If I had superpower and could drive eclipse....</h3>
</div>
<div>
<div>
What would I do, if I could influence the direction of eclipse and work with a team of people that would have the manpower to make some changes to eclipse?</div>
<div>
<br /></div>
<div>
I think, <b>with a few relative simple changes or additions, eclipse could increase its future freedom of action dramatically by embracing the reality of many developers</b>. The key factors are: </div>
<div>
<ul>
<li>simplify, simplify, simplify</li>
<li>install a minimal set of plugins and suggest additions</li>
<li>embrace the file system -- don't impose projects on directories</li>
<li>don't try to build everything in java -- integrate external tools</li>
<li>embrace the command line</li>
<li>do clever search and code completion using heuristics instead of complicated models</li>
</ul>
Or in one sentence: <b>eclipse could be an editor that talks to its environment that can grow to full blown IDE if the user needs and wants it. </b>Instead of being an all-inclusive self-contained IDE that can be abused as editor.</div>
<div>
<br />
<div>
Here are some more concrete ideas to focus on:</div>
<ul>
<li>Create a simple extensible <b>editor with pluggable syntax highlight</b> (something like <a href="http://liclipse.blogspot.de/">LiClipse</a> by Fabio Zadrozny)</li>
<ul>
<li>leverage existing (external) syntax highlighting tools to do the job (tools that are not necessarily written in java)</li>
<li>or allow to use existing syntax highlighters like the ones form TextMate</li>
</ul>
<li>allow to simply create <b>projects that are whole directory trees including different git/subversion repositories</b></li>
<ul>
<li>Essentially, allow to point to one one or more root directories and with some clever filtering, allow to exclude parts of the file-tree that are relevant. </li>
<li>Make it simple to assign properties, like 'generated', 'test-code', 'external-library' to subtrees (using patterns or by some UI) to be used for filtering</li>
</ul>
<li>Allow to easily integrate external tools and builders. There is a strong tendency to rewrite tools in java to integrate them. Instead, <b>provide an environment that allows to run, manage and communicate with processes that run externally on the local or on remote machines</b>.</li>
<li>Create a clever <b>non-modal search tool, that understands the basic syntax of languages</b> and that can be configured to know where to search, given a context.</li>
<ul>
<li>When I am in file X, I know that file Y is relevant but file Z is not connected to where I am. The problem with search is often <b>how to limit the search scope</b> cleverly. </li>
<li>Typical filters on string searches would be: Do or don't search generated files, test files or external libraries; do or don't search in comments or strings; do or don't search local variables. With some basic understanding of scopes and different areas (which could come for the syntax highlighter), search can be dramatically improved.</li>
</ul>
<li>A plug-in recommender</li>
<ul>
<li>Provide a mechanism that <b>suggests to install plug-ins based on the content of the project</b> </li>
</ul>
<li>Provide a generic <b>heuristics based code completion</b> tool (similar to <a href="http://www.eclipse.org/recommenders/">CodeRecommenders</a>). </li>
<li><b>Heuristics based code navigation</b>. Instead of trying to do full static code analysis of like JDT, use clever heuristics for code navigation and "learn" form users choices.</li>
<li>Provide a <b>simple integration with command line debuggers</b></li>
<ul>
<li>Debugging scripting languages is often much simpler than e.g. C, C++, or hardware debugging</li>
<li>It might be enough to provide a simple integration for a command line debugger. (In the 90ies I wrote an extension to the python command-line debugger that made the commands act like gdb, so I could use the gdb integration in emacs and SNiFF+). </li>
</ul>
</ul>
These are just bullet points and if there is interest, I could expand on each of them. The underlying idea is to <b>embrace the text based "unstructured" nature of lots of systems and go back to a simple editor that can progressively be more clever as the user needs it</b>. Do context-based search and navigation and try to syntax highlight as many languages as possible. <b>Instead of being the super-capable IDE that knows everything and contains lots of feature, the user never uses, be the editor that progressively becomes an IDE as the user needs it.</b></div>
<div>
<br /></div>
<div>
If eclipse cannot be used as a strong editor, the chances are low that we will attract all those developers that simply use and need a capable editor. The world is changing fast, and I wonder how many projects today can ignore the web and mobile apps that use all those dynamically typed "languages" and set-up files.</div>
<div>
<h3>
Promising future for eclipse</h3>
</div>
</div>
<div>
I think, eclipse has a bright future! <b>I see some good attempts to go in a promising direction</b><b>.</b> <b>The risks is not lack of ideas. The risks are lack of resources and money</b> to fund the work that needs to be done. There are a lot of freelancers and small companies, that form the eclipse eco system, making most contributions and working very hard to keep eclipse successful. They all act very intelligently, which means they have to balance their own survival and freedom of future action with the eco system they live in.<br />
<br />
Is that enough? How to increase the "power" to act to make eclipse as a whole more "intelligent"? What do you think?</div>
<br />
<div>
</div>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<div style="margin: 0px;">
<br /></div>
</div>
<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com11tag:blogger.com,1999:blog-17681521.post-87711171451511133102014-03-11T16:26:00.001+01:002014-03-11T16:50:53.066+01:00Evolution: form Emacs to Eclipse to IntelliJ and back to Emacs?A few days ago, Dinis Cruz asked "<a href="http://blog.diniscruz.com/2014/03/why-does-eclipse-doesnt-stand-up-more.html">Why doesn't
Eclipse community stand-up more to
IntelliJ?</a>". As a long term eclipse fan, let me explain why I am currently not using eclipse but IntelliJ (actually PyCharms) and why I almost feel like going back to emacs. It is not because I think eclipse is bad or it misses features. It is because I have to get my job done and I don't really need an IDE,
<b>all I need is a good editor with CM integration and some search and debugging capabilities</b>.<br />
<h3>
From emacs to sniff to eclipse...</h3>
About 30 years ago I started using emacs on a <a href="http://de.wikipedia.org/wiki/VT100">VT100</a> terminal as my first "IDE" for programming <a href="http://en.wikipedia.org/wiki/Modula-2">modula-2</a>. When I started using C++ the first graphical IDE
was <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.93.6521">sniff</a>. About 20 years ago I became part
of the team commercialising SNiFF+ and 10 years ago the team switched to Java and eclipse. Each of the development environments
was better than its predecessor... Clearly, eclipse was and is the ultimate IDE.
<br />
<h3>
...then entering the wild wild web....</h3>
Since almost a year, I am working on a startup web project. The project is based on open source projects which use coffeescript, python, javascript, jquery, angularjs, json, xml, css, less, elasticsearch, sqlite, flask, grunt, nodejs, git, make, sh, markdown, reStructuredText etc. The projects are linked and nested in some "strange" ways. Not necessarily the choices I would have made. <b>But I have little control over how the open source projects I use are organised and structured</b>.<br />
<h3>
...with unknown territory...</h3>
When I started the project, I did not know much about the inner details and structure of the components in my workspace. It was just a tree of nested directories. I did not know much about the filetypes inside the directory tree. Nor did I understand the relationship between the files and directories. What I needed at this point was a tool that would help me explore the unknown territory. This is not exactly what eclipse is made for.
<b>Eclipse wants me to know a lot about the code in order to install the necessary plug-ins and in order to 'flatten' the nested
tree into a list of projects.</b>
<br />
<h3>
...using eclipse....</h3>
So, given that 'reality', the question is how to make eclipse happy. <b>I really tried hard for a few weeks to get this running
with
eclipse. </b>But it was a constant battle on multiple front lines. How to find and install the plugins I need to support the languages I use. Another battle is that eclipse has a very strong idea on how projects should be structured. That is great if you start form scratch and build java projects. It turns out to be very difficult if you cannot control or fully understand the structure of the projects. Another front line is that egit requires a certain project layout to work properly (it expects a 1-to-1 relationship between projects and git repositories). In essence, I spend a lot of time trying to install and configure eclipse to make it work with the code, but with limited success.
<br />
<br />
On one hand, <b>eclipse is very opinionated</b> and that can get in the way if the "reality" does not fit the eclipse model. On
the other hand eclipse offers too many choices and little advice on what to install. I want
the opposite: <b>give me the freedom to keep the files and directories the way they are and give me good advice on plug-ins I
should use and install</b>.
<br />
<h3>
...stop fighting windmills and trying something else...</h3>
After a long battle fighting with my inability to force eclipse to do what I want, <b>I gave IntelliJ (in my case PyCharms) a
try</b>. After relatively quick setup and learning phase, I came to the conclusion that <b>it can deal better with the my
reality than
eclipse</b>. It supports most of the languages out of the box well enough for me to be able to work. I could just point to the root directory with all my sources and it found the git repositories inside. I had no problem finding and installing the plug-ins I needed (in fact it suggests to install plug-ins when I open a new file type instead of opening the file with an "arbitrary" application on my system like XCode for .sh files). To borrow a term the python community often uses: "it comes with batteries included". I don't think it is the better IDE, it just works for me with much less pain. Maybe I am to opinionated on what eclipse should do and therefore I struggle. With IntelliJ I am much more humble. I am happy if I get things done.
<br />
<h3>
...(ab)using IntelliJ as editor with syntax-highlight...</h3>
It turns out that I use PyCharms essentially as editor.<b>
</b>I probably use less than 1% of the features of the IDE. <b>I am not really happy with
that</b>. It still feels unfamiliar. <b>And I miss mylyn very much.</b><br />
<br />
<b>What I actually use/need is very simple</b><br />
<ul>
<li><b>browsing code</b> with syntax highlight (because a big part of the code is coffeescript, and there is no usable support
for coffeescript eclipse, that is one of the killer features for using PyCharms)
</li>
<li><b>navigation</b> (not as good as it could be)</li>
<li><b>search</b></li>
<li><b>editing</b> with code completion (for me it is much worse than it could be)</li>
<li><b>debugging</b> of python (javascript and coffeescript I debug in the browser)</li>
</ul>
I choose PyCharms, because I thought I need an IDE, but, if I think about it now, I could have gone back to my first love, emacs or
<b>I could have chosen one of those many clever editors out
there</b>. At the time when I made the switch I thought it has to be a real IDE. But then I learned a surprising lesson:<br />
<h3>
...the revival of simple text editors and command-line tools...</h3>
I am always interested in what kind of tools other people use when working on similar projects. I have to say, <b>I was really
shocked at the beginning, when I saw what tools really talented developers use: vi, emacs, notepad++, TextMate</b> and a few
other more or less advanced text editors. I have not seen much use of anything I would call an "IDE".<br />
<br />
The other observation is that<b> a lot is done on the command-line</b>. The projects use command-line tools to install, setup,
build and deploy the code. I am really glad, I got a MacBook, because most projects run out of the box on a mac. With windows
this might be much more difficult.<br />
<br />
It seems there is a new generation of developers that have never used a VT100 terminal. But they make their environment look
like what was the reality 30 years ago when I started programming: simple text editors, green colors on black background and
running command-line tools.<br />
<br />
What is my conclusion of this? <b>I think there is a different world that needs much simpler tools</b> than the ones we have
build over the last 25 years when we created super powerful IDEs. <b>It is a kind of down-sizing when it comes to
development environments.</b> When the famous great libraries you use (jQuery, angular, node, backbone...) are just a <i>few
thousand lines</i> of code, why should your IDE be <i>tens of millions </i>of lines of code?<br />
<br />
In fact, <b style="color: blue;">I don't think that IntelliJ is the biggest competitor of eclipse, its all the simple text
editors and command line tools that compete with both eclipse and IntelliJ.</b>
<br />
<h3>
...but eclipse can provide solutions...</h3>
Hmm, should I really try emacs again (I still use it every day, but not as IDE), but that feels so wrong. Maybe there are
solutions in the diverse eclipse community.... Maybe something like a Light Eclipse or an Easy Eclipse could emerge for the
eclipse eco system...
<br />
<h3>
...therefore let's contribute money and resources!</h3>
...and yes that is just happening! <b>There are some promising attempts to go in the right direction like <a href="http://brainwy.github.io/liclipse/">LiClipse</a> and <a href="https://www.kickstarter.com/projects/283096083/easyeclipse-for-java">EasyEclipse</a>. </b>Both are crowd
funded. I think, eclipse has a bright future! The risks is not lack of ideas.<b>The risks is lack of
money</b> to fund the work that needs to be done. You can help too....
<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com5tag:blogger.com,1999:blog-17681521.post-51489009903004292722014-02-12T04:51:00.000+01:002014-02-13T02:16:40.740+01:00A new Equation for Intelligence F = T ∇ Sτ - a Force that Maximises the Future Freedom of Action<h2>
Intelligence is a Force with the Power to Change the World</h2>
<br />
Describing intelligence as a <i><b>physical force</b> that maximises the future freedom of action</i>, adds a new aspect to intelligence that is often forgotten: the power to change the world. This, I think, was the biggest revelation for me, when I started thinking about the the <i>new equation for intelligence</i>. The second revelation was, that intelligent systems are survival engines, that increase their chances of survival by maximising a single quantity: the freedom of action. Both insights may sound trivial or obvious, but I don't think they are.<br />
<br />
A few days ago a saw the <a href="http://www.ted.com/talks/alex_wissner_gross_a_new_equation_for_intelligence.html">TED talk "A new equation for intelligence"</a> by <a href="http://www.alexwg.org/">Alex Wissner-Gross</a>. He presents an equation he published in April 2013 in a physics journal. It may not be the most impressive talk I have ever seen. And I had to watch it twice to fully understand it. But the message excites me so much, that I don't sleep well since a few days. I thought everybody must be excited about this equation. But, it seems that this is not the case. Either I am not understanding it correctly or others don't get it. Or maybe it resonates with me, because I am physicist, with a strong background in computing, who has done research in computational biology. To find this out, let me explain my understanding of the equation. Please tell what your think and what's wrong with my excitement (I need sleep)....<br />
<br />
So, why did the equation blow me away? Because this very simple physical equation can guide us in our decisions and it makes intelligent behaviour <i>measurable</i> and <i>observable</i>. It adds a new real physical <a href="http://en.wikipedia.org/wiki/Force">force</a> to the world, the <i>force of intelligence</i>. From the equation we can deduce algorithms to act intelligently, as individuals, as societies and as mankind. And we can build intelligent machines using the equation. Yes, I know, you may ask: "How can the simple equation <b>F</b> = T <b>∇</b> Sτ do all of that?"<br />
<h2>
Intelligence is a Force that Maximises the Future Freedom of Action</h2>
Before we look at the equation in more detail, let me describe its essence in every day terms. Like many physical laws or equations the idea behind it is simple:<br />
<ul>
<li><b>Intelligence is a force that maximises the future freedom of action.</b></li>
<li>It is a force to keeps options open.</li>
<li>Intelligence doesn't like to be trapped.</li>
</ul>
But what is necessary to keep options open and not to be trapped? <b>Intelligence has to to predict the future and change the world in a direction that leads to the "best possible future"</b>. In order to predict the future, an intelligent system has to observe the world and create a model of the world. Since the future is <a href="http://en.wikipedia.org/wiki/Chaos_theory">not deterministic</a> the prediction has to be based on some heuristics. Prediction is a kind of statistical process. In order to change the world, <b>the intelligence has to interact with the world</b>. Just thinking about the world, without acting, is not intelligence, because it produces no measurable force (well, sometimes it is intelligent not to act, because the physical forces drive you already in the right direction, but that is a way of optimising resources). The better in can predicted the future and the better a it can change the world in the desired direction, the more intelligent the system is.<br />
<br />
<h2>
The new Equation for Intelligence F = T ∇ Sτ</h2>
<div>
<b>Note:</b> skip this section, if you are not interested in understanding the mathematics of the equation!<br />
<br />
<br />
This is the equation:</div>
<div>
<br /></div>
<div>
<b>F</b> = T <b>∇</b> Sτ<br />
<br />
Where <b>F</b> is the force, a directed force (therefore it is bold), T is a system temperature, Sτ is the entropy field of all states reachable in the time horizon <b>τ</b> (tau). Finally, <b>∇ </b>is the <a href="http://en.wikipedia.org/wiki/Del">nabla operator</a>. This is the <a href="http://en.wikipedia.org/wiki/Gradient">gradient</a> operator that "points" into the direction of the state with the most freedom of action. If you are not a physicist this might sound like nonsense. Before I try to explain the equation in more detail, let's look at a another physical equation of force.<br />
<br />
The intelligence equation very similar to the equation for <a href="http://en.wikipedia.org/wiki/Force#Potential_energy">potential energy</a> <b>F = ∇ </b>W<span style="font-size: x-small;">pot.</span> W<span style="font-size: x-small;">pot </span>is the potential energy at each point is space. The force <b>F</b> pulls into the direction of lower energy. This is why gravitation pulls us in direction of the center of the earth. Or think of a landscape. At each point the force points downhill. The direction is the direction a ball would roll starting at that point. The strength of the force is determined by the steepness of the slope. The steeper the slope, the stronger the force. Like the ball is pulled downhill by the gravitational force<b> </b>to reach the state with the lowest energy, an intelligent system is pulled by the force of intelligence into a future with lowest number of limitations. In physics we use the <b>∇</b> Nabla operator or gradient to turn a "landscape" into a directed force (a <a href="http://en.wikipedia.org/wiki/Force_field_(physics)">force field</a>).</div>
<div>
<br /></div>
<div>
Back to our equation <b>F</b> = T <b>∇</b> Sτ. What it says is that intelligence is a directed force <b>F</b> that pulls into the direction of states with more freedom of action. <i>T</i> is a kind of temperature, that defines the overall strength (available resources) the intelligent system has (heat can do work, think of a steam engine: the more heat the more power). <i>Sτ</i> is the "freedom of action" of each state that can be reached by the intelligence within a time horizon τ (tau). The time horizon is how far into future the intelligence can predict. Alex Wissner-Gross uses the notion of <a href="http://en.wikipedia.org/wiki/Entropy">entropy</a> <i>S</i> to express the <i>freedom of action</i> in the future. The force of intelligence is pointing into that direction. As we have seen, in physics the direction of the force at each state is calculated by a <a href="http://en.wikipedia.org/wiki/Gradient">gradient</a> operation <b>∇ </b>(think of the direction the ball is pulled). The Nabla operator <b>∇ </b>is used to assign a directional vector (the direction of the force of intelligence) to each state (in our case: all possible future states). The more freedom of action a state provides the stronger the force is pulling in that direction. So, <b>∇</b>Sτ is the pointing into the direction with the most freedom of action. The multiplication with <i>T</i> means the more power we have to act, the stronger the force can be.</div>
<div>
<br /></div>
<div>
<b>Note: </b>the optimal future state is the optimal state form the viewpoint of the intelligent system. It might not the optimal state for other systems or for the entire system.</div>
<div>
<br /></div>
<div>
If you want to understand the equation in more detail read the original paper '<a href="http://www.alexwg.org/publications/PhysRevLett_110-168702.pdf">Causal Entropic Forces</a> - <a href="http://www.alexwg.org/publications/PhysRevLett_110-168702.pdf">by A. D. Wissner-Gross and C. E. Freer</a>'.</div>
<div>
<br /></div>
<h3>
An Algorithmic Explanation of the Equation</h3>
<div>
As an intelligent system you want to get the best possible future. The best possible future is a future where you are not trapped. To get there, you try to predict possible futures. You adjust the time horizon τ of your prediction, so that your prediction is reliable enough to make a decision.<b> </b>Look at all possible states and you assign a <i>freedom of action</i> value <i> </i>Sτ<b> </b>to each state. In that map of states, you choose the state that has the highest potential for future actions, the state that gives you the most freedom and power. This requires that you have a model of how the world works and you have to be able determine the current state of the system. Now you move in that direction.</div>
<div>
<br /></div>
<div>
If the sate you are heading is not reachable effortless, you have imposed a force <b>F</b> on the world in that direction. This is the <i>force of intelligence</i>. The <i>temperature</i> T represents the power or "resources" you have to reach the desired state. The more power you have, the more force <b>F </b>you can impose. As you move (in time and space), you have to constantly validate desired state and adjust the direction you move. This adjustment is needed, because your model of the future was only a vague prediction and, as you go, your internal models of the world have to be updated with the reality. </div>
<div>
<h2>
The Physical Force of Intelligence</h2>
</div>
<h3>
It is Really a New Force?</h3>
<div>
This force is a real physical force. This force is not explainable with the other physical laws. If you read this, on a computer or on paper, the letters are in an order that would not exist without an intelligence imposing forces on the physical world. Intelligence influence the world. This influence is directed. The direction can be understood by looking at the formula F = T ∇ Sτ. This means some intelligent actor came to the conclusion that this is a better state to be in. Some state changes requite little force (if I type a or s does not make much of a difference). Other state changes require a lot of directed force, e.g. building a new house.</div>
<h3>
How to Measure the Force of Intelligence?</h3>
<div>
If intelligence is a physical force, it has to be observable, right? In the TED talk, Wissner-Gross gives a nice example of how alien observers could detect intelligence on earth with a telescope: Suppose alines would measure the number of asteroids hitting the earth for millions and billions of years. But suddenly a "magic force" appears, and asteroid do not hit the earth anymore. Instead they detonate or get deflected before they hit the earth. This is when humans have learned to to prevent the impact of asteroids with some advanced technology. For the aliens, none of the "classical" forces of physics would explain this. But the <i>Equation of Intelligence</i> would explain this otherwise mysterious force as the <i>Force of Intelligence</i>...</div>
<div>
<h3>
Is it a Break-Thru Like Chaos Theory?</h3>
</div>
<div>
I believe, this simple equation will change the way we see and understand the world. It may lead to a better future for mankind. I remember in the 80ies, when I studied physics, <a href="http://en.wikipedia.org/wiki/Chaos_theory">Chaos Theory</a> emerged into physics. It provided a scientific explanation for the behaviour of complex systems. Once you understand that small differences in the initial conditions of non linear systems can yield to wildly diverging outcomes (<a href="http://en.wikipedia.org/wiki/Butterfly_effect">butterfly effect</a>), chaos theory is simple and obvious. The <i>Equation of Intelligence</i> has similar qualities. Once you understand it, it is so obvious that you wonder why it was not formulated much earlier. As physicist, I really like the simplicity, beauty and generality of the equation. I also like the idea that we now can describe intelligence as a force that changes the physical world.</div>
<div>
<div>
<h3>
The Problem of Ambiguity of the Future</h3>
</div>
<div>
The biggest problem with this equations is to determine the entropic field Sτ and the accessible Temperature T. One might argue that this equation is useless because it is not well defined. I would agree with this critique, but the equation is a kind of approximation. The intelligence cannot know all possible future states nor can it know the freedom of action of each of the states. So, does it mean this equation is useless? I don't think so, because it as a set of interesting implications.</div>
<div>
</div>
<h2>
Implications</h2>
</div>
<div>
Let me point out a few implications of the equation.</div>
<h3>
Intelligence Needs a Dynamic Model of the World</h3>
<div>
In order to estimate the quality (in terms of actability) of future states, the system needs a model of the world. This model is used to simulate future states and to estimate risks, cost and and freedom of action for those states. This also means that, as the intelligence moves in a certain direction in option space, it has to re-evaluate the future states and correct the predictions and the direction. Our brain is a prediction engine. It makes predictions by associations. For example, we can predict the slope of a moving body without much reflection. But sometimes we have to question the automatic prediction (as <a href="http://en.wikipedia.org/wiki/Thinking,_Fast_and_Slow">Daniel Kahneman</a> points out) and use slow analytical thinking. For example, our intuition for probability is often wrong and depending on how a problem is described we may have a <a href="http://en.wikipedia.org/wiki/Framing_effect_(psychology)">bias in our predictions</a>. Simple intelligent systems, like a single cell following the light, have very simple 'models' of the world. Many systems have no explicit model of the world. Instead they have a "good enough" build-in heuristics that they find good states to move to.</div>
<h3>
Intelligence Needs Power to Act</h3>
<div>
Intelligence has to maximise the "temperature" T<b> </b>in the equation to increase the force (the impact to change the sate of the world). When humans learned to utilise energy (like fire) and turn it into physical forces (like with a steam engine), they increased their influence on the world. So, just observing future states is not enough. <b>The intelligence needs to have the power to turn the knowledge about the desired future state into a force to move there. </b><br />
<br />
The power needed to reach the desired state is a resource that has to be taken into account when we predict the freedom of action in the future. Let's consider an example: a cat is hunting a mouse. Instead of wasting a lot of energy running after the mouse, the cat sits still, and observes the mouse. It follows its movements and makes a prediction when there is a good moment to catch the mouse. This is a very good use of resources.</div>
<div>
<h3>
What is an Intelligent System?</h3>
<div>
Any system that creates a force into the direction of more freedom to act, is an intelligent system. This means a single cell or a single human is an intelligent system. But also communities can be seen as an intelligent systems. Animal colonies, nations, armies, religions, mankind can form intelligent systems. These systems are hold together by a set of rules that make them interpret the world in a specific way and they act (consciously or unconsciously) to give their system more (or less) freedom of action. Some of those system do a kind of random walk in time and space, but others have internal models and rules that guides them into a direction of more freedom of action. True intelligence is revealed when the state changes and the old rules do not work anymore. In that situation, the ability to anticipate the new situation and find new solutions distinguishes really intelligent systems form just well adapted systems.</div>
<h3>
Hierarchy of Intelligent Systems</h3>
<div>
Let me point out, that intelligent systems are often hierarchical. Cells form plants, animals and humans. Humans form families, tribes, nations. The entire biotope of the earth is an intelligent system. Think about mankind. Each individual person has a model of the world, and the interaction of all humans form an implicit model of the world of mankind. Evolution, with survival of the fittest, is a form of intelligent system. Any believe system or <a href="http://en.wikipedia.org/wiki/Meme">memes</a>, like a religion, atheism, capitalism or communism have a build-in set of models of the world and create forces in the world. It would be really interesting to analyse how good different believe systems are in terms of maximising the future freedom of the system. In terms of force to change the world and in terms of direction. There could be memes that have a lot of force but are misguided and die out.</div>
<h3>
Competition of Intelligent Systems</h3>
<div>
Another implication of hierarchical intelligent systems is, that intelligence at one level (a single human, company, religion, nation) may undermine the intelligence of the higher level system. Or vice versa, a higher level system has to reduce freedom of actions of its subsystem in order to maximise its freedom of action. If we see mankind as the more important system that a single human, this might have implication on how we should act as individuals, companies, or nations. If mankind is pulling in too many directions at the same time, then the overall force might be zero and therefore the intelligence is reduced to the intelligence of a bare physical system.</div>
<h3>
Brute Force Versus the Force of Intelligence</h3>
<div>
If you know what the best future would be, but you cannot or do not act, brute force systems may determine your future. It's that simple. Thinking about a better future is not enough. The ability to act is integral part of intelligence. And that is what intelligence is actually optimising, the ability to act. The greatest idea, if not actionable, is not intelligence. Classical <a href="http://en.wikipedia.org/wiki/Iq">IQ tests</a> measure only the future prediction part, but miss out on the power to act. Sometimes simple but strong systems rule the world and "intelligent" systems fail because they are not able to act.</div>
<h3>
Why is the Force Directed to Future Freedom of Action?</h3>
<div>
Not having any freedom of action means you are dead. Future freedom of action, essentially means to increase the probability of survival of the intelligent system. Therefore, intelligent systems increase their chance of survival by moving to states with the highest probability of survival. Because it is impossible to predict the future correctly, the best heuristic is to put yourself into a state where you are not trapped. <b>Freedom of action means survival, which is a simple and general goal.</b> From that, any sub goal is magically derived.</div>
<h3>
Evolution on Steroids</h3>
<div>
Because intelligent systems actively increase their chance of survival, intelligent systems are systems with an accelerated evolution. "Blind" evolution depends on random variations and the power of selection. Intelligent systems can boost the chances of survival by using force to move to states with higher chance of survival.</div>
<h3>
How to increase the force of intelligence?</h3>
There are tow ways to increase to force of intelligence:<br />
<br />
<ol>
<li>Make better predictions of the future, which means detect sates of maximum freedom of action</li>
<li>Increase the power to move in the desired direction. By adding more energy or being clever in finding paths that require less resources.</li>
</ol>
<h3>
Other Implications</h3>
</div>
<div>
The last few days, I did not sleep well, because my mind was overwhelmed by thinking about the implications of that simple equation. Here are just a few thoughts and each of them needs further exploration and refinement:</div>
<div>
<ul>
<li>I read about claims that say, artificial intelligence needs senses and a body to interact with the world. I think this is true, because in oder to change the future, intelligence has to interact with the world (apply forces). In order to make predictions it has to sense the world. So, AI without a <i>body</i> and <i>senses</i> is no intelligence because it cannot understand and interact with the world and therefore cannot apply any directed force.</li>
<li>Intelligence based on that definition might not have a "moral" in the sense we use moral. The only goal it has is to maximise its future ability to act. The moral emerges from what has to be done in order to get to the best future. E.g. if you own a company and you treat you employees badly, it might fire back in the future because they may leave or they revolt against you.</li>
<li>Intelligence may flow with the laws of physics but occasionally use force to change the world in a way that opens changes in the future. </li>
<li>As Wissner-Gross shows in his <a href="http://www.youtube.com/watch?v=cT8ZqChv8P0">video</a> on the <a href="http://www.entropica.com/">Entropica</a> webpage (which is also shown in the TED talk), a AI system that is build to maximise future options automatically chooses "intelligent" goals. For example a trading robot that maximises the portfolio, because it gives the system more freedom of action in the future within that game.</li>
<li>Politics is often not very good at maximising the future freedom of action of the nation. Instead they are focused on maximising their own power.</li>
<li>It would be interesting to analyse the way we manage software development with the question of how we can maximising the future freedom of action....</li>
</ul>
<h2>
Conclusions</h2>
</div>
<div>
The simple formula </div>
<div>
<br /></div>
<div>
<b>F</b> = T <b>∇</b> Sτ</div>
<div>
<br /></div>
<div>
explains how intelligence applies forces to the world that maximises its future freedom action. If we understand and apply it, we might be able to act more intelligently, which means we may put us in a better state for the future. It might provides us with cues on how to act more intelligently as individuals, as families, as communities, as companies, as countries and as mankind. </div>
<h2>
</h2>
<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com66tag:blogger.com,1999:blog-17681521.post-29036692113834999282013-10-11T19:29:00.000+02:002013-10-11T20:53:42.624+02:00Imagine the eclipse IDE would cost $300...<h2>Summary</h2>
Eclipse should have a price tag. Reason: for many customers, it is much easier to pay than to provide a committer.
There should be a discount system that allows for different discounts including getting eclipse for free. But the
point is users have to explicitly apply for a discount and give reasons why they think they cannot pay the full
amount. This is psychologically very different from donating voluntarily.
<h2>The tragedy of the commons</h2>
Recently, there have been some blogs about the <a href="http://en.wikipedia.org/wiki/Tragedy_of_the_commons">tragedy
of the commons</a> <a href="http://recoskie.blogspot.de/2013/10/the-tragedy-of-eclipse-commons-and.html">[1]</a>,<a
href="http://eclipseecf.blogspot.de/2013/10/evolution-of-cooperation.html">[2]</a>. <b>The tragedy is that there
are not enough resources to work on some core parts of eclipse.</b> There are many contributions but many of them
are in the interest of some companies not in the general interest of eclipse. My "<a
href="http://michaelscharf.blogspot.de/2009/10/future-of-eclipse-road-construction.html">road construction
analogy</a>" blog four years ago explains the problem. I cannot say if things have changed since then (I don't want
to make a judgement here). But I want to throw out an idea that I have been thinking about for a while...
<h2>The solution: the eclipse IDE costs $300</h2>
Imagine the eclipse foundation would sell eclipse for $300 (see below) with lots of discount options down to $0 (see
below). <b>The foundation would use the money to hire developers to work on common infrastructure to prevent the
tragedy of the commons.</b> Customers who pay could assign half of the money to specific projects or bugs. The other
half is used to maintain the eclipse common part.
<h2>Who should pay?</h2>
<b>The payment is for anyone who uses eclipse, but is not contributing back. </b>If you are a committer or
making contributions to eclipse, you have already "payed".
<h2>Why pay instead of contributing?</h2>
For many companies <b>payment for software is a standard procedure but contributing is an exceptional case</b> that
requires a much more complicated approval process. Contributing back by writing code is limited. Even if a company
decides to give let's say 80 hours of work back to eclipse, how efficient would that be if the contributor has to
learn all the process and the code etc? 80 hours for a full time committer are probably much more productive than 80
hours for a project newbie or for someone who has never written java code. If a company wants to spent the
equivalent of N hours it might be more efficient to pay for licenses instead of appointing a person within the
company to contribute.
<h2>Why would anyone pay?</h2>
<b>If you can get it for free anyway, why would anyone pay?</b> I think there is a huge psychological difference
between voluntarily paying (<a href="http://www.eclipse.org/donate/">friends of eclipse</a>) and choosing an option
like <i>"I believe others should pay for eclipse"</i>. The key is, if you wan to get eclipse for free you have to acknowledge
that you are not paying for something that otherwise costs money. This is <b>very</b> different form making a
donation. <b>To donate you really have to love eclipse. To refuse to pay, you really have to hate it. </b>
<h3>
The problem with donation</h3>
I wonder how many of the friends of eclipse ask the company they work for to pay the fee? I didn't and my guess
is that many donations are private. With an official price, it should be very easy to ask your company to pay the
fee, much easier than to say "I want to make a donation to eclipse, can you pay this for me...".
<h3>Payment allows you to determine the direction of eclipse</h3>
Half of the payment goes to development determined by the eclipse foundation. The other half the paying customer can
distribute on bugs, features op specific plugins or projects (a kind of <a
href="http://en.wikipedia.org/wiki/Crowdfunding">crowdfunding</a>).
<h3>Lots of complaints</h3>
No doubt, there will be lots of complains when eclipse would suddenly start adding a price tag to the eclipse IDE. Well, if you thing this is wrong, you can apply for a discount or refuse to pay. This is totally legitimate. But if you feel guilty not paying then this may say something about you and your attitude.... So, there is no reason to complain, if you think it has to be free, you can get it for free (period).
<h2>Another reason for payment: give the competition a chance</h2>
Here is another reason why eclipse should cost: Do you remember how many IDEs existed 10-15 years ago? Do you remember how expensive they were? Who survived? How can a company create a commercial IDE and make money when they have to compete with free tools like eclipse? I think it is not good for the future of IDEs in general that eclipse is free. What happens if you offer something for free until all competitors run out of business? You create a monopoly. But is that the goal of eclipse, to kill all commercial IDEs and become a monopoly? A monopoly that eventually will die because of the tragedy of the commons...
<h2>Price</h2>
I just made an assumption of $300 but it could be $50, $100, $500 or $1000. This has to be determined. The amount of
discounts is also open but there must be a 100% discount to get eclipse for free. It is important that there is
a discount option that allows employees to choose a price that it is easy approvable within their company. If the
internal limit for easy approval is $200, you might get a "special" discount to reduce the price to that amount.
<h3>One time or subscription price</h3>
Extending the licence to new versions of eclipse should be discounted and maybe there is a subscription licence
(the exact conditions have to to be determined)
<h2>Discounts</h2>
Here are some possible reasons for discounts the user can choose form. Yes, some of the reasons are a bit cynical,
but I think they reflect reality (I'm not sure if all the reasons end up in a real implementation of the idea, and
maybe there are better ideas for good discount reasons)
<ul>
<li>I am a committer (discount of 100%)</li>
<li>I made contributions (10%-100%)</li>
<li>I reported bugs (5%-100%)</li>
<li>I use eclipse only for open source projects (up to 100%)</li>
<li>It is too expensive (you choose the price)</li>
<li>The price is above the limit I get approval for (you choose the price)</li>
<li>I cannot afford it (you choose the price)</li>
<li>I come form a poor country (10-90%)</li>
<li>Eclipse member companies should pay (100%)</li>
<li>In my country/company we never pay software licences (100%)</li>
<li>Eclipse sucks, but I have to use it (100%)</li>
<li>Others should pay, not me (100%)</li>
<li>It is my right to get it for free (because it used to be free) (100%)</li>
</ul>
To get eclipse for free, you have to acknowledge that others are paying or contributing. It is only a moral
difference. If you use eclipse for free today, you do the same: you somehow mentally acknowledge that other should
"pay" for it, in terms of contributions or money ....
<h2>Implementation</h2>
The eclipse webpage should allow to pay directly or get a free (trial) download. After using the trial
version for while (30 days of usage) a licence dialog will pop up and ask you to enter a licence or pay
(like many commercial applications). Sure, you can remove the plugin or apply for a 100% discount.
<h2>Conclusions</h2>
The intention is to create a constant revenue stream to found eclipse ground work. The payment should be worded that
accountants in companies pay the amount without much questioning. <b>As employee to make your company to donate or
asking for time to contribute might be difficult. Getting approval for a software purchase might be simple.</b>
<p>What do you think? Does any of that make sense?</p>
<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com12tag:blogger.com,1999:blog-17681521.post-31822357686471866412013-05-11T03:01:00.000+02:002013-05-11T03:04:19.709+02:00Support fundraising for LiClipse and PyDevThe last days I have been struggling setting up a development environment to browse and understand some open source projects that contain all kinds of different (programming) languages, like python, javascript, coffeescript, ruby, css, HTML, HTML5, sh, csh, markdown, reStructuredText etc. Unfortunately, eclipse is not really good for that use case.
<br />
<br />
I have been looking for alternatives to do the code browsing, including the <a href="http://www.jetbrains.com/">JetBrains</a> products (which are really cool) and emacs (which I use since 30 years). But I don't want to learn a new IDE (JetBrains) nor do I want to go back to the 80ies using emacs.<br />
<br />
The real pain with eclipse is to find and install the plug-ins needed to browse and the code. <b>Even if you have the right plug-ins installed it is very painful to set up projects correctly to parse and understand your code</b>.<br />
<br />
In fact if you don't have the right plug-in installed, double clicking on an unknown file-type it opens any external tool you operating system has associated with that extension which is <b>really</b> annoying (see<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=142228"> bug142228</a>).<br />
<br />
Anyway, since eclipse is not usable for "random github projects", I was looking for alternatives and I stumbled over <a href="http://liclipse.blogspot.de/">LiClipse</a> by <a href="http://pydev.blogspot.com/">Fabio Zadrozny</a> (the maintainer of <a href="http://pydev.org/">PyDev</a>) and a his <a href="http://www.indiegogo.com/projects/pydev-and-liclipse-for-a-fast-sexy-and-dark-eclipse">fund raising for LiClipse at indiegogo</a> which I think is a great idea!<br />
<br />
LiClipse wants to bridge the gap between heavy weight IDEs and having a plain text editor. I think this is a fantastic idea and therefore I support it with a donation, and if you think it is a good idea, you should do the same... But the<b> fund raising ends Monday 13 May 2013</b>, so you have to hurry and <a href="https://www.indiegogo.com/projects/pydev-and-liclipse-for-a-fast-sexy-and-dark-eclipse/contributions/new">add your contribution</a> now!<br />
<br />
I think it is important to support projects like PyDev and LiClipse because eclipse lives form contributions and many of us would do open source work for the fun of it, but somehow we have families and a life that needs funding. The choices are<br />
<br />
<ul>
<li>that you do it in your spare time</li>
<li>you find a company that pays you for doing the project </li>
<li>you create your own startup in the hope to get somehow money in the future (might be very risky and does not pay your bills now)</li>
<li>you use crowd-funding to kick off your business...</li>
</ul>
I really hope that Fabio gets enough money to do LiClipse!<br />
<br />
<br />
<br />
<br />
<br />
<br /><div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com3tag:blogger.com,1999:blog-17681521.post-17092695352897027882013-03-20T21:55:00.000+01:002013-03-21T02:10:53.451+01:00Coming to EclipseCon 2013 as freelancer...This year I will come as independent freelancer to EclipseCon2013. After 19 years working for the same company it is time for me to move on and get into new adventures. I had a really great time. In April 1994, I started as a freelancer working for a small startup company called <a href="http://web.archive.org/web/19970211210431/http://www.takefive.com/">TakeFive</a> from my home office in <a href="http://heidelberg.de/">Heidelberg</a> (and I still work from my home office). TakeFive was located in <a href="http://www.salzburg.info/">Salzburg</a> about 500km from where I live. Working from a home office was tough back then. I had only an <a href="http://en.wikipedia.org/wiki/Acoustic_coupler">Modem</a> at 9600bits/sec (about 1kb/s) and calling to Austria was expensive at that time. So, I was regularly traveling with my sun workstation to Salzburg to synchronise my data. If I compare this with today it is hard to believe that I worked that way.
The name of the company changed but it was the same old TakeFive for me:
<br />
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDxYLpcNMUcKhy0Vm6MXit2Pi_RynGCL343-GWH2x4rCC6G5I2H-CazgqC1s3tGLQrf5ZB51zRvd-bKPRlxEwQwrc-y4WlCAcFePud_op0XRbFPyddktuvbo0NEb9XG-KyEfPHHA/s1600/TakeFive.gif" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDxYLpcNMUcKhy0Vm6MXit2Pi_RynGCL343-GWH2x4rCC6G5I2H-CazgqC1s3tGLQrf5ZB51zRvd-bKPRlxEwQwrc-y4WlCAcFePud_op0XRbFPyddktuvbo0NEb9XG-KyEfPHHA/s320/TakeFive.gif" /></a>
</div>
TakeFive then was acquired by <a href="http://www.thefreelibrary.com/Integrated+Systems+Acquires+TakeFive+Software%3B+Provides+Open...-a017473310">ISI in 1995</a>. In 2000 ISI merged with WindRiver and 2009 <a href="http://www.windriver.com/news/press/pr.html?ID=6921">WindRiver was acquired by Intel</a>. Since 2009 I worked as employee at Wind River...
<p />
TakeFive was selling an IDE, called <a href="http://engineering-software.web.cern.ch/engineering-software/Products/Sniff/attachments/docs/usersguide.pdf">SNIFF+</a>, originally created by <a href="http://dl.acm.org/author_page.cfm?id=81100495223&coll=DL&dl=GUIDE">Walter Bischofberger</a> based on <a href="http://citeseerx.ist.psu.edu/viewdoc/summary;jsessionid=B8B3F9F2A91506C0FE5C5C104CFF0FFB?doi=10.1.1.33.4786">ET++</a>, a very cool framework created by <a href="http://de.wikipedia.org/wiki/Erich_Gamma">Erich Gamma</a> and <a href="http://www.linkedin.com/pub/andre-weinand/3/105/44b">André Weinand</a>. Around 2002/2003 we switched using eclipse as basis of our IDE... But it was in 1999 when I have seen the first versions of eclipse. In 2000 (before eclipse became open source) I started using it. I have been to all EclipseCons (and EclipseCons Europe) until 2010... But now it is time to meet all the nice eclipse folks again....
<p />
I am currently working on a start-up project that looks really promising but it is top secret and I can't talk much about it. Working for start-ups is a gamble. My gamble in 1994 worked for 19 years... Let's see if this one works out... I really enjoy working for a small start-up from my home office. It feels very much like TakeFive in the early days: it is challenging -- it also feels free -- free to win and free to fail, but that is the destiny of a freelancer ...
<br /><div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com2tag:blogger.com,1999:blog-17681521.post-8013437874872727822009-12-20T19:37:00.004+01:002009-12-20T22:24:35.009+01:00Contradicting myself with my eclipsecon submissions....If you look at my EclipseCon 2010 submissions:<br /><ul><br /><li> <a href="https://www.eclipsecon.org/submissions/2010/view_talk.php?id=1443">1443</a> Declarative UI sucks? Create your own!<br /><li> <a href="https://www.eclipsecon.org/submissions/2010/view_talk.php?id=1480">1480</a> Extensible EMF Switches<br /><li> <a href="https://www.eclipsecon.org/submissions/2010/view_talk.php?id=1483">1483</a> Annoyed by all those similar looking interfaces: IMemento, IConfigurationElement, IPreferenceStore, IDialogSettings, ILaunchConfiguration...<br /><li> <a href="https://www.eclipsecon.org/submissions/2010/view_talk.php?id=1484">1484</a> JFace/SWT Tables turned upside down<br /></ul><br />It seems that I am contradicting myself, because in <a href="https://www.eclipsecon.org/submissions/2010/view_talk.php?id=1443">1443</a> I propose to create your own (copy) of a declarative UI and in <a href="https://www.eclipsecon.org/submissions/2010/view_talk.php?id=1483">1483</a> I whine about all those similar looking interfaces. How does this go together? <br /><br />Well, in the case of all the different property stores, they all do the same and having 10 different classes/interfaces is indeed annoying. On the other hand. I simply do not believe that there is "the" declarative UI that solves everybody's problems. <b>Whenever you try to create the ultimate declarative UI you are doomed to fail because it is either simple but too restrictive or powerful but too complicated</b> (I'd be very happy if someone could prove me wrong).<br /><br />The idea of a domains specific language is to be Domain Specific! One could argue that UI is a domain and a (e.g. xml based) declarative UI is a domain specific language for creating UI. But, in reality UI is not UI. It's like creating a domain specific language for programming. You end up creating a Turing complete general purpose language. OTOH, if you want to create a domain specific language for form based UI on top of EMF you have a good chance it becomes a good abstractions. But do not expect this language to be used to create something like JDT or PDE. <br /><br />I do not believe there is the ultimate declarative UI language. But I believe that saving properties is so universal (and simple) that one 'language' should be sufficient.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com2tag:blogger.com,1999:blog-17681521.post-31305536931058279122009-10-24T04:38:00.002+02:002013-10-01T13:51:27.561+02:00Future of eclipse: The Road Construction Analogy<a href="http://www.gerhardtinformatics.com/">Frank Gerhardt</a> will host a session at ESE called <a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=1037">Symposium on Eclipse Foundation 2.0</a>. Half a year ago I burned my fingers with my <a href="http://michaelscharf.blogspot.com/2009/04/eclipse-freeloader-award.html">"Eclipse Freeloader Award"</a> blog entry. I got lots of negative comments and mails. I also got a few positive reactions. I decided not to continue talking about the future of eclipse.<br />
<br />
Today, half a year later I look back and one interesting mail I wrote at that time is an email press interview. I decided to post it as I wrote it and I use it as my position paper for the symposium. <br />
<br />
<b>If this blog is to long just read the <a href="https://www.blogger.com/blogger.g?blogID=17681521#RC">"The road construction analogy"</a> section.</b> This is the part of the interview I am most proud of....<br />
<br />
The last months I have been heavily involved in an internal Wind River project based on eclipse and modeling, especially <a href="http://www.eclipse.org/Xtext/">Xtext</a> and I have not had too much time to work on eclipse except bug reporting and asking stupid questions on the tmf newsgroup. <br />
<br />
I have no idea how the community will react on that (very long) post. <br />
<br />
<b>Disclaimer</b>: The text below was written half a year ago. It expresses my personal opinion at that time. I have not followed the recent developments and I might change my mind at any time... ;-)<br />
<br />
<br />
<b>My reply to an e-mail interview on April 18. 2009:</b><br />
<br />
<b>Q:</b><i> If you were ready to give the freeloader award, who would be the three finalists for the "honor." Why these guys?</i><br />
<br />
<b>A:</b> I had no particular company in mind. However, it is the general mentality of the industry that frustrates me: the attitude to take advantage of something like open source and not give back anything to the system. This is also known as the <a href="http://en.wikipedia.org/wiki/Tragedy_of_the_commons">"Tragedy of the Commons"</a>: Scott Lewis pointed out that the bigger a community is the less people participate: <a href="http://eclipsesource.com/blogs/2009/04/07/the-logic-of-collective-action/">"The Logic of Collective Action"</a><br />
<br />
From an architectural perspective, there are things to be done in eclipse that should not been driven by direct interests of some companies but in the common interest of the community. IBM somehow took this role for a while, when they put some of their best people on the core of eclipse. At that time they were interested in the overall success of eclipse. Since some years they started removing quite some developers from eclipse (and put them on the Jazz/RTC project).<br />
<br />
I believe there should be an independent group of developers driving eclipse. In my opinion it would be best if they would be paid by the community but act independently in the best interest of eclipse.<br />
<br />
Now the questions is: why should companies put money into something that is free? If they put money in the system and their competitors do not, they have a competitive disadvantage. They support the community but they have no direct advantage. And in fact the company I work for (Wind River) just ended their membership (which is a sponsorship of the foundation) just recently.<br />
<br />
That is why I was brainstorming about ideas how to stimulate companies to contribute. I am really afraid that eclipse will suffer in the future because the architecture degenerates over time and there is not enough manpower to keep modernize the architecture. Yes, there is e4 (the next generation of eclipse), but I am not 100% convinced that this is the solution.<br />
<br />
To stimulate companies to give money/resources to support the <a href="http://en.wikipedia.org/wiki/Commons">commons</a> there has to be a benefit. If there is no positive benefit why would a company do that? So, my idea was to create peer pressure. One way to create peer pressure for companies to make them avoid negative press. A freeloader award would create negative pressure. No company would like to win the freeloader award.<br />
<br />
<b>Q:</b><i> Other people I've spoken to, include Mike M. at Eclipse are much less concerned about the problem. Why do you see it as so serious?</i><br />
<br />
<b>A:</b> Well, I probably have a different perspective than Mike. Mike sees the eco system and the new companies joining eclipse. My focus is more on the architecture of eclipse. So, the irony is that although eclipse is widely successful the underlying architecture ages and dissolves slowly. Partly because eclipse is stretched into so many different directions. It is never good for an architecture to go into too many directions at the same time. When eclipse started it was a platform for IDE like applications. It was later retro fitted to be the basis for rich client applications. The people ported eclipse to embedded systems. Then the it was used for the web and for servers.... All this is good for the short term success but I am afraid that the long term impact on the architecture could be disastrous. The architecture council is not really focusing on architecture. Partly because the members have never been the ones that created and drove the original architecture. And partly because architecture by committee is doomed to fail. <br />
<br />
<a href="" name="RC"><b>The road construction analogy</b></a><br />
<br />
One analogy for the general eclipse community problem I have been thinking about recently is road infrastructure in a country. Suppose a big company (=IBM) created a basic road infrastructure and decided to make this available to the public for free (=original eclipse).<br />
<br />
In the beginning, the big company somehow drove the journey and continued building the free infrastructure. They also had some interest in this infrastructure because they wanted to have a well accepted public road system to deliver their products. But over time they gave the roads to the public and let the other companies continue building the roads. The hope is that the market is self regulating and it would continue maintaining the road infrastructure and new roads would be build by other companies.<br />
<br />
In the beginning the companies understood the plan of the big company and continued building in that spirit. But some companies realized that it is not in their interest to build roads for their competitors. And it makes no sense for them to maintain the highways in general. They might build junctions to their private road network but hope that others maintain the net of highways created by the big company long ago. Sure they would fix some obvious holes on the roads. One could argue that roads build like that really reflect the needs of the community. But some of companies make sure the competitors do not get access to their key roads. What happens is: many private roads are be build in parallel, instead of some new highways. Companies would build "public roads" that connect their private roads. If the companies would understand that they all would benefit form good public roads, then they could come together and hire an independent road building organization and give them money (a kind of tax) to build the roads that are in the interest of the entire eco system. But at the moment there is no authority to enforce the tax payment. Lots of the roads are public and some companies donate "public roads" to the system. Who could blame those companies? They give something free to the community but also act in their own interest. They are much better than companies that use the public roads without contributing back. But something is wrong here. The nicely designed infrastructure degenerates over time. Can we blame the ones who contribute for that? That is the key to the problem: companies are contributing, but the contributions are not really in the best interest of the eco system.<br />
<br />
How to solve the problem? How to make sure that roads are build that are in the common interest? Would it make sense to have a "tax paid" independent organization build and maintain the infra structure? How can we motivate the community to pay the taxes? Can we blame the companies that fix the roads and add now ones?<br />
<br />
<br />
<b>Q:</b><i> Any suggestions, besides public disgrace, to ease the problem?</i><br />
<br />
<b>A:</b> The questions boils down to: how can we motivate companies to maintain and enhance the common infra structure?<br />
<br />
Positive motivation: all participants understand that they have to invest into the system beyond direct interests. But do all participants understand that? And how to deal with community members that do not want to pay their taxes? If someone can get away not paying the taxes the others who pay the taxes are the stupid ones. So, positive motivation works if all participants understand that they depend on the system. It essentially requires a certain level of moral. The bigger the community (and the more anonymous) the easier it is to get away without paying the tax. And in a capitalist world companies act in their own interest. Who can blame them for doing so? How else can they survive?<br />
<br />
Negative motivation: have a police, a pillory, public opinion (press), a freeloader award. Something that puts pressure on members that do not want to pay their "taxes"...<br />
<br />
<b>Q:</b><i> I always prefer to quote people by name, but if you like, I can withhold yours.</i><br />
<br />
<b>A:</b> You can quote me. Those who know me know that I can change my mind very quickly. Partly because I simply forget what I say and partly because I like to look at problems from very different angles. Therefore, I could never ever become a politician because you could find lots of statements where I contradict myself.<br />
<br />
If I look into the eclipse world, I see that the number of people warning about the future problems is underrepresented. That is why I raised my voice. If everybody would scream and warn about the future of eclipse, I would certainly find a lot of good arguments why eclipse has a bright future and why the current eclipse eco system works so exceptionally well and why eclipse is a great example of a successful open source project. <br />
<br />
But at the moment I think there is not enough awareness of the problems of the tragedy of the commons. And that companies think they act in their own interest, but in the long term and from an higher level, they do not act in their own interest because they "ultimately destroy a shared limited resource".<br />
<br />
[sorry for the long reply, but this is a topic that upsets me at the moment because I can see the disaster coming]<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com8tag:blogger.com,1999:blog-17681521.post-41058827496367442532009-09-17T21:05:00.008+02:002009-09-17T22:09:42.957+02:00Never put things above a user specified pathIf you tell a program to use a path to store something you normally expect that the program puts its data <span style="font-weight:bold;">inside</span> that path and not into the parent. Sounds simple, but in the last 24 hours I ran two times into violations of this basic principle.<br /><br /><br />1. For the next release of our Wind River Workbench product we will use p2. We have thought our customers to use the <a href="http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm"><code>-configuration</code> option</a> to redirect the place where eclipse puts its "stuff" if they use a shared installation. If they have different installations or different versions installed, that worked nicely (before p2): for version 3.0 they would use <code>-configuration /someplace/wrwb3.0</code> and for version 3.1 they would use <code>-configuration /someplace/wrwb3.1</code>. Unfortunately since version 3.4 eclipse violates the principle "<span style="font-weight:bold;">never put things above a user specified path</span>" (<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=230384">bug 230384</a>) and puts things like artifacts.xml and the p2 directory above the directory specified. If customers mix different versions of our product the old way, then they get a mess because two configurations that are supposed to live side by side suddenly share the potentially incompatible information in the parent. We are thinking to change the behavior of -configuration to add implicitly one more directory (to turn a user specified <code>-configuration /someplace/wrwb3.0</code> into <code>-configuration /someplace/wrwb3.0<b>/configuration</b></code>) so that the two configurations <code>-configuration /someplace/wrwb3.0</code> and <code>-configuration /someplace/wrwb3.1</code> do not infer with each other.<br /><br /><br />2. I am really excited about <a href="http://www.eclipse.org/Xtext">Xtext</a>! Yesterday I created a new Xtext language project (let's call it <code>gr.scharf.mylanguage</code>). The wizard suggests to call my language <code>gr.scharf.MyLanguage</code>. Sounds good, but it puts its files into the package <code>gr.scharf</code> which is not such a good idea, because it pollutes the parent name space (see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=289780">bug 289780</a>) and therefore violates the principle "<span style="font-weight:bold;">never put things above a user specified path</span>".<br /><br /><span style="font-weight:bold;">Conclusion: if the user gives you a path put things underneath the path and do not touch the parent!</span><br /><br />...think twice to make sure not to violate this simple principle....<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com1tag:blogger.com,1999:blog-17681521.post-28795270769948137122009-06-13T19:13:00.012+02:002009-06-14T03:41:18.563+02:00Every pixel counts! The new eclipse fullscreen plugin...A few days ago <a href="http://dev.eclipse.org/blogs/kevinmcguire/">Kevin McGuire</a> blogged with the title <a href="http://dev.eclipse.org/blogs/kevinmcguire/2009/06/05/every-pixel-is-sacred-not-any-more/">Every pixel is sacred (not any more!)</a> and a follow up <a href="http://dev.eclipse.org/blogs/kevinmcguire/2009/06/12/eclipse-ui-real-estate-wasters/">Eclipse UI Real Estate Wasters!</a>. I still believe that every pixel counts and I often wanted to have eclipse in full screen mode to save a few pixel. I use full screen mode in the browser and with pdf files a lot and I really love it. I remembered that there is a new <a href="http://help.eclipse.org/stable/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/widgets/Shell.html#setFullScreen(boolean)">Shell.setFullScreen</a> method in SWT. During a boring meeting, I decided to create a small plugin that would add a toolbar button and a menu entry to toggle eclipse in to fullscreen. I started with the "New Plugin wizard" and choose the <i>Hello, World Command</i> example and replace the handleCommand line with one line:<code><br />window.getShell().setFullScreen(!window.getShell().getFullScreen());<br /></code><br />I changed the labels in the <code>plugin.xml</code> and <b>I was done, in less than 10 munites.....</b><br /><br />I should know that <a href="http://michaelscharf.blogspot.com/2009/05/why-is-rcp-emf-p2-databinding-so-hard.html">even "simple" things can be quite complicated</a>.<br /><b>I wanted to make the plugin nice and share it but that was the start of a nightmare.....</b> but that is another story. <br /><br /><br /><h2>Download/update</h2><br />You can use <a href="http://www.scharf.gr/eclipse/fullscreen/update/">this site as update site</a> or download the plugin from here: <a href="http://www.scharf.gr/eclipse/fullscreen/update/gr.scharf.fullscreen.zip">gr.scharf.fullscreen.zip</a><br /><br /><br /><h2>Functionality</h2><br />The plugin has been written for eclipse 3.5 but it works also for eclipse 3.4 although there are some problems with the handling of the toggle state of the commands...<br /><br />The plugin adds a <i>Fullscreen</i> command to the <i>Windows</i> menu and a Keybinding <i>M3+F11</i> which translates on windows to <i>Alt+F11</i>:<br /><br /><img src="http://scharf.gr/eclipse/fullscreen/update/images/WindowNotFullscreen.gif"><br /><br />When fullscreen mode is active all (main) windows are in full screen mode:<br /><br /><img src="http://scharf.gr/eclipse/fullscreen/update/images/WindowFullscreen.gif"><br /><br />There is also a Toolbar button that can be enabled. Because the plugin uses the <a href="http://wiki.eclipse.org/Platform_Command_Framework">Commands Framework</a> there are some unfortunate restrictions (<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=280033">bug 280033</a>):<br /><ul><br /> <li>When you go to <i>Window->Customize Perspective->Tool Bar Visibility</i>, you will <b>not</b> find the Fullscreen tool bar unless you have enabled it in <i>Window->Customize Perspective->Command Groups Availability</i><br /><br /> <li>The <i>Toolbar details</i> are empty, although the toolbar contains a command:<br /></ul><br /> <img src="http://scharf.gr/eclipse/fullscreen/update/images/FullscreenCustomizePerspective.gif"><br /><br />Once you have succeeded enabling the toolbar button, it will look like this:<br /><br /> <img src="http://scharf.gr/eclipse/fullscreen/update/images/ToolbarButtonNoFullscreen.gif"> and <img src="http://scharf.gr/eclipse/fullscreen/update/images/ToolbarButtonFullscreen.gif"><br /><br />I decided to hide the button by default, because in most cases the shortcut and the windows menu command should be enough.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com12tag:blogger.com,1999:blog-17681521.post-8909614880842988652009-05-12T02:28:00.007+02:002009-05-12T03:30:37.508+02:00Why is RCP, EMF, p2, databinding... so hard to learn?There are some interesting discussions on my recent blog entry on "<i><a href="http://michaelscharf.blogspot.com/2009/04/how-to-explain-emf.html">How to explain EMF?</a></i>". The debate is between those who find it hard to learn EMF and those who have a hard time seeing the difficulty. I think there is a general pattern behind this debate. The same arguments could be made for almost any non trivial technology/framework inside and outside eclipse (EMF, RCP, p2, databinding, [<i>your "favorite" hard to learn technology</i>],...). <br /><br /><b>Why do many people really suffer form the steep learning curve and others master the same technology easily</b>?<br /><br />I think we have to step back for a moment from any concrete technology and we should to look at how the technology gets created and how learning and applying of the technology works. <br /><br /><b>The creators of the technology/framework have a deep knowledge in the particular domain the framework solves.</b> They have created several software systems where they saw some reoccurring patterns. They realize by putting the common parts into a framework they can dramatically increase their productivity, because the work is then reduced to assemble the pieces and write some "glue code" (in some sense they create a kind of domain specific language for that problem). As long as the creator(s) of the abstraction are the only users of the system, there is no real problem and they can show dramatic increase of productivity, because they can focus on the business relevant part of the system.<br /><br />Now comes the next phase, where others adopt the technology. Those early adopters are usually people with a similar experience background as the original authors of the framework. They have typically written such systems by hand or created their own framework and they see the value of the technology. For them, learning the system is almost effortless because they understand the underlying problems and the solution provided by the cool technology. <b>Good candidates of successful adopters are typically consultants using the technology in multiple projects.</b> They report impressive increase of productivity. Let's call them <i>expert users</i>.<br /><br />Now another category of users, the <i>normal users</i> wants to use the technology. They see the impressive results created by the expert users. The expert users tell them how effortless this is and how quickly you can create solutions.<b>This is where the problem starts!</b> The expert users understood the problem before they started, they understand the solution in depth and they reapply the technology to many projects. <b>The normal users typically have a single project where they want to apply the technology.</b> They might have a vague understanding that the new technology fits to their problem. The "documentation" build from expert users for expert users make no sense, because there is a lot of background knowledge and experience missing. Normal users have to put a lot of effort into learning and understanding a complicated system just to apply it once. <br /><br />If the <i>normal user</i> manages to use the technology to solve his problem, his solution is often "suboptimal", because he might be happy to have found just <i>one</i> solution. The expert would see that it is by far not the best possible solution, because he has a much deeper understanding of the solution space. OTOH, the normal user might have a much better understanding of his specific problem domain and the expert might propose a bad solution, because his limited understanding of the problem domain.<br /><br />Let me give you an analogy: Some weeks ago, my mother told me that she has a serious problem, because her old typewriter broke. She explained me how they do their tax-declaration: my father hand-writes tables with income and expenses and my mother types them with the typewriter. Well, they have a computer (which they use to read email and browsing). The solution is clear: a spreadsheet is all the technology they need to optimize the process. Me "the expert", could just tell them that they can be much more productive by using this "new and cool" technology. All, they'd have to do is to enter the numbers directly into a spreadsheet and with a few more mouse-clicks and a bit of excel programming he would even get some cool graphics and analysis.... Do you think I did that? No way. They are in their mid 70ies, they have done it "their way" all their life. How steep would their learning curve be? Does that mean they are stupid? My father is extremely good with his hand written tables, he uses colors and creates cool graphs by hand. He has an extremely good understanding of the money flow. He even knows exactly how much money they spend on me and my brothers from our birth to now. I wish I would have 10% of his knowledge on where my money flows. <br /><br />In this example we see very well the difference between "expert users" and "normal users" of the technology. This technology would work really well for me and would not work at all for my parents. And even if I would try to teach them, I would have to use a very different language to explain it to them than I would use it explaining it to you. I would have to explain them what a spreadsheet is and so on. Then I could ask them if they prefer open-office or Microsoft office. Because they have absolutely no idea, even this simple this choice would stress them a lot.... Once they would start with an empty spreadsheet, there would be so much choices and decisions to make that they would be totally paralyzed. Would examples or documentation help? Well somehow, if an example does exactly what they want to do, but then it is almost the solution. Does that mean that spreadsheets are complicated technology? Well, it depends on your background. I think it would be more efficient for me to help them doing their tax declaration and prepare a spreadsheet and every time they do it, sit with them and help them. But I think the way they do it is OK for them, all I need to do is to fix my mothers typewriter.... If they were young and they had a lot of numbers for their tax declaration, it would make sense for them to learn the technology....<br /><br />OK, I stressed this example enough... What does this mean for the "complicated" technologies around eclipse? <br /><ul><br /><li>There is a big danger that a great technology gets a "bad reputation", just because "normal users" want to apply it and they find it the technology incredibly hard to learn and to apply. <br /><li>As expert user, you can cause a lot of damage it you tell some unexperienced users to use a technology without guiding them. And in some cases <b>it might be better to tell them <i>not</i> to use the technology if they are not "ready"</b>. For you it might be the right choice, for them it would cause disasters at all levels.<br /><li>Learning "complicated" technologies might not be worth the effort if you want to apply it once. <br /><li>Ask yourself if it is more efficient to hire an expert than to learn the technology. Especially if you want to apply the technology only once in a relatively simple way. In this case the expert can be 10-100 times more efficient than you.<br /><li>If you are a <i>normal user</i> and you still want to learn the technology, be prepared that is takes time and it is a painful process. In order to make educated decisions you have to become at least "Competent" (see <a href="http://en.wikipedia.org/wiki/Dreyfus_model_of_skill_acquisition">the Dreyfus model of skill acquisition</a>) or needs "Conscious competence" (see <a href="http://en.wikipedia.org/wiki/Four_stages_of_competence">Four stages of competence</a>).<br /><li>Maybe <i>expert user</i> and <i>normal user</i> should team up to write documentation and create example. For experts it is often very difficult to understand the problems of normal users and for normal users it is impossible to come up with good examples and documentation.<br /></ul><br /><br /><i>This post is a bit longer than my normal posts and I kept is as draft for a while but I decided to post it. It is a bit like with complicated technology: you can't explain it in two sentences ;-)....</i><div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com11tag:blogger.com,1999:blog-17681521.post-59958436696842908822009-04-23T03:51:00.003+02:002009-04-23T05:36:18.892+02:00How to explain EMF?Have you ever tried to explain EMF to <i>nonbelievers</i>? I find it difficult to explain what EMF is and why it makes sense to use it. I had this a few times in my career: <br /><ul><br /><li>In the mid 80ies when I started with object oriented programming. For procedural programmers (modula2/pascal/C/Fortran) it sounded like a lot of buzzwords and seemed to add no real value...<br /><li> End of 80ies and in the beginning of the 90ies (before the <a href="http://en.wikipedia.org/wiki/Gang_of_Four_(software)">GOF book</a> was out), patterns seemed to be quite fuzzy and it was hard to explain what the value of describing "patterns" is.<br /><li>Around the same time I discovered scripting languages (starting with (g)awk->TCL->perl and ending with python, which I used for a decade). It was hard to motivate why those "slow" languages are in any way useful.<br /><li>Aspect oriented programming is still in the "hard to explain/motivate" phase.<br /></ul><br />The common pattern with those "hard to explain" new technologies is that they are incremental changes to existing stuff but once you understand and use them, they change the way you are thinking. If you adopt the "new technology" you feel a boost in productivity and you see better ways to solve old problems. The level of abstraction raises and you can focus more on the problem instead of dealing with low level implementation details (or reinventing the wheel). And then comes the time when you think all problems can be solved with the new "hammer"....<br /><br />It is similar to converting to a new <i>religion</i>. For the <i>believers</i> it changes their life. It changes the way they see, experience and interact with the world. For the <i>nonbelievers</i> it looks like a stupid set of paradigms that make no sense. They learn how to block the arguments of missioners of the <i>new religion</i> and the more missionary the believers are the more skeptical the <i>nonbelievers</i> get.<br /><br /><b>So, how do you explain the benefit of EMF?</b> <br />What is the best strategy to <i>evangelize nonbelievers</i>?<br />What is the best way to get the <i>converts</i> over the initial pain of change?<br /><br /><b>What are the typical questions and problems with EMF?</b> <br />Here is a list of things I hear often:<br />Why to use EMF for my DSLs instead of some hand-written well tuned Java?<br />It generates lots of code and bloats my project.<br />EMF is so complicated, it takes a long time to learn -- in that time I have solved my problem twice without EMF.<br /><br /><b>What are scenarios where EMF increases productivity and where is it the wrong tool?</b><br /><br />I have seen <a href="https://www.eclipsecon.org/submissions/2009/view_talk.php?id=358">Peter Frieses talk at eclipsecon</a>. I really liked it but I am not sure it helps <i>nonbelievers</i> to understand what EMF (and modeling in general) is. I think what is needed is a hands-on way with some real examples that show step by step how modeling and EMF can be applied to real problems. <br /><br />I will post some of my experience with EMF in this blog in the next weeks and months.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com16tag:blogger.com,1999:blog-17681521.post-13022797191659880192009-04-07T21:18:00.003+02:002009-04-07T22:36:30.184+02:00The Eclipse Freeloader Award<span style="font-weight:bold;">The future of eclipse in in danger</span>: The problem is that there is no real pressure for companies to contribute back to the community and it is easy to use the eclipse "for free" for the own products. There are some interesting blogs on this topic by <a href="http://cdtdoug.blogspot.com/2009/04/another-great-post-by-bjorn-on-life-at.html">Doug Schaefer on the future of eclipse</a> and <a href="http://eclipse-projects.blogspot.com/2009/04/its-new-world.html">Bjorn on life at Eclipse in the new world</a>. <br /><br />According to wikipedia, this is called <a href="http://en.wikipedia.org/wiki/Freeloader">free loading</a>: <span style="font-style:italic;">"choosing not to do work and letting others do it"</span>. <br /><br />Eclipse is open source and companies can take advantage of the open source work. There is nothing legally that can prevent them from doing so. But <span style="font-weight:bold;">the eclipse community should create peer pressure to prevent the freeloaders and parasites from getting away without punishment.</span> <br /><br />A few ideas to increase the pressure for freeloaders:<ul><li> Create an eclipse freeloader award<br /><li> Have an "eclipse supporter" logo<br /><li> Have a list of of freeloaders prominently on the eclipse page<br /><li> Create an eclipse <a href="http://en.wikipedia.org/wiki/Pillory">pillroy</a></ul><br />Is this too harsh? Well, it is less harsh than to take advantage of the work of others and letting eclipse die. It seems that positive stimulus is not enough. I want eclipse to succeed in the future. But if everybody is only thinking about his own agenda the entire system will die. Eclipse has to defend itself. The eclipse foundation is to polite to upset some companies. That has to change. It has to be an honor being part of eclipse, and is has to be crystal clear that eclipse is not for free! <br /><br /><span style="font-weight:bold;">Disclaimer </span>(not sure if this helps, but it seems common to add a disclaimer to anything that could potentially upset an employer): <span style="font-style:italic;">This is my personal opinion and not the opinion of my employer</span>.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com22tag:blogger.com,1999:blog-17681521.post-751677052107370252009-04-07T17:03:00.010+02:002009-04-08T02:54:28.418+02:00Good versus evil diversity - why the foundation must hire developersIn German we have two contradiction proverbs: <span style="font-style: italic;">"Gleich und Gleich gesellt sich gern"</span> (<span style="font-style: italic;">"birds of a feather flock together"<a href="http://herzeleid.com/en/lyrics/rosenrot/mann_gegen_mann"> *</a></span>) and <span style="font-style: italic;">"Gegensätze ziehen sich an</span>" (<span style="font-style: italic;">"opposites attract"<a href="http://www.dict.cc/german-english/Gegens%C3%A4tze+ziehen+sich+an.html"> *</a></span>). <br /><br />When applied to couples, I think both are true but for different aspects: for social status, education, religion etc, coming form similar background makes things easy. But when it comes to character, being of different kind is good because my partner might have something I don't have and together we are more "complete".<br /><br />Diversity in open source is similar. There are areas where diversity is absolutely vital and other areas where diversity has a very negative impact.<br /><br />Bjorn criticized the "<a href="http://eclipse-projects.blogspot.com/2009/03/diversity.html">lack of diversity</a>" in the eclipse community because <span style="font-weight:bold;">most projects are "mono-vendor"</span>. He is right, <span style="font-weight:bold;">we need more diversity here!</span><br /><br />But there is another kind of <span style="font-weight:bold;">diversity that is bad: if there are many ways of doing the same thing</span>. Excellent system are not designed by committee, but by a few people (often a single person) with strong ideas about architecture, design and the "right way of doing things" (<a href="http://en.wikipedia.org/wiki/Fred_Brooks">Frederick Brooks</a> calls this "<a href="http://en.wikipedia.org/wiki/The_Mythical_Man-Month#Conceptual_Integrity">Conceptual Integrity</a>"). This leads to excellent systems. From my experience I learned that it does not matter much, which set of rules are applied, as long as the rules are consistent and everybody in the team believes in them and follows them.<br /><br />Startup companies often get this kind of consistency "for free", because they grow form a small set of people and they hire only new people that fit into the "mind set" of the team. Open source projects, created by some enthusiasts, get it, because they attract people who believe in the system. The (original) eclipse platform is an example of such a consistent system. <br /><br /><span style="font-weight:bold;">I am afraid that the future of eclipse is in danger if this wrong type of diversity (I call it chaos) increases</span>. (I wish the architecture council could help to defeat this kind of diversity, but I am afraid that the council is already way too diverse when it comes to "architecture")<br /><br />It would help a lot if there would be a set of developers paid by the foundation coming form different backgrounds but with a common mind set when it comes to technology. <span style="font-weight:bold;">If the foundation would hire people, I am sure we could find a great team of people that would be able make eclipse ready for the future.</span> <br /><br />Having a "vendor neutral" team of developers dedicated to the future of eclipse would give eclipse a boost. Else, I am afraid, eclipse is <span style="font-style:italic;">"auf dem absteigenden Ast"</span> (<span style="font-style:italic;">"heading south"</span><a href="http://www.dict.cc/?s=auf+dem+absteigenden+ast"> *</a>)<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com4tag:blogger.com,1999:blog-17681521.post-79771125978944423392009-03-20T03:18:00.006+01:002009-03-29T19:14:01.122+02:00New Book: Eclipse für C/C++-ProgrammiererI just got a copy of <a href="http://www.dpunkt.de/buecher/2828.html">Eclipse für C/C++-Programmierer</a> by <a href="http://www.sebastianbauer.info">Sebastian Bauer</a>, the first German CDT book. The first impression is very good. This book is ideal for C/C++ developers who are new to eclipse and new to CDT, but it also has a few gems for more experienced users. It covers a wide range of topics (see the <a href="http://www.dpunkt.de/leseproben/2828/Inhaltsverzeichnis.pdf">table of contents</a>), it is well written and takes a very good route to get started with CDT. Although it has a lot of screen shots, I don't have the impression there are too many, because they complement the written text in a very good way. It has a very good balance between practical tips and explaining the concepts and ideas behind CDT.<br /><br /><span style="font-weight:bold;">This book is the missing manual for CDT!</span> It should be delivered with each copy of CDT. I wish it would be available in English because it deserves a wide audience.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com3tag:blogger.com,1999:blog-17681521.post-15902988512891991322009-03-15T17:02:00.008+01:002009-03-16T17:13:44.789+01:00eclipse 3.5M6: linked extension locations now require a .eclipseextenison file<b>UPDATE: the problems have been solved/explained (see below)</b><br /><br />There is a <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=224145">hot debate</a> between the community and the p2 team on supporting extension locations. A few weeks ago I described <a href="http://michaelscharf.blogspot.com/2009/02/p2-how-i-install-plugins-in-extension.html">a simple procedure to use and maintain extension locations with p2</a>. <br /><br /><b>In eclipse 3.5M6 links file do not work anymore, unless you add a <code>.eclipseextension</code> marker file next to the <code>plugins</code> and <code>features</code> directories of the extensions location</b> (see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=268673">bug 268673</a>).<br /><br />This marker file was required by the classical update manager in order to be able to add a directory as <a href="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/product_extension.htm">product extension</a> from the UI. Until 3.5M6 link files just worked when pointing to a directory containing a <code>plugins</code> directory (or a <code>eclipse</code> directory containing a <code>plugins</code> directory). No <code>.eclipseextension</code> file was needed.<br /><br />Ironically, the classical update manager in M6 <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=268674">cannot be used to add extension locations anymore</a>. (To enable the classical update manager: <i>Preferences...->General->Capabilities->Classical Update</i>) <br /><br />Is this a sign that the p2 team wants to discourage extension locations and link files? Or am I believing in a stupid conspiracy theory?<br /><br />-------------------<br /><b>Update! Both problems have been solved</b><br />1. <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=268673">bug 268673</a>: p2 tries to be clever: when it detects a <code>artifacts.xml</code> in the extension location it needs a <code>.eclipseextension</code> marker file to believe that this is really an extension location. Normal extension locations are not affected by this bug.<br /><br />2. <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=268674">bug 268674</a>: This happens only if you <b>never</b> have started eclipse from the installation location (and always start with the <code>-configuration</code> option.<br /><br />==> <span style="font-weight:bold;">no conspiracy :-)</span><div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com5tag:blogger.com,1999:blog-17681521.post-26201609965276492162009-02-20T15:34:00.012+01:002009-03-15T17:54:56.969+01:00p2: how I install plugins in extension locations...The following procedure explains how I <b>install plugins into different extension locations and share those extension locations</b> between different eclipse installations <b>using the p2 update manager and link files</b>. For a lengthly discussion see bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=224145"> bug 224145</a><br /><br />I keep a set of different extensions locations in <code>C:\eclipse\extensions</code> (each extension location is in a subdirectory of that directory). Suppose I want to install <i>foo</i> into the new extension location <code>C:\eclipse\extensions<b>\foo</b></code>. <br /><OL><br /><LI>I start eclipse with: <pre>-configuration C:\eclipse\extensions<b>\foo\eclipse\configuration</b></pre><br /><LI>I install <i>foo</i> using the update manager.<br /><br /><LI>Now I can use the extension by creating a <code>foo.link</code> file inside the <code>links</code> directory of an eclipse installation (you might have to create the <code>links</code> directory) containing: <pre>path=C:/eclipse/extensions/foobar</pre> <br /></OL><b>That's it :-)</b><br /><br /><br /><b>Note:</b> You have to the forward slashes on windows in the links file.<br /><br /><b>Note:</b> This procedure works for eclipse 3.4 and 3.5.<br /><br /><b>Note:</b> You don't have to create any directory specified by the <code>-configuration</code> parameter. Eclipse will do that for you.<br /><br /><b>Note:</b> It is important to follow the pattern <code>EXTENSION_NAME/eclipse/configuration</code> for the <code>-configuration</code> parameter because p2 will put the plugins one directory above the <code>configuration</code> directory and link files require that the directory that contains the plugins is called <code>eclipse</code>.<br /><br /><b>Note:</b> With this structure I can update plugins into the extension locations by running eclipse with the <code>-configuration</code> and then do the update.<br /><br /><b>Advanced use</b>: If I want to install <i>bar</i> based on my <i>foo</i> extension, I create a link file to <i>foo</i> in the <i>bar</i> extension location <code>links</code> directory:<pre>C:\eclipse\extensions\<b>bar</b>\eclipse\links\<b>foo.link</b></pre> and follow my standard procedure described above (the links directory can be populated before the first run of eclipse)...<br /><br /><b>Note for eclipse 3.4:</b> If you are using eclipse 3.4 and you want to use the eclipse default update sites, you have to run eclipse without <code>-configuration</code> and export them (Help->Software Updates->Available Software (tab)->Manage Sites->Export), so you can import them into the <code>-configuration</code> eclipse.<br /><br /><b>Note for eclipse 3.5M6:</b> You have to add an (empty) <code>.eclipseextension</code> file <a href="http://michaelscharf.blogspot.com/2009/03/eclipse-35m6-linked-extension-locations.html">next to the plugins and features directory</a> of the extension location.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com5tag:blogger.com,1999:blog-17681521.post-19761642585820124512009-02-03T04:17:00.014+01:002009-02-03T06:14:29.135+01:00When the runtime Application uses the wrong plugins...Today I run into a problem that can cause a lot of frustration: a runtime eclipse launch that runs with he wrong plugins. The frustration comes form the fact that your application behaves strangely and it is hard to guess that this is caused by loading some worng plugins. Those plugins might even be closed or deleted from your workspace!<br /><br />Here is what happens: PDE (eclipse 3.4) does some hidden magic when you run an eclipse application (lets call the launch configuration <code>foo</code>): it creates a directory in <code>.metadata/.plugins/org.eclipse.pde.core/<b>foo</b></code>. This directory is used with the <code>-configuration</code> flag when running the application to store the runtime configuration of your application. But, there can be cases when this directory is not updated correctly, like when you switch between "<i>launch with all enabled and workspace plug-ins</i>" and "<i>plug-ins selected below</i>". It can happen that the runtime application still uses all plugins although you have selected to run with some specific plugins. I have not tested the exact conditions when this happens, but it happened several times to me in the last months.<br /><br />Unfortunately the "Clear workspace" flag does not help, because it clears the workspace but not the configuration area! It took me several hours to figure that out.... <br /><br />As Chris points out in the first comment, here is <b>the solution: On the "<i>Configuration</i>" tab of the launch configuration check the option "<i>Clear configuration area before launching</i>".</b><br /><br />Chris also recommends to use <b><code>-clean -consoleLog -debug -console</code></b> as arguments for plugin development launch configurations. In this case, the <code>-clean</code> option takes care of cleaning the configuration area.<br /><br /><b>Tip</b>: you can set <b><code>-clean -consoleLog -debug -console</code></b> as default in <i>Preferences->Plug-In Development->Target Platform->Launching Arguments->Program Arguments</i><br /><br />I hope this tip saves someone some wasted time...<br /><br />.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com5tag:blogger.com,1999:blog-17681521.post-57058212406042597342009-01-22T17:10:00.008+01:002009-01-22T18:15:00.123+01:00Finally, I found a good book on JavaScript!For some years I have been looking for a book on <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript </a>that would explain the language to someone who already knows programming. But all I have seen until recently are books for beginners or books that talk a lot about web programming, web browsers, DOM, XML, HTML etc, or books that explain all the different versions of JavaScript implemented in different browsers (many of these books have 1000 pages or more). <br /><br />The book I read is a 180 page book called <a href="http://oreilly.com/catalog/9780596517748/">JavaScript: The Good Parts by Douglas Crockford</a>. The idea of the book is: JavaScript is a messy language but here is a subset and some best practices how to use JavaScript in a manageable way. And that is done on 100 pages (the rest are interesting appendices). I read it last week on a flight and it was a kind of eye opener for me.<br /><br />I finally understood that the object system of JavaScript is not <a href="http://en.wikipedia.org/wiki/Class_(programming)">class based</a> like in C++/Java/Python/Ruby but it is <a href="http://en.wikipedia.org/wiki/Prototype-based_programming">prototype based</a> like in Self/Perl/Lua. This prototype based approach is not supported by a special syntax. There are many ways of creating and dealing with objects. But be book makes some suggestions and explains some best practices for creating objects.<br /><br />The other eye opener was how <a href="http://en.wikipedia.org/wiki/Closure_(computer_science)">closures</a> can be used to build objects with private information.<br /><br />An interesting design decision of JavaScript is that there is essentially one data structure, called Object, with string keys and any object as value. It can be used as hash map, array or object. Even functions are objects and you can associate information with them or add methods to one or all functions. <br /><br />If an object is used as array, the index is converted to a string key -- I find this very strange -- but it seems to work. The array.lenght attribute is defined as the "largest integer property name plus one", which means it looks for string keys that look like positive integers and takes biggest one, provided it is less than 4294967295.<br /><br /><span style="font-weight:bold;">If you want to learn JavaScript as a language I would highly suggest to read <a href="http://oreilly.com/catalog/9780596517748/">JavaScript: The Good Parts</a>.</span> After you finished the book, you might not be able to read any bad JavaScript programm, but you might be able to write your own "clean" scripts. I really like that approach.<br /><br />If you are interested in <a href="http://wiki.eclipse.org/E4">E4</a>, knowing JavaScript might be useful, because E4 will be scriptable with JavaScript.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com2tag:blogger.com,1999:blog-17681521.post-89923010132881707942008-11-16T16:51:00.002+01:002008-11-16T17:14:39.257+01:00Eclipse summit europe -- no more hotelsOK, I admit, it is a bit late to look for a hotel for <a href="http://www.eclipsecon.org/summiteurope2008">Eclipse Summit Europe 2008</a>. Today I tried about 30 hotels. It seems all hotels in Ludwigsburg are booked out. Well, I thought no big deal: I would follow the S-Train line and book a hotel close to any S-train station. Well, all hotels are booked out along the S-train lines, including the hotel close to the Stuttgart main station!? I finally found a hotel not far from Ludwigsburg, next to the S-Train station in Asperg, but it turned out that the address was listed wrongly in google maps and the hotel is not even close to any train station....<br /><br />It's not that bad -- with public traffic it is 1h30 to 1h45 from my home in <a href="http://en.wikipedia.org/wiki/Heidelberg">Heidelberg</a> to the <a href="http://www.eclipsecon.org/summiteurope2008/venue">"Forum am Schlosspark"</a>. The only bad thing is that my latest train is around 9:30PM, and the good discussions are usually late in the bar....<br /><br />That means waking up early (it's really early for me, since I "virtually" live in the EST time zone -- I go to bed at 6AM and wake up at 1:30PM)... <br /><br />If you found a hotel in <30 min distance to summit, let me know.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com1tag:blogger.com,1999:blog-17681521.post-86088974266254252292008-10-10T19:41:00.008+02:002008-10-14T16:20:33.431+02:00ConcurrentModificationException: Why do Java collections not have robust iterators?Ever got a ConcurrentModificationException? It just hit me. How does this happen? <span style="font-weight:bold;">It happens when one method iterates over a collection while another method (that bis recursively called from the for loop) modifies the collection</span>. <br /><br />Note: <code>ConcurrentModificationException</code> has nothing to do with threading! (Well, this is a bit too strong statement, as <a href="http://the.modelprogrammer.com/rafael.chaves/">Rafael</a> points point out in a comment: it <b>might</b> occur due to a threading race condition (but in such cases you probably have other problems as well)). <span style="font-weight:bold;">A <code>ConcurrentModificationException</code> may have nothing to do with threading!</span>. Here I am talking about about the non threading related case.<br /><br />Here's a simple example to show the problem. We have a class that can register new listeners and when <code>fireChange</code> is called it calls <code>changed</code> on the listeners. So the test listener here removes itself on the change call and <span style="font-style:italic;">boom</span>, we get the ConcurrentModificationException:<br /><pre><br />public class IteratorTest {<br /> final Collection<Listener> fListeners;<br /> public IteratorTest(Collection<Listener> listeners) {<br /> fListeners = listeners;<br /> }<br /> static class Listener {<br /> public void changed(IteratorTest subject) {<br /> <span style="font-weight:bold;">subject.removeListener(this);</span><br /> }<br /> }<br /> public void addListener(Listener listener) {<br /> fListeners.add(listener);<br /> }<br /> public void removeListener(Listener listener) {<br /> fListeners.remove(listener);<br /> }<br /> public void fireChange() {<br /> for (Listener listener : fListeners) {<br /> listener.changed(this);<br /> }<br /> }<br /> static void test(Collection<Listener> coll) {<br /> IteratorTest t = new IteratorTest(coll);<br /> t.addListener(new Listener());<br /> t.fireChange();<br /> }<br /> public static void main(String[] args) {<br /> test(new ArrayList<Listener>());<br /> }<br />}<br /><br /></pre> <br />The problem can happen if you call out to "other code" (code someone else has written) and "other code" can change the collection while you are iterating. <span style="font-weight:bold;">One solution is to iterate over a copy of the collection</span>:<br /><pre><br /> public void fireChange() {<br /> Listener[] listeners=(Listener[]) fListeners.toArray();<br /> for (Listener listener : listeners) {<br /> listener.changed(this);<br /> }<br /> }<br /></pre><br />That helps. But there is a lot of code out there that iterates over a collection and calls "other code" and there is always a chance that the "other code" calls back to modify your collection and you get a ConcurrentModificationException....<br /><br />The good news is: Unlike threading race conditions it happens deterministically. The bad news is: if you are the client it is often not easy to find a way out. <br /><br />15 years ago, <a href="http://www.ubilab.org/publications/wei94.html">ET++</a> (the cool framework created by Erich Gamma and Andree Weinand in the 80ies) suffered form missing <span style="font-style:italic;">robust iterators</span>. "Robust iterators" means robust to changes of the underlying collection. At that time, making a copy of a collection seemed an unacceptable overhead. So, Thomas Kofler added <a href="http://www.ubilab.org/publications/kof93.html">robust iterators to ET++</a> (the PDF has the pages on reverse order -- here is a <a href="http://scharf.gr/eclipse/blog/robust_iterators/Robust%20Iterators%20in%20ET.pdf">readable version</a>). The implementations are efficient and robust.<br /><br />Robust iterators are so fundamental, I am really surprised that Java does not have them....<br /><br />.<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com11tag:blogger.com,1999:blog-17681521.post-8585598398806760162008-10-10T17:30:00.007+02:002008-10-13T18:18:40.910+02:00The bridge between Interaction Design (IxD) and Domain Driven Design (DDD)Some time ago I read <a href="http://en.wikipedia.org/wiki/Alan_Cooper">Alan Cooper's</a> book on <a href="http://www.amazon.com/About-Face-Essentials-Interaction-Design/dp/0470084111">About Faces 3</a>. I am currently reading his book "<a href="http://www.amazon.com/Inmates-Are-Running-Asylum-Products/dp/0672326140">The Inmates Are Running the Asylum: Why High Tech Products Drive Us Crazy and How to Restore the Sanity</a>". He makes a strong point that interaction design has to be based on research and that is has to be made by interaction designers and not engineers. Engineers think too technical and therefore will create too complicated solutions. <b>Engineers don't know how "normal users" think</b>. And he is right! But I think, <b>it's not enough</b> to have some "interaction designers" designing the interactions and then let the programmers write the code. That might be important. But it is equally important if not more important <span style="font-weight:bold;">that the the developers deeply understands the problems domain and goals the users have</span>. <br /><br /><span style="font-weight:bold;">There is a great one hour talk I really enjoyed: <a href="http://www.infoq.com/presentations/Fowler-North-Crevasse-of-Doom">Martin Fowler and Dan North Point Out a Yawning Crevasse of Doom</a></span> (I had to look up the words <a href="http://en.wikipedia.org/wiki/Yawning">Yawning</a>, <a href="http://en.wikipedia.org/wiki/Crevasse">Crevasse</a> and <a href="http://en.wikipedia.org/wiki/Doom">Doom</a> -- those British guys speak hard to understand English ;-)). Their point is that <span style="font-weight:bold;">there has to be a <span style="font-weight:bold;">bridge</span> between developers and users in order to communicate</span> as apposed to a <span style="font-style:italic;">ferry</span>, where information is transported from one side to the other by someone like the interaction designer, marketing person or analyst. <br /><br />The solution requires what <a href="http://domaindrivendesign.org/about/index.html#eric">Eric Evens</a> describes in his book as <a href="http://domaindrivendesign.org/books/index.html#DDD">Domain Driven Design (DDD)</a> (BTW: <a href="http://www.infoq.com/minibooks/domain-driven-design-quickly">Domain Driven Design Quickly</a> is a 100 page book available online describing the essentials). One of the central ideas is to have a dialog between the developers and users to come up with a "ubiquitous language" to describe the "core domain". That is: use the same language when talking to the users as when talking about the code. Create classes and methods that model the domain using the same terminology used by the users when they talk about the problem domain. <br /><br /><span style="font-weight:bold;">To get better software we have apply the techniques of interaction design <span style="font-style:italic;">and</span> we have to have a dialog with our users to be able to create models that match their mind sets.</span><br /><br />Yes, I am guilty myself of not doing this. So, this post is a reminder for myself....<br /><br />P.S.: After writing this post, I did some search on ("<a href="http://www.google.com/search?q=IxD+DDD">DDD and IxD</a>") and I figured that about a year ago I started a <a href="http://www.ixda.org/discuss.php?post=17617">discussion on this topic</a> on the IxD mailing list. I wish I would have a better memory....<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com0tag:blogger.com,1999:blog-17681521.post-70702614905712580252008-08-01T01:39:00.007+02:002008-08-01T02:12:45.350+02:00Emfatic downlowad and update site available...I like <a href="http://wiki.eclipse.org/Emfatic">Emfatic</a> a lot. It is a very cool textual representation of EMF ecore files. The Emfatic has a nice text editor for .emf files. Much easier to edit than the graphical ecore editor. It was originally created by Chris Daly and made <a href="http://www.alphaworks.ibm.com/tech/emfatic">available at IBM alphaworks</a> under a restrictive license. Some time ago it became an eclipse project.<br /><br />Unfortunately, I could not find a download or update site for the open source emfatic (which has quite some enhancements over the alphaworks version). Only some <a href="http://wiki.eclipse.org/Emfatic#Where_to_download_Emfatic_from">build instruction</a>. I build it following the "instructions" (which is a simple <a href="http://wiki.eclipse.org/Image:Emfatic-in-CVS.PNG">screen-shot of the projects in cvs</a>, enough for "experts"). Then I realized it also needs <a href="http://www.antlr2.org/download.html">org.antlr-2.7.7</a>, which cannot be hosted at eclipse.org because of IP (copyright) issues. I could not find the org.antlr-2.7.7 plugin. I had to create it. <br /><br />I am sure I am not the only one who simply wants to download emfatic. So, I decided to make my build available.<br /><br />Here is my <b><a href="http://scharf.gr/eclipse/emfatic/download/">emfatic download site</a></b> it has <a href="http://scharf.gr/eclipse/emfatic/download/org.eclipse.emf.emfatic_latest.zip">a zip with emfatic and antlr</a> file that can be dropped into an p2 drop-in folder or used as extension location (it already contains the .eclipseextension file). <br /><br />And for those who like to use the update manager, I created an <b>update site with emfatic and antlr</b>: <code><a href="http://scharf.gr/eclipse/emfatic/update/">http://scharf.gr/eclipse/emfatic/update/</a></code><br /><br />Note the emfatic plugins it require Java 1.5!<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com6tag:blogger.com,1999:blog-17681521.post-34108691089918211662008-06-07T03:33:00.006+02:002008-06-07T04:49:49.928+02:00Looking for a JavaVM with the weakest possible memory modelThe Java Memory Model gives some minimal guarantees about what happens if two threads are accessing the same variables. Brian Goetz describes this in chapter 7 of <a href="http://www.briangoetz.com/pubs.html">Java Concurrency in Practice</a>. And <a href="http://www-128.ibm.com/developerworks/java/library/j-jtp03304/#3.0">here is a good summary of the new (1.5) Memory Model</a>. Doug Lea describes the <a href="http://gee.cs.oswego.edu/dl/cpj/jmm.html">old memory model</a>. If you really want to dig into it read <a href="http://java.sun.com/docs/books/jls/third_edition/html/memory.html">some more formal specs</a>.<br /><br />The essence of the java memory models is: <span style="font-weight:bold;">If one thread modifies a variable another thread may not see the change unless "some synchronization" happens</span> (a synchronized block, a shared lock etc). But most real java VMs implement a much stricter memory model, that means if one thread modifies a variable the other thread sees it even without synchronization. And that is the problem. It is almost impossible to find those threading problems without a java VM that implements only the minimal memory model guarantees.<br /><br />My favorite "theoretical threading bug" is <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=162673">NullProgressMonitor.cancelled should be volatile</a>. If a java VM would implement only the minimal memory model the code would not work, but as <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=162673#c1">John points out</a>: <span style="font-style:italic;">"This is true in theory, but never happens in practice. In practice, the thread calling isCanceled may obtain a stale result for a short period of time, but the thread cache is soon synchronized. It is common practice to omit synchronization in cases where obtaining a stale value is acceptable."</span>. This is unfortunately true. At least I could not construct an example where one thread would not see the changes made by another thread. <br /><br />Getting threading right is extremely hard. Deadlocks often occur only if you have a bad day. You can get away with obviously wrong code just because Java VMs are so gracious. <br /><br /><span style="font-weight:bold;">I wonder if there is java VM that implements only the minimal memory model?</span> It would be cool if it would be possible to force the VM to behave like the worst possible memory model. For example: it would not make changes visible to other threads unless the data is synchronized. This would be extremely helpful for testing and debugging purposes. I wonder how well eclipse would behave on such a "minimal memory model VM"....<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com3tag:blogger.com,1999:blog-17681521.post-52625814638065105472008-04-17T15:40:00.000+02:002008-04-17T15:41:02.473+02:00Is OSGi the enemy of JUnit tests?I wrote a set of <a href="http://junit.org/">JUnit</a>(3.8.1) tests for the <a href="http://wiki.eclipse.org/DSDP/TM/Terminal">terminal</a>. Originally those were normal unit-tests. To be able to test non public methods and non public classes, I put the tests into the same package but into a separate test plugin. I also added the test plugin as friend plugin of the packages I want to test. This works fine if I run the tests as normal JUnit tests. But <span style="font-weight:bold;">if I run the same tests as JUnit Plug-in Tests I get <code>java.lang.IllegalAccessError</code></span>. The reason is simple: each OSGi bundle runs it's own class loader and therefore the classes appear not to be in the same package. <br /><br />There are different solutions:<br /><ul><br /><li>Make all methods and classes you want to test public (really bad idea)<br /><li>Put the unit tests into the same plugin as your code and make the dependency to JUnit optional (not a good separation of concerns).<br /><li>Only test public classes and methods (I think this is to restrictive and often to coarse grain)<br /><li>Make your test plugin a fragment. One problem is that other plugins cannot access classes defined in fragments (as <a href="http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/">Patrick Paulin points out in a more detailed discussion about fragments in unit tests</a>). Another problem is that plugin.xml in a fragment is ignored. And therefore you test plugin cannot contribute<br /></ul><br /><br />I tried out turning a plugin into a fragment. It is as simple as adding adding a line following line to your MANIFEST.MF<pre>Fragment-Host: org.eclipse.the.plugin.you.want.to.test</pre> and removing the plugin you want to test from the required plugins. As long as your test plugin is not part of a bigger test case and it does not need to contribute extensions <a href="http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/">Patrick Paulin describes a solution for that using reflection</a>, fragments are a good solution.<br /><br />A good way to avoid having to use extensions (plugin.xml) in your test plugin is to use <a href="http://michaelscharf.blogspot.com/2006/09/dependency-injection-pattern.html">dependency injection</a> for your classes.<br /><br />But I think there should be a better way to write a test plugin that can access non public classes and members. I understand why the security concept of OSGi introduces those problems, but I am still looking for a solution for my JUnit tests. <br /><br />Any ideas?<div class="blogger-post-footer">Michael Scharfs Eclipse and Java Blog http://MichaelScharf.blogspot.com/</div>Michael Scharfhttp://www.blogger.com/profile/16708708879318235495noreply@blogger.com16