Interesting. I've mostly been programming clojure for the last couple years. But I've got one project I'd like to try to make that is very GUI centric.
I don't know what it is about GUI programming, but I pretty much hate it. It's a complete schlep for me... it seems to take so much energy and work for something that is tangential.
If I had to go through the same level of effort to print something to the console, I'd never program anything.
Add me to that club. Every tool designed to make GUI programming easier seems to just add complexity and confusion.
From hand coded Win32 C++ GUIs to Tcl to Swing to Interface Builder/Storyboards, AngularJS and Bootstrap, I've had to use it all and have managed to turn all those things into giant writhing masses of spaghetti code every time.
I always go old school in my own GUI programming, preferring just to draw everything myself via canvas or other immediate mode drawing APIs. It always comes out much cleaner than using a retained widget library.
I've used a fair amount of GUI tookits (including all the ones mentioned by grandparent), as well as written my own. I have to say that I really like Cocoa (particularly UIKit over AppKit) and feel that of everything I've ever worked with, it gets the most right.
Of course, you become bound to a specific platform (I've been meaning to give GNUstep a try, not sure how good it is).
The two things that have helped me write clean GUI code the most are having some sort of event bus and following the MVVM pattern. The event bus helps you to decouple various parts of the UI, like when a certain menu item has to be disabled by certain data. MVVM let's you embrace the inherent statefulness of UI's and to test them.
Both add a fair bit of complication in the short term but reduce it when the app gets bigger. Neither seems to suffer from the performance/correctness trade off that other methods (like forcing every minor change to redraw the UI) often have.
that's because , as much as we backend dev don't like to admit, frontend development is actually quite hard to be done properly. You have pretty much the same issues as in the backend : state management, concurrency, latency; plus specific ones : aesthetic and ergonomic.
i've seen many backend dev calling themselves code heroes falling apart after a few days spent trying to design an android interface. it's a great humility lesson.
That only helps for building the actual UI, which IME is not where the spaghetti comes from. The spaghetti comes from "if this data disable this control" type of stuff.
Next time, give Vue a shot. All it does is take an HTML template, fill in some data, and update the data when the original 'source of truth' updates. All you have to do is modify that 'source of truth.'
Yeah you still have to work with HTML and CSS but it abstracts away DOM manipulation without introducing too much overhead. Use it with Bootstrap, or even materialize for a more opinionated but batteries-included CSS experience.
Personally, I tried and hated Angular because it tried to control everything I did. Vue says "make your application however you like, let us handle the view layer and that's it."
If you like clojure, I think you'll find that the clojurescript tools like reagent are among the simplest ways to build interfaces you'll find in any language. I've been using swift, C++, JavaScript, Elm, clojurescript, and others the last few years to build really nice user interfaces, and clojure is by far was the best.
A young person in our family was using this. It's a beautiful app, but typing and editing code on an iPad without a physical keyboard appeared to be extremely frustrating. Cutting-pasting, refactoring, etc. all become cumbersome and she had to spend time fighting with the editor instead of focusing on the problems.
Waiting for them to make a Mac port, since coding happens on a "real" computer (for now, anyway).
Integrating this app into Playgrounds in xcode would work, although they'd have to make it accessible; xcode is easy enough to install, but it's not marketed as a "install this to learn to code" type of app. Distributing it separately would be better.
You can use a bluetooth keyboard with an ipad. (the stock aluminium mac keyboard is the most obvious choice but I guess every bluetooth keyboard will work).
I bought an iPad hoping to teach myself Swift as an experienced developer, having seen the success my wife had had as a non-programmer.
The UI eventually just irritated me too much, and I sold the iPad. Really wish this was available as a Mac app.
I am far from the only person for whom learning is only really possible while doing, and I'd love to see more programming language tutorials written as problems to solve, but targetted at experienced developers. I can kind of fake it by solving the Cryptopals problem set for a language, but I'd like something where the initial learning curve jump was minimized.
This particular degree course (http://www.cs.ox.ac.uk/softeng/) is the only reason I have a degree, as almost all the modules were doing rather than listening or reading.
Swift 4 and iOS 11 are coming soon, but I wouldn't wait for the course to get updated. Downside of it being a university lecture is that it'll be a while.
As far as I know they are all the same course, just new editions for each batch of students (and by coincidence, each new iOS versiopn).
I followed it when it was still objective c, and I can only assume it gets better each time. As long as it's still the excellent Paul Hegarthy holding it, just use the latest one.
If you use the Itunes U app on the ipad you'll get all the exercises etc in a nice format. And at least when I did it there was even a special forum for all the MOOC students to discuss the lectures and exercises.
I can't recommend this course enough, it's one of the best I've ever come across, any category.
I like to work out small examples on the iPad. It’s not ready to replace Xcode but you can certainly work out small examples. At some point I’ll move my code to Xcode to continue.
By the way, I’ve created a Github repo with two dozens basic examples that should help anyone who likes to learn from code:
I have a feeling we are going to see a bigger push for development work on the iPad this upcoming year. Xcode 9 took a huge chunk from the iPad Swift Playgrounds app (mainly the new source editor.)
Being able to edit storyboards and wire up view connections on my iPad would be awesome.
The on screen ipad keyboard does support moving the cursor, just put two fingers on the keyboard and move them around.
With an external keyboard selection works like on a pc, just hold shift and use the arrow keys.
The only thing that's really missing to make editing text on the ipad a breeze is a way to select while moving the cursor with the two finger gesture above.
>The only thing that's really missing to make editing text on the ipad a breeze is a way to select while moving the cursor with the two finger gesture above.
You can. Double-tap a word or character so it's selected, then do the two-finger select gesture on the keyboard.
Yeah, I didn't think of that and it goes part of the way, but it would be nice if you could move the cursor to the exact position you want to select from, put down a third finger on the keyboard and then move the cursor. At least for me that would feel more efficient.
Yeah, that seems like it would be the best way, at least until they get 3D Touch on an iPad. On the iPhone you move the cursor with a light 3d touch on the keyboard, then can start a selection by pressing down harder.
You can go one better than that: double tap with two fingers on the software keyboard to initiate a selection on the current word and then drag to extend selection.
You don't need to double tap on the actual text or characters, you just tap-then-drag with two fingers on the software keyboard.
Amazing, thanks! I tried various versions of single finger tapping but the result is usually both disastrous and expected, replacing the selection with a single letter.
When the article says: "because for all the multitouch gestures Apple can add, there’s just no beating a good old mouse when it comes to selecting text." I have to wholeheartedly agree.
I am a heavy mouse (and trackpad) user and have been for decades. Editing and refactoring code for me is all about the mouse. The same goes for editing prose, which I also write a significant quantity of.
The two-finger, on-glass "trackpad cursor" trick doesn't work well for me--it never has. It looks like the "ghost caret" is in the right place, but at least half the time, when I lift my fingers the cursor appears a character off in either direction. Verrry frustrating. Also, the two-finger trick requires the on screen keyboard and is clumsy to use if you are using an external keyboard.
About a year ago I gave up on my personal quest to use the iPad as a heavy writing device. It's just not for me. I picked up a bottom-of-the-line 12" Macbook and have never looked back.
> I am a heavy mouse (and trackpad) user and have been for decades. Editing and refactoring code for me is all about the mouse.
It's a very interesting and surprising statement to me. For me the mouse is absolutely nowhere near convince of selecting text with keyboard. When your editor allows you to jump between paragraphs, words, ending and beginning of line (so pretty much every editor) it seems to be relatively easy to rapidly jump to place that one wants to select with couple of key strokes.
I would definitely agree that my mousing is not as efficient as an expert-level keyboard only approach. But it's what I do and what is comfortable to me. Random text selection in big bodies of text is always easier (for me) with a mouse first, trackpad next, keyboard last.
Keyboarding, mousing, editing is a very personal thing to folks who have to work at their computer all day. Lot's of different ways to work, lots of approaches to the work. Each person has to find their comfort zone.
One thing I wished this app had was a playground that teaches you how to interact with the iOS SDK. After all, you can use it in the blank playground, might as well show people how to use it.
52 comments
[ 762 ms ] story [ 2623 ms ] threadI don't know what it is about GUI programming, but I pretty much hate it. It's a complete schlep for me... it seems to take so much energy and work for something that is tangential.
If I had to go through the same level of effort to print something to the console, I'd never program anything.
From hand coded Win32 C++ GUIs to Tcl to Swing to Interface Builder/Storyboards, AngularJS and Bootstrap, I've had to use it all and have managed to turn all those things into giant writhing masses of spaghetti code every time.
Of course, you become bound to a specific platform (I've been meaning to give GNUstep a try, not sure how good it is).
Expect not so good Objective-C support for anything later than 2.0 and API support at best around Panther timeframe.
Both add a fair bit of complication in the short term but reduce it when the app gets bigger. Neither seems to suffer from the performance/correctness trade off that other methods (like forcing every minor change to redraw the UI) often have.
i've seen many backend dev calling themselves code heroes falling apart after a few days spent trying to design an android interface. it's a great humility lesson.
Every GUI of any significant complexity I've ever created ended up needing (if not having) an explicit state machine to work reliably.
Yeah you still have to work with HTML and CSS but it abstracts away DOM manipulation without introducing too much overhead. Use it with Bootstrap, or even materialize for a more opinionated but batteries-included CSS experience.
Personally, I tried and hated Angular because it tried to control everything I did. Vue says "make your application however you like, let us handle the view layer and that's it."
It is by far the best GUI library/setup i have used by a large margin. It really makes everything else seem completely shit.
Re-Frame: https://github.com/Day8/re-frame Reagent: https://reagent-project.github.io/
Waiting for them to make a Mac port, since coding happens on a "real" computer (for now, anyway).
The UI eventually just irritated me too much, and I sold the iPad. Really wish this was available as a Mac app.
I am far from the only person for whom learning is only really possible while doing, and I'd love to see more programming language tutorials written as problems to solve, but targetted at experienced developers. I can kind of fake it by solving the Cryptopals problem set for a language, but I'd like something where the initial learning curve jump was minimized.
This particular degree course (http://www.cs.ox.ac.uk/softeng/) is the only reason I have a degree, as almost all the modules were doing rather than listening or reading.
https://itunes.apple.com/us/course/developing-ios-10-apps-wi...
https://web.stanford.edu/class/cs193p/cgi-bin/drupal/
Swift 4 and iOS 11 are coming soon, but I wouldn't wait for the course to get updated. Downside of it being a university lecture is that it'll be a while.
I followed it when it was still objective c, and I can only assume it gets better each time. As long as it's still the excellent Paul Hegarthy holding it, just use the latest one.
If you use the Itunes U app on the ipad you'll get all the exercises etc in a nice format. And at least when I did it there was even a special forum for all the MOOC students to discuss the lectures and exercises.
I can't recommend this course enough, it's one of the best I've ever come across, any category.
By the way, I’ve created a Github repo with two dozens basic examples that should help anyone who likes to learn from code:
https://github.com/melling/ios_topics/blob/master/README.md
It all compiles in Swift 4 without warnings on Xcode 9.
Being able to edit storyboards and wire up view connections on my iPad would be awesome.
With an external keyboard selection works like on a pc, just hold shift and use the arrow keys.
The only thing that's really missing to make editing text on the ipad a breeze is a way to select while moving the cursor with the two finger gesture above.
You can. Double-tap a word or character so it's selected, then do the two-finger select gesture on the keyboard.
You don't need to double tap on the actual text or characters, you just tap-then-drag with two fingers on the software keyboard.
I am a heavy mouse (and trackpad) user and have been for decades. Editing and refactoring code for me is all about the mouse. The same goes for editing prose, which I also write a significant quantity of.
The two-finger, on-glass "trackpad cursor" trick doesn't work well for me--it never has. It looks like the "ghost caret" is in the right place, but at least half the time, when I lift my fingers the cursor appears a character off in either direction. Verrry frustrating. Also, the two-finger trick requires the on screen keyboard and is clumsy to use if you are using an external keyboard.
About a year ago I gave up on my personal quest to use the iPad as a heavy writing device. It's just not for me. I picked up a bottom-of-the-line 12" Macbook and have never looked back.
It's a very interesting and surprising statement to me. For me the mouse is absolutely nowhere near convince of selecting text with keyboard. When your editor allows you to jump between paragraphs, words, ending and beginning of line (so pretty much every editor) it seems to be relatively easy to rapidly jump to place that one wants to select with couple of key strokes.
Keyboarding, mousing, editing is a very personal thing to folks who have to work at their computer all day. Lot's of different ways to work, lots of approaches to the work. Each person has to find their comfort zone.