Live data from Hacker News

Stevia: Human-readable auto-layout in code

github.com

41–50 of 60 posts

Re: Stevia: Human-readable auto-layout in code

#41

Earlier quoted context omitted.

Um, auto-layout, which this says it uses, is an Apple supported constraints system? https://developer.apple.com/library/ios/documentation/UserEx...

I think grandparent poster is saying app devs should program directly to the built-in Apple syntax rather than using a third-party library which wraps it. Because if Apple comes out with extensions or changes, then anyone who uses Stevia will need to wait until the library incorporates them, losing their advantage to competitors in the process. I sympathize somewhat with the grandparent poster's point, but it all dep…

I can see that now. Certainly anyone who worked with the HTML-based iOS components Facebook had back in the day was in for a shock later. I don't recommend using any iOS libraries you aren't prepared to upgrade/replace later -- and this includes Apple code too! Plenty of Apple APIs change every year, so... I'd hope somebody takes up the cause of updating this for as long as the API proves useful. :)

Re: Stevia: Human-readable auto-layout in code

#42
post #13

It's not really on-topic, but why do people name their projects with names that are very difficult to find via search engine? I really don't understand this mindset.

Even worse is the tendency to give every subproject a non-descriptive name. E.g. Safari on iOS/OS X

This just raises the mental burden and lowers discoverability.

Re: Stevia: Human-readable auto-layout in code

#43
Thanks for the effort. As a professional iOS developer since 6 years, I think is really good to see people coming out with better ways to do things. Autolayout works but the amount of code that you have to write is just out of this world, is a nonsense. And implementations like yours should open the eyes of apple to create something better. GREAT JOB OP

Re: Stevia: Human-readable auto-layout in code

#45
post #2

I am not an iOS developer with much experience. I have taken one class and built two very simple apps. So I can't weigh in on how good of an idea this is from an iOS developer standpoint. But I can say from a beginner to iOS standpoint that this looks amazing and I will put it to use in an app I am building immediately, as soon as I can figure out how. To the author of this library, thank you.

Thanks a ton for the kind words :)

Re: Stevia: Human-readable auto-layout in code

#46

OP: this is really neat, but i'm curious - what was your motivation for creating something so similar to autolayout's first party visual format language? https://developer.apple.com/library/prerelease/ios/documenta...

This is indeed vastly inspired by Visual Format Language purposefully so, so that there's nothing more to learn. This actually does pretty much the same thing behind the hood. We can say this is just Apple's visual format on steroids.

Three reasons mostly motivated us : 1. having the compiler on our side and not just hope the string would parse fin at runtime. 2. Laying out Horizontal and Vertical layout at the same time 3. Having something readable cause readable == maintainable :)

Re: Stevia: Human-readable auto-layout in code

#47

OP: this is really neat, but i'm curious - what was your motivation for creating something so similar to autolayout's first party visual format language? https://developer.apple.com/library/prerelease/ios/documenta...

Have you tried using it? It's all string-typed, and the worst when you don't get any error until you compile the app and then it complains you have an error in your layout "code" (which is just a string). Layout in code should be checked at compile time, which this project seems to attempt.

Exactly the problem we're trying to solve ;)

Re: Stevia: Human-readable auto-layout in code

#48
post #43

Thanks for the effort. As a professional iOS developer since 6 years, I think is really good to see people coming out with better ways to do things. Autolayout works but the amount of code that you have to write is just out of this world, is a nonsense. And implementations like yours should open the eyes of apple to create something better. GREAT JOB OP

What we found after trying lots of different layout strategies on our iOS App was that Autolayout in code was the simplest to maintain, and still using Apple technology, contrary to ReactNative for example. Furthermore we were absolutely against reinventing a heavy layout engine knowing we had Autolayout at hand. The syntax was very harsh on the eyes though so we looked into ways to make it better, and Stevia (healthy syntactic sugar) was born! Thanks a lot for the kind words :)
Post reply on HN