Pelles C forum

Pelles C => General discussions => Topic started by: PhilG57 on January 01, 2016, 03:54:56 PM

Title: Just Curious - What Is This Stuff???
Post by: PhilG57 on January 01, 2016, 03:54:56 PM
I thought my computer might be running a little hot so I poked around on the web to find a utility which would display internal temperatures, fan speeds, and the like.  While online, I thought I'd look for something with source code to investigate just for fun.

I found the "OpenHardwareMonitor" site, downloaded the executable, and ran it on my machine - no notable problems.  When I unzipped the source code, I discovered the files had a suffix of "cs", not the expected ".c" or even ".cpp".  I've attached a sample and it looks like C++ code but I'm wondering if it is maybe C# ???.  Then why is it named ".cs" ???

Has anyone seen this stuff before?  Any idea of what language this is?

Happy New Year and Many Thanks again. 
Title: Re: Just Curious - What Is This Stuff???
Post by: DMac on January 01, 2016, 06:43:14 PM
.cs is the C# file extension.  C# is the Dot Net C syntax object oriented programming language that Microsoft developed as an alternative to Java.
Title: Re: Just Curious - What Is This Stuff???
Post by: TimoVJL on January 01, 2016, 07:47:52 PM
Ex Delphi developer designed C#, when he go to MS ;)
Title: Re: Just Curious - What Is This Stuff???
Post by: Bitbeisser on January 02, 2016, 04:44:03 AM
I've attached a sample and it looks like C++ code but I'm wondering if it is maybe C# ???.  Then why is it named ".cs" ???

Has anyone seen this stuff before?  Any idea of what language this is?
Yes, it is indeed C# code, and .cs is the default extension for C# source code, as the '#' is a 'troublesome' character to be used in a filename...

Happy New Year!

Ralf
Title: Re: Just Curious - What Is This Stuff???
Post by: PhilG57 on January 02, 2016, 02:33:07 PM
The c# code is nice looking but, to me, not as clean and pure as ".c" code.  Thanks to all for helping... 
Title: Re: Just Curious - What Is This Stuff???
Post by: Bitbeisser on January 04, 2016, 05:47:51 AM
Ex Delphi developer designed C#, when he go to MS ;)
Yup, it's almost 20 years now that he went over to the dark side...  :-\

Ralf
Title: Re: Just Curious - What Is This Stuff???
Post by: Bitbeisser on January 04, 2016, 05:52:36 AM
The c# code is nice looking but, to me, not as clean and pure as ".c" code.  Thanks to all for helping...
Well, for one, C# is a object oriented language and even in that small program, is calling a lot of methods and references properties of those objects, which by and large, are part of the .NET runtime environment.

For me, this just adds another layer of dependencies, which is why I try to stay as far away from it as possible...

Ralf
Title: Re: Just Curious - What Is This Stuff???
Post by: Grincheux on February 21, 2016, 05:01:18 AM
One more spaghetti manufacturer.