Learning a programming language

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

I know PHP well enough and it's for the web, but what programming language should I start learning for desktop programming? C, C++, VB or what others are there that I could learn?

Java and C(#|++) seem to be common contenders

Does Java have better multi-platform support then C(#|++)?

The most important thing to me at the moment (that I can think of) is multi-platform support (Windows, Android, *nix, MacOS)...
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

It looks like you're best bet is Java if you want anything to do with Android.

Other than that, I'd say C/C++.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Any good tutorials online and books for Java and C/C++ (which one would be better though?).

I got the JDK and NetBeans IDE 7.4 for Java, is that a step in the right direction?

What compiler should I use for C/C++? Preferably a free one right now as I don't have any money to buy any paid ones. I'm thinking I'll start off with C/C++ first before going to Java.

Isn't C newer then C++, therefore better? Or is that a misconception that newer = better? Or are they better for different purposes?

Does JDK 7 come with the Java compiler?
  • techker
  • Novice
  • Novice
  • User avatar
  • Posts: 26

Post 3+ Months Ago

look on Udemy,they often have major discounts on courses..they are really good..
  • Nightslyr
  • Proficient
  • Proficient
  • Nightslyr
  • Posts: 283

Post 3+ Months Ago

C++ is newer than C (you know the post-increment operator? $i++? yeah, that's why C++ is named the way it is). It's not 'better' than C, but rather aimed at doing different things.

C is really used for code that has to run close to the metal. Think operating systems. The Linux kernel is written and maintained in C. C++ is for application development. OOP, that sort of thing.

Java is a different beast altogether. It's a managed memory OOP language that runs on a virtual machine. Unfortunately, since Oracle bought it, it's largely been stagnating.

C# started off as Microsoft's answer to Java, but has really surpassed it in terms of features (a dash of functional programming (lambdas and whatnot), LINQ, better generics, etc.). The only problem there is that, while Microsoft has made it open source, and there's a Linux compiler, most of the use cases are on the Microsoft stack, so you'll be limited. Which is a shame, because C# really is a nice language.

To sum up, if you want to do desktop applications, C++. Mobile devices will be Java for Android and Objective-C (which really isn't C at all) for iOS. Microsoft-specific stuff, C#.

Forget you ever heard of VB. It's horrendous in terms of syntax. If you ever need to do anything in .NET, go C# or go home. I'm not kidding. Microsoft has largely (quietly) slowed support for VB as the years have gone by. It's still the go-to language for a lot of legacy systems, but... ugh, it's just horrible to read and write.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Thanks Nightslyr, if I could +1 that post I would. That was really helpful!! Going from what I read in your post I want to learn C++ for desktop applications, but Java is mainly for Android development, right?

Also, what books/tutorials that I could use to start learning C++ and possibly Java (for Android development), but I want to put most of my energy on C++
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

C++ is great, but having a basic grasp of C first will help you in the long run, IMO. You should be comfortable working with native types, pointers, and memory manipulation before you start using libraries that handle most of that for you.

@Nightslyr: Have you checked out Mono? It's an open-source .NET implementation and it's fairly mature; the feature gap between Mono and Microsoft's .NET implementation is pretty thin.
  • Nightslyr
  • Proficient
  • Proficient
  • Nightslyr
  • Posts: 283

Post 3+ Months Ago

@Spork, yeah, Mono is pretty great. The biggest issue is that there's still this perception that traditional open source languages (PHP, Python, Ruby, etc.) = *nix stack, while Microsoft languages = Microsoft stack. So, while it's definitely possible to use C#/.NET on linux, good luck finding a team or project that actually does it.
  • Nightslyr
  • Proficient
  • Proficient
  • Nightslyr
  • Posts: 283

Post 3+ Months Ago

Bogey wrote:
Thanks Nightslyr, if I could +1 that post I would. That was really helpful!! Going from what I read in your post I want to learn C++ for desktop applications, but Java is mainly for Android development, right?

Also, what books/tutorials that I could use to start learning C++ and possibly Java (for Android development), but I want to put most of my energy on C++


Java does have its uses in other areas outside of Android. A lot of devices use it to talk to one another, and it's fairly ubiquitous in intranets (you're basically Java or .NET there). That said, the hotness is definitely Android. That's where the growth is/going to be.

I learned what little C++ I know at UNH 15+ years ago, and from a couple of other books. The "Thinking in C++" books are good, if dated. They can teach you the underpinnings of the language, and is a pretty good place to go to work on pointer notation vs. addresses. There's cplusplus.com/org?, too.

If you're still on the fence on what language to learn, try to think about what you really want to do as you grow as a developer. There's usually a go-to language or two that the industry uses for each task.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Well, at the moment, I'm thinking about writing a program that deals with images, video and audio. Would C++ be good for such project?
  • Poly
  • Guru
  • Guru
  • User avatar
  • Posts: 1091
  • Loc: Same place you left me.

Post 3+ Months Ago

Bogey wrote:
Well, at the moment, I'm thinking about writing a program that deals with images, video and audio. Would C++ be good for such project?


Yes. My 2 cents on your dilemma:

If you are interested in desktop & android, go with Java. While you can use a wrapper to support just about any language on Android, it's best to go native.

If you are interested in desktop & iOS, go with Objective C. Support for Windows is less than ample though so you would benefit from learning 2 languages in this case.

If you are interested in purely desktop programming, the only real answer is C++.

As a side bar away from this, if you are learning this for something other than personal interest(IE getting a better/different job), I would suggest dropping all of those in favor of learning Haskell.
  • Fatima087Haley
  • Born
  • Born
  • Fatima087Haley
  • Posts: 2

Post 3+ Months Ago

Bogey wrote:
I know PHP well enough and it's for the web, but what programming language should I start learning for desktop programming? C, C++, VB or what others are there that I could learn?

Java and C(#|++) seem to be common contenders

Does Java have better multi-platform support then C(#|++)?

The most important thing to me at the moment (that I can think of) is multi-platform support (Windows, Android, *nix, MacOS)...



Hi Bogey :)!

Yeah, nowdays Java is Best Platform Independent language , it is similar to c++ but James Gosling added some other features in JAVA like interfaces are in java but not in c++ :) . So , in my opinion JAVA is BEST if you want to Learn .
yes , Java have better multi-platform support then c++/c# :).
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

I have another question on this subject. I don't want an IDE to develop in C (mainly because I don't know how to use an IDE and I don't know the language yet).

I want to be able to type in Notepad++ (or something like that) and then be able to compile it and run.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

...so what's your question?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

I downloaded Eclipse (and installing Cygwin compiler) but it turns out that Eclipse is an IDE... maybe I didn't understand a certain tutorial right, which said:

Quote:
decide whether you want to run an Integrated Development Environment (IDE) or if you want to edit C files manually through an editor like Notepad and compile from the command line.


I bolded what I want... maybe it's just that I don't understand what an IDE is... I just want to write C like I right PHP... in Notepad++ and then compile it and run it. How would I do that? Or is that what IDE lets me do? Type my code and run it?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

In a really simple explanation, an IDE is basically an advanced editor that can do way more. For example I actually use Eclipse PDT which is basically a version of eclipse that works with PHP. There are a few reasons why I like using an IDE like eclipse. The first is it understands PHP, knows my functions and classes and can automatically complete text as I type it. If I have tons of files and I am using a function or see a function or class in my code, I can easily go to the definition of it by hitting the CTRL key and clicking on it. On top of that it has a built-in debugger that let's me step through my code using xdebug which makes it super easy to resolve bugs or figure out what is going on.

With another language like C, I believe you would just set it up to work with a compiler. You could still compile it separately if you wanted. The IDE just allows you to do as much as possible through the program if you set it up to work that way.

Hope that helps :)
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Ah I see, sorry, it's been a long day.

Just grab yourself a C compiler and you can compile/run everything via the command line; that's about as basic as it gets. If you're developing on a Mac or Linux machine (which I recommend), you'll want either GCC or Clang. On Windows, your best options are probably VC++ (the command line compiler comes with Visual Studio Express, which is free), or Bloodshed Dev-C++.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

I got Cygwin compiler which took over 12 hours to download and install and took up about 35Gigs of space :shock:

I don't have a Linux or another machine... Cygwin comes with GCC and other stuff... many other stuff... 35Gigs of other stuff!!

Thanks for the help!! I'll try using the Eclipse with the compiler
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Should've mentioned before -- MinGW is a good option too.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Ok, so I've removed cygwin and installed MinGW, but... I don't have G++ or GCC?

I run g++ hello.c -o hello.exe and I get that 'g++' is not recognized as a command, operable program or a batch file...

I obviously run that in the folder where hello.c resides in... maybe I did something wrong... I don't know.

I ran the installation... I got to tell you, cygwin was easier to install... neither of them are working for me at the moment.

[EDIT:] Nevermind, I fixed it... I didn't add C:\MinGW\bin; to the paths variable... now that I have, it's working fine
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Now the problem is, I run hello.exe and it opens a command prompt with Hello World written in there, and immediately turns off... I guess that is normal behavior, but how does the other programs that run are not closed off immediately?

The same with everything... once it gets to displaying something, it immediately turns off.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Run your programs from an existing command prompt; don't double-click them. (You're right, default behavior in Windows for command line programs is to run then close.)
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

I just tried that and it still blinks on and then off... I went to CMD and typed the following.

Quote:
cd C:\Sources

start hello.exe

It opened the program but immediately turned it off
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Why are you using 'start'? Just run the program directly:

Code: [ Select ]
C:\Sources>hello.exe
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

Hehe didn't know you could do that. Thanks :D

Works great now, thanks.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Yup! "start" is used to open programs/scripts in a new window, hence the behavior you were seeing.

Post Information

  • Total Posts in this topic: 26 posts
  • Users browsing this forum: No registered users and 152 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.