maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   I want to write apps for N900. Should i learn C or C++? (https://talk.maemo.org/showthread.php?t=42482)

ChristofferC 2010-03-07 10:53

Re: I want to write apps for N900. Should i learn C or C++?
 
To learn basic programming concepts I would recommend Python. It's easy to get started with and you don't have to care about the nitty gritty details. I can wholeheartedly recommend the free book Think Python, which teaches you programming from the ground up. After you have read through and understood the contents of that book, you will know all the basics of programming. The journey of learning doesn't end there though. It takes a long time to become a decent programmer, so you have to keep at it!

If you want to write apps for the N900 I would also recommend Python. Just keep in mind that performance is an issue on small devices. Personally, I wouldn't use anything but C++ for "real" N900 apps because of CPU and memory concerns.

attila77 2010-03-07 11:14

Re: I want to write apps for N900. Should i learn C or C++?
 
Just a slight note - Python is not as slow as you might think, but it requires more 'planning' on how you do stuff if you run into speed limits. Also, what has not been mentioned here, it's fairly easy to mix C++ and Python, so you can replace the more intensive functions with C++ code, minimizing speed differences.

PS. and to correct the statement from a few posts above - PyQt apps require the same amount of root space as regular Qt apps do, no disadvantage there.

noobmonkey 2010-03-07 11:15

Re: I want to write apps for N900. Should i learn C or C++?
 
have to admit, learning from scratch PyQT has been brilliant for me, picked it up and got it working in 30 mins.... Taken a month or so to get my first app workable, havn't found any major problems yet :D

Only just started using a few ctypes, works ok :) - but again i have no knowledge in that area :D

efekt 2010-03-07 11:53

Re: I want to write apps for N900. Should i learn C or C++?
 
I find it easier to start with C and then advance into C++. I think that if you can do stuff in C, you can definitely find it easier to learn other programming languages, such as C++ or even Java (but not Assembly :)).
C is a very good basis. Making the first steps into programming with an OO language, IMHO, could be very confusing - and sometimes could even lead to acquiring some very bad programming habits.

attila77 2010-03-07 12:29

Re: I want to write apps for N900. Should i learn C or C++?
 
Quote:

Originally Posted by efekt (Post 558636)
I find it easier to start with C and then advance into C++. I think that if you can do stuff in C, you can definitely find it easier to learn other programming languages, such as C++ or even Java (but not Assembly :)).
C is a very good basis. Making the first steps into programming with an OO language, IMHO, could be very confusing - and sometimes could even lead to acquiring some very bad programming habits.

IMHO python to C++ is better on the long run. With C you're missing out on Qt which is big deal in Maemo, with python you're making future proof GUI apps in minutes. Plus, there is simply no excuse for people to futz with malloc's and char*-s in 2010. As for bad habits... plenty of those acquirable from the C world, too :)

CharlesM 2010-03-07 21:25

Re: I want to write apps for N900. Should i learn C or C++?
 
hmmm this is an interesting thread!

asking which is best c,c++,python, perl or awk is like asking a parents which of their children do they love the most.

All of these languages have their place when developing an application which is why you would really struggle to favour one over the other. In truth thats the wrong question.

what is it you are trying to do? the best apps will make best use of a mixture of lowlevel and scripting languages. This is the biggest strength of the UNIX programming operating system. This is what the founders intended.

lots can be done with shell scripting and other highlevel languages. if that suites your need then do it. Whatever you learn it will come in handy at some stage!

I can understand why everybody is raving about Qt and dont get me wrongs its all good but lots (and i mean lots ) can be done with with c and shell from the command line!

fatalsaint 2010-03-08 20:24

Re: I want to write apps for N900. Should i learn C or C++?
 
Quote:

Originally Posted by attila77 (Post 558606)
PS. and to correct the statement from a few posts above - PyQt apps require the same amount of root space as regular Qt apps do, no disadvantage there.

I'm pretty sure when I made that comment they were non-optified...

But in any case, correct: There really isn't a negative to PyQt4 apps anymore except that they *do* take a little more resources than the same app coded in C++.

On topic, I personally (opinion, not fact) still am of the mindset that critical, system apps should be C++ - and the vast majority of 3rd party or just normal "apps" would be better off being PyQt4 due to portability.

tpaixao 2010-03-08 20:36

Re: I want to write apps for N900. Should i learn C or C++?
 
I think learning C++ is the way to go. I don't think python is any easier than C++ (as an example I whipped up an app in around 4 hours, starting from scratch, knowing nothing about Qt ). And C/C++ gets you skills that are more marketable than python. Knowing C++ gets you almost all the other languages (except esoteric stuff like LISP and what not) almost for free.

Plus, I really hate the way you have to get the indentation right with python. I know the code gets pretty and so on, I'm pretty sure it's excellent, but seems to me that spending time checking whether those spaces are really spaces or tabs really bugs me (especially when you are moving between different OSes)

fnordianslip 2010-03-08 20:46

Re: I want to write apps for N900. Should i learn C or C++?
 
I much prefer C++ over C, and I prefer Python over Perl. I guess that is a case of whether you want object orientation or not, and I certainly do. When I'm writing C++ and need to use a C API, the first thing I do is wrap an OO abstraction around it.

There's a huge difference in the development philosophy/methodology with OO. I'm so used to that mindset that I don't think I could deliver anything but a trivial project in C anymore, in fact I probably couldn't even get it to compile.

If i was you I'd go for some C++ and Python. The concepts you will use are similar in both and OO code seems so much easier to understand than its non-OO counterpart.

IsaacDFP 2010-03-08 21:50

Re: I want to write apps for N900. Should i learn C or C++?
 
Just out of curiousity, im not a programmer/developper at all, but all the talk here i've seen mostly only concerns the N900... I am interrested in learning to read the language, not necessary to write an app, but to understand the scripts that i am installing/running on my device. But I don't wanna start learning something that will become irrelevant in the future. What about MeeGo? Is C++ and Python writing still gonna be the exact same thing to MeeGo as writing to Maemo? What would you suggest to start getting ready on the future MeeGo platform?


All times are GMT. The time now is 23:49.

vBulletin® Version 3.8.8