Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
paul2020
Posts: 11
Registered: ‎07-22-2011
My Device: PlayBook with Torch 9810 - Love the Torch !!!
My Carrier: Rogers
Accepted Solution

C++ or Cascades or HTML5 for BB10

Hi Everyone,

 

I am new to BB development and although I have done some VB work and some HTML work, I am a bit stuck on which direction to follow.  The application I want to develop is a business application with a decent amount of business logic going on in the background.   Since I am not developing a game that requires super fast processing speed nor lots of custom screens, I was thinking of using the Cascades system.  Am I right? Or should I be developing in C++ (which I don't currently know).

 

I also have seen somewhere that there is a VB plug-in for BB10?  Is this a suitable path to follow - develop in VB which I already know?

 

C++

Cascades

VB

 

Any thoughts on the pro's and con's of each approach would be appreciated.

 

Thanks,

Paul

Please use plain text.
New Developer
gooslap
Posts: 2
Registered: ‎05-15-2012
My Device: Blackberry Playbook
My Carrier: T-Mobile

Re: C++ or Cascades or HTML5 for BB10

Hi Paul,

 

Learning to use C++ will take some time. Reading books and experimenting using the BB10 native sdk will be pretty awesome though if you choose that path. C++ has a lot of features, and you surely won't need them all, but it can be overwhelming. The benefit to using C++ is you get the greatest amount of power and flexibility.

 

Given your current experience level, you might want to learn Javascript so you can do HTML 5 or QML + Javascript. Check out the link below which has more information. 

 

https://bdsc.webapps.blackberry.com/cascades/documentation/ui/javascript/index.html

 

If you do decide to learn Javascript, I recommend the book "Javascript: The Good Parts" by Douglas Crockford.

 

 

The reason I would stay away from VB is that even if it's possible to use it via some plugin, VB is not directly supported by RIM. You can also use Javascript for web development as well.

 

 

Regards,

Mason

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: C++ or Cascades or HTML5 for BB10


paul2020 wrote:
The application I want to develop is a business application with a decent amount of business logic going on in the background.   Since I am not developing a game that requires super fast processing speed nor lots of custom screens, I was thinking of using the Cascades system.  Am I right? Or should I be developing in C++ (which I don't currently know).

 

I also have seen somewhere that there is a VB plug-in for BB10?  Is this a suitable path to follow - develop in VB which I already know?

 

C++

Cascades

VB


I think it comes down to what "decent amount of business logic" really means.  To some people that might mean a few hundred lines of simple, procedural non-GUI code and a simple persistence mechanism.  To others it might mean tens of thousands of lines of sophisticated object-oriented code, a SQL database, and possibly network connections to web services.

 

VB, if by that you mean Visual BASIC, is not an option.  The plugin you heard about is probably the Visual Studio pluin, which is in beta testing right now, and which will merely allow you to write C++ (and Cascades? not sure) programs using that IDE.

 

If you don't know C++ already, and you business logic is more than a few hundred lines, then you might be cautious getting into it. Depending on your background, it's either a perfectly suitable language, or an overly complicated and dangerous one. It's not a modern dynamic language which manages memory for you, and it can be difficult to debug, including the risk of crashes through pointer errors in the code.

 

On the other hand, for complex logic, Javascript is possibly not the best option either, though obviously very complex systems have been written in it. As a dynamic language, it doesn't give you the benefit of the static type checking a compiler provides, so a whole different class of errors is possible.

 

Cascades probably implies QML in this context, which means you could use Javascript for the non-GUI portions. The GUI stuff is in QML, a declarative language that feels slightly CSS-ish. It is possible to write interesting business apps with a combination of QML and Javascript, with minimal C++ beyond the boilerplate code you need to launch the QML stuff.

 

You didn't mention HTML, but that's certainly an option for BB10 as well, with Javascript for the code and the bbUI.js package recently created to emulate much of the look of Cascades.

 

There are also other options possible, depending on your background, including Lua (there's a port on the BB Github pages), and Python (there's a Python 3.2 interpreter in the PlayBook, though it's officially unsupported in any fashion and thus potentially subject to removal in any update).

 

What's best? That depends on you and things you haven't described yet aside from your inexperience with C++. I can at least eliminate one option, which would be using the NDK and "pure C++" without either Cascades or WebWorks... pure C++ would have no advantages whatsoever for you here, given the lack of UI frameworks for it.

 

What's your own background (range, duration) in programming languages, and styles of programming (e.g. OOP, etc)?  How concerned are you about, say, automated testing, third-party libraries, debugging support?  What about maintainability of the code?  Do you see this app evolving continuously and getting more complex than you envision it initially? And what about other apps? Is this likely a one-time thing for you, or the start of a new career?

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
paul2020
Posts: 11
Registered: ‎07-22-2011
My Device: PlayBook with Torch 9810 - Love the Torch !!!
My Carrier: Rogers

Re: C++ or Cascades or HTML5 for BB10

I see the app developing over time and increasing in complexity.  Definitely sql right off the bat.  Probably several hundred lines of logic but moving to several thousand lines of logic in short order (months).  Also, I want to interface with a desk top application down the road.  Right now it has to run on the Playbook and BB10 and it would be nice (but not necessary) to have it run on OS7 since this is the phone I have right now.  I also have a PlayBook as well.  I don't want to paint myself in a corner where my app is limited due to the programming approach.

Please use plain text.
Developer
BryceMcMurter
Posts: 32
Registered: ‎05-21-2012
My Device: Bold 9900 & Playbook
My Carrier: Telus

Re: C++ or Cascades or HTML5 for BB10

[ Edited ]

LOL the site double posted my comment see below 

Please use plain text.
Developer
BryceMcMurter
Posts: 32
Registered: ‎05-21-2012
My Device: Bold 9900 & Playbook
My Carrier: Telus

Re: C++ or Cascades or HTML5 for BB10

Hey Paul,

 

I too found myself standing at this same crossroads trying to decide between HTML5, QML, and C++.

 

HTML5 is definitely one of the easier languages to learn and there are lots of code tidbits that you can take instead of having to reinvent the wheel. HTML5 also offers easy portability to other platforms should you decide to expand your market. The downfall to HTML5 (at least to me) was having to deal with JavaScript for all of my non GUI related code blocks.

 

QML seems to be a quite interesting. I have taken a few days to review some of the tutorials on the blackberry dev site and I have to say that it is quite easy to develop some really beautiful GUI's. Again, the downfall for me was JavaScript and the fact that portability is a concern. 

 

lastly I took a look at the C++ tutorials on the blackberry dev site. I can see how looking at the C++ implementation of cascades (or any program for that matter) can look quite daunting. I guess it all depends on your aptitude for learning. If your the kind of person that picks up topics quickly you might be able to pickup a decent C++ programming book and be off to the races. The tutorials on the site are quite good and offer a basic understanding the cascades API (and don't forget all the people willing to help here on the forums.) 

 

Personally I decided to go the C++ route as I have a Computer Science degree and have previous C++ experience but I think that C++ is definitely the way to go as it offers more flexibility then the other options. Just make sure that you get some training under your belt as C++ can be unforgiving sometimes.

 

I suggest trying out all of the options. Take some time to try all the tutorials for each language to see which one works for you. After exploring all your options your decision will be much easier.

 

Hope this helps! 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: C++ or Cascades or HTML5 for BB10

paul2020, it sounds like the WebWorks approach may work best for you, at least to start with.  It will let you handle the BB phone with much the same code base.

 

If you structure the code cleanly, with business logic strictly separate from UI, then you could migrate to Cascades using QML for the UI and possibly with some of that Javascript code kept intact.

 

For the size of the app, I'm not sure you would need to do much on the C++ front initially, so you could defer that learning curve until a later day. Given how much else there is to learn here, that may be best.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
paul2020
Posts: 11
Registered: ‎07-22-2011
My Device: PlayBook with Torch 9810 - Love the Torch !!!
My Carrier: Rogers

Re: C++ or Cascades or HTML5 for BB10

Hi Peter,

 

I agree.  This is the direction I am going to take - Webworks is the way to go.  Thanks everyone for their input.

 

Paul

Please use plain text.