r/sysadmin • Systems Engineer • Aug 18 '16

PowerShell is open source, available for Linux and OS X

https://github.com/PowerShell/PowerShell
1.3k Upvotes

369 comments sorted by

View all comments

Show parent comments

15

u/theevilsharpie Jack of All Trades Aug 18 '16

.NET integrates very nicely with Windows because Windows itself is object-oriented. Linux isn't. Linux treats everything as a stream of text.

There is nothing inherently object-oriented (or text-oriented) in either Windows or Linux.

2

u/LeeTaeRyeo Aug 19 '16

Eh, I'm not super familiar with Win32 programming, but from what it seems, it is fairly OO-friendly. I mean, everything functions by creating a handle to some structure and then passing messages around to the different structures, which then causes functions to be invoked on individual structures depending on handles. This is very reminiscent of Objective-C's object system. In ObjC, you essentially have structures with access levels and a set of messages that the structure will respond to, with each message being either a class message or an individual message which acts on an individual instance of the structure, based on a pointer to that instance.

Also, almost no one uses straight Win32 anymore and most use COM or some such library, an object oriented framework on top of Win32.

I could be wrong about all of this, so take it with some salt.

2

u/virgnar Aug 19 '16

Can you clarify what you mean by that? Nearly everything in Windows is represented by an object, and a lot is done in Linux through interacting with it as if it was a file or stream of data.