f



Beginning for Beginning Beginners


I occasionally become motivated to dabble in programming, just to the point of
getting a particular task done, and am wondering where I should start. I am 
generally more interested in the ends rather than the means.

I want to work with what is available with Panther on the XCode CD, and am
intrigued by Tigers Automator. I wouldn't mind putting a minimal GUI framework
on some old UNIX code.

My programming history as a non-programmer.......

I did take a pascal course way back when, and remember getting an assignment or
two done well... the toughest part at that time was sending the code over POTS
to the university computer, from an Apple II.

I also played with Logo a bit on the Apple II as well.

I typed a text adventure in BASIC into a VAX from copies of BYTE, and played
around with the DEC help system enough to learn a few things. Made DOS line
commands a bit easier later, but I never got much beyond a directory listing,
apple DOS or MS DOS, save for copying files.

I played with Hypercard a bit, only useful to me when someone tagges some lower
level code into it... remember some calls to MIDI.

I played with recordable macro scripting programs in classic mac os.
I have read or adapted an existing applescript or two, but never built one from
scratch. What irks me the most about applescript, beyond its speed, and its
applicability to scriptable apps, is that I have seen few that let me clearly
know when a task is finished.

I built a few regular expressions to search and sort in BBEdit. Never really
moved to PERL from that point. Did get the O'Reilly Camel books and CDs.

Excel Macros?  Never dealt with them.  =SUM(), *C9, thats about my level.

Oh and I suppose HTML counts to some degree as well. Nothing server side, all
rollover javascripts and the like, borrowed from others.

Better at overall broad logic problems compared to catching syntax errors.
..............

The following Developer Getting Started URLS look interesting, but given my
history above, which path should I take? Java? I am interested in text
processing, but not via line command necessarily.

I would prefer something to work fast and look nice, staying in Cocoa, building
high level, compiling for speed.

Tell me where to go.


http://www.apple.com/macosx/tiger/automator.html
http://forums.macrumors.com/showthread.php?mode=hybrid&t=63162
http://forums.macosxhints.com/showthread.php?t=22352
http://developer.apple.com/
http://forums.macrumors.com/showthread.php?t=69103
http://macscripter.net/books/
http://macscripter.net/faq/
http://developer.apple.com/gettingstarted/
http://developer.apple.com/macosx/index.html
http://developer.apple.com/macosx/introdevtech.html
http://developer.apple.com/enterpriseit/
http://www.apple.com/hardware/
http://developer.apple.com/referencelibrary/GettingStarted/GS_Java/index.html
http://developer.apple.com/referencelibrary/GettingStarted/GS_Cocoa/index.html
http://developer.apple.com/referencelibrary/GettingStarted/GS_AppleApplica
tions/index.html
http://developer.apple.com/referencelibrary/GettingStarted/GS_AppleScript/
index.html
http://developer.apple.com/referencelibrary/GettingStarted/GS_MacOSX/index.html
http://developer.apple.com/referencelibrary/GettingStarted/GS_Porting/inde
x.html
http://developer.apple.com/referencelibrary/GettingStarted/GS_Tools/index.html
http://developer.apple.com/java/faq/
http://java.sun.com/docs/books/tutorial/
http://java.sun.com/
http://developer.apple.com/documentation/Java/Conceptual/Java141Developmen
t/index.html#//apple_ref/doc/uid/TP30001142
http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGu
idelines/index.html#//apple_ref/doc/uid/20000957
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaObjects/Art
icles/JavaCocoa.html#//apple_ref/doc/uid/20001937
http://developer.apple.com/documentation/Cocoa/Conceptual/JavaTutorial/ind
ex.html#//apple_ref/doc/uid/TP30001111
http://developer.apple.com/documentation/AppleApplications/Conceptual/Sher
lock/index.html#//apple_ref/doc/uid/10000121i
http://developer.apple.com/documentation/UserExperience/Conceptual/Address
Book/index.html#//apple_ref/doc/uid/10000117i
http://developer.apple.com/samplecode/AppleApplications/index.html#//apple
_ref/doc/uid/TP30000925-TP30000418
0
jonesr
7/18/2004 5:02:25 PM
comp.sys.mac.programmer.tools 504 articles. 0 followers. Post Follow

13 Replies
601 Views

Similar Articles

[PageSpeed] 35

On 2004-07-18, JonesR <jonesr@aol.com> wrote:

>I want to work with what is available with Panther on the XCode CD, and am
>intrigued by Tigers Automator. I wouldn't mind putting a minimal GUI framework
>on some old UNIX code.

Give Python a try.  It's already on your system.  

http://python.org/topics/learn/

You can write Cocoa programs in Python:

http://pyobjc.sf.net

The BitTorrent client for Mac OS X is written completely in Python.

Dave Cook


0
David
7/18/2004 6:36:40 PM
In article <20040718130225.10713.00000091@mb-m13.aol.com>, JonesR
<jonesr@aol.com> wrote:

> I occasionally become motivated to dabble in programming, just to the point of
> getting a particular task done, and am wondering where I should start. I am 
> generally more interested in the ends rather than the means.
> 
> I want to work with what is available with Panther on the XCode CD, and am
> intrigued by Tigers Automator. I wouldn't mind putting a minimal GUI framework
> on some old UNIX code.
> 
Welcome.
For getting acquainted with the Xcode development tools, I recommend 
_Cocoa Programming for the Moc IS X Second Edition_ by Aaron Hillegass.
If it's at all like the first edition, it will be a very friendly
introduction to Xcode.

It uses Objective-C.

-- 
Chris Henrich
God just doesn't fit inside a single religion.
0
Christopher
7/18/2004 11:46:54 PM
In article <20040718130225.10713.00000091@mb-m13.aol.com>,
 jonesr@aol.com (JonesR) wrote:
> I want to work with what is available with Panther on the XCode CD, and am
> intrigued by Tigers Automator. I wouldn't mind putting a minimal GUI 
> framework
> on some old UNIX code.

I'd start by picking a language.  Objective-C comes to mind if you're 
mostly interested in working with Cocoa.  That'll only work on MacOS X 
boxes, though.  If you want to develop more platform-independent code, 
then I can recommand Java with Swing (Swing is the GUI system for Java, 
and supercedes an older GUI system called AWT).  C and C++, although 
executing significantly faster than both Objective-C and Java, can be 
more difficult for a beginner to become comfortable with, especially 
when you try and port your Mac-based code to other platforms.

David Cook also mentioned Python.  Python is a terrific, very powerful 
language for working with complex objects, but it suffers from one 
significant drawback: it's extremely slow when you're doing anything 
CPU-intensive.  In one numerical test I performed, in which a million 
random numbers were calculated using a special algorithm, a C 
implementation ran in 1.48 seconds, a Java implementation ran in 2.62 
seconds, and the same code written in Python ran in 338.86 seconds.  If 
you're building a GUI, though, you typically don't need to make a 
million calculations, but if your application is a game or something 
scientific this could be an issue.


COCOA WITH OBJECTIVE-C

If you're interested in building Cocoa apps with Objective-C, I can 
highly recommend two books by O'Reilly & Associates as a starting point.  
They are:

"Building Cocoa Applications: A Step-by-Step Guide"  $44.95
   <http://www.oreilly.com/catalog/buildcocoa/>

"Learning Cocoa with Objective-C"  $54.95
   <http://www.oreilly.com/catalog/learncocoa2/>

The first book is a primer, and the latter goes into more advanced 
stuff.  I found these texts essential when I was starting out with 
Cocoa.  All of the examples can be built and tested with Xcode or 
Project Builder and Interface Builder.


JAVA

Java is my favorite language at the moment, for a number of reasons that 
I won't go fully into.  MacOS X Panther comes with Java 1.4.2 built-in, 
and it's an extremely fast implementation, as my earlier benchmarks 
should attest.  I find the language itself to be extremely clean and fun 
to play around with.  You can do some very advanced stuff with not too 
much work.

Not too many people know that Java can also be used to develop Cocoa 
applications, and has a faster message-passing scheme than Objective-C.

If you're interested in Java at all, there's a couple of O'Reilly books 
I can recommend:

"Learning Java, 2nd edition"  $44.95
   <http://www.oreilly.com/catalog/learnjava2/>

"Java in a Nutshell, 4th Edition"  $61.95
   <http://www.oreilly.com/catalog/javanut4/>

The first book is a primer, and the second is a reference text I find 
essential when I forget how to talk to the built-in classes.  Xcode (or 
the older Project Builder) are both excellent development/debugging 
environments for Java code.


PYTHON

I like this language a great deal, with the caveat that my primary work 
is calculation-intensive, so I can't use it except in limited ways.  I 
got started with a couple of O'Reilly books on the subject:

"Learning Python, 2nd edition"  $50.95
   <http://www.oreilly.com/catalog/lpython2/>

"Programming Python, 2nd edition"  $54.95
   <http://www.oreilly.com/catalog/python2/>

Once again, the first book is a primer, the second is their more 
advanced text.  They also have a handbook and other titles on Python.


Lastly, I should mention that I don't work for O'Reilly, I just have a 
lot of their books and have rarely been disappointed by their content.  
I also received about forty of their books or free, which helps....   ;->

-- Bert Sierra
0
Bert
7/19/2004 1:53:50 PM
On Mon, 19 Jul 2004 06:53:50 -0700, Bert Sierra
<bert_sierra@commspeed.net> wrote:
> David Cook also mentioned Python.  Python is a terrific, very powerful 
> language for working with complex objects, but it suffers from one 
> significant drawback: it's extremely slow when you're doing anything 
> CPU-intensive.  

Caveat: I am Python biased, but...

While it is interpreted it is not normally as slow as your
figures suggest and optimisers like Psycho and Pyrex are normally
very good at speeding up CPU intensive jobs like number
crunching. Also there are several math specific libraries
written in C.

From my experience I find, with C as a base, that 
performance ranges like this:

C - 1
C++ - 2-5 (assuming using OOP features)
Java native code - 3-5
Java Bytecode - 5-10
Python bytecode - 10-20
Python optimised - 3-15 (depends heavily on app)

For Python to be 100 times slower than Java I suspect some 
major inefficiency in the Python implementation of the algorithm!

But the general point is valid that Python is interpreted and
should probably be compared to Applescript rather than 
Objective C in a Mac programming context.

> million calculations, but if your application is a game or something 
> scientific this could be an issue.

And Python has the wonderful PyGame application kit that provides
most of the CPU hitting bits in C wrappers...

www.pygame.org

But I admit I'm biased :-)

Alan G.

Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld
0
Alan
7/19/2004 5:53:41 PM
<< > David Cook also mentioned Python.  Python is a terrific, very powerful 
> language for working with complex objects, but it suffers from one 
> significant drawback: it's extremely slow when you're doing anything 
> CPU-intensive.   >><BR><BR>

Until you mentioned that slowness, http://www.pythonmac.org/wiki/FAQ had
reminded me why I had probably been recommended to try python before, given my
criteria.

What about something like Ruby?

But you know, a lot of what I wish to accomplish may very well not be CPU
intensive anyway. There are already Applescripts for some of what I would like
to do, it is just that running them does not provide enough feedback to me, or
running script editor seems a bit kludgey in comparison to something that might
have a window interface (which is easier to pop on an applescript these days it
seems)

Portability to other platforms is not really an issue for me. I prefer the look
and feel of cocoa apps.
0
jonesr
7/19/2004 9:42:04 PM
On 2004-07-19, Bert Sierra <bert_sierra@commspeed.net> wrote:

> David Cook also mentioned Python.  Python is a terrific, very powerful 
> language for working with complex objects, but it suffers from one 
> significant drawback: it's extremely slow when you're doing anything 
> CPU-intensive.  In one numerical test I performed, in which a million 

Usually if you were going to do anything like that with Python you would use
a wrapper around some C code like numarray for numerical work or pygame for
games.  A Python application written in pyobjc or pygtk will generally feel
more responsive than a Swing application and will certainly use much less
memory.

Dave Cook



0
David
7/19/2004 11:26:56 PM
<< 
Lastly, I should mention that I don't work for O'Reilly, I just have a 
lot of their books and have rarely been disappointed by their content.  
I also received about forty of their books or free, which helps....   ;->
>><BR><BR>


Oh they are worth buying. I agree with you wholeheartedly about O'Reilly books.

0
jonesr
7/20/2004 1:07:11 AM
In article <o22of01h3s3h05d5mvlp15iv9h6u0bqgcl@4ax.com>,
 Alan Gauld <alan.gauld@btinternet.com> wrote:
> > David Cook also mentioned Python.  Python is a terrific, very powerful 
> > language for working with complex objects, but it suffers from one 
> > significant drawback: it's extremely slow when you're doing anything 
> > CPU-intensive.  
> 
> For Python to be 100 times slower than Java I suspect some 
> major inefficiency in the Python implementation of the algorithm!
>

The code is simply a straight port of the C / Java code base.  There's 
pretty much a one-to-one correspondence of the lines of code.  
Admittedly, my benchmark is not a fair thumbnail of Python's overall 
performance, and there are wrappers like PyObjC and PyGame that can get 
it much closer to the speed of plain C.

Still -- I was scared away from using Python in my application.


-- Bert Sierra
0
Bert
7/20/2004 2:00:21 AM
In article <20040719174204.23846.00002277@mb-m28.aol.com>,
 jonesr@aol.com (JonesR) wrote:

> But you know, a lot of what I wish to accomplish may very well not be
> CPU intensive anyway. There are already Applescripts for some of what
> I would like to do, it is just that running them does not provide
> enough feedback to me, or running script editor seems a bit kludgey
> in comparison to something that might have a window interface (which
> is easier to pop on an applescript these days it seems)
> 
> Portability to other platforms is not really an issue for me. I prefer
> the look and feel of cocoa apps.

Plus, Interface Builder simplifies how you connect the various GUI 
elements and associated classes and methods.  That's a BIG plus.

One more thing to consider when choosing the language: Xcode only 
supports graphic debugging of C / C++ / Objective-C / Java code.  As far 
as I know, there's no way of stepping through a Python or Perl program a 
line at a time and viewing variables.  Maybe the experts will know of a 
tool out there that does this.


-- Bert Sierra (again)
0
Bert
7/20/2004 2:09:09 AM
On 2004-07-20, Bert Sierra <bert_sierra@commspeed.net> wrote:

> One more thing to consider when choosing the language: Xcode only 
> supports graphic debugging of C / C++ / Objective-C / Java code.  As far 
> as I know, there's no way of stepping through a Python or Perl program a 
> line at a time and viewing variables.  Maybe the experts will know of a 
> tool out there that does this.

The Python debugger is called pdb.  I'm sure Perl has a debugger.  In 8
years of using Python I've never used a debugger, relying mostly on print
statements and tracebacks.

http://www.pythonmac.org/

Dave Cook



0
David
7/20/2004 5:33:42 AM
On Tue, 20 Jul 2004, David Cook wrote:
>  On 2004-07-20, Bert Sierra <bert_sierra@commspeed.net> wrote:
>  
> > One more thing to consider when choosing the language: Xcode only
> > supports graphic debugging of C / C++ / Objective-C / Java code.  As
> > far as I know, there's no way of stepping through a Python or Perl
> > program a line at a time and viewing variables.  Maybe the experts
> > will know of a tool out there that does this.
>  
>  The Python debugger is called pdb.  I'm sure Perl has a debugger.  In
>  8 years of using Python I've never used a debugger, relying mostly on
>  print statements and tracebacks.
>  
>  http://www.pythonmac.org/
>  

If you're running X11.app, ddd is a graphical interface to a variety of
debuggers.
        <http://www.gnu.org/software/ddd/>
joe
0
Joe
7/21/2004 3:34:24 PM
On Sun, 18 Jul 2004, Christopher J. Henrich wrote:
>  In article <20040718130225.10713.00000091@mb-m13.aol.com>, JonesR
>  <jonesr@aol.com> wrote:
>  
> > I occasionally become motivated to dabble in programming, just to
> > the point of getting a particular task done, and am wondering where
> > I should start. I am generally more interested in the ends rather
> > than the means.
> > 
> > I want to work with what is available with Panther on the XCode CD,
> > and am intrigued by Tigers Automator. I wouldn't mind putting a
> > minimal GUI framework on some old UNIX code.
> > 
>  Welcome.  For getting acquainted with the Xcode development tools, I
>  recommend _Cocoa Programming for the Moc IS X Second Edition_ by
>  Aaron Hillegass.  If it's at all like the first edition, it will be a
>  very friendly introduction to Xcode.
>  
>  It uses Objective-C.

It's a great book, I agree.  Given the OP's experience however, I'm not
sure Objective-C is the road to go -- he has no experience in C, and an
ages ago Pascal course is probably only going to make it harder to
learn.

I suspect Python may be a reasonable answer, though I must admit I'm
more familiar with Perl.

One must realize there are several things one needs to learn to do this
kind of programming. They're all munged together in practice, but you
may want to look at those tutorials to see what they focus on.  I'm sure
others will have a different list, but here's my initial list:

a) how to program / think about programming -- this is a skill usually
learned in conjunction with a programming language, but is actually a
different skill than knowing the language.  OP's done some of this already.

b) a programming language -- the syntax / semantics of the language --
usually easier than a).

c) the libraries associated with the language -- these are the things
that save tons of coding -- instead of inventing everything yourself,
you use other people's work.   In learning Cocoa, this is probably the
hardest part, after a).

d) the development tools.  Xcode, for instance

e) the pattern set / pattern languages that fit it all together.  This
really comes with experience -- but, particularly with Cocoa, they're
embedded in the Cocoa frameworks -- Model View Controller, for instance.

joe

0
Joe
7/21/2004 3:54:36 PM
In article <m2wu0x1iio.fsf@Jupiter.local>,
 Joe Davison <haltingNOSPAM@comcast.net> wrote:

> On Tue, 20 Jul 2004, David Cook wrote:
> >  On 2004-07-20, Bert Sierra <bert_sierra@commspeed.net> wrote:
> >  
> > > One more thing to consider when choosing the language: Xcode only
> > > supports graphic debugging of C / C++ / Objective-C / Java code.  As
> > > far as I know, there's no way of stepping through a Python or Perl
> > > program a line at a time and viewing variables.  Maybe the experts
> > > will know of a tool out there that does this.
> >  
> >  The Python debugger is called pdb.  I'm sure Perl has a debugger.  In
> >  8 years of using Python I've never used a debugger, relying mostly on
> >  print statements and tracebacks.
> >  
> >  http://www.pythonmac.org/

One can also use PyOXIDE - http://projects.gandreas.com/pyoxide

It includes a graphic debugger which steps through code, sets 
breakpoints, views local & global variables (as well as provides all the 
various editor functions including syntax hilighting, popup function 
menus, etc...)

It's also open-sourced.
0
Glenn
7/21/2004 5:36:07 PM
Reply: