• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

C or C++

Status
Not open for further replies.
Level 23
Joined
Apr 16, 2012
Messages
4,041
if at the end you want to end up with C++ anyways, just begin with C++, because it has most of the stuff C has(its Superset of C and most of the C programs will compile under C++; exceptions are programs which use reserved C++ keywords which are not context sensitive(delete, final) as variable names) and more stuff

if you just want C, you can go for pure C and if you later decide to learn C++, you will have some base knowledge already(using void* in C++ is not ideal tho unlike in C)
 
If it's your first programming language and you have absolutely no idea what you're doing then I wouldn't suggest C or C++. I would go with Ruby or python because they are more verbose and "noob friendly". C# is also a nice alternative because of the GUI designer and auto-completion IDE (Visual Studio). However if you think you're capable of downloading a compiler and possibly an IDE on your own AND writing effective, logical code then sure go with C++. Although judging from this question and how you asked it I'm not sure sure you will be able to just jump into it.

https://www.ruby-lang.org/en/
http://www.python.org/
http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
well I learned Jass as my first "programming" language, and then learned C in school and self-taught C++

I dont find it that hard, but yes I got some education(very silly one tbh, afaik we didnt even cover what functions are) in school

you dont need to write effective, logical code when learning, not that you will make game or whatever while learning :D

but yes, some people think C++ is too hard and complex for beginners, so maybe you could have a look at python or something
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I pretty much made a game with SDL when I just started my path with C++ (with only prior knowledge in Jass and a little in Java), so it's certainly possible, though with hindsight I wouldn't recommend it to other people.

It's not that C++ is "hard", it's just very annoying and unfriendly, and has no real-time testing environment (like most interpreted languages have), which is a very nice thing to have, especially when you are learning a new language.

That being said, if you do end up learning C++, please don't learn from sites that are geared towards C.
You will end up writing C code in C++, which is usually not what you want (void*, char*, FILE*, etc.).
In some very specific cases you will want this, but it's better to learn from a proper site to begin with.
 
Level 15
Joined
Dec 21, 2013
Messages
911
Just saw python and ruby website... Haven't download yet cause I'm still using my mobile
This things create another question, python or ruby?......
By the way, thank you all
 
Just saw python and ruby website... Haven't download yet cause I'm still using my mobile
This things create another question, python or ruby?......
By the way, thank you all

I would use ruby, because indentation based languages suck ass.

Ruby also is extremely noob friendly, just take a look at any of the examples and you will be amazed by the simplicity.
 
Level 15
Joined
Dec 21, 2013
Messages
911
Whoa, what a fast respond
Okay, downloading with slow internet,
What is .gz extension?
Edit:
Never mind, found it on google...

More question:
What compiler should I use? (For newbie, easy to use)
Is it Eclipse? Or netbeans? Or maybe code block?
 
Last edited:
You can also use SharpDevelop for Ruby, C#, I think you can do C++ too...

anyway, if you wanna go C++, you can try getting Visual C++ so that you have a bit of visual help with it...

anyway for you, I suggest either Ruby, VB.net or C#

Ruby:
#Ruby: I guess about as verbose VB.NET but shorter
class THW
  def Hello
    if x
    elsif
    else
    end
  end
end

Code:
'VB.net: I'd say this one is really verbose
Class THW
  Sub Hello
    If X
    Else If
    Else
    End If
  End Sub
end Class


C#:
//C# is like a .NET implementation of C++ I think
public partial class MainForm : Form
	{
		public MainForm()
		{
			
		}
	}

there are also lots of reference books online for Ruby...
 
Last edited:
Level 22
Joined
Sep 24, 2005
Messages
4,821
I learned basics from BASIC on NES cartridge, the console had a keyboard... Anyway, good luck learning, I hope you enjoy it. :D
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
C++ is pretty much an extension to C. Sure it technically is not since C can do stuff C++ cannot but generally most C stuff will work in C++ but not the other way round.

I would advise starting with C as that avoids all the OOP nonsense which can get confusing until you are more at home with the language. Then move on to C++ as you start to understand everything.

Any long term project should probably be written in C++ due to the OOP nature making things easier. If what you are writing is targeting embedded systems than stick to C as it is most portable since most embedded systems do not support C++.
 
Level 15
Joined
Oct 18, 2008
Messages
1,591
You can also use SharpDevelop for Ruby, C#, I think you can do C++ too...

anyway, if you wanna go C++, you can try getting Visual C++ so that you have a bit of visual help with it...

Visual C++ is a subset of Visual Studio now so better just get VS with all the extendability and other languages. If you are a uni student, you can get a free Visual Studio Pro from Dreamspark using your uni email account.

if at the end you want to end up with C++ anyways, just begin with C++, because it has most of the stuff C has(its Superset of C and most of the C programs will compile under C++; exceptions are programs which use reserved C++ keywords which are not context sensitive(delete, final) as variable names) and more stuff

if you just want C, you can go for pure C and if you later decide to learn C++, you will have some base knowledge already(using void* in C++ is not ideal tho unlike in C)

void*... I don't really like the general purpose pointers/variables in a type based language, only use I see for them are general purpose containers, but then the container should have a header showing the type of what it contains. But well, that's what I think.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Visual C++ is a subset of Visual Studio now so better just get VS with all the extendability and other languages. If you are a uni student, you can get a free Visual Studio Pro from Dreamspark using your uni email account.



void*... I don't really like the general purpose pointers/variables in a type based language, only use I see for them are general purpose containers, but then the container should have a header showing the type of what it contains. But well, that's what I think.

Pre C++11:
std::auto_ptr

C++11 and on:
std::shared_ptr, std::unique_ptr, std::weak_ptr

you never need to call malloc() or new nor free() or delete, just use smart pointers, which even manage the lifetime of the pointer
 
C++ is pretty much an extension to C.

As much as I like to agree with you usually, I stick to the view that C++ is a completely distinct language from C.

Seeing it that way is better for novices because they should see the C++ standard libraries as the right tools to use instead of "slow" alternatives to C-API stuff.

GhostWolf is right: When you write C++, do it right. Don't write C memory-managing, bit-fiddling, pointer-abusing code.
 
Status
Not open for further replies.
Top