ThinkC [Study Group 0] Getting your Development Environment Setup & Hello, World!

Relating to ThinkC Development

eric

Administrator
Staff member
Sep 2, 2021
941
1,542
93
MN
scsi.blue
Welcome to the FIRST Study Group Getting your Development Environment Setup & Hello, World!

Remember if you're not ready to start this week, don't worry, just come back when you are, we'll still be here to help!

Our goals for this week:
  • Setup your environment
  • Start reading Chapter 1 & 2 of Macintosh C Programming Primer 1992
    • Provides a quick overview and getting your first Hello, World!ANSI C app running
      • Share a screen shot of your app in this thread once complete!
  • Post here with questions, tips, and help each other out
  • Positive attitude, all are welcome. Everyone is here to learn and have fun.
  • Ask questions - no idea what "ToolBox" means - ask here!
We will be focusing on ThinkC 5 or 6 for this Study group. The book is based on ThinkC 5 but there are only minor differences which we will call out for ThinkC.

If your development machine is System 6, use ThinkC 5, if you're on System 7 use ThinkC 5 or 6. I believe the resulting binaries of eitehr will run on System 6+.

Environment Setup:

Real Hardware
or an Emulator are fine, whatever experience you'd like to use!

Mini VMac - I recommend the MacII version as you will get 8mb of ram (can have Think Reference and ThinkC open at the same time)

Basilisk II
Ample (Mame) https://github.com/ksherlock/ample/releases

Software Links
  • Required
    • ThinkC 6 - The tool we'll be using to build and run our software.
    • Think Reference 2 - Documentation for ToolBox and libraries used in ThinkC
    • ResEdit - Create Resources for your apps
  • Optional but good to have:
    • Amend - Source Control system on System 6+
      • Can share your amend files on amendhub.com
    • Popfuncs - An optional function navigator utility for THINK C
    • Hex Wrench 1.0 - A decimal to hexadecimal converter (need garden link)
    • HexEdit 1.0.7 - View/Edit/Diff binary files
    • MacTech Vol 1-12 - TONS of examples, articles, resources for mac programming.
    • Do you have any other recommendations? Post them in this thread!

Remember to have fun, post status updates on this thread, your profile posts, twitter, or anywhere you'd like!
 
Last edited:

pfuentes69

Active Tinkerer
Oct 27, 2021
380
293
63
Switzerland
I used this link to the Garden. It's 6.0.1, but it contains an IMG file with TC pre-installed.

I need to re-read the intro of the book, but here you go!

Screenshot 2022-08-17 at 21.37.12.png
 

atariorbit

Tinkerer
Nov 1, 2021
27
25
13
OK, I'm game. I'll be using Think v5 and playing along with some real hardware. I'm hoping to learn enough to build a little config app for the Fujinet - which would be used on older mac's via the Disk drive port (like a floppy emu but mount disks over the net).

Two other interesting books:

Programmer's Introduction to the Macintosh Family

Learn C on the Macintosh




IMG_4021.JPG
 

pfuentes69

Active Tinkerer
Oct 27, 2021
380
293
63
Switzerland
I tried Amend and it has an issue so it only works with short file names.
Hopefully this will be solved before we have to use it.
 

eric

Administrator
Staff member
Sep 2, 2021
941
1,542
93
MN
scsi.blue
I tried Amend and it has an issue so it only works with short file names.
Hopefully this will be solved before we have to use it.
https://jcs.org/amend 3.5 was just released
Changes in this version:
  • Add metadata editor to change author name, date/time, and log messages of existing amendments
  • Change references of “commits” to “amendments” to be consistent
  • Change temporary filename generation to avoid generating bogus filenames when diffing
  • Show progress while opening repo
  • Tweak font sizes
  • Fix bug that may have shown a bogus character at the end of a log message in the amendment list

Updated first post with everyone's feedback, keep it coming, thanks!
 
  • Like
Reactions: pfuentes69

eric

Administrator
Staff member
Sep 2, 2021
941
1,542
93
MN
scsi.blue
Here's my setup -

Quadra 950 132MB RAM, 6gb SCSI spinny drive, BlueSCSI, Internal SCSI CD, External CD, Zip Drive, Design Speakers, NEC LCD, Image Writer II, sticky notes for writing down some notes, and books!

I also use Mini vMac Mac II for doign quick testing while this machine isn't on.
3A5B2B01-06ED-48E9-9160-B95E0353DDA2.jpeg
 

eric

Administrator
Staff member
Sep 2, 2021
941
1,542
93
MN
scsi.blue
Very cool stuff here! Just one question, why not Pascal or Apple Pascal as that was the development environment in the early days, no?
I guess "had to choose one" is the best answer to this question. The few times I've tried to learn Pascal it's syntax has felt foreign to me and I gave up. Trying to learn a new language while trying to learn a framework as well can be frustrating. I feel much more comfortable in a C environment coming from Java, c++, python, etc. Also the books I've found that are based on C felt more "complete" for someone who knows nothing about toolbox/etc (I'm sure there's the same for Pascal)

That of course doesn't mean there isn't room for both here - but I think starting out we should focus on one. If you want to share some code or resources around Pascal please do and use the Pascal Prefix in this forum.
 

Trash80toG4

Active Tinkerer
Apr 1, 2022
910
260
63
Bermuda Triangle, NC USA
Not a code kinda guy outside of Basic and batch programming that's late 80s to mid-90s out of date. Just along for the ride, as much as I can understand it anyway. Great stuff, thanks!

I was figuring the answer might be that learning C is applicable across the board in a more modern world than the classic Mac development environment. I think you very much made the right choice. :)
 

Patrick

Tinkerer
Oct 26, 2021
434
1
224
43
for me personally. learning c is more interesting because its more portable. maybe if i get better on it on the mac. i can take that knowledge and use it on other platforms easier. (like embedded stuff or on modern computers or whatever)
 
  • Like
Reactions: retr01

retr01

Senior Tinkerer
Jun 6, 2022
2,473
1
796
113
Utah, USA
retr01.com
Exactly, @Patrick. C is still in demand today, related to C+, C++, C#, and others like Python, Java, Swift, etc.

Maintained by the Massachusetts Institute of Technology (MIT), Scratch is an excellent way to learn programming concepts via point, click, drag, and drop high-level programming.
 
  • Like
Reactions: Patrick

Crutch

Tinkerer
Jul 10, 2022
293
228
43
Chicago
Random belated endorsement for the excellent choice of using C.

I resurrected some old Pascal game code I wrote in 1992 (https://macintoshgarden.org/games/beamwars) for an updated “30th anniversary edition” (still coming soon … eventually) and dealing with the Pascal quickly became a giant slog. Eventually I ran the whole thing through a Pascal-to-C converter, which was its own small adventure but eventually paid off. Plenty of people were writing Mac Toolbox code in C by 1990 so it’s still historically legit 😊
 
  • Like
Reactions: Cashed and eric