GUI development: should you design it or code it - Dissecting SemanticMerge, Part 3

Sunday, March 23, 2014 52 Comments

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:

Each time the Interface Builder modifies one of the .xib files (files containing XML defining the interfaces) Xamarin Studio gets notified and rebuilds whatever linked code it needs. It always worked for us with pet projects but I wouldn’t really like to be in the situation, 6 months after starting the project, with tons of code written, to find some sort of ‘conversion error’ when linking the .h files populated by Interface Builder with the Xamarin code. I hope I’m wrong here, but simply I don’t want to be in that situation.

Now, more about UI designer vs plain code: recently I read this blog post about creating “imperative UIs” with C# in the Xamarin blog. When I found this post we already had finished the SemanticMerge UI programming in “imperative mode”.

There were various reasons why we went the ‘imperative way’ and we coded our entire interface completely avoiding the Interface Builder:

  • First we wanted to avoid any potential issue with the ‘automatic conversion’ as I mentioned.
  • Prior to starting with Mac we developed a GTK# UI for SemanticMerge, to give it native look and feel on Linux. We used MonoDevelop 4 there, which is great, but its interface designer is… well, far from looking solid. So we went the ‘hardcore’ way and created the entire UI with code. It can sound like an overkill (it *did* sound crazy to me years ago) but read the next bullet point first.
  • We’ve been developing Plastic SCM ( with a WinForms UI for almost 9 years now. We always used the Visual Studio designer and… you know what? I hate it. It looks great for a toy application, you just go and drag and drop your controls and everything looks fine. But use it for a decade and you’ll find out:
    • That the infamous .resx will break or simply won’t get correctly updated and you will lose alignments or some event handlers from time to time. Time wasted.
    • At least the WinForms designer doesn’t enforce good practices: I hate when I find auto-generated names in controls such as Form1 or Label1 and so on. Of course you can ask your team to… not do it this way, but the tool *helps* doing it wrong.
    • Suppose you redesign a Form and then you need to move part of the UI inside a new panel and then add more things to the form… well, you’ll need to play with the “anchors”, cut and paste… and pray. BTW the entirely regenerated automatic code will be a nice thing to merge...
    • Since it is very easy to just “throw controls on the window” then probably many unneeded ones will hang around, like panels inside panels and other beauties.
    • Keep the right margin for buttons and controls in all forms… looks easy, but someone will have to hand write the margin space again and again… wouldn't a constant help?

As counter-intuitive as it might sound (tell it to my younger self coding a MFC UI and missing Delphi), for long running projects I truly believe it is better to go and code the UI: you can refactor code to make it more readable, you’ll think twice before adding a control, you’ll name everything correctly, you’ll just have to slightly modify the code to change the hierarchy of objects inside a window… and you won’t have to depend on error prone UI designers.

We develop Plastic SCM, a version control that excels in branching and merging, can deal with huge projects and big binary assets natively, and it comes with GUIs and tools to make everything simpler.

If you want to give it a try, download it from here.

We are also the developers of SemanticMerge, and the gmaster Git client.


Unknown said...

Excellent post. This is very useful. Thanks for sharing.

UI/UX Designing Course in Chennai

Riya Raj said...
Robbie Royce said...

Good information and, keep sharing like this.

Crm Software Development Company in Chennai

swathima said...
Savanah Eden said...

thanks for ur valuable information,keep going touch with us

Scaffolding dealers in chennai

shanthumA said...
adhi said...

thanks for your information really good and very nice web design company in velachery

Nandhakumar said...
divi said...

thanks for your information really good and very nice web design company in velachery

RoyceRobbie said...
zuan said...
zuan said...

Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
web designing classes in chennai | web designing training institute in chennai
web designing and development course in chennai | web designing courses in Chennai
best institute for web designing in chennai | web designing course with placement in chennai

zuan said...
sasi said...
Reshma said...
Daniel Bryan said...

I am really impressed with your blog article, such great & useful knowledge you mentioned here. Keep sharing more articles like this.

ecommerce development sydney
ecommerce design company
website development services
best web design company australia

If you own a website SEO is the best way to grow your business in this modern era. We are a Digital marketing agency providing SEO Services in Chennai. Hiring an SEO expert will increase your chances of growing your business better and faster than your competitor. So, if you are looking for Best SEO Services in Chennai feel free to contact us.

Are you looking for the dental clinic near you? Visit Dr Smilez. They provide high-quality dental treatment. Check our website and read our testimonials, what our patients say about us.

Check these links also
Full Mouth Implants
Dental Implants cost in Chennai
Zirconia Crown

Unknown said...
Unknown said...
Indhu said...

Thanks for sharing this wonderful informations.
android training institutes in coimbatore

amazon web services training in coimbatore

big data training in coimbatore

C and C++ training in coimbatore

Blue prism training in coimbatore

artificial intelligence training in coimbatore

RPA Course in coimbatore

Sandra Jessy said...

Thank you for sharing excellent information. Your web-site is very cool. I’m impressed by the details that you be on this web site. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. website design and development

sdexter said...

useful information on topics that plenty are interested on for this wonderful post.Admiring the time and effort you put into your b!.. logo design companies

Experties said...

excellent blog. I loved reading your articles. this is in reality a tremendous read for me. i have bookmarked it and i'm looking forward to studying new articles. hold up the coolest paintings! best logo design company

You must indulge in a contest for one of the greatest blogs over the internet. Ill suggest this web site! logo designers

WebCodex said...

Nice read, I just passed this onto a colleague who was doing a little research on that. And he just bought me lunch since I found it for him smile So let me rephrase that: Thank you for lunch! best branding agencies san francisco

Daniel Bryan said...

This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
website design long island

TechMatrite said...

As an end-to-end solution, ERP software eliminates any patch-work software as well as data imports or exports outside of the unifying ERP solution. download google input tool offline

This is a great post; it was very edifying. I look ahead in reading more of your work.
best digital agency websites

I have learnt various good stuff right here, and I’m sure everyone will get advantage of it.
best ui ux design companies

Thanks for sharing this information article to us and keep sharing this info, One of the best Chatbot development services, which is the best AI based industry leading chatbot maker for your business to offer 24/7 help with live chatbot on website. Reach us or just give a call to us for chatbot development.
Chatbot app development company
Chatbot development company
Chatbot development service
Chatbot Development
Chatbot developer
Bot developer

Dextemade said...

useful information on topics that plenty are interested on for this wonderful post.Admiring the time and effort you put into your b!.. corporate identity design

A Chatbot Development is a product program for reproducing wise discussions with human utilizing rules or man-made brainpower. Clients connect with the Chatbot development service by means of conversational interface through composed or spoken content. Chatbots can live in informing stages like Slack, Facebook Messenger bot developer and Telegram and fill some needs – requesting items, thinking about climate and dealing with your fund in addition to other things. As a Chatbot development company advancement organization our competency let you find happiness in the hereafter by taking care of clients all the more intelligently to accomplish wanted outcome. As a Chatbot companies we can streamline a large portion of your dreary undertakings, for example, voice bot advancement and client service, online business advices and so on

Dextemade said...

excellent blog. I loved reading your articles. this is in reality a tremendous read for me. i have bookmarked it and i'm looking forward to studying new articles. hold up the coolest paintings! branding package pricing

Cloudi5 said...

Thanks for providing great informatic and looking beautiful blog, really nice required information & the things I never imagined, and I would request, wright more blog and blog post like that for us. Thank you once again
by Cognex
AWS Training in Chennai

Red Hat Certified Engineer is a professional who has expertise in handling the Red Hat Enterprise Linux System. The Certified Engineer takes care of various tasks such as setting kernel runtime parameters, handling various types of system logging and providing certain kinds of network operability. The professionals must have the ability to install networking services and security on servers running Red Hat Enterprise Linux.

Red Hat Certified Engineer

SEO Calgary said...

I really loved reading your blog. SEO Calgary

Unknown said...

thanks for sharing.Security License Course

Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.

Security Guard License
Ontario Security License
Security License Ontario
Security License

Thank you..

Well, it’s a nice one, I have been looking for. Thanks for sharing such informative stuff.
UI design company

Thank you for share us. For more information visit our Best App Development Company in Hyderabad

This post is really meaningful for those looking for innovative ideas , website development and boosting up your business can be brought up to speed with selecting better options for your business solutions, magento website development services
give it a go , Cheers!

krnphrneseng said...

Thanks to this news blog. You write so much, it's very good. I like your news blog

Priya said...

Great Post,Very well written post
Data Science Course Hyderabad