
Replacing Photoshop with NSString - aaronbrethorst
http://cocoamine.net/blog/2015/03/20/replacing-photoshop-with-nsstring/
======
charles_parnot
Hi, all. I am the blog post author, blown away by the attention this 1-day
hack is getting! I am the author of Findings, a lab notebook app for
scientists. Check it out and show it to others:
[http://findingsapp.com](http://findingsapp.com)

I also created this page: [http://asciimage.org](http://asciimage.org), with
my friend @mz2. There is a simple editor as well called ASCIImage Super
Studio.

And check out Monodraw, I love it!!
[http://monodraw.helftone.com](http://monodraw.helftone.com)

(see comment here:
[https://news.ycombinator.com/item?id=9240942](https://news.ycombinator.com/item?id=9240942))

~~~
aidos
Really cool concept. Well done.

I didn't quite understand how the single points worked. It seemed to me that
your definition for, say, 3 single points was the same as a triangle. How does
it know which is which? Or do the curves have to be closed?

~~~
charles_parnot
When you skip a character, you move on to next shape.

So, 1-2-3 5-6-7 = 2 triangles

But 1 3 5 = 3 points

~~~
aidos
I think I was thrown off by the example which used 1,1,1,1 for the sphere and
2, 3 to represent isolated points. But they're consecutive. Unless I'm missing
something?

~~~
charles_parnot
fixed!

~~~
aidos
Ah ha, now it makes sense. Thanks :-)

------
milen
Shameless plug - Monodraw [1] is perfectly suited to create the ASCII diagrams
for this. I'm planning to add special support for ASCII Image if there's
enough demand - so definitely let me know.

[1] [http://monodraw.helftone.com](http://monodraw.helftone.com)

~~~
skrebbel
Wow. That looks like a dream come true. (if only it worked on my computer)

I guess a Windows or Linux version is never going to happen? I'd love to be
able to run this.

~~~
milen
Unfortunately, it's very unlikely. I'm a Mac developer and that's why Monodraw
is written for OS X (in Obj-C).

I'm a supporter of all platforms but I do not have any cross-platform desktop
GUI skills.

------
cordite
This is a work of art in of its self, never mind the icons made.

It is also inspiring for ascii to graphics representation utilities as well. I
wonder if this could be extended to make shape holder content, where in the
art you can specify the stretch locations and protected zones. (kinda like how
you can do a boxy like configuration on images for dynamic content inside via
CSS3)

~~~
command_tab
I imagine it could work like Android 9-patch PNG drawables, which have an
extra ring of pixels around the perimeter that mark content zones and
stretching zones.

------
anigbrowl
I don't wish to sound rude, because this is great work by the author, but
isn't this reinventing the wheel? Why not just use SVG? It might be somewhat
less efficient for the very simplest images, but doing raster layers in code
and including things like bezier handling seems perversely complex.

~~~
supercoder
Because this lets you 'code' the icon visually , rather than describing the
steps to draw.

It's a brilliantly simple but effective ideas. Very tempted to use it in my
next project.

~~~
anigbrowl
But why not just draw it instead of, well, _typing_ it in ASCII? Once you
start doing layers and blending and so on, you're just asking for misalignment
errors, surprises when your bezier paths turn out to generate little unwanted
loops and so on...

It seemed like the author's original problem was having to do so over and over
to deal with different pixel densities, but this is exactly the sort of
problem SVG exists to solve. I do admire the technical skill, I just don't get
the attraction of compiling ascii art into a vector image for anything
practical, for much the same reason that I wouldn't want to use Photoshop or
Illustrator to write code.

~~~
dragonwriter
> But why not just draw it instead of, well, typing it in ASCII?

Maybe because it is (or at least can be, the more advanced usages become less
so) tolerably self-describing in that you can readily see what it is
producing, in a way that SVG isn't, while still being source-control and
diffing-tool friendly text?

For small things like its intended uses, it fits well within coding tools and
workflows, and avoids separately documenting and coding the art.

~~~
ryandrake
Um, graphic files are also self-describing.

This kind of reeks of "If your only tool is a text editor, every problem looks
like text".

~~~
greggman
Way off topic but this is one reason I was excited about Atom the text editor.
Given its running inside a browser you should, theoretically, be able to show
svg inline, even allow visual editing inline.

~~~
Ironballs
Emacs has supported inline SVGs in org-mode since 2007 or so.

------
ygra
My go-to choice for this has been SVG. For shapes as the ones in the post it's
trivial to write by hand and equally trivial to generate various amounts of
raster images in various sizes. It's been quite helpful for preparing Android
and iOS app icons without constantly having to revise half a dozen different
images whenever one changed. It's also easy to change opacity or colour of the
shapes/strokes for generating icons for different themes (Holo Dark and Holo
Light on Android need different colours, for example).

~~~
paupino_masano
I haven't checked lately but traditionally SVG wasn't available with UIImage
yet was with NSImage. This often lead to custom drawing code for vectors on
iOS.

~~~
ygra
I used it only as source for the differently-sized raster images. I sort-of
inherited an Android and iOS app at that workplace and just went with what was
there. But given that the app used OpenGL I'm not sure there even was a
possibility of a vector format to use.

~~~
jheriko
why does OpenGL rule out vector formats? there aren't that many great
libraries out there for doing it cross platform, but if you treat them as
platform dependencies it should be easier...

you can probably google and find loads, but to get you started a little...

the main one I have experience of is 'cairo' which is quite a powerful library
for all kinds of drawing things. there is an android build config (although
its a bit old now) here: [https://github.com/anoek/android-
cairo](https://github.com/anoek/android-cairo) \- it is however not great for
iOS or OS X...

i've not used, but heard good things about 'sugar' as well:
[http://sourceforge.net/projects/libsugar/](http://sourceforge.net/projects/libsugar/)

~~~
ygra
It doesn't rule it out per se, but just rendering a texture is much easier,
with fewer dependencies. Android toolbar icons are PNG, not SVG. Most
renderers have trouble with all but the simplest SVGs (filters, etc. can be a
pain in the ass – Inkscape renders them nicely to PNG and I just don't have to
worry). There's a trade-off everywhere and all my solution did was take input
SVGs and render the PNGs in various sizes which we previously had to maintain
by hand. If rendering vector graphics would have been a major competitive
advantage to the app I'm sure it would have been considered ;-)

~~~
jheriko
sure. you are right.

i do wonder how long it will take for Apple to come around to mipmapping and
trilinear filtering to tackle their very normal problem of multiple
resolutions.

it seems to work well enough in all their use cases for the last 20 years or
so... :)

------
adamtj
This looks vaguely like xpm, but monochrome and vectorized. xpm is an image
format that is also valid C code, so you can #include "image.xpm" in your C
source code.

[https://en.wikipedia.org/wiki/X_PixMap#Comparison_with_other...](https://en.wikipedia.org/wiki/X_PixMap#Comparison_with_other_formats)

~~~
wtallis
This isn't monochrome. Stroke and fill colors can be specified per-shape, just
not in the diagram itself.

~~~
grkvlt
XPM isn't monochrome either, though. I always thought XPM was an elegant hack,
since I could just #include my icons into the C source for my Xt or Motif
applications. I don't miss the rest of Xt and Motif, particularly the pseudo-
object-oriented C style code, or the twenty kilograms of O'Reilly books
containing the documentation!

~~~
ci5er
So, you're a straight Xlib via man pages person?

------
pjbrunet
This is how we did DOS VGA fonts ~1990. Draw the pixels right in the code
(everything was monospace) and write that array directly to video memory. Mode
13 (320x200x256) video memory was sequential, easy to animate. Also you could
do palette scrolling. Consequently, Mode 13 was the best video mode for games
[http://en.wikipedia.org/wiki/Mode_13h](http://en.wikipedia.org/wiki/Mode_13h)

~~~
thom
In the 80s I made most of my games by using the Amstrad's font support to draw
sprites in a similar fashion. :)

------
infogulch
What if you allowed composing multiple "layers" into a single output to make
different parts of an otherwise busy diagrams more clear? For example, I found
the bug one particularly obfuscated:

    
    
        · · · · 3 · · · · · · · · · · · · · 
        · · · · · · · · · 7 · · · · · · · · 
        · · · · · · · · · · · · · · · · · · 
        · · · 1 3 · · 1 · · · · · · · · · · 
        5 · · 5 · · · · · · · · · · · B · · 
        · · · · · 2 · · · 7 · · · · 2 · · · 
        · · · · · · · · · · · · · · · · · · 
        · · · 1 · · · 1 · · · · · · · · · · 
        · · · · · · · · · · · B · 9 · · · · 
        · 8 · · · 8 · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · · 
        · · · · · · · · C · · · · · · · · · 
        · · · · · · · · · · · · · · · · · 9 
        · · · · · · · · A · · · · · · · · · 
        · · · · · 2 · · · · · · · · 2 · · · 
        · · · · C · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · · 
        · · · · · · · · · · · · A · · · · · 
    
    

But if you split it into two diagrams it becomes much more clear what's going
on:

    
    
        · · · · · · · · · · · · · · · · · ·     · · · · 3 · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · 7 · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · · · · · · · · · · 
        · · · 1 · · · 1 · · · · · · · · · ·     · · · · 3 · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     5 · · 5 · · · · · · · · · · · B · · 
        · · · · · 2 · · · · · · · · 2 · · ·     · · · · · · · · · 7 · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · · · · · · · · · · 
        · · · 1 · · · 1 · · · · · · · · · ·     · · · · · · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · · · B · 9 · · · · 
        · · · · · · · · · · · · · · · · · ·     · 8 · · · 8 · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · C · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · · · · · · · · · 9 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · A · · · · · · · · · 
        · · · · · 2 · · · · · · · · 2 · · ·     · · · · · · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · C · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · · · · · · · · · · 
        · · · · · · · · · · · · · · · · · ·     · · · · · · · · · · · · A · · · · ·  
    

Especially if you name them. Here, "body" and "legs". Edit: add spaces for
clarity. Edit2: use cdot.

~~~
charles_parnot
TBH, the bug is an example of where this hack should not be used :D

~~~
infogulch
I agree, the bug is mostly a worst-case complexity scenario, but it seems to
help with the other slightly more complex examples like the lock as well, by
separating the keyhole from the rest of the shape:

    
    
        · · · · · · · · · · · · · ·    · · · · · · · · · · · · · ·
        · · · 1 · · · · · · 1 · · ·    · · · · · · · · · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · · · · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · · · · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · · · · · · · · ·
        · 3 · 1 · · · · · · 1 · 4 ·    · · · · · · · · · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · · · · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · A · · A · · · · ·
        · · · 1 · · · · · · 1 · · ·    · · · · · · · · · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · C D · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · A · · A · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · · · · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · B E · · · · · ·
        · · · · · · · · · · · · · ·    · · · · · · · · · · · · · ·
        · 6 · · · · · · · · · · 5 ·    · · · · · · · · · · · · · ·

~~~
charles_parnot
You are totally right, and I actually also considered doing just that
initially in my code.

~~~
matiaspiipari
I've just added support for layering using '#>>>' as a layer separator to
ASCIImage Super Studio ([http://asciimage.org/ass](http://asciimage.org/ass)):

[https://twitter.com/mz2/status/579080005453398017](https://twitter.com/mz2/status/579080005453398017)

Your lock example from above is shown here:

[https://twitter.com/hodapp/status/579082721491705856](https://twitter.com/hodapp/status/579082721491705856)

~~~
matiaspiipari
Ermm, second link was meant to be
[https://twitter.com/mz2/status/579083258631073792](https://twitter.com/mz2/status/579083258631073792)

------
matiaspiipari
There's more info about Charles' ASCIImage at
[http://asciimage.org](http://asciimage.org) , including an OSX based editor
for the file format it that we put together with Charles during NSConference
(direct download link to the ASCIImage Super Studio editor:
[https://rink.hockeyapp.net/apps/8ac351501c5c3db78ececb2f7e26...](https://rink.hockeyapp.net/apps/8ac351501c5c3db78ececb2f7e26062f))

------
halosghost
Actually, something very like this has been done for a long time (the XPM):
[https://en.wikipedia.org/wiki/X_PixMap](https://en.wikipedia.org/wiki/X_PixMap)

All the best,

~~~
daeken
XPM is only for resolution-specific rasters. His technique allows for bezier
paths, arbitrary fills, etc and is resolution-independent. It's pretty clever,
IMO.

~~~
halosghost
I didn't say what the author did was bad, uncool or not clever. But it
certainly isn't a revolutionary thing that's never been done before.

Additionally, XPM sucks (I'm aware), and I've been wishing for a significant
update to it for a long while :P

------
JoshTriplett
This is really impressive!

For the actual drawing, I'm wondering if the cairo library and drawing model
would help. It effectively gives you the move-to line-to curve-to drawing,
with some additional capabilities. A simple script around cairo seems like it
would cover many more cases, and then this ASCIImage mechanism will help
generate those scripts.

~~~
wtallis
What extra capabilities do you think cairo would provide that could be exposed
through the ASCII-art mechanism without overly complicating it? This thing is
already choosing to not expose the full functionality of the NSBezierPath
drawing APIs.

~~~
JoshTriplett
I'm not suggesting extending the ASCII art mechanism. I'm just suggesting that
compared to the API shown in the first example, cairo makes simple line-art
quite trivial to write as code.

Specific features that would make sense to have available rather than drawing
art in an image editor:

Line width, to draw the chevron without having to draw two adjacent lines.

Dotted/dashed lines.

------
tehwebguy
This reminds me of the sprites I made in QuickBasic with 2-digit color codes.
Very cool!

~~~
thom
Yeah, the chevron in the article would just be:

    
    
        DRAW "BM+3,+1 R1 F4 D1 G4 L1 U1 E3 U1 H3 U1"
    

You could change the scale with "Sn" so you could draw any size, and there
were commands to fill shapes etc.

There was a similar language for music as well, they were both nice little
DSLs.

------
twsted
I like it very much. I would push this even further: I see it as a sort of
"Markdown for simple vector graphics", with tools able to convert it to SVG
and other formats.

~~~
charles_parnot
Nice way to think about it. I agree.

------
myfonj
Feature idea: BRUSH. After finishing a shape or stroke, call it a brush and
drag it.

Brush from a shape (like in the example chevron):

    
    
      . 2 3 . . . .
      . 1 4B# . . . 
      . . # # # . . 
      . . . # # # . 
      . . . # # 5 . 
      . . # # # . . 
      . # # # . . . 
      . # 6 . . . . 

Brush from single line stroke (like a 'calligraphic pen'):

    
    
      . 1b# # # # 2
      1 # # # # # .
      . . . . # . .
      . . . # . . .
      . . # . . . .
      . 3 # # # # 4
      # # # # # # .
    

This would also ease creating complex strokes with rounded corners: with
ellipses or other rounded shapes as a brushes.

------
brianpgordon
I did something very similar to render scaled ASCII-art text (a la Figlet):

[https://github.com/briangordon/vector-
figlet](https://github.com/briangordon/vector-figlet)

------
Kiro
> Because of “retina”, you also have to create separate files for 1x, 2x, and
> now 3x-scale

OT but why do you need three different and not just go with the 3x which you
scale down?

~~~
dirtyaura
Designers have more possibilities with 3x and 2x than with 1x as you can draw
small details. If you scale them to 1x, the icon will look blurry, because the
details doesn't scale well. If you want high level of polish, you typically
make at least some touches to the scaled down icons.

Of course, in the context of the original ascii art icons, that level of
polish doesn't matter.

------
lepht
It'd be interesting to combine this with monodraw:

[http://monodraw.helftone.com/](http://monodraw.helftone.com/)

~~~
Zezima
Guess we can expect a full NSImage export feature in the full version. I just
started using Monodraw and this was the first thing that came to mind as well.

------
gus_massa
Feature request: With 4 repeated numbers in the corners, draw a filled
rectangle instead of a filled ellipse:

    
    
      Circle          Square
      ..#1#..         2#####2
      .#####.         #######
      #######         #######
      1#####1         #######
      #######         #######
      .#####.         #######
      ..#1#..         2#####2

~~~
charles_parnot
I actually did consider this when writing the "parser" but it was complicated
enough that it was just getting in the way of my goal of having the simplest
code and specs that got the job done. Also using 1-2-3-4 is simple enough that
I decided it was not worth the extra rule.

------
chj
What a powerful way to represent graphics in code. I am definitely using this.
Thank you!

------
grimmdude
Very cool. I like the idea of using a text editor as an image editor.

~~~
archagon
I am really surprised that there haven't been more efforts in this direction.
As a programmer who's recently been dabbling more in graphics, I _hate_ having
to fiddle with knobs and redo my work when I often know exactly what needs to
be done and how to do it. If I need to draw an oval 10 times, I shouldn't have
to copy and paste it, forcing me to redo the entire thing if I decide to make
a change; I should be able to define the oval in script and use a loop to
position it exactly how I want!

I wish there was an editor with an interface as great as (say) Pixelmator's,
but with an optional script window that let you write and edit the code for
your vector graphics if you need to. Something PostScript powered, maybe?
(PaintCode does something like this, but it's more of a one-way, vector-to-
code mapping. Bloom promises to do a lot of this, but I haven't used it in a
while.[1])

[1]: [http://thebloomapp.com/features/](http://thebloomapp.com/features/)

~~~
teleclimber
> If I need to draw an oval 10 times, I shouldn't have to copy and paste it,
> forcing me to redo the entire thing if I decide to make a change

Indeed you shouldn't! That's why all serious image manipulation programs have
this capability built in.

Most of them also let you write your own plugins for those cases where you
need more than what the interface provides.

I think going to all-code drawing is more limiting than freeing. It seems more
like a case of having a hammer and seeing that everything can be made to look
like a nail.

~~~
archagon
Well, I'm not advocating all-code drawing! What I'm suggesting is a WYSIWYG
editor like any other, but with a 1-to-1 script mapping for all the commands
under the hood. If you want to generate an oval in code, go for it; but you
can also create one using the oval tool (and edit it later in script if you
change your mind).

As for plugins, that's not really integrated into the workflow in the way I'm
envisioning. I shouldn't have to write heavy code just to experiment with a
quick artistic idea! Think web development. It should be as simple as editing
a JS file and refreshing the page.

------
locusm
Thats cool, reminded me of PaintCode which I keep meaning to try out.
[http://www.paintcodeapp.com/](http://www.paintcodeapp.com/)

~~~
robin_reala
We used PaintCode on our recent iOS game in conjunction with RubyMotion. My
colleague wrote a blog post about it:
[http://paulsturgess.co.uk/blog/2015/03/03/using-paintcode-
to...](http://paulsturgess.co.uk/blog/2015/03/03/using-paintcode-to-
dynamically-create-images-in-the-ios-football-manager-game-title-challenge/)

------
woah
Is it really slow to draw these waiting for compile each time?

~~~
david-given
Judging by the first example, I'd guess it's probably creating an NSBezierPath
and then letting OSX actually do the rasterisation later.

~~~
charles_parnot
Exactly

------
bakul
This seemed like a fun little project so I created
[https://github.com/bakul/avg.git](https://github.com/bakul/avg.git) \-- a Go
package that converts an "ascii vector graphic" string vector into a shape
vector.

~~~
charles_parnot
I added a link to it on asciimage.org

------
vbezhenar
I wonder what's better from the point of final user (app size, app starting
speed, app performance, memory usage): png or this drawing code? I suspect
that PNG should work better. And programmer can easily generate multiple PNG
from single hand-written SVG.

~~~
myfonj
Not speaking about processing costs, this could be nice format for storing the
data. Consider the example from page:

    
    
        1 2 3 4 5 6 7
      a · 1 2 · · · · 
      b · A # # · · ·
      c · · # # # · ·
      e · · · 9 # 3 ·
      f · · · 8 # 4 ·
      h · · # # # · ·
      i · 7 # # · · ·
      j · 6 5 · · · ·
    

It is textually 58 characters of data:

    
    
      7 ·12·····A···············9·3····8·4·········7······65····
    

(Axis headers and whitespace ommited, two characters added to keep the row
width information.)

It is almost the same size of the smallest possible SVG polygon of similar
shape consisting of 59 characters:

    
    
      data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><polygon points="0,0 2,0 5,3 5,5 2,8 0,8 0,6 2,5 2,3 0,2"/></svg>
    

Using even the simplest coordinates notation it could look like 24 characters:

    
    
      a2a3e6f4j5j6i7f6e9b2f cf
    

(Three characters added to keep "Close and fill" information.)

Smallest 7×8 px PNG with the same image is 96 bytes large:

    
    
      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAIAQMAAAAPyndFAAAABlBMVEX///8AAABVwtN+AAAAFUlEQVQI12NIYChgsGCQAUILICsBABJQAkm4hriIAAAAAElFTkSuQmCC

~~~
charles_parnot
Nice to see the actual comparison of the binary size (and there is the 2x and
3x png). On the other hand, to be fair, the memory footprint will be more with
the ASCII version (text + final NSImage loaded as bitmap in memory) compared
to png (only the bitmap in memory, directly loaded from disk). The size of the
bitmap is big anyway: there is no compression.

------
Vektorweg
This reminds me of the ASCII-fied arrow notation.
[http://scrambledeggsontoast.github.io/2014/09/28/needle-
anno...](http://scrambledeggsontoast.github.io/2014/09/28/needle-announce/)

------
agumonkey
Nice idea. Can't help but to think of Emacs artist-mode:

[http://tanehp.ec-net.jp/heppoko-
lab/diary/artist_mode_test.p...](http://tanehp.ec-net.jp/heppoko-
lab/diary/artist_mode_test.png)

------
sah2ed
Very cool work! A great link I found in the article's comments for generating
dot-matrix text:

[http://www.omgtldr.com/.matrix/](http://www.omgtldr.com/.matrix/)

------
SunboX
Can't understand why there's no good SVG implementation in Objective-C /
Swift. SVG makes Web-Dev or even C# / XAML so much easier.

------
tres
It would be awesome to extend this into a library based on FontAwesome; create
an abstraction layer which would allow easy reference like CSS.

~~~
robbiep
It sure would... fontAwesome ios libraries (mostly using NSImage) are all
awful and broken

------
jheriko
this is quite cool. reminds me of making levels for games using ascii art in
code... but taken to a whole other level :)

------
cpncrunch
It would be nice to have an html5 version that draws into a Canvas.

~~~
charles_parnot
Be my guest :-)

I added the js port on asciimage.org. There is a Go version as well I will
link to.

~~~
cpncrunch
Nice. I was half considering doing it myself, but it looks like it's already
done :)

I'm considering using this to redesign the UI on one of my products. Hiring a
designer is a huge pain, but this is a viable alternative.

------
vinceyuan
Cool and useful!

------
arctangos
a) This is a remarkably neat idea. b) It probably shouldn't have to exist.

... which just about sums up the Objective-C experience

~~~
soup10
I'm going to join you here in the grey. Objective-C is a disaster of a
language on many levels. Portable C++ is the smarter and better choice(and
those few cases where it isn't is solely because of intentional and unethical
design decisions by apple to lock you into their platform).

~~~
christoph
I know you & the parent have both been down-voted, but it would be great if
you could explain some rationale behind why Objective C is such a disaster in
your opinion(s)?

When I first started learning it, I absolutely _hated_ it. With a burning
passion.

It is probably now my current favourite and most productive language.

I seem to very rarely write buggy/poor/badly structured code and almost never
hit compiler errors/hard crashes unless they are something relatively obscure.
It's quite common for me to write 1k+ lines of code, hit build and have
exactly what I wanted compile & work pretty much first time.

~~~
archagon
Not OP, and I agree that Objective-C is great. However, it _is_ potentially
troubling, from a performance standpoint, that practically everything is
allocated on the heap. There's no support in the language for stack-allocated
objects, for example. Now that I've used Swift in production, I also really
miss generics. Casting to and from containers gets really annoying and unsafe!

~~~
seanalltogether
"that practically everything is allocated on the heap"

That's kind of the point though. If you want something on the stack, you write
plain old C structs or work with primitives. There's plenty of this happening
throughout the cocoa frameworks. On the other hand, if you find yourself
writing C structures to the heap in objc, you're probably wasting your effort.

