MAKE PROGRAMMING EASY AGAIN

Originator:utugau
Number:rdar://31324614 Date Originated:29-mar-2017
Status:open Resolved:
Product:All Apple OSes Product Version:n/a
Classification:Feature Request Reproducible:n/a
 
I have 9 years of experience programming for Apple stuff, iOS, MacOS and tvOS.

After all these years you expect to surpass the APIs difficulties and become a master in that programming language but I see this is not happening.

This is not happening because APIs are becoming complex and due to to poor documentation Apple writes for them, you end spending 70% of the time fighting the code and trying to understand it.

Lets talk about a recent problem I am having.

I am creating this video camera application for at least 6 months. I have created a technical incident support to solve the first problem that my code had. Even Apple engineers took 2 month to discover the problem. Now I am having another problem, but I have no money to open a new technical incident. But this is not the problem. The problem is that APIs are very complex and this is preventing people from creating amazing apps for Apple stuff.

See what Steve Jobs said about OOP:
https://youtu.be/2kjtQnPqq2U?t=41

THIS IS HAPPENING AGAIN. Programming for modern OSes is very complex and like Steve said, "programmers are paying the price".

We need something that simplifies creating stuff.

For example: this video camera of mine has thousands of lines just to grab video/audio and write it to file and the code has thousands of problems, of timings, buffer crashes and all kind of crap that should be happening. 

MY SUGGESTION
My suggestion is the following. Consider SpriteKit. What SpriteKit is? Is it simplistic or simple and powerful? My answer is: SpriteKit is not simplistic. It is simple and powerful.

This is what I mean APIs should be designed.

For example. Creating a video app should be like this:

AVVideoCamera *videoCamera = [AVVideoCamera new];
videoCamera.useCamera = AVFrontCamera;

// AVVideoCamera should handle image flip for preview
// developers don't care if the camera is sideways, make it right internally. Don't make developers responsible for showing the preview correctly. Handle autorotation too.

// creating a preview view should be simple
AVPreviewView *myPreviewView = [AVPreviewView metal];
videoCamera.showPreviewOnView = myPreviewView;

videoCamera.outputVideosToCameraRoll = YES;

videoCamera.outputVideoToFilePath = myFilePath;
videoCamera.useMicrophone = AVMainMic;


// advanced stuff can be added
videoCamera.startVideoByFadingInFromColor = blackColor;
videoCamera.endVideoByFadingOutToColor = pink;
videoCamera.startMicByFadingIn = YES;
videoCamera.endMicByFadingOut = YES;

// this should be the only flag necessary
// the preview view should animate flipping of cameras during
// video recording. AVVideoCamera should handle everything.
videoCamera.flipFrontBackCameraWithAnimation = YES;
videoCamera.flipFrontBackAnimation = myAnimation;

// possibility of adding an overlay that responds to user interaction
videoCamera.overlay = myOverlay;

// passing an array of CIFilters to videoCamera
// should be all that is needed to have these filters process the image
videoCamera.filterChain = myFilterChainArray;

and THAT'S IT.

That should be the only lines necessary to create a video camera, not thousands of lines where the developer have to handle even preview rotations and deal with code that does not work most of the time.

Every area of iOS should be simplified by creating simple and powerful APIs. 

MAKE PROGRAMMING EASY AGAIN!

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!