ballp.it

Snakes In The Ball Pit => Yay, I get to talk about me! => Topic started by: Yavuz on August 16, 2016, 10:02:05 am

Title: Help me throw myself into the deep end of programming, please
Post by: Yavuz on August 16, 2016, 10:02:05 am
I know there are a number of programmers on here. I am not one of them. However, I'd like to become one, because I want to make an iOS app. Specifically, I want to make an app that, using the Huffington Post Pollster API (http://elections.huffingtonpost.com/pollster/api), would show polling results and averages. The closest I've ever really come to coding is that, when I was a kid, I screwed around with HTML a bit and made a bad website for my Boy Scout troop. At any rate, I don't know anything about programming. But I want a halfway decent iOS poll tracking app so much that I am willing to learn how to make it myself. Where would you recommend that I start? Am I being too ambitious? Please help. [wikihow]
Title: Help me throw myself into the deep end of programming, please
Post by: Nifty Nif on August 16, 2016, 10:14:38 am
Yay programming!
If you want to go the iOS route, there are a number of ways to start.  However, you will be pigeonholed into working with Objective-C or Swift as your languages.  Additionally, it is a real drag trying to get your stuff onto the app store once it's finished.  Might I suggest starting with Android, instead?  That way, you can go with Java (my fave), and there are a number of free IDEs you can program inside of, and testing and deployment will be much easier.  That's just my suggestion.
There are reams of tutorials available online for both iOS and Android app development.  All you have to do is google "[OS] app development tutorial" and someone will have written a tutorial to get you started.  It may be hard to follow at first, but this is, in fact, the deep end.  They will assume a great deal of prior programming knowledge on your part, so go slowly and read the instructions carefully, doubling back where necessary.  You may need to supplement with other tutorials, including introductory ones on the language of your choice.
Good luck!
Title: Help me throw myself into the deep end of programming, please
Post by: Zekka on August 16, 2016, 10:21:02 am
I don't know very much about iOS, but I know Apple's languages targeting that platform are Objective-C and Swift, where Swift is considered easier to start with. Your other options include:

- HTML5: the combo of HTML (the language you use to write content on web pages) and JavaScript (the language you use to write programs that move things around on web pages)
- C#: Microsoft's general-purpose programming language. Supported on Windows, but also on Linux through Mono and .NET Core, and on Android and iOS through Xamarin. (which is a tool for, uh, supporting C# apps on platforms other than Windows)
- Game Maker: This programming language is designed to be really easy to use and to do flashy graphical effects in. It can compile for most devices. But the developers are total flakes and frequently break their own product -- also, it's kind of expensive. I would feel bad recommending this to you unless you already knew you liked it.

Out of these technologies I think C# has the least rough edges -- it uses a real garbage collector and doesn't have to maintain compatibility with a weird and broken old design like Swift. (A garbage collector is a component that comes with a programming language which figures out if there are resources your program isn't using and if so, gets rid of them -- Swift uses a very cheaty design that works almost as well for the same kinds of thing.) But I'm biased because I just finished an internship at Microsoft. Also, I've never worked with Xamarin so I don't know if it's any good.

Nif suggests Android, whose primary languages are the same as I listed, but replace Objective-C and Swift with Java. (where Java is pretty similar to C#)

You may want to start by writing a simple command line program in a well-supported language for desktop computers (like Python, C#, or Java) which just fetches the results of the API HuffPo is giving you. You basically have two groups of problems: problems their API creates for you, and problems your mobile phone creates for you -- if you can tackle them separately you might be better at diagnosing problems that come up once you come around to combining your prototypes.
Title: Help me throw myself into the deep end of programming, please
Post by: Nifty Nif on August 16, 2016, 10:23:13 am
RE: interfacing with the API:
If you've never interacted with an API before, all I can say is that it will be tricky if you're working with any one of these backend languages.  The pollster API does not have any wrappers or examples for mobile languages, so I'm not sure if you'll need a second tier of Javascript over your mobile backend or if you'll just want to do the heavy lifting on the app side.  Maybe someone with mobile development experience can speak more to that.  I think, personally, since you're just starting out, that you ought to keep it to a single tier for the time being, and spread it out if it is truly too difficult to do with your mobile language.  It can certainly be done (I have interfaced with APIs in Java many times--it's not cute, but you can do it).
The tricky part (as per my experience) will be making the GET requests work.  You'll have to cross that bridge when you come to it, and it will depend on your implementation.  What you're trying to accomplish here is the act of sending a properly-formed request to HuffPost Pollster and receiving a good response in return.  This is harder than it sounds the first time around, but if you know what you're doing, it shouldn't be too hard.
Title: Help me throw myself into the deep end of programming, please
Post by: Emperor Jack Chick on August 16, 2016, 10:45:55 am
so nif and zekka are both kinda dancing around languages and whatnot, which is all irrelevant until you start getting serious about coding. for example: I don't give a fuck about the differences between languages except at the syntactical level, and that's pretty who cares. This is not to say that language difference isn't important, it is, just not for a beginner.

The standard way to do this is to pick a language/tutorial series and then jam through it and learn the basics. Then you build shit. And after that, you build more shit. And after that, you build more shit.

Objective C and C# are both languages that are used at my work. They're both based off C and read like C. Consequently you should probably learn C (or C++). This is not because you'll do most of your programming in either language, but because learning them gives you the framework from which to learn the discipline of software engineering. You can learn this framework through any language. For example, you could learn on python or ruby. Both of them have somewhat different syntax from the C family, and so you would then have an extra step of learning syntax. Why not sidestep that?

The hard way (https://www.amazon.com/Primer-5th-Stanley-B-Lippman/dp/0321714113) --- this is the C++ primer. It is a long, dirty slog that will teach you how to code in C++, but it will mostly teach you how to be disciplined as an engineer. It is hard, it is boring. It will work.

I learned by going to codecademy and learning through javascript which is fine. I hesitate to recommend it because it falls into the pitfall of "LEMME SHOW YOU THIS COOL THING" and then not explain it. But it has good interactive examples.


Disclaimer - Nif and Zekka are Real Programmers. I am not.


inb4 gleech recommends a 4 year degree in CS :D
Title: Help me throw myself into the deep end of programming, please
Post by: Lemon on August 16, 2016, 10:58:47 am
Just to add another confusing layer to this, you could also write the thing in HTML/CSS/JS and then turn it into a mobile app using something like Cordova (https://cordova.apache.org/)

Advantages
Learn the languages of the web
Make something accessible via browser, iOS, Android, Windows Phone, etc etc

Disadvantages
Learning four languages simultaneously
Not "real" app development.
Title: Help me throw myself into the deep end of programming, please
Post by: Yavuz on August 16, 2016, 11:18:34 am
Nif- The problem with starting with Android is that I've never actually used Android. The whole reason behind wanting to do an iOS app is that I have an iPhone (and I'm pretty firmly locked into iOS for the foreseeable future, if only because I have invested far too much money in iOS apps). I suppose I could pick up a cheap Android tablet for my birthday, like the low-end Fire tablet.

Just to add another confusing layer to this, you could also write the thing in HTML/CSS/JS and then turn it into a mobile app using something like Cordova (https://cordova.apache.org/)

Advantages
Learn the languages of the web
Make something accessible via browser, iOS, Android, Windows Phone, etc etc

Disadvantages
Learning four languages simultaneously
Not "real" app development.
Lemon, August 16, 2016, 10:58:47 am

That actually does sound interesting. I'm mainly interested in the results, so I'm not particularly concerned with whether or not it's "real" development. And honestly, if I wanted to put this sort of thing on my resume, I think that knowledge of HTML and whatnot would probably be more relevant than Apple development.
Title: Help me throw myself into the deep end of programming, please
Post by: Nifty Nif on August 16, 2016, 11:34:39 am
Well, just to add to all the confusion, you shouldn't need an actual device to test your app until it's deployed.  It might take some of the fun out of it, but there are definitely ways to test without actually bundling up your app and deploying it out.  Just my two cents!
All of the advice here is great, and thanks Jack Chick for actually getting to the nitty gritty of learning a language instead of making assumptions!
Title: Help me throw myself into the deep end of programming, please
Post by: Zekka on August 16, 2016, 12:25:06 pm
Objective C and C# are both languages that are used at my work. They're both based off C and read like C. Consequently you should probably learn C (or C++). This is not because you'll do most of your programming in either language, but because learning them gives you the framework from which to learn the discipline of software engineering. You can learn this framework through any language. For example, you could learn on python or ruby. Both of them have somewhat different syntax from the C family, and so you would then have an extra step of learning syntax. Why not sidestep that?
jack chick, August 16, 2016, 10:45:55 am

Your app is probably going to be a quick-and-dirty hack based on some builtin stuff for iOS/Xamarin/HTML5, whatever, and the only problems you personally have to solve will be in "how does the UI framework work?" and "how does the API work?" I'm mostly emphasizing languages because for this project afaict, once you've picked a language, most of the choices for those two problems have already been made for you. It'll just be a matter of wiring it together.

IMHO C and C++ are both far harder to work with than what you're likely to be using, and the real difference here between languages is how good the builtins are for asking an API for something. (HTTP) I don't think adding C or C++ to the list is likely to improve the situation. I'm pushing C# and JavaScript because they both come with really simple builtin resource management. (C comes with no builtin resource management, and C++ comes with somewhat tricky builtin resource management: think hackier, more manual version of Swift's.)

If you make your goal "work effectively in C or C++," though, web app stuff will be the least of your problems, and you'll probably learn a lot about programming. My advice for a C learner is to not put up with C bullshit (like freeing resources once you allocate them) until you're comfortable writing programs that bare-minimum work -- just focus on getting the right output, then eliminate memory leaks, stuff like that. My advice for a C++ learner is learn C, because a lot of C++ features are weird and make more sense if you know how the C feature worked. (like references) But a lot of C++ programmers are divided on this.

C and C++ are very discipline-intensive languages that will eventually need a lot of planning to be effective in, so you might learn more about design if you work in them, but it's easier to hack things out planning-free in languages that come with automatic resource management.
Title: Help me throw myself into the deep end of programming, please
Post by: A Whirring Bone-White Gleech on August 16, 2016, 03:45:00 pm
I am also really skeptical of C or C++ as a first language.  Ideally, with a first language, you're learning to program - to think in exact terms, to use the structures present in programming languages, with only the abstractions that you build.  C and C++ make you do a lot of other stuff by hand, with primitives that are hard to use, and, in C++'s case, with syntax that's a goddamned mess; that complicates learning those basic skills.  I'd agree that Java, or C#, or my beloved Python are much better as first programming languages.

Practically, iOS development may not be an option, unless you're willing to spend money.  You can't use an actual iphone with the dev tools unless you buy a developer key for the phone.  And like nif said, the Android tools are available for free on every platform, and you can use (most) android phones with them for free without too much hassle.  (I assume the iOS dev tools come with an emulator that you can use, but if it's anything like the one in ADT, it's probably horribly slow and deeply unpleasant to work with, and thus not a very good option in practice.)

If you just want to work directly toward your goal, your best bet is probably something like what Zekka said.  Pick the language and system you want to work with, which might still be iOS, download the development tools, and start working through tutorials.  That might be pretty rough, because you'll be learning a lot of different things over the course of your project.

Although lemon's Cordova suggestion is definitely interesting and worth considering seriously.  Cordova is free, you could download the iOS dev tools, and whatever Cordova uses, and work through a "getting started" tutorial for each, and see which one you like better.

inb4 gleech recommends a 4 year degree in CS :D
jack chick, August 16, 2016, 10:45:55 am

Hah, gotcha, because the actual thing that I was predictably going to do is - wait, let me put this behind a spoiler tag, so Runic has a chance to win a bet.

I'm going to recommend python.  Python is probably the easiest language to learn that I have ever seen.  It also has a good libraries for fetching urls and parsing JSON and XML built right in, which make it particularly good for exactly the kind of thing you're trying to do.  It also has Tk built in for GUI work; Tk isn't great, but it works, and the Python binding is easy enough to use.

The only problem is, there is no good way (that I know of) to get Python code onto a mobile phone as an app.  So, if you're really sold on winding up with an iOS app as quick as possible, python won't help you.

In a perfect world, if you were willing to turn this into a very-long-term project in which you learned programming in a deep way, I'd absolutely tell you to start with python first.  But if not, then yeah, go straight to the tools for yor platform.


p.s. may of the tools we've mentioned in this thread are free, so in principle you can just try all of them and see which ones you like.
Title: Help me throw myself into the deep end of programming, please
Post by: nuffkins, of all people, on August 16, 2016, 05:06:57 pm
Seems like you had a cool idea about an app which is all you need to program for. If that's true, jump in to the language you'll use. You'll spend less time beating your head against the wall than you would learning theory via other languages first.

You can find tutorials online, but if you want more theory first, consider an intro CS or algorithms course, probably via Coursera.

If you just want to work directly toward your goal, your best bet is probably something like what Zekka said.  Pick the language and system you want to work with, which might still be iOS, download the development tools, and start working through tutorials.  That might be pretty rough, because you'll be learning a lot of different things over the course of your project.
Der Trommelngleech, August 16, 2016, 03:45:00 pm

How you get into programming entirely depends on the goal. For a career, you're gonna want to learn theory and abstraction first. Structure and Interpretation of Computer Programs and the course that taught it (https://www.youtube.com/playlist?list=PLE18841CABEA24090) are a fucking great start. Python's easy to learn and build useful things in, so it's also a good start. If you go this route, it might take a 4 year degree.