Mac New to coding

chorikawa321

macrumors newbie
Original poster
Jun 7, 2011
5
0
Hello everyone,

I recently just purchased a MacBook Pro to manage my calendar, notes, and Books. I want to do more with my MacBook Pro. I would like to know how to make apps. Does anyone have any recommendations for beginners?
 

superscape

macrumors 6502a
Feb 12, 2008
926
216
East Riding of Yorkshire, UK
Hi there, and welcome!

It very much depends on what sort of apps you want to make. You can make very simple apps to help you automate everyday tasks using AppleScript or Automator. That's probably the easiest route to making a simple 'app', but they'll not have much of a UI and functionality will be very limited.

However, if you mean native iOS or macOS apps then I'd suggest you look for some beginner's guides on Swift*, for example https://www.raywenderlich.com/ios/learn There are also some good tutorials on lynda.com

It can be a steep learning curve, but stick with it and feel free to ask back here if you get stuck.

Good luck!

r.



* Or you could look at Objective-C, but most folks seem to be migrating to Swift at varying rates.
 
  • Like
Reactions: organicCPU

Toutou

macrumors 6502a
Jan 6, 2015
677
944
Prague, Czech Republic
Not trying to burst your bubble, but someone has to tell you: Programming isn't exactly easy. It's not something you pick up in a week and master in a month.
I'd suggest you run through a Python course on Codecademy to get a taste of what you're into.
(also the courses are pretty good and Python is used almost everywhere, so it's both a first taste and a real start)

If you find it cool, great! Swift is the best choice for macOS/iOS development. JavaScript, Python or Ruby for the web, C++ or Rust if you're brave enough and interested in the low-level stuff.
 

Geeky Chimp

macrumors regular
Jun 3, 2015
130
59
If you are looking for something relatively simple but powerful take a look at FileMaker.

Otherwise, if that isn’t what you are looking for Xojo is a great alternative.
 

superscape

macrumors 6502a
Feb 12, 2008
926
216
East Riding of Yorkshire, UK
Not trying to burst your bubble, but someone has to tell you: Programming isn't exactly easy. It's not something you pick up in a week and master in a month.
That's absolutely true. Getting to the standard where you can confidently create a native macOS/iOS app is time consuming and difficult. That's not to say it's not worth trying. Take some online courses. Read a lot of documentation. Ask a lot of questions.

That said, I can teach you how to create a super-basic app in AppleScript in 2 minutes:

1. Open Script Editor from Applications/Utilities
2. Type the following into the window:
Code:
display dialog "Hello world"
3. File>Save> and choose "Application" as File Format

Hey presto, your first App!

OK, that's a ludicrously simple app and not really of any use to anyone. My point is, if your needs and aspirations are fairly basic then you can dip your toes into scripting/coding with something like AppleScript/JavaScript/Automator and make something that will help you with your every day work. No need to spend years becoming a master of Swift/Cocoa if all you want to do is automate shunting files around.

Even more concisely: think about what you want to achieve (just "making apps" is extremely broad). Once you've done that, figure out what tools you're going to need to master and off you go.
 
Last edited:
  • Like
Reactions: organicCPU

organicCPU

macrumors 6502a
Aug 8, 2016
646
173
Hi, glad you found the proper forum ;-)

As others already pointed out, coding can have many directions and maybe the best idea to get into programming is to get something practical done or claim something that you always were interested in a pure fun project to start with. A clear aim is always good to have.

One of the first things to do IMO is to get an overview of what you´ve got, maybe get some additional tools, get some basic knowledge and start tinkering around. Your Mac comes already packed with (almost) everything you will ever need or it makes it quite simple to get it.

Then take a look at …
- … Automator and Script Editor, like @superscape recommended
- … Terminal and type your first commands (man man, man -h, help, man bash, ls -al, man ls, cd ~, cd /some/dir, more /some/text.txt, pico /someNewFile.txt). With the q key you leave the help files and if your prompt is waiting for some input and doesn't react anymore Ctrl+c or Ctrl+d are probably good to know. The Terminal recognizes Drag'N'Drop. That means you can type some command like more, hit spacebar one times, drop some text file from the Mac Finder into that Terminal window and just hit enter. Voila, you read your text file without opening some GUI app. Your first own app experience could be something like you define a variable by typing into a Terminal MyVariable="Hello World" (Press Enter), type echo $MyVariable (Press Enter), type say $MyVariable (Press Enter). Learn more about bash, writing shell scripts and loops. These are really helpful, compile your first apps that someone else wrote and take a look at the ready-made code. At that point the terminal will ask you to install Command Line Tools. Those are utilities made available by Apple that contain a compiler and other neat features for the Terminal. With a compiler you´ve been reaching half way of being a programmer !:) another stretch of way is reading, reading and reading, especially the docs and then trying to figure out how everything works, well until it works
-… XCODE. That is a GUI (Graphical User Interface) developer app. It is your IDE (Integrated Developer Environment), mainly for programming with high level languages like Swift or Objective-C. You can find a lot of source code, e.g. on GitHub, that you can grab and try to compile with XCODE to get a feeling of how it works
-… https://www.apple.com/everyone-can-code/ - If you'd also like to learn how to program for iOS devices, that´s probably a nice starting point
-… https://developer.apple.com - Log in there (for free) with your Apple ID and enjoy a huge repository of resources, like docs and tools (Oh, yes, something more to read :)))

If you did the above, I'm quite sure, you'll come back here to the forum and have some more questions on tools, languages and whatever comes knocking on your mind… Have fun!
 
  • Like
Reactions: ddsmyers

hawkeye_a

macrumors 65816
Jun 27, 2016
1,313
3,386
I'm not entirely sure what your goals are or what you are trying to achieve, but there are many "layers" (without going too much detail). Maybe you can provide more detail? (example: I want to write a custom app which ........). It would be helpful to know if you have any experience with coding/programing as well....

I suspect you probably want to automate workflows of your common tasks? In which case, look into 'Automator' and AppleScript (I'm pretty sure it's free and comes with every macOS install).

If you want to actually write custom apps/programs you will need to invest ..... a lot more time. Apple's Development tools are available for free to download, and there are many tutorials and instructional videos online to help you get started. (Keywords to look for IMHO.... 'Objective-C', 'Cocoa').
 

robvas

macrumors 68030
Mar 29, 2009
2,801
372
USA
Go to a bookstore (or Amazon.com)

look at their books about creating iPhone apps. Buy one! Study it. Make an app.

Xcode etc are free from Apple. If you end up making something you want to put in the App Store you will need to pay $99 to register but that’s a bit down the road.
 

okieiam

macrumors member
Dec 17, 2016
38
3
Why do you thing, learn to code in macos different than a PC? Learn Java it's OS independent.
 

Loki.Mephisto

macrumors 6502a
Why do you thing, learn to code in macos different than a PC? Learn Java it's OS independent.
As is Python. Or C. C++. Objective-C. Javascript. Rust. Ruby. Go. And so on and so forth. Swift is platform independent as well.

However, apart from Swift and Objective-C most are hardly a good choice for App development (assuming the OP is talking iOS rather than Android)
 
Last edited:

Red Menace

macrumors 6502
May 29, 2011
390
53
Littleton, Colorado, USA
Why do you thing, learn to code in macos different than a PC? Learn Java it's OS independent.
Java? Ack.

I wouldn’t start out with anything involving Xcode, either, as that has a steep learning curve all by itself. Like others have mentioned, there are several installed languages for you to look at to get an idea what your next step should be. Ruby, Perl, Python, Swift, Javascript, AppleScript, etc, are already installed and ready to play with - adding an IDE and the Cocoa/Touch frameworks can come later.
 

okieiam

macrumors member
Dec 17, 2016
38
3
As is Python. Or C. C++. Objective-C. Javascript. Rust. Ruby. Go. And so on and so forth. Swift is platform independent as well.

However, apart from Swift and Objective-C most are hardly a good choice for App development (assuming the OP is talking iOS rather than Android)
Java? Ack.

I wouldn’t start out with anything involving Xcode, either, as that has a steep learning curve all by itself. Like others have mentioned, there are several installed languages for you to look at to get an idea what your next step should be. Ruby, Perl, Python, Swift, Javascript, AppleScript, etc, are already installed and ready to play with - adding an IDE and the Cocoa/Touch frameworks can come later.
As OP is zero in coding, he may swing between UI rich application to low-level communication components. So Java satisfies both targets.
 

Red Menace

macrumors 6502
May 29, 2011
390
53
Littleton, Colorado, USA
As OP is zero in coding, he may swing between UI rich application to low-level communication components. So Java satisfies both targets.
The issue is that the OP is a beginner, so complications such as installing additional frameworks and development environments such as Xcode or a Java IDE should really be avoided until they get their feet wet. I would recommend starting with Ruby or Python, as either can be used out-of-the-box with a simple text editor and/or the Terminal, and move into other languages and development environments as they become comfortable with the existing tools, utilities, and development in general.
 

Loki.Mephisto

macrumors 6502a
As OP is zero in coding, he may swing between UI rich application to low-level communication components. So Java satisfies both targets.
As do a lot of other languages. Again: iOS apps with Java? Good luck with that.

Anyway, since the OP seems to have lost interest the discussion became academic for we have no idea what exactly he means by the term "app".
 

casperes1996

macrumors 601
Jan 26, 2014
4,103
1,998
Horsens, Denmark
That's what people who've never done Java say. :D
Hey, at least Java is more OS Independent than so many other things. Or well, saying it like that makes it sound like a language feature; As someone else pointed out, something like Swift is technically platform agnostic too (though with no Windows compiler yet as far as I know?). So it's not so much about the language as it is the toolchain, compiled programs and whatnot.

But yeah, Java is great for platform agnosticism as long as you don't want it to feel or behave like a native app. But you can fairly easily get it to play nicely with more platform. The apple.laf for Java for instance is a good place to go (you write a boolean as true in the laf to get native menu bar support as an example)

I think Java is a great place to start actually. There's a tool called BlueJ for beginner programmers that has great visual aids for getting to terms with the idea of Objects and classes and such. You also don't need to worry about specifying a main and the like - you justs right-click a Class in a visual grid and you can run static methods or create an object that's placed on the so-called "Object Workbench" where you can right click objects to inspect state and run methods on them.

It's a really good tool for learning the basic concepts. Java being very explicit about object creation and the like in the code I'd also think would be advantagous for newcomers. Like the new keyword can be simpler to understand than .init or ClassName().

I think there are good reasons why Java is typically the first language taught at university.

For learning resources, there's also a brillant book called Objects First with Java which also references the aforementioned BlueJ coding environment (I don't really want to go as far as calling it an IDE...)

Inside Apple Development terminology however, I don't strictly speaking think it's correct to classify any program as "an app". I'd say that it's only an app if it extends UIApplication or NSApplication. Though that's more of a semantics thing, since you could also very well argue that if it performs a usable function it acts as an application.

In any case, I think Java is a good language for familiarising oneself with Object-Oriented programming concepts, but I wouldn't recommend it as a language in general. Maybe if multi-platform development is the target, but in that case I'd use Scala instead. It's a much nicer language in my opinion, and it runs on the JVM, so once compiled into ByteCode is essentially the same as Java.

If native development for Apple platforms is the goal, Swift is the best language to choose, but it's such a feature rich language that it may be too overwhelming for newcomers. I think Swift code is really easy to read, but to write Swift that interacts well with the SDK APIs you need to understand concepts like unwrapping optionals, using closures/lambdas, computed properties and so on. Even if you only write Swift in an Object Oriented style, the API you interact with may be aimed at a more functional approach or vice-versa, which I think can make the learning experience harder.

Whilst later versions of Java have a lot of these features too with lambdas in 1.8, optionals and generics in what? 1.6? and so on, a lot of the libraries are easier to work with without needing to understand very many of these concepts. The downside is that you're more likely to get a NullPointer exception because Optionals aren't more widely used, but the positive is that you'll get something running more quickly.

I also think the "strict" syntax of Java is beneficial to new coders. Getting used to remembering semi colons and the like. Then they can of course go on to start forgetting it again when they get used to Swift, Scala, Python or whatever, but it gives a better basis of understanding as to why the semi-colons may then sometimes be omitted in these other languages, and why the compiler might complain about ambiguotiy at other times when you don't break up your code in an expected way and the semi-colon would be necessary for the structure to be parsed correctly.

That's just my thoughts on the matter anyway :)

Oh, and once you've mastered all other languages, it's time to learn cock****. The most hardcore language - Or perhaps Arnold.
 
  • Like
Reactions: okieiam

556fmjoe

macrumors 68000
Apr 19, 2014
1,639
947
I recommend learning C first. On most Unix systems, including macOS, almost all C library functions are well documented. For example, you can simply open a terminal and type "man strlcpy" to learn all about the strlcpy() function. C also just requires a compiler, which you can get from Xcode's command line tools without having to install all ten million gigabytes of Xcode. You don't need huge frameworks, interpreters, or weird version incompatibilities (Python 2 vs Python 3, for example).

I learned C as my first language on an old BSD box this way and having mountains of documentation at hand was immeasurably helpful.
 
  • Like
Reactions: organicCPU

okieiam

macrumors member
Dec 17, 2016
38
3
What ever language, but the algorithm is more important, or coders may call you trainee.
 

StellarVixen

macrumors 68020
Mar 1, 2018
2,180
3,498
Earth
That's what people who've never done Java say. :D
They are not far from truth, though. Java is still king for cross platform compatibility.


Thing is, OP, if you learn Java, prepare for the mess of the corporate world. No one else is using Java these days. Yet, they alone make the Java still most popular language in the world.
 

okieiam

macrumors member
Dec 17, 2016
38
3
That's what people who've never done Java say. :D
They are not far from truth, though. Java is still king for cross platform compatibility.


Thing is, OP, if you learn Java, prepare for the mess of the corporate world. No one else is using Java these days. Yet, they alone make the Java still most popular language in the world.
Zero to code, should learn algorithm 1st

Java In 2019 And Beyond
 
Last edited:

grandM

macrumors 65816
Oct 14, 2013
1,100
57
I recommend learning C first. On most Unix systems, including macOS, almost all C library functions are well documented. For example, you can simply open a terminal and type "man strlcpy" to learn all about the strlcpy() function. C also just requires a compiler, which you can get from Xcode's command line tools without having to install all ten million gigabytes of Xcode. You don't need huge frameworks, interpreters, or weird version incompatibilities (Python 2 vs Python 3, for example).

I learned C as my first language on an old BSD box this way and having mountains of documentation at hand was immeasurably helpful.
lol, you really want to scare him &&&off.
The first question to the OP is which devices he/she targets. Then we can discuss the appropriate language.