What is a good initial setup for C ++ / Python on OSX?

I am looking for a good setup to learn C ++ and end up Python on Mac OSX. Since I use C ++, I do not want to use Xcode, because (I understand) it is mainly used with Objective-C. I have little experience programming in Java and MATLAB, and math is probably not going to be my main problem. I was thinking of an approach that looked something like this:

  • Work through Accelerated C ++ .
  • Write a couple of small math programs; something like a Mandelbrot set, a PDE solver, or a graphics application. This will be done using the widget toolkit.
  • Write a little game with really crappy graphics. This will probably be Jetmen Revival or Space Invaders ripping; -)
  • (When I'm tired of playing the game doesn’t work), work my way through Core Python .
  • Repeat steps 2 and 3 in Python.

I am going to go with Eclipse and GTK + / X11. Any thoughts on the IDE and GUI tools? Preferably open source and, of course, free. And what do you think of the 5 steps?

Any help would be greatly appreciated - thanks in advance!

+4
source share
7 answers

When choosing an IDE, this is very important, so the best choice is probably to try a few days a day. Eclipse and Xcode are both popular options that are certainly excellent in their own way. I can not help you with widgets, because I know very little about it. GTK + is a popular infrastructure, but native OS X support was not ready the last time I tested, but development continues, so this could change. Qt is less popular, but is currently completely open source, so the licensing issues that it used are now being resolved, so you can also explore this. wxWidgets are popular in Python and I found it easy to use, but I don’t know how good it is like others, but it can be very good.

As for the five steps, first of all, it makes sense to do it in Python. Python is easy to learn and learn, especially if you are NOT corrupted by C / C ++. C / C ++ programmers often have to wean things out, as there are a lot of things you have to do, and think that you don't need to worry in Python.

With Python, you can focus on learning libraries and tools, rather than learning not to shoot in the foot with C ++. Learn C ++ after that and you will get a smoother learning curve and get more fun.

+2
source

As I will use C ++, I do not want to use Xcode, as (I understand) this is mostly used with Objective-C.

Xcode is a great choice, even for clean C ++ solutions.

Work with accelerated C ++.

What a book that started me! This is a great choice, but not a walk in the park. It took me a month or two, at a rate of 1 to 2 hours a day. But after that you will make the MAJOR transition to becoming a really good C ++ programmer.

Write a couple of small math programs; something like a Mandelbrot set, a PDE solver, or a graphics application. This will be done using the widget toolkit. Write a little game with really crappy graphics. This will probably be ripping Jetmen or Space Invaders ;-) (When I'm tired of the game not working), work your way through Core Python (this is a book, maximum link / question for new users ...).

Ok, I did Tetris.

Repeat steps 2 and 3 in Python.

I have no experience using Python, but I know that it is much simpler than C ++. Therefore, if you can learn C ++, Python will not be a problem.

You can use Qt for the GUI, especially now LGPL has done it. However, Cocoa is also interesting if you feel brave enough to also recognize Objective-C :) (By the way, there is a Python port for Cocoa.)

+3
source

Xcode is a mature development environment, well suited for almost any language. C ++ is especially well supported.

GTK + seems to have built-in OSX widget support , although I never used it, so you can skip the X11 stack altogether if you want. Other cross-platform widget sets include wxWidgets , fltk and Tk .

However, they are less optimal for games. for this I highly recommend LibSDL or its binding to python, PyGame . They can provide a convenient, standard interface for OpenGL if you want to use it, or you can use hardware accelerated 2d primitives if that's all you need.

+2
source

I would choose GTK +. It is very simple. I'm not sure about the OS X graphics libraries. I know that OS X primarily uses Objective-C, but if the native graphics library can be used with C ++, use it for game graphics.

As for the IDE, I don't know. I use GNU Emacs, but I would not recommend this for beginners. Learning how to use Emacs is like learning a new programming language. I would start with the main text editor (see one with syntax highlighting) and compile from the terminal for now, so you also don't need to learn the IDE. They make larger projects easier, but can be PITA for small things.

0
source

You can use VIM with cscope and ctags plugins for C ++, I personally think that this is the fastest. Eclipse for C ++ is also good if you need gui, but it is not as rich as for Java, but it is a good open source environment.

In terms of books, efficient C ++ and more efficient C ++ are good.

0
source
  • Work with accelerated C ++.
  • Write a couple of small math programs; something like a Mandelbrot Set, a PDE solver or an imaging application. This will be done using the widget toolkit.
  • Write a little game with really crappy graphics. This is probably going to be a margin from the Jetmen Revival or Space Invaders; -)
  • (When I'm tired of the game does not work), work my way through Core Python (this is a book, maximum link / question for new users ...).
  • Repeat steps 2 and 3 in Python.

Can I recommend doing this in reverse order with respect to languages? Keep in mind that GTK + is not trivial to learn, nor C ++. In fact, I would recommend starting with Cocoa and PyObjC first . Cocoa is a little more to wrap your head around, but once you lower it, it’s very easy to see its advantage. Setting up GTK and PyGTK development can be PITA to install on OS X (at least that was for me).

0
source

NetBeans is another choice. Although support for Python and C ++ is quite new to it. Python works find, but I have not tried C support.

0
source

Source: https://habr.com/ru/post/1286538/


All Articles