The Student Room Group

Best programming language to learn?

Scroll to see replies

Reply 40
Original post by CJKay
I agree to some extent but, whilst I don't use it often, I find C++/CLI actually a really enjoyable language to use! It's rated a lot lower than I feel it should be. :tongue:

You're mad. :tongue:

Original post by CJKay

I mentioned C++/CLI purely because it allows you to use typical game development without having to delve too much into memory management and whatnot. It's not really a practical choice in comparison to some of the other stuff that is out there though.


I think that's a terrible idea. If you want to get into game development without delving into memory management, just use C#. There's a lot to learn that is language independent, and more still that applies to both C# and C++ as both are object oriented and statically typed. Using C++/CLI would probably make things more confusing when you make the switch to proper C++ because it won't be obvious which bits are C++ and which bits are CLI.

The main thing to learn about C and C++ as opposed to managed languages is the memory management. So it seems a bit pointless learning a language on the basis that it's C++ without memory management when you could learn a language that is actually designed to be a managed language, rather than C++ with some awkward language extensions bolted on.

And another thing in C#'s favour for game development is that it actually is widely used in game development. The game code itself isn't typically written in C# (although the Unity engine does use it as a scripting language), but C# is widely used for development tools.
Reply 41
Original post by CJKay
C['s] [...] uses are quite niche today (drivers, operating systems, embedded development, etc.).


Strongly strongly disagree. As far as I can see it's the de-facto 'tooling' language.
A fair number of programming languages are written in C. Utilities (everyday command line tools on linux) are popularly written in C (though Go is meant to be a competitor here...in time). If you want to interact with something, chances are there are two options - a C api and other language (Java if a business piece of software or python otherwise). Your infrastructure (if on linux) is probably built with C - the kernel itself, webserver, database, any native (read: really fast) extensions to your language of choice, unix tools themselves etc etc.

Sure you can use it in C++...but 'extern C' may be the only reliable/supported way. C is very much alive.
Reply 42
Original post by Chrosson
Strongly strongly disagree. As far as I can see it's the de-facto 'tooling' language.
A fair number of programming languages are written in C. Utilities (everyday command line tools on linux) are popularly written in C (though Go is meant to be a competitor here...in time). If you want to interact with something, chances are there are two options - a C api and other language (Java if a business piece of software or python otherwise). Your infrastructure (if on linux) is probably built with C - the kernel itself, webserver, database, any native (read: really fast) extensions to your language of choice, unix tools themselves etc etc.

Sure you can use it in C++...but 'extern C' may be the only reliable/supported way. C is very much alive.


Many tools on Linux are written in C because of the culture surrounding it. Linux itself is written in C and many of the tools used today are the same as 20 years ago, and Torvalds' attitude pervades most of the tools of the operating system. That does not, however, apply to even remotely large applications like compilers, servers, clients, and in the majority of cases anything that is larger than a search indexer will be written in C++. Grep, for instance, is written in C because it is only about 10 source files, and if you look at its main.c you'll notice it was originally written... about 22 years ago - long before C++ became the de-facto language. GCC, however, is written in C++ because it is much easier to scale and because it was neccessary to convert it from C.

Is it worth learning? Of course. How often can you realistically expect to use it? Not that often.
(edited 10 years ago)
Reply 43
Original post by CJKay
Many tools on Linux are written in C because of the culture surrounding it. Linux itself is written in C and many of the tools used today are the same as 20 years ago, and Torvalds' attitude pervades most of the tools of the operating system. That does not, however, apply to even remotely large applications like compilers, servers, clients, and in the majority of cases anything that is larger than a search indexer will be written in C++. Grep, for instance, is written in C because it is only about 10 source files, and if you look at its main.c you'll notice it was originally written... about 22 years ago - long before C++ became the de-facto language. GCC, however, is written in C++ because it is much easier to scale and because it was neccessary to convert it from C.

Is it worth learning? Of course. How often can you realistically expect to use it? Not that often.


Python has a C api for writing extensions. Guidance for C++ is basically "use extern C". The same is true of Go. In fact, Go itself (which includes a compiler!) is written in C (originally written in 07). Nimrod (a recent in-development language getting some mild interest) was written in C before it became self-hosting. Rust (a recent in-development language from Mozilla Research) offers the ability to directly call C library functions (it supports the C ABI). It doesn't have the same ability for C++. Redis (released 09) is written in C. Nginx (02) is written in C.

Now allow me counter your sweeping assertion with a single anecdote (this truly is the epitome of debate :wink: ).
I personally am using C a fair amount at the moment with the python C api (and another language) and with some core technology where I work.

On a personal level, C++ is just too much. I don't have the time or investment to truly understand the language, it's a lifelong undertaking. C which is a very compact language.
Frankly I think you'll find non-C/C++ languages scale better because of ease of development. Segfaults really put a downer on your day and a single substandard programmer could bring down your app. Hence the popularity of Java and .NET.
Reply 44
Original post by SorryInAdvance
We were learning Haskell for the introduction course for computing - it's a bit weird, it's purely functional (controlled side affects) so it's fairly niche- but it's so cool!!!


Edinburgh student?
Reply 45
My advice would be to pick a language you like the look of and can think of some engaging projects to code with it. Unless you find some captivating projects, you won't stick at it, and unless you find the language intrinsically appealing, you will find it harder to enjoy.

Personally I most like C#, PHP and C++.
Reply 46
Original post by Chrosson
Python has a C api for writing extensions. Guidance for C++ is basically "use extern C". The same is true of Go. In fact, Go itself (which includes a compiler!) is written in C (originally written in 07). Nimrod (a recent in-development language getting some mild interest) was written in C before it became self-hosting. Rust (a recent in-development language from Mozilla Research) offers the ability to directly call C library functions (it supports the C ABI). It doesn't have the same ability for C++. Redis (released 09) is written in C. Nginx (02) is written in C.

Now allow me counter your sweeping assertion with a single anecdote (this truly is the epitome of debate :wink: ).
I personally am using C a fair amount at the moment with the python C api (and another language) and with some core technology where I work.

On a personal level, C++ is just too much. I don't have the time or investment to truly understand the language, it's a lifelong undertaking. C which is a very compact language.
Frankly I think you'll find non-C/C++ languages scale better because of ease of development. Segfaults really put a downer on your day and a single substandard programmer could bring down your app. Hence the popularity of Java and .NET.


Regarding Python:
The original Python interpreter, CPython, was originally written in something like '89, way before C++ was particularly well known. It falls under the programs I mentioned that use C for historical reasons. Many programs use C for their APIs and consequently their tools because it guarantees compatibility with both C and C++, and it's a lot harder to write cross-platform C++ APIs because of name-mangling (so you can't just bundle your API in a .dll or .so and LoadLibrary/dlopen it).

Regarding Go:
There are two main compilers for Go. There's Google's C one, which is now being transitioned to Go, and there's GCC's C++ one. GCC's is actually the most efficient one right now, but that's irrelevant.

Regarding Nimrod:
Never heard of Nimrod so I can't comment.

Regarding Rust:
That is nothing special. Any language that can interpret shared libraries has the ability to call external C functions, C++, Java and C# included. To say that it supports the C ABI is nonsense: C does not define an ABI. The standard calling convention is up to the chip and the operating system. It doesn't have the same ability for C++ because C++ does not provide a standardised name mangling scheme (int helloWorld(int, char **) is __Z10helloWorldiPPc with my mingw32 but ?helloWorld@@YAHHPAPAD@Z with my MSVC11).

Regarding Redis:
Redis was written in ANSI C for maximum compatibility. Not even a remotely updated version of C (yes, it takes using a 25 year old version of C to maintain good compatibility with everything, another disadvantage of C).

Regarding Nginx:
As for Nginx, remember 2002 was just 4 years after C++ was first standardised. C++11 was standardised almost 3 years ago and it's still not a good idea to use it if you want good compatibility. C++ has a very slow uptake, but I bet you barely even knew C11 was also ratified at the same time.

Another argument for not using C: on Windows, you only have one good option for compiling C programs, and you won't be happy with it unless you're familiar with the command line. MSVC supports only a very old, very basic subset of C ('89) needed to compile C++. It has limited, non-standard and only partial support for later versions. Your only option then is to use mingw32, which can be a massive bitch to set up.
(edited 10 years ago)
Original post by Valentas
Edinburgh student?

Indeed
Reply 48
It's a pleasure talking to someone who engages in the conversation :smile:

Original post by CJKay
Linux itself is written in C and many of the tools used today are the same as 20 years ago, and Torvalds' attitude pervades most of the tools of the operating system. That does not, however, apply to even remotely large applications like compilers, servers, clients, and in the majority of cases anything that is larger than a search indexer will be written in C++. [...] GCC, however, is written in C++ because it is much easier to scale and because it was neccessary to convert it from C.

Just to come back to this paragraph, I feel like you're having your cake and eating it. Linux is bigger than GCC. If it was truly necessary to convert to C++, Linux would have converted regardless of how much Linus hates it (otherwise it's not a necessity). So we must conclude that it's not necessary. All these large programs written in C could (would) have also converted to C++ if it was necessary for a large size project.

Is it worth learning? Of course. How often can you realistically expect to use it? Not that often.
Amortised over all possible developer roles, the same is true of C++...let's not generalise.

Original post by CJKay
Python, Go, Nimrod, Rust, Redis, Nginx, Windows

I agree most of what you say, and you kinda make my point with the notes about Python and Redis. Compatibility is not niche.
I agree with Windows usage.

To come back to your original statement:
Original post by CJKay
C['s] [...] uses are quite niche today (drivers, operating systems, embedded development, etc.).

We've established that we need to use it if we want what we write to be widely compatible (as per what you said about redis and api interaction). We also need to use it if we want to contribute to the large number of programs written in C.
I'm not arguing about the utility of C++. But C is not the modern equivalent of Fortran or COBOL.
There's no "best" programming languages in general but in specific situations some are better suited than others.

The first thing you need to consider is if you want a language to compile to byte code or machine code. Ones that compile to byte code rely on a 3rd party to continually support your operating system of choice and also require your users to have their run time installed which makes user adoption very important. Applications compiled to byte code are usually slower, less convenient for your users to install and require more disk space, though this normally isn't a problem. However there's the risk that company who's developing the run time goes out of business or stops developing it. Languages that compile to machine code are a lot lower level (unnecessarily in most cases) and have to be compiled multiple times to support multiple platforms (assuming there's a compiler for that platform). When a language that compiles to machine code stops being developed for whatever reason, as long as it's mature and the community still support it, should still be fine to use.

There's also the fact of whether you plan on getting a job with the language you choose. In most cases, the lower level the language, the more likely you'll get a well paid job.

So based on this, I would suggest one of the following:

C++ (machine code, jobs, OS support, long term)
Java (byte code, jobs, OS support)
C# (byte code, Windows support)
Haxe (worth looking at, OS support)

Personally I would avoid C++ as it seems overkill for most tasks and would base my Java vs C# choice on which OS(es) I plan to support. Right now I'm still trying to choose a language to move on from AS3.
(edited 10 years ago)
Reply 50
Original post by Serentonin
I'm fairly okay with python, and while I will continue with it, I wanted to pick something new up as a new challenge as my uni workload is quite low this term...was thinking C++, but does anyone have any recommendations for anything that would be more useful?

Thanks.
C++ is a good language, and saves you from some of the problems with pure C (which is my preferred language), but to be fair its OOP implementation isn't complete. It depends what you want to use it for though. If you just want to much around with something text-based, I'd say
learn C; it's more of a challenge to do some things but that's what programming as a game or an art form is about. If you want to learn to do useful stuff in a simple, C-based language, I'd suggest C#.
Reply 51
C++ is most suitable for larger applications using object orientation as a design model and most suitable for programs where efficiency and performance are the primary concern.The appropriate assembler language is most suitable where the program is relatively short and high performance is critical.

Thanks
vectorindia.org
(edited 10 years ago)
Learning the Linux command line stuff is probably the most useful of all.
Reply 53
Original post by jaksonmith
C++ is most suitable for larger applications using object orientation as a design model and most suitable for programs where efficiency and performance are the primary concern.The appropriate assembler language is most suitable where the program is relatively short and high performance is critical.

Thanks


I disagree. Learning assembler languages is worthwhile for the understanding of the hardware you'll gain, but I think cases where it makes practical sense to use it are few and far between. If you need to write a program that is relatively short and high performance is critical, I'd say C is a good choice. Maybe if it really is performance critical there might be a couple of functions you might want to hand write in assembly, if you really know what you're doing. But it only makes sense to do that after you've identified that the compiler is not producing optimal assembly in that case.
Reply 54
Learn as much as you can I say. I think Assembly, C, C#, python, HTML and PHP are the bare essentials.
Reply 55
Golang http://golang.org
Developed by Google (as a replacement for some of their old, legacy C/C++ codebase (the server that powers http://dl.google.com is written in Go now)), it's a pretty easy to understand language with a lot of nice features built in. Concurrency plays a massive part in the language too (languages like java require a substantial amount of effort to get concurrency properly implemented).

Er, you could also learn JavaScript and Python?
If you really wanted to delve deep into a computer's architecture, a mixture of C, C++ (to an extent), Rust (maybe) and ASM would be ideal.

Quick Reply

Latest

Trending

Trending