Jump to content

Programming languages and their use

Hi P

I've been taking the CS50 course (week 5 out of 11) and I really liked C, so I just bought a C course that I will begin once I'm done with CS50.

 

Finished CS50 some time ago, I'm halfway through a C course!

 

I'm aware that most programming languages can do mostly anything, but each of them have specific uses, for example, it's possible to do an android app in Python, but it's better to use Java, you could also do Neural Networks in Java (I think...) but you are better off using Python for that.

 

Having said that, I was wondering whats the most common use of the following programming languages, just so I have a general idea.

 

Feel free to add stuff and / or correct me :)

 

C : low level system programming, web and desktop dev

C++ : Gaming engines

C# : Windows desktop apps, Game coding in Unity

Java : Enterprise apps, Android dev

Python: Machine Learning

 

Thank you

 

Link to comment
Share on other sites

Link to post
Share on other sites

C is for low level system programming. Most operating system is written in it. Although at my school, a crazy instructor for an operating system course decides to replace C with Java for some crazy reason. 

 

If a crazy dude comes here and tell you C is good for coding front end website, don't believe him. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, wasab said:

C is for low level system programming. Most operating system is written in it.

Thanks, could you elaborate a bit on what does this mean? like, if you were to have a C job, what kind of stuff would you have to do in said job?

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hi P said:

Thanks, could you elaborate a bit on what does this mean? like, if you were to have a C job, what kind of stuff would you have to do in said job?

 

Microcontrollers perhaps, although it is also quite common to use higher langauge like python or java for microcontrollers these days. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Hi P said:

Thanks, could you elaborate a bit on what does this mean? like, if you were to have a C job, what kind of stuff would you have to do in said job?

 

Assembly is for low level programming. Touching the bare metal, speaking to the machine in its language.

No one (almost) does assembly any more because the systems these days are powerful enough not to need the performance boost from assembly. But some of us assembly coders are still out there.

NOTE: I no longer frequent this site. If you really need help, PM/DM me and my e.mail will alert me. 

Link to comment
Share on other sites

Link to post
Share on other sites

Try not to pigeon hole languages like that. Game engines comprise such a small % of the C++ code out in the world (it's behind most of the web browsers you use for example), and python isn't the only language to do machine learning in. There is truth in some of the language stereotypes, but it might give you wrong idea about a language if you latch on too firmly.

 

Instead of specific applications, think of the languages in terms of their strengths weaknesses and go from there:

 

(this is BY NO MEANS an exhaustive list, just the stuff that comes to my mind) 

C/C++

Pros

  • Low level
  • High performance
  • A lot of tooling to catch errors at compile time
  • Portable

Cons

  • Higher skill curve
  • some types of defects can be very hard to track down (e.g. memory/GDI issues)

 

C#/Java

Pros

  • Not as performant as C/C++, but adequate for the vast majority of applications
  • have a wide variety of built in features (especially with C# and .NET)
  • Lower skill curve, as many low level operations are abstracted away

Cons

  • Managed memory (garbage collection) can sometimes have performance impact (not common)
  • Not necessarily as portable. The appropriate JVM/.NET environment, and .NET in particular is limited to mostly windows machines.

Python/Javascript/Ruby

Pros

  • Typically the lowest barrier of entry. Very little is needed to run simple but useful things
  • Great for automation and quick scripts
  • Extremely large library selection, with a huge dedicated userbase constantly adding to it (this is why python is such a common research language)

Cons

  • Weaker performance, though this can often be mitigated (such as using precompiled libraries in python)
  • Heavy reliance on third party libraries means extra work with upkeep.
  • Not as portable

 

again, THIS WAS NOT MEANT TO BE A COMPLETE LIST. This is just to show how you should look at languages based on strengths, not stereotypical uses (which are often outdated).

11 minutes ago, Hi P said:

like, if you were to have a C job, what kind of stuff would you have to do in said job?

Most likely embedded development in todays market, but it depends wildly based on where you work.

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, Radium_Angel said:

Assembly is for low level programming. Touching the bare metal, speaking to the machine in its language.

No one (almost) does assembly any more because the systems these days are powerful enough not to need the performance boost from assembly. But some of us assembly coders are still out there.

Would COBOL be around assembly level as well ? 

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, reniat said:

Snip

What do you mean java is not portable? 

 

Porting c/c++ applications to a different platform also requires code rewrite. I mean isn't that the reason we have POSIX in tbe first place? To make c portable across various Unix systems?

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

C/C++ as source code is portable, no need to rewrite it on another machine. But if you have different compilers between the machines, and your code is not so much well written following the norm, then you could have some issues that need code rewritting (debugging) - this happens also if the compiler is buggy!

 

In the HPC world, you have also FORTRAN as a major scientific coding language.

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, wasab said:

What do you mean java is not portable? 

It just requires a compatible JVM version. I meant not as portable compared to something like C, where pretty much every major system already has a valid compiler without needing to install anything. C# was mainly the focus of the compatibility stuff since historically it's pretty Windows focused though they do have stuff like Xamarin 

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

57 minutes ago, reniat said:

It just requires a compatible JVM version. I meant not as portable compared to something like C, where pretty much every major system already has a valid compiler without needing to install anything. C# was mainly the focus of the compatibility stuff since historically it's pretty Windows focused though they do have stuff like Xamarin 

Oracle has a sdk for all major operating systems. These all run the same. Portability usually means you can develop code on one platform and then run it on another without major change to the source code. It has nothing to do with whether a complier exists for it or not. I mean if complier doesn't exist, you wouldnt be able to compiled a binary from that langauge at all. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, Mesterial said:

C/C++ as source code is portable, no need to rewrite it on another machine. But if you have different compilers between the machines, and your code is not so much well written following the norm, then you could have some issues that need code rewritting (debugging) - this happens also if the compiler is buggy!

 

In the HPC world, you have also FORTRAN as a major scientific coding language.

It is portable if you stick to crossplatform framworks and libraries otherwise no. 

 

Complier bugs are extreamly rare. These softwares went through rigorous test and engineers who work on these things went to the extreames of mathmatically proving they work correctly by inductions.  Generally if a code is misbehaving, the bug lies in the source code being compiled, not the compiler. Bugs in the standard library I do see occasionally, compiler bug on the other hand is something I have yet to encounter. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

Does "Internal compiler error" sounds familiar? ?

Believe me, I know that for a fact, I do work in this field. Some compiler versions are pure sh#t! 

Also, some compilers are more…. let's say permissive than others about the norm, so your code can compile well using them, but simply can't compile using another (even on the same machine!).

 

Quick example: overwritting a constant… ? Some compilers say "you're doing some sh#t but ok, I'm saving the constant and give you a copy of it", while some say "let's goooo" and then the code crashes when you run it! And some just stop the compilation saying "nice try, but try again" ?

Link to comment
Share on other sites

Link to post
Share on other sites

58 minutes ago, Techicolors said:

Would COBOL be around assembly level as well ? 

No.

 

I was a COBOL programmer as well. Incredibly clunky language, very slow. Stay away from it (but it is/was easy to read, as you spelled out everything. Including symbols like + = - etc)

NOTE: I no longer frequent this site. If you really need help, PM/DM me and my e.mail will alert me. 

Link to comment
Share on other sites

Link to post
Share on other sites

36 minutes ago, Mesterial said:

Does "Internal compiler error" sounds familiar? ?

Believe me, I know that for a fact, I do work in this field. Some compiler versions are pure sh#t! 

Also, some compilers are more…. let's say permissive than others about the norm, so your code can compile well using them, but simply can't compile using another (even on the same machine!).

 

Quick example: overwritting a constant… ? Some compilers say "you're doing some sh#t but ok, I'm saving the constant and give you a copy of it", while some say "let's goooo" and then the code crashes when you run it! And some just stop the compilation saying "nice try, but try again" ?

No, I haven't seen my complier spits out such error yet. I use gcc, maybe it is the better one out there but idk. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, wasab said:

No, I haven't seen my complier spits out such error yet. I use gcc, maybe it is the better one out there but idk. 

I would NOT say it's the better one, but it is VERY permissive for sure (sometimes too much).

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Mesterial said:

I would NOT say it's the better one, but it is VERY permissive for sure (sometimes too much).

C complier is generally permissive by nature. Most errors are caught at runtime, not compile time. These compliers generally do not check more than sythax errors. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, wasab said:

C complier is generally permissive by nature. Most errors are caught at runtime, not compile time. These compliers generally do not check more than sythax errors. 

Yep, that's very easy to read/write in the memory where you're not supposed to ?

Link to comment
Share on other sites

Link to post
Share on other sites

@wasab mind if I ask one last question?

 

Is it worth learning C or should I just skip it and go straight into learning C++?

Link to comment
Share on other sites

Link to post
Share on other sites

I'd say it's worth more to learn C than to learn C++

 

There's also Go that wasn't mentioned in this thread , or Kotlin ... also  Object C , Pascal / Delphi , Perl, Typescript  and quite a few other languages that are more obscure like Haskell , Scala , Lisp , Prolog

Even old stuff like Cobol and Fortran is still used in industrial machines, banking, stuff that deals with mainframes

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, Hi P said:

C : low level system programming

C++ : Gaming engines

C# : Windows desktop apps, Game coding in Unity

Java : Enterprise apps, Android dev

Python: Machine Learning

Those are examples of where they're used commonly, but these are not the definitive use cases for why they exist or what not. You can write application programs in C. You can write OS components and firmware in C++. C# can be used outside of Windows through Mono. And I use Python mostly for writing test tools and utilities because of how easy it is to get something out the door.

 

Basically, most widely used languages are not locked down to a specific use case. It's just that the community surrounding that specific use case zeroed in on a language (because it's easier when everyone uses the same language) and that got the most support out of it.

23 hours ago, Hi P said:

Thanks, could you elaborate a bit on what does this mean? like, if you were to have a C job, what kind of stuff would you have to do in said job?

Systems software is software that more or less interacts directly with hardware. They provide services to application software, which is software that provides services to the user.  However taking a C job doesn't necessarily mean you'll be doing that. Where I work, we have application software written in C. Also Android can allow developers to use C or C++, either high performance is necessary or to ease porting of an existing C/C++ app.

 

13 hours ago, Hi P said:

Is it worth learning C or should I just skip it and go straight into learning C++?

C++ has enough similarity to C that you can learn C++ first, go to C, and not feel lost.

 

Link to comment
Share on other sites

Link to post
Share on other sites

If you're also interested in some context as to why things are the way they are:

 

The thing C has going for it is a certain reliability. Take Java for example. I know people that have to have multiple versions of Java installed, just because different programs require different versions of Java to work correctly. It's a hot mess. Also, whenever I hear someone say something was developed in Java, that's basically a code word for this software is incredibly slow. The exchange would go like "Hey, I just started X." - "Oh, X is developed in Java." - "Alright, time to make a coffee.".

 

You don't have this with C by design. On the flip side, writing code in Java is really easy and writing code in C is not. That's why enterprises ended up embracing Java, while C is associated with low level system stuff. Business need to ship something quick, doesn't matter if it's a bug ridden mess that takes forever to do anything, as long as it solves a problem someone is paying you to solve.

 

C# is basically Java, just a little better/worse depending on whether you ask a Java or a C# developer.

As for C++, read the following and try to figure out if it's satire or not: http://www.stokely.com/lighter.side/stroustrup.html

Small extract:

Quote

Interviewer: Yes, but C++ is basically a sound language.

Creator of C++: You really believe that, don't you? Have you ever sat down and worked on a C++ project? Here's what happens:

First, I've put in enough pitfalls to make sure that only the most trivial projects will work first time. [...]

 

Oh yeah, somehow Python made it into the mix. Python is basically an incomplete reinvention of Lisp.

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/31/2019 at 8:14 PM, Hi P said:

C : low level system programming

I use C for web and desktop development.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/31/2019 at 2:14 PM, Hi P said:

C : low level system programming

C++ : Gaming engines

C# : Windows desktop apps, Game coding in Unity

Java : Enterprise apps, Android dev

Python: Machine Learning

Depending on who you ask it pro/con will vary as @reniat explained well the list is very long. Not everyone has same opinion. I have the chance to work with many client and dealing a lot with business app of all sort. This is what i see them used in on the business app side :

 

C : On the couple thousand of project a year we get to work on one project once every 1-2 years. So far they all revolve around serial bus controller for an equipment of some sort. Last one we got was around last fall and it was to control a particle sensor on filtering media (small balls that absorb viruses/bacteria or things like that).

 

C++ : Most common use i have with these are small library where manufacturer offer other company to implement in their software in order to buy their product. C++ is very popular for those kind of things. Also quite a good amount of small/medium size business applications like product selection, client database system, ERP. If you get to touch the thermodynamic domain it is very very common.

 

C# : In what we get to work on i would say it's 50/50. Half is ASP.NET and i include in this all web aspect of .NET (razor, WCF, azure..). the other half is small to large business apps. Most our request and work require that. Lots of robots interface with C# and i am not talking about hobby robots. I have only worked with very large ones like those that cost in the 6 to 7 digits so far .Also CAD is a very big chunk too AutoCad, Solidworks, Fusion, SolidEdge, NX, Inventor and Revit are all interfaced or have addin in .NET.

 

Java : Not strong but still kicking. Our amount of projects on that language dropped a lot and is nearly only used for interfacing with robots like amazon shelving robots when they are not controlled by C#. If they don't interface thru .NET then chances are you need java (or a mangled version of it at least.... actually 100% of the time so far LOL).

 

Python : Never got any project request on Python and never heard being used in business apps in my circle. Been there for what ~20 years and still nothing. I have no clue what it could be used for in business apps. I know it's used for machine learning but all those i have worked with have been implemented in ERP for decades now in C++/C#. 

Link to comment
Share on other sites

Link to post
Share on other sites

35 minutes ago, Franck said:

Java : Not strong but still kicking.

I wasn't expecting this :o I thought Java was one of the most widely used languages out there, is Kotlin taking over?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×