Supporting PHP was required by many of our users. Today we wanted to let you know that we have upgraded SemanticMerge's core diffing and merging machine to parse and understand PHP. It will now be able to detect changes at the code line distribution but also within specific PHP methods and classes, for example.
I was invited to chat with the Cpp Cast crew, Rob Irving and Jason Turner – the best podcast on C++ development out on the interwebs. They wanted to know more about SemanticMerge, how it parses and merges C++ code and what this means for everyday programming in C++.
This is a short summary of our conversation on these and many other C++ topics such as the upcoming SD20 C++ teaching group or Alexander Boden's Cross-Platform framework.
Here is the scenario: you have a source file with a class and some methods, and then you think it is a good idea to do some cleanup. You know, sort the methods in visibility order (public first) maybe create a subclass to wrap some functionality together, or place methods close to each other depending on how they are called, just to improve readability.
But, someone was doing changes to the same file concurrently (you know, it happens) and then he is less than happy to merge his fixes together with your cleanup…
So, here is the deal: shouldn't we try to keep the code as clean as possible? Yes, of course, sticking to whatever common style rules the team agreed to stick to. But then, in real life, isn't it a merge killer?
This blogpost shows how SemanticMerge helps to solve this case, when integrated with Git. For those of you who didn't know, SemanticMerge parses the code before calculating any merges. Unlike other 3-way merge tools, it is not just based on text. It can parse Java code, C#/VB.net code (Roslyn based) and C. There are also external community written parsers for Delphi and JavaScript.
This is just a minor release after the changes released in 1.0.64 and solves a few customer requests.
There are 3 new tasks being merged in 1.0.65 which are:
We switched to the latest open-source Roslyn in the previous release and now we’re adding more features based on that.
This new release includes 2 major features:
- Automatic method body merge resolution with the
--merge-declparam: so far if a method (or any declaration body) was modified by the two contributors, the user had to manually launch the external 3-way merge tool to solve the conflicts, even when the merge was automatic. Now the new param forces Semantic to try to solve every method body so now the merge is as automatic as possible. - Skip code formatting conflicts: suppose two developer reformat the same method but only one of them introduces an actual change. It can be time consuming to figure out that the change was only a reformat and that nothing really changes before accepting the real change. This is exactly what the new feature does for C#. It solves 3 User Voice requests:
- http://plasticscm.uservoice.com/forums/196398–mergebegins/suggestions/3986679-semantic-merge-needs-to-be-smarted-about-unimporta
- http://plasticscm.uservoice.com/forums/196398–mergebegins/suggestions/4124571-ignore-whitespace-around-curly-braces
- http://plasticscm.uservoice.com/forums/196398–mergebegins/suggestions/4416982-format-code-to-every-user-s-liking-and-end-the-end
We have just released a new version of SemanticMerge, full of interesting improvements.
The two main ones are:
- Semantic is now based in the newest Roslyn (the new open sourced version Microsoft just released) which means: Semantic now supports C# 5! 🙂 Also, Semantic now requires .NET 4.5 to run on Windows. The added C# 5 support closes one of the top UserVoice requests.
- Now Semantic is able to skip differences where only EOLs and indentation changed. Look at the following example:
Ever thought about writing a Mac GUI in C#?
You’re probably used to Buttons, Panels, Dialogs and the like, but how do they map to the Mac counterparts?
Well, this is what we try to cover in this post: a Cocoa 101 for WinForms developers.
Our question here was: "should we use the designer or code an imperative UI?
As you have just seen using the Interface Builder is really simple, just drag and drop, getting used to the new controls and the UI of the designer and so on.
Xamarin Studio doesn't provide its own designer it simply relies on invoking Interface Builder, which is not bad since they’re not reinventing the wheel.
But, there are some concerns in my opinion:
Note: this is the second part in the Dissecting SemanticMerge series. Part I is How we develop for Mac using C# and MonoMac.
So, if you’re going to write a C# “native looking” app for Mac the choice is MonoMac a.k.a. Xamarin.Mac. It is pretty well documented and it looks solid.
The first thing you’ll have to do is to go and grab a Xamarin Studio installer and you can play with it for free before you decide to go commercial.
Installing is easy and then you’ll be on a very familiar environment since it feels like Visual Studio (it is the famous MonoDevelop now in Xamarin disguise, pretty polished. We’ve been using it for months and it is pretty good. Of course, MonoDevelop 4 is also solid on Linux. Having used all versions since their first release, version 4 is really a plus).
Objective-C is the language of choice when you go for Mac (and iPhone) but thanks to Xamarin now more than half a million C# developers are able to code for Apple platforms in their language of choice. And this is something good if you’re a Windows developer who need to develop a new app on Mac.
I’m going to share the things we learned while developing SemanticMerge for Mac using C# and MonoMac, and I’d like these posts to be the sort of writing I wish we had when we started our journey :-). This is the part one of a series of posts dissecting SemanticMerge to explain how we develop with C# and Mac
Finally! We are ready to share the Mac version with you!
If you’re eager to put your hands on it, sign up here and we’ll contact you ASAP. The beta is not yet 100% public, that’s why we’re asking you to sign up, so we can create a group of people willing to send us valuable usability feedback (among other).
Check how the new version looks like here:
As you can see the Mac version includes the “visual merge” which is the piece which really simplifies understanding the complex merges.
Say “refactor” to a corporate executive and he will say, “talk to me about business”. What he doesn’t realize is that refactoring is more about business than it is about code. It is all about keeping the cost of change low, being able to react fast to customer requests, being able to focus on adding value to the product… Put it this way and you’ll catch the exec’s attention.
Popular Posts
- GUI development: should you design it or code it – Dissecting SemanticMerge, Part 3
- Dissecting SemanticMerge, Part 4: Cocoa 101 for WinForms/WPF developers
- Dissecting SemanticMerge, Part 1: how we develop for Mac using C# and MonoMac
- Skip format conflicts with the new SemanticMerge 1.0.64
- Solving semantic conflicts with Git and SemanticMerge
- What most developers don’t know about refactoring
- Dissecting SemanticMerge, Part 2: Enter MonoMac
- SemanticMerge for Mac is here
- New SemanticMerge 1.0.61 is out
- Cpp Cast interviews SemanticMerge team

