Outpost Universe Forums

Off Topic => Computers & Programming General => Topic started by: Fire Plague on September 11, 2019, 12:35:30 AM

Title: program language uses
Post by: Fire Plague on September 11, 2019, 12:35:30 AM
Hey all you professional ( or equivalent) programmers out there. Is C++ a "difficult" laguage in comparison to most or easier or what? I'm told that on larger projets it becomes nightmare-ish-ly complex and it has a steep learning curve.
What box would you place C++ in?
Title: Re: program language uses
Post by: TechCor on September 11, 2019, 05:52:31 AM
How to decide which programming language to use:

If you are just starting out and want to practice some programming, it depends on what you want to do.

Do you want to start a career in programming?

Do you want to write some simple programs as a hobbyist?

In all cases, make sure you are learning how to write good code. Otherwise, large projects will always be out of reach. You wouldn't believe how many projects I've seen fall apart once they've reached a certain size. You will figure this out on your own when you get in over your head. It happens on everyone's first complex project. Just make sure you learn from it.
Title: Re: program language uses
Post by: Fire Plague on September 11, 2019, 08:16:49 AM
hmm.
Do you have any good examples in C++ that is up to date? 
would the projects here fall under that umbrella?

 (i would think not, seeing that they said themselves that it was older "style")
Title: Re: program language uses
Post by: TechCor on September 12, 2019, 04:28:08 AM
You haven't really stated what you are trying to accomplish.

The problem with the projects here is that it is all based on reverse engineering an old game no one has source access to. Personally, I think this stuff is too complicated for an absolute beginner.

If you are serious about programming, you really need to grab a textbook. A good book will start with the basics and work up through more advanced concepts, and teach you why you are doing what you are doing. You will learn much faster this way.

C++ Primer Plus Book (https://www.amazon.com/Primer-Plus-6th-Developers-Library/dp/0321776402/ref=asc_df_0321776402/?tag=hyprod-20&linkCode=df0&hvadid=312060980065&hvpos=1o2&hvnetw=g&hvrand=15445892804864351158&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9011765&hvtargid=pla-434079514206&psc=1)
Title: Re: program language uses
Post by: Vagabond on September 15, 2019, 05:18:57 PM
Fire Plague,

For what its worth, I learned C# before C++. C++ will be more difficult to learn up front for general application programming than C++, but it isn't really wrong to start with one language over the other. Java or Python would be decent choices as well.

The modern C++ projects hosted in this community would be OP2Archive, OP2MapImager, and OP2Utility. They all use C++11 or newer language features. op2ext has been redone to use more modern features, but it is mixed with 'older' language features since it edits Outpost2.exe in memory.

If you are looking to learn programming while working on Outpost 2, I would recommend trying to program a simple mission (no AI base or very simple base). It is pretty well documented through the forums. Keep in mind since there is a lot of community input, some code here will be awful and some will be good. One small and simple twist is all you need to make it interesting, not the kitchen sink if that makes sense.

I'm not a professional, but a long time hobbyist. Like TechCor mentioned, might be easier to help knowing what you wish to accomplish and could give more specific advice.

-Brett
Title: Re: program language uses
Post by: leeor_net on September 16, 2019, 06:45:27 PM
As a developer who uses primarily C++, I can say with confidence that yes, it's very difficult. Unless you're writing low-level software or middle ware, you're better off using C#, Java, Python, etc. These have a much easier learning curve, don't present you with very low level concepts, handle resource cleanup for you (mostly), etc. etc. etc.

Odd that the user deleted their account... wonder why? Are we that scary?
Title: Re: program language uses
Post by: Hooman on September 18, 2019, 02:53:02 AM
I agree with pretty much everything said above.

Not all C++ needs to be overly difficult, and like any language, you can probably become productive in it within 2-4 weeks. With that said, I would probably classify C++ as potentially one of the more difficult languages to learn. Mostly that's because of the scope of the language, and all the tempting and really cool features that you'll want to dabble with just because they are there. By that token, I would also classify C++ as one of the more important languages to learn if you really want to learn a lot about computers. There's so much to explore, and so much thought and detail that went into the language. There's a reason the C++ standard can come off reading like a legal contract. It doesn't necessarily require a steep learning curve to handle simple code, but because the option is there, it may be a little more likely. And if you like learning, C++ offers many dark corners of the language to explore that will keep you busy for many years to come. I think I first started learning and using C++ regularly back in 2001, and I'm still learning new stuff today. Granted, the language has had a ton of new additions in the C++11, C++14, and C++17 standards released in recent years. The language is evolving quickly, which is probably making it much better at handling the extremely large code bases that now exist in C++.

In terms of recommending the language, if it was an employer asking about what language to use for a new and upcoming programming project, then no, I would probably recommend they stay away from C++. You'd need a very compelling reason to use C++ on a new greenfield project, unless you had a very good reason. Perhaps a project in a niche area like embedded development, a new operating system, a device driver, or perhaps some real-time performance critical code that needs a lot of determinism. I would not recommend C++ to develop a new desktop app, and certainly not to develop a new web app, and probably not for a new cell phone app. C++ is not the best language for general application development, which probably accounts for most of current software development.

If it was a computer science student asking if they should learn C++, then hell yes. There are few languages that can teach you as much about computers as C++. I wouldn't say use exclusively C++, but C++ should certainly be among the languages that you learn.

If it was a hobby programmer, then use whatever they want to learn.



The projects here probably are suitable for someone just starting out and wants something to dabble with. They're not really all that big, and the active projects here have been modernized.

As Brett mentioned, OP2Utility, OP2MapImager, and OP2Archive all use pretty modern idioms, and are written to the C++17 standard. We're also working actively on op2ext which is in the process of being modernized, and is probably mostly there, though that project may be a little harder to understand due to more complex features being used and the runtime memory patching that is does to Outpost2.exe. It's not a typical project. I'd also agree with the Mission SDK being a reasonably easy start.



And yes, I think we are that scary. :P