c++

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
colinn
Posts: 0
Joined: Sat Jan 28, 2012 3:26 am

c++

Post by colinn » Mon Mar 26, 2012 9:45 pm

Hello.

Is C++ code accepted in blender? I noticed that there isn't much of it other than in the somewhat disjoint game engine.

Is there any reason to not gradually move from C to C++ for some OOP features other than unfamiliarity with C++?

Thanks,
Colin

ldo
Posts: 0
Joined: Sun Nov 07, 2010 11:30 pm
Location: Hamilton, New Zealand

Post by ldo » Wed Mar 28, 2012 9:15 am

Well, there is the fact that it is such a needlessly complicated and cumbersome language.

But then, that’s just my opinion from having written about 100,000 lines of it over several years.

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Wed Mar 28, 2012 6:41 pm

Is there any reason to not gradually move from C to C++ for some OOP features other than unfamiliarity with C++?
Yes. Re-writing code in another language is pointless and silly.

colinn
Posts: 0
Joined: Sat Jan 28, 2012 3:26 am

Post by colinn » Fri Mar 30, 2012 4:12 pm

stiv wrote:
Is there any reason to not gradually move from C to C++ for some OOP features other than unfamiliarity with C++?
Yes. Re-writing code in another language is pointless and silly.
I'm not asking to rewrite blender in C++, I'm asking if C++ modules are accepted, and at what level? You mention rewriting code in another language being silly, but I specifically found a case (using Google) where a C++ addition to blender kernel was rewritten in C

I'm trying to avoid having to rewrite any feature additions I make to Blender because of an OOP design I chose that is incompatible with standard C

Myrmecophagavir
Posts: 0
Joined: Tue Aug 24, 2010 1:40 am

Post by Myrmecophagavir » Sat Apr 07, 2012 1:11 am

Good question, I've often wondered why there's so much pure C in the Blender codebase.

IndieLoner
Posts: 0
Joined: Tue Apr 24, 2012 1:24 am
Location: Alabama, United States

This is why

Post by IndieLoner » Wed Apr 25, 2012 2:33 am

Blender was released in 1995 and was written prior to that. The official C++ standard was in 1998. There were plenty of C++ programmers, but it is to no surprise that Blender was primarily written in C. And unlike other people say, I would advise that instead of picking favorites in the programming languages, just learn as many as you can, because they all serve some purpose(s) better than others.

Post Reply