views:

877

answers:

7

Good afternoon. I am a user experience designer, proficient in XHTML and CSS. I have dabbled with some PHP and JavaScript but by no means am I comfortable with them.

My main goal is to develop OS X and iPhone software. I have been given advice on those topics, but in I am struggling with Object Oriented programming.

Books that I have regarding Mac development include: Cocoa Programming for Mac OS X 3rd Edition - Aaron Hillegass, Programming in Objective-C 2.0 - Stephen Kochan, The Object-Oriented Thought Process -Matt Weisfeld

In short I feel like I do not have enough experience with programming to tackle this at the moment, so I would like to direct my learning towards a web technology. I have read a bit on the differences between Ruby on Rails and PHP. My question is, which will be more beneficial towards my end goal? Ruby on Rails is initially object oriented, where as PHP is not.

I have video courses for both, which would you recommend that I begin with? Perhaps I am going about this the wrong way? What do you think?

Apologies if this post is inane or doubled, I'm stuck.

UPDATE I have been following a PHP course all week. Concepts appear to be very clear to me now. During the middle of this coming week I plan to begin the OOP chapters of the video training. I'm quite happy with what I will be able to pursue with this new found knowledge in terms of web application development.

In regards to Objective-C, I know that it is recommended to learn C prior to pursuing Objective-C. Before I continue with Aaron Hillegass's book, should I take a dive a C? Learn C, is this optimal for a newb, or would you experienced developers rather see a beginner tackle a book? Should I forget about C all together and learn OOP with PHP as stated above and move straight into Objective-C?

+1  A: 

Don't despair! Your experience with Javascript/CSS is sufficient to make iPhone apps. Check out jQTouch. It's a JQuery plugin that allows you to create a touch-screen-friendly mobile webapp using Javascript. I have to stress that jQTouch creates a web app, and not a native app. The downside is that you don't have access to all the APIs that a native app would have. The upside is that jQTouch web apps work accross all phones with webkit-based browsers (iPhone, iTouch, Android devices, etc). In terms of UI, JQTouch does a very good job maintaining the look, feel, and navigation of native iPhone apps.

mdemmitt
+2  A: 

Part of the trouble with understanding Object Oriented programming is not so much grasping the concept of objects and classes, but how these are to be used effectively. The best strategies are outlined in the Design Patterns book. While this reference is fairly technical, it is very thorough and details how to approach many common situations from a strategic software-design standpoint.

You can see that this kind of approach was fully embraced in the Apple iPhone SDK, a framework largely built upon the work done at NeXT.

Although Ruby, and especially Ruby on Rails are not as strongly biased towards the design patterns conventions, the same principles can be applied.

If you're up for a challenge, it is a very useful reference book.

For a new developer there are many advantages to Ruby over Objective-C. Being interpreted, it is very hard to crash Ruby because of a simple mistake, and the interactive command line is a powerful tool for quick experimentation. On the other hand, the debugging abilities of Ruby are severely limited to the Objective-C and XCode environment. Ruby on Rails in particular suffers from incomplete documentation and a sprawling feature set that is not always organized very well.

Objective-C is not especially hard to learn, but the complete SDK is enormous. The good news is it is extremely well documented and there are many video tutorials and code samples. I would say it is more challenging to absorb enough to be an effective iPhone developer, but you may find that to be more rewarding.

The good news is that both are well supported by their respective communities and on places like Stack Overflow.

Ultimately, I would look at the kinds of projects you are intending to try out and see which platform is the best suited.

tadman
Thank you for your post. To clarify I have interest in creating web applications as well, RoR vs PHP is just something I am trying to decide between for future OS X dev.I will definitely check out the book you recommended.
twinbornJoint
You shouldn't compare RoR with PHP. RoR is a Ruby framework whereas PHP is a programming language. For that matter you should compare Ruby with PHP or RoR with Zend Framework/CakePHP/Any of the other dozen PHP MVC frameworks.
Htbaa
It's valid to compare PHP to Ruby on Rails directly since those are both platforms people commonly use to develop applications. PHP is both a web development framework like ERB and a language, whereas Ruby is just a language.
tadman
You're missing the point. There's a big difference between them. RoR is a framework, PHP isn't.
Htbaa
Regardless of what the technical difference is, people want to develop web applications, and two options for achieving that goal are using PHP or Ruby on Rails. They are comparable in that they achieve the desired result.To say "PHP is a language" is like saying trucks and cars are different, but if all you want to do is go somewhere, they will both get you there.See also: http://en.wiktionary.org/wiki/pedantic
tadman
@tadman It is not pedantry. Your analogy is flawed. If Ruby on Rails is a Truck, then PHP is a drivetrain. You can't very well compare the two without adding a frame and controls to PHP. The point is if you want to compare Ruby on Rails to PHP, you should compare it to a full PHP framework like Zend/CakePHP etc.
ghoppe
The only reason to be so fussy is if you want a "fair" comparison, but a comparison can be made regardless. PHP can be used, by itself, to build a web app, and it was expressly designed for this job. Ruby is just a language, so there is a considerable amount of work involved in even getting it to "speak web" enough to render a single page, not unlike how difficult Perl is without the CGI module. Ruby, Perl, Python, and most other languages are just that. Coldfusion and PHP are more.
tadman
Thank you everyone, I see clearly how the two are different.
twinbornJoint
A: 

So I have heard that Ruby on Rails would not be optimal because it is easy for a beginner to confuse the language with the framework. Also, PHP is not optimal because it does not force you to program with object orientation and lacks certain features. Is there anything more to it?

twinbornJoint
You're already mixing the language and the framework as Ruby on Rails is a framework and not a language while PHP is a language.
Tomas Markauskas
I meant the ruby language.
twinbornJoint
+1  A: 

While PHP and Ruby are both interesting languages to get to know and would be good skills to have in your UI designer career, I'd really encourage you to just start tinkering a little with Objective-C. I think starting with some small examples and experimenting a little, you'd soon become comfortable with the language and have the confidence to branch out.

You say you don't have the experience in programming to get to grip with Objective-C; well, now's your chance to learn some really nice stuff with a real goal in sight. There's obviously a learning curve here, but there most certainly will be with Ruby and PHP too, so you can maybe proceed in a more direct fashion by going straight for Objective-C.

I've read the Hillegass book and it's a fine text but I'm not sure if it's quite right as a beginning point. Have you had a look at Scott Stevenson's tutorial? That might be a good place if you do decide to go the ObjC way. I also think once you see how object oriented programming works in practice, you'll soon get the theory behind it.

acju
A: 

It's noteworthy that the Macruby compiler exists and can create native-compiled Cocoa applications for Mac OS X. The iPhone is not currently supported, but it could serve as a bridge.

Zak
+2  A: 

If you already have a basic knowledge of Javascript, you should continue in this direction rather than picking up a totally different language like Ruby or PHP. Javascript has a lot more in common with Objective-C in how it's used than RoR or PHP.

Server-side languages run small programs from start to finish in a split second, whereas Javascript or Objective-C programs run for an indefinite amount of time. Both types of programs require a different mindset, and object oriented programming makes a lot more sense when you actually have a bunch of objects that interact with each other over time and that the user can interact with. Objects in PHP are mainly a way to organize code, they don't teach you a lot about object interaction.

Since there's going to be a learning curve no matter what, you may as well dive right into Objective-C, but learning Javascript first is the next best thing if you really don't want to. Since you can play around with it in your browser's console it offers a great interactive way to learn. The problem with Javascript is the lack of good material, but Crockford and the Mozilla Reference are probably the best places to start.

Programming in Javascript usually means manipulating a browser's DOM, which is another concept you'd have to learn. It also means having to deal with browser quirks, which is best dealt with by using a Javascript framework/library like jQuery, MooTools or Prototype, which is yet another technology.
To avoid these additional learning curves, you can use Javascript in a bunch of other scenarios, including desktop widgets/gadgets. These work a lot like mini-Cocoa apps in terms of user interaction and might be a good starting point.

deceze
+1  A: 

About C

you will not need pure C, unless you are really doing some cutting edge high performance calculation. The Cocoa framework provides solution to many of the common tasks you will face, or at least sufficient tools to build such solutions, without diving into the rough world of low level C. As powerful and fast C might be, it is a very unsafe language, that'll make you write tons of code and spend a lot of time debugging.


as others stated, RoR is a framework and PHP is a language. So let me first say something about Ruby, JavaScript, PHP.

Ruby

Ruby is a wonderful language. Of those mentioned, it is the one that is closest to Objective-C. Like Objective-C, it uses the model of message passing for method calls. There's a wonderful introduction to Ruby online. I read it in a few days and loved it. Unfortunately Ruby is quite slow, and not very easy to deploy.

PHP

well ... PHP. the advantages: PHP is extremely easy to deploy, which is probably the reason of its success. It has a large and active community that has built up a vast ecosystem. And PHP is very forgiving, so it doesn't require a lot of experience to use it.

You probably sense, there must be a "but". Well, instead of going into details, I'd like to quote a friend of mine, who does an awful lot of PHP: "PHP is the rotten flesh among programming languages".

PHP, like every languages, has flaws. But PHP has them to the point, where it invites a behaviour, that has been coined as "PHP bashing" by PHP supporters. This is something that appears quite often, i.e. each time when someone puts to discussion whether PHP is good. Generally, PHP programmers will take side for PHP (which is a reasonable behaviour, assuming that you thoroughly considered your options before choosing your language), and most programmers who know PHP and an alternative, will complain a lot about PHP. I want to avoid this, since you can find enough on that topic on google. >This< question deals with the subject in a pleasant and polite way. It doesn't cover the whole subject.

The point I want to make is, that you shouldn't use PHP because you think, it'll help you evolve as progammer, or because you think it's a good language. If you choose PHP, you should do so for strategic reasons. And you should use a proper framework, such as symfony or flow3. Just keep in mind, PHP offers nothing, you can't find in plenty of other languages.

JavaScript

JavaScript is a beautiful language as well. It is not very far from Ruby. It's object orientation is not as strong as Ruby's, however it is much more suitable for functional approaches, since Ruby is a little inconsistent with high order functions, having several non-interchangable versions of them, that all work a little different. JavaScript is forgiving as well, but maybe more than it should be. Right now and for the foreseable future, JavaScript is very hip, and it's used in more and more areas. With HTML5, CSS3 and WebGL, one will be able to create great apps using JavaScript. However, you'll always have to deal with cross-browser quirks. Also, you're likely to find out that JavaScript has other limitations


Of these three, I believe Ruby to be the most elegant and powerful language. If you want to evolve as a programmer, this of all three is the best choice.

haXe

I'd like to propose my own candidate though: haXe. it is an open source language, that is still relatively young and evolving very fast. It is cross-plattform, and can be compiled to many different platforms. Unlike any of the proposed languages (including Objective-C), haXe is built around a very strong type system, which proves to be unobstructive but very supporting. You can output PHP with haXe, so basically you can deploy haXe easily. You can also output JavaScript. I personally use it to target the Flash Player. You can use one single language for a sheer multitude of things. If you do choose this language, then don't hesitate to join the community. Preferably the mailing list or the IRC channel.

well, I hope this helped ... :)

greetz

back2dos

back2dos