|
|
| Author |
Message |
| JonnyFoxtrot |
This post is not being displayed .
|
 JonnyFoxtrot Trackday Trickster

Joined: 01 Jan 2009 Karma :    
|
 Posted: 14:48 - 12 Apr 2012 Post subject: Learning Programming (C/C++) |
 |
|
Properly, properly nerdy I know but is it possible to learn the above during my spare time? And more so, is it worth it?
I've started getting a bit into Linux (only GUI based stuff to be fair) recently and am also quite clued up on what goes on in the Android phone community (XDA etc) however I want to actually start to get involved and therefore want to learn a programming language. As I understand it, nearly everything nowadays is written in, based on or has some part of C/C++ used.
I'm pretty much a complete noob when it comes to programming or code based environments other than the odd DOS command prompt work I sometimes do at my job or the couple of years of Computing I did at college (long forgotten) where we dabbled with VB. Is it something I could feasibly learn using online free tutorials in my spare time, i.e the couple of hours before falling asleep where the gf is dozing off and I'm on the lappy in bed?
I'm not planning on pursuing a career in it, but it would be nice to understand some of the work serious devs or forum users put into the work I see on various linux distros or xda custom roms. Hell, it would even be nice to contribute if I was to be any good at it.
Worth pursuing? Or shall I just walk away now? Should I consider something else to start with? Go back to VB or Java maybe?
Ta  ____________________ '89 Honda NS125F (SOLD) -> '92 Suzuki GS500E (SOLD) -> '03 Kawasaki ZX6R B1H (SOLD) -> '96 VFR 750 RC36 (SOLD) -> '02 Honda CBR1100XX Blackbird |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| nowhere.elysium |
This post is not being displayed .
|
 nowhere.elysium The Pork Lord

Joined: 02 Mar 2009 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| daemonoid |
This post is not being displayed .
|
 daemonoid World Chat Champion

Joined: 27 Jun 2008 Karma :    
|
 Posted: 15:12 - 12 Apr 2012 Post subject: |
 |
|
The android sdk (Software Development Kit) is for java. So either start there or if you are totally new take a look at:
https://code.google.com/p/android-scripting/
Then use Python. Python is a very good language for beginners, it teaches the basics and is highly structured which enforces good programming practices that will benefit you in the long run. One tip before you start in Python though is there's a big difference between a tab and a bunch of spaces!
<edit> C++ is beginning to go out of fashion, it will be used for the foreseeable future, but other languages are beginning to replace it. The main reason is that the development cycle becomes cheaper with higher level languages. A simple switch from C++ to C# means much less time spent managing memory (and I've seen memory issues add months to projects). C is pretty much gone... I've not actually heard of anyone starting a (decent sized) project in C in the past 10 years. C tends to be used only on legacy systems. ____________________ current: ducati monster 750
past: hyosung gt250r, bajaj pulsar 180, hyosung gt 125 comet
@thomasgarrard | www.straitjkt.com | www.racingseven.com
Last edited by daemonoid on 15:20 - 12 Apr 2012; edited 1 time in total |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| nowhere.elysium |
This post is not being displayed .
|
 nowhere.elysium The Pork Lord

Joined: 02 Mar 2009 Karma :    
|
 Posted: 15:18 - 12 Apr 2012 Post subject: |
 |
|
Yeah - most structured languages will have you looking suspiciously at any whitespace before too long
Of course, if you're like me, then you'll find Perl nice to work with. No structure at all, and you can even turn what little self-regulation there is off at the beginning of the program.
It's kind like programming on post-its. You get very used to terse, incomprehensible statements, which you'll never be able to pick apart again. ____________________ '10 SV650SF, '83 GS650GT (it lives!), Questionable DIY dash project, 3D Printer project, Lasercutter project |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| daemonoid |
This post is not being displayed .
|
 daemonoid World Chat Champion

Joined: 27 Jun 2008 Karma :    
|
 Posted: 15:25 - 12 Apr 2012 Post subject: |
 |
|
| nowhere.elysium wrote: | Yeah - most structured languages will have you looking suspiciously at any whitespace before too long
Of course, if you're like me, then you'll find Perl nice to work with. No structure at all, and you can even turn what little self-regulation there is off at the beginning of the program.
It's kind like programming on post-its. You get very used to terse, incomprehensible statements, which you'll never be able to pick apart again. |
I hate perl. I couldn't sit down and write in it, but I have been tasked with debugging it a few times. It has 3 ways to do anything, none of which work quite how you'd expect. It's a mess of a language that produces messy unmaintainable code.
On one occasion I threw in the towel and just rewrote the script from scratch in Python. If I'd done it in the first place it would've saved me 2 days.
Also, not really a fan of lua, it kinda has an identity crisis - it's never sure whether it's OO or not. ____________________ current: ducati monster 750
past: hyosung gt250r, bajaj pulsar 180, hyosung gt 125 comet
@thomasgarrard | www.straitjkt.com | www.racingseven.com |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Rogerborg |
This post is not being displayed .
|
 Rogerborg nimbA

Joined: 26 Oct 2010 Karma :    
|
 Posted: 15:34 - 12 Apr 2012 Post subject: |
 |
|
Pick an open source project that interests you and which has simple, crystal clear instructions on how to download and build it on your development platform.
Do that. In a couple of days when you realise that the instructions are several versions out of date, and never really worked anyway, switch to another project.
Rinse and repeat until you find something that you can actually build and run yourself.
Choose one thing to change, even if it's just the colour on a menu.
Recompile and see the results of your change.
Toss a celebratory one off the wrist - you've just taken your first step into a larger universe. ____________________ Biking is 1/20th as dangerous as horse riding.
GONE: HN125-8, LF-250B, GPz 305, GPZ 500S, Burgman 400 // RIDING: F650GS (800 twin), Royal Enfield Bullet Electra 500 AVL, Ninja 250R because racebike
Last edited by Rogerborg on 21:32 - 12 Apr 2012; edited 1 time in total |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| nowhere.elysium |
This post is not being displayed .
|
 nowhere.elysium The Pork Lord

Joined: 02 Mar 2009 Karma :    
|
 Posted: 17:07 - 12 Apr 2012 Post subject: |
 |
|
If you want to play with something that feels like a proper language, and doesn't require three sides of A4 just to render something GUI-flavoured, try playing around with Processing.
C++-style syntax, prebuilt graphical functions, masses of support, and it's a really nice and simple sandbox environment to play around in. ____________________ '10 SV650SF, '83 GS650GT (it lives!), Questionable DIY dash project, 3D Printer project, Lasercutter project |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| el_oso |
This post is not being displayed .
|
 el_oso World Chat Champion

Joined: 17 May 2008 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Andy_Pagin |
This post is not being displayed .
|
 Andy_Pagin World Chat Champion

Joined: 08 Nov 2010 Karma :    
|
 Posted: 17:46 - 12 Apr 2012 Post subject: |
 |
|
Best learn to walk before you try to run, this site has a decent tutorial and a useful reference to the C/C++ libraries.
https://www.cplusplus.com/
On Linux you'll need gcc and g++ compilers and a IDE, I use Code::Blocks https://www.codeblocks.org/. Getting it all set up is a bit of a headache, but it works well. ____________________ They're coming to take me away, ho-ho, hee-hee, ha-haaa, hey-hey,
the men in white coats are coming to take me away.
Yamaha Vity -> YBR125 -> FZS600 Fazer -> FZ1-S Fazer |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| daemonoid |
This post is not being displayed .
|
 daemonoid World Chat Champion

Joined: 27 Jun 2008 Karma :    
|
 Posted: 20:03 - 12 Apr 2012 Post subject: |
 |
|
To those worried about how hard it is to set up an environment on windows, just download and install visual studio express - https://www.microsoft.com/express
I'd reiterate that C++ is not where a beginner should start. C# is ok, but as the OP wants to work on android java or one of the scripting languages is the only way to go. ____________________ current: ducati monster 750
past: hyosung gt250r, bajaj pulsar 180, hyosung gt 125 comet
@thomasgarrard | www.straitjkt.com | www.racingseven.com |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Frost |
This post is not being displayed .
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Bomberman |
This post is not being displayed .
|
 Bomberman World Chat Champion

Joined: 17 Aug 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Codemonkey |
This post is not being displayed .
|
 Codemonkey Crazy Courier

Joined: 18 Oct 2009 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| daemonoid |
This post is not being displayed .
|
 daemonoid World Chat Champion

Joined: 27 Jun 2008 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| JonnyFoxtrot |
This post is not being displayed .
|
 JonnyFoxtrot Trackday Trickster

Joined: 01 Jan 2009 Karma :    
|
 Posted: 11:46 - 13 Apr 2012 Post subject: |
 |
|
Thanks all for the replies, top notch as always
Think I'm going to give Python a go as a few on here and elsewhere have recommended and then possibly step into the realms of Java once I'm confident with Python. Cheers!!  ____________________ '89 Honda NS125F (SOLD) -> '92 Suzuki GS500E (SOLD) -> '03 Kawasaki ZX6R B1H (SOLD) -> '96 VFR 750 RC36 (SOLD) -> '02 Honda CBR1100XX Blackbird |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Frost |
This post is not being displayed .
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Rogerborg |
This post is not being displayed .
|
 Rogerborg nimbA

Joined: 26 Oct 2010 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| supZ |
This post is not being displayed .
|
 supZ World Chat Champion

Joined: 03 Feb 2009 Karma :   
|
 Posted: 15:29 - 24 Apr 2012 Post subject: |
 |
|
if you want to learn a language id recommend C#/.net
its 'the thing to do' these days
if you hate bill gates and all microsoft related products you can give php a go if you wish (v5+ for OO)
C#.net will set you up for any little projects you want to do. be they windows programs to websites. its a modern language as well so plenty of support and info out there.
to answer your question though.. yes its reasonable to learn it yourself. when i first got into coding i learnt classic asp/php/javascript/sql etc.. on my own. years later i've developed 100s of programs/sites/apps in those languages.
most of my current job is still classic asp working on legacy applications but im currently doing a .net (C#) project that'll turn into the updated version of these apps.
i have done visual studio 2010 and c# courses paid for by work so i cant really say thats self taught although i did write an ajax powered chat program before as a play around heh.
a good idea is to think of something you'd like to do. an app/website or something and start learning with that in mind. if you have a clear idea of what you want to do you'll be more inclined to stick at it than just with fiddling about doing examples. ____________________ CBR954RR - Daily toy
CBR600RR - Trackbike |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| LordShaftesbu... |
This post is not being displayed .
|
 LordShaftesbu... World Chat Champion

Joined: 03 Sep 2008 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| el_oso |
This post is not being displayed .
|
 el_oso World Chat Champion

Joined: 17 May 2008 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| _Chris_ |
This post is not being displayed .
|
 _Chris_ Nitrous Nuisance

Joined: 25 Apr 2011 Karma :     
|
 Posted: 18:01 - 24 Apr 2012 Post subject: |
 |
|
It really depends on what you hope to be able to do.
1 - Programming Applications - e.g. a simple calculator
2 - Scripting - automating a series of tasks
Either way, the most important thing to learn is logical structures. Once you decide what you want to achieve, write it out like a recipe (it's called pseudocode), then you can use that base for whichever programming/scripting language you like.
e.g, For me, I have to automate tasks against many remote PCs. So to put a file on each PC, the pseudocode may look like:
1 - Define a list of target PCs I want to interact with
2 - Check each one is online (no point trying to send a file to a switched off box)
3 - Perform the action on the online workstation - send the file
That's a pretty typical job, I'd add some logging in there so I have a record of what PCs were successful.
Personally I use powershell for these things as it's quick and easy, code would be something like:
1 - Define a list of target PCs I want to interact with
$targetPCs = get-content c:\workstations.txt
2 - Check each one is online (no point trying to send a file to a switched off box)
foreach ($entry in $targetPCs)
{$onlinecheck = test-connection $entry -count 1 -quiet
3 - Perform the action on the online workstation - send the file
if($onlinecheck){copy-item c:\requiredfile.txt \\$entry\c$}
}
Regardless of what you want language you want to learn, if you can't break down a problem into its component parts then you'll really struggle. Try writing pseudocode for typical math formulas - Pythagoras' Theory is an easy one to start with. Once you have the list of steps that need to happen, you can 'translate' them into a language - most people know more than one language and use the one most suitable to the task at hand. For example if I have to distribute something to a user, I can't use powershell as they don't have it installed, so I'll have to use VisualBasicScript or similar.
Basically, yes, you can teach yourself, you just need to know what your goal is. ____________________ Just getting started |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| LordShaftesbu... |
This post is not being displayed .
|
 LordShaftesbu... World Chat Champion

Joined: 03 Sep 2008 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Rogerborg |
This post is not being displayed .
|
 Rogerborg nimbA

Joined: 26 Oct 2010 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| tbourner |
This post is not being displayed .
|
 tbourner World Chat Champion

Joined: 17 Mar 2012 Karma :   
|
 Posted: 08:19 - 25 Apr 2012 Post subject: |
 |
|
I need to get back onto that, I did the first 5 or 6 weeks then stopped. Was very good though if a little badly programmed in places (how ironic). ____________________ Trev, now a biker?
Looking for first big bike. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| bazza |
This post is not being displayed .
|
 bazza World Chat Champion
Joined: 27 Aug 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
Old Thread Alert!
The last post was made 13 years, 286 days ago. Instead of replying here, would creating a new thread be more useful? |
 |
|
|