Mark Minasi's Reader Forum
Mark Minasi's Reader Forum
Home | Profile | Register | Active Topics | Active Polls | Members | Search | FAQ | Minasi Forum RSS Feed
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 HALP! Questions on Windows and Windows Server
 PowerShell
 Where is the line between scripting & programming?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

JeffWouters
Here To Stay

Netherlands
147 Posts
Status: offline

Posted - 04/09/2012 :  05:29:02 AM  Show Profile  Visit JeffWouters's Homepage  Click to see JeffWouters's MSN Messenger address  Look at the Skype phone address from JeffWouters  Reply with Quote
Where does scripting end and programming begin? That's a question I got through Twitter a couple of minutes ago...
Anyone got an answer to this one?

Note: I posted this in the PowerShell topic and not the Scripting topic due to the 2012 Scripting Games... where some of the Advanced events look a heck of a lot like programming to me ;-)

Greetsz,
Jeff.

jhicks
Here To Stay

USA
283 Posts
Status: offline

Posted - 04/09/2012 :  08:12:09 AM  Show Profile  Visit jhicks's Homepage  Reply with Quote
For me, scripting is taking commands you might normally have run interactively and putting them in a file that will run them automatically for you. Sometimes this requires some basic logic and looping structures, like you would also use in programming, but that doesn't make it programming. The knowledge required for scripting is a deep understanding of the technology or tool you are scripting, such as PowerShell. Scripting is also immediate and requires no special development tools or compiling. Programming is writing code to control a system or application based on underlying design concepts, such as the .NET Framework. This requires a very specialized knowledge set. If you are programming, you are writing something that has to be processed in some way, before it can be executed.

Certainly, there is a gray middle area. We've all seen PowerShell scripts that call the .NET Framework directly, make use of COM objects and are incredibly complex. In my opinion, if I see a script that uses the .NET Framework to achieve the same result that could be reached with a cmdlet, I think that is more programming than scripting and wonder why they are bothering with PowerShell at all. And unfortunately, some things like Windows Forms and WPF require a bit of programming sophistication, even though they can be included in a PowerShell script.

For me, the bottom line is that scripting is immediate and doesn't require specialized knowledge. Programming is a step removed and requires specialized tools and knowledge.

Jeffery Hicks
Windows PowerShell MVP

http://jdhitsolutions.com.blog
http://twitter.com/JeffHicks
http://www.ScriptingGeek.com
Now Available: Managing Active Directory with Windows PowerShell: TFM 2nd ed.
Go to Top of Page

JeffWouters
Here To Stay

Netherlands
147 Posts
Status: offline

Posted - 04/09/2012 :  08:24:24 AM  Show Profile  Visit JeffWouters's Homepage  Click to see JeffWouters's MSN Messenger address  Look at the Skype address for JeffWouters  Reply with Quote
For me personaly, programming involves some GUI you create (forms and stuff like that) where scripting is, as Jeff wrote, immediate and most of all... no GUI ;-)
The part about calling the .NET Framework and/or COM objects directly is a good point however... don't know yet where to place those in my thoughts about scripting/programming... food for thought :-D

Greetsz,
Jeff.
Go to Top of Page

netmarcos
Honorable But Hopeless Addict

USA
2219 Posts
Status: offline

Posted - 04/09/2012 :  08:36:06 AM  Show Profile  Visit netmarcos's Homepage  Click to see netmarcos's MSN Messenger address  Look at the Skype address for netmarcos  Send netmarcos a Yahoo! Message  Reply with Quote
Script: Compile at runtime - batch, VBS, PoSH
Program: Compiled in advance - .exe, etc.

Not 100% applicable, but it comes close to a definition for most of my purposes.

Mark M. Webster

Genius may have its limitations, but stupidity is not thus handicapped. - Elbert Hubbard

Go to Top of Page

Will Steele
Welcome Newcomer

USA
1 Posts
Status: offline

Posted - 04/09/2012 :  10:08:17 AM  Show Profile  Visit Will Steele's Homepage  Reply with Quote
Programming is the creation of systems. Scripting is the automation of programmed systems. Scripting is a subset of programming because it relies on a pre-existing system whereas programming is more about creating the system itself. Often times a script is little more than automating what would normally be user-driven events for a program. In a sense, this automation merely removes the operator from the role of generating events and puts it back on the system itself in a pre-defined way. If something does not yet exist a script can become a program by creating the ability to perform tasks a program does not yet have defined. In short, scripting uses existing systems; when scripting languages create new possibilities for programs it is a programming with a scripting language. That, as was alluded to above, can be a gray area. For instance, when is a sophisticated script a program versus a really sophisticated script. My mind is drawn to the analogy of a ship being replaced board by board. At what point is it no longer the original ship?
Go to Top of Page

JamesNT
Moderator

USA
3150 Posts
Status: offline

Posted - 04/09/2012 :  7:09:39 PM  Show Profile  Visit JamesNT's Homepage  Click to see JamesNT's MSN Messenger address  Reply with Quote
Scripting ends and programming begins when you start using object oriented principles.

JamesNT

James Summerlin
www.jamessummerlin.com
Go to Top of Page

JeffWouters
Here To Stay

Netherlands
147 Posts
Status: offline

Posted - 04/10/2012 :  12:10:23 AM  Show Profile  Visit JeffWouters's Homepage  Click to see JeffWouters's MSN Messenger address  Look at the Skype address for JeffWouters  Reply with Quote
@JamesNT: That would mean that PowerShell is by definition a programming, not a scripting, language...?

Greetsz,
Jeff.
Go to Top of Page

JamesNT
Moderator

USA
3150 Posts
Status: offline

Posted - 04/10/2012 :  07:30:48 AM  Show Profile  Visit JamesNT's Homepage  Click to see JamesNT's MSN Messenger address  Reply with Quote
Can you do inheritance, reflection, and so forth in Powershell?

JamesNT

James Summerlin
www.jamessummerlin.com
Go to Top of Page

jhicks
Here To Stay

USA
283 Posts
Status: offline

Posted - 04/10/2012 :  08:10:09 AM  Show Profile  Visit jhicks's Homepage  Reply with Quote
It can do those things only because PowerShell is built on the .NET Framework. But using those features doesn't necessarily mean we're programming. PowerShell is a management engine that can be hosted by an application. For most admins that is the familiar blue console. But running a command like Get-Service in a script doesn't mean I'm programming. But if I run this: [System.ServiceProcess.ServiceController]::GetServices() which does the exact same thing, then I would say *that* is programming.

Jeffery Hicks
Windows PowerShell MVP

http://jdhitsolutions.com.blog
http://twitter.com/JeffHicks
http://www.ScriptingGeek.com
Now Available: Managing Active Directory with Windows PowerShell: TFM 2nd ed.
Go to Top of Page

Curt
Moderator

USA
6648 Posts
Status: offline

Posted - 04/10/2012 :  1:47:51 PM  Show Profile  Visit Curt's Homepage  Reply with Quote
Remember that we once wrote C code in a text editor and compiled it.

So no GUI was needed. And we WERE programming.

Now we can use a minimal amount of code within an GUI and "Program" a process for business.

It's programming. Extending the base functionality of an application or interface.

Curt Spanburgh
Microsoft Certified Business Solution Specialist.
Dynamics CRM MVP
Contributing Editor, Windows IT Pro

He that is walking with wise persons will become wise, but he that is having dealings with the stupid ones will fare badly.
Proverbs 13:20


Go to Top of Page

jhicks
Here To Stay

USA
283 Posts
Status: offline

Posted - 04/10/2012 :  2:00:09 PM  Show Profile  Visit jhicks's Homepage  Reply with Quote
The key word in your response is "compiled". If the code I'm writing has to be compiled or processed in someway before I can use it, then that's programming.

Jeffery Hicks
Windows PowerShell MVP

http://jdhitsolutions.com.blog
http://twitter.com/JeffHicks
http://www.ScriptingGeek.com
Now Available: Managing Active Directory with Windows PowerShell: TFM 2nd ed.
Go to Top of Page

Curt
Moderator

USA
6648 Posts
Status: offline

Posted - 04/10/2012 :  2:47:26 PM  Show Profile  Visit Curt's Homepage  Reply with Quote
Thanks Jeff.

Yes, it is. With the world of MS CRM 2011 and MS CRM 2011 online we have multiple types of "Programming" where we write Plug-ins, Workflows,Reports but we also write JavaScript into the entity forms and create "Solutions" that can then be imported from DEV to Production.

There are multiple skills going on here and it blurs the traditions.
Customizations to the system are tested and published to the production on the same system, because we can see and run code test while not affecting production in a large way.

Often, with the use of grids and option sets and other tools we "Program" the entity forms and the relations within the objects and views without opening up Visual Studio. The changes are compiled in the publishing to all users after verification and the platform has rules of precedence.

So all of this seems to blurr my friend James terse description.

Curt Spanburgh
Microsoft Certified Business Solution Specialist.
Dynamics CRM MVP
Contributing Editor, Windows IT Pro

He that is walking with wise persons will become wise, but he that is having dealings with the stupid ones will fare badly.
Proverbs 13:20


Go to Top of Page

jhicks
Here To Stay

USA
283 Posts
Status: offline

Posted - 04/10/2012 :  3:03:49 PM  Show Profile  Visit jhicks's Homepage  Reply with Quote
I guess the reason this hits close to home for me is that as a speaker and trainer I often get people thinking they are are programming in PowerShell, or that programming skills are required; and that couldn't be further from the truth.

Jeffery Hicks
Windows PowerShell MVP

http://jdhitsolutions.com.blog
http://twitter.com/JeffHicks
http://www.ScriptingGeek.com
Now Available: Managing Active Directory with Windows PowerShell: TFM 2nd ed.
Go to Top of Page

Curt
Moderator

USA
6648 Posts
Status: offline

Posted - 04/10/2012 :  3:23:24 PM  Show Profile  Visit Curt's Homepage  Reply with Quote
But it does seem a bit like T-SQL development and I would consider that programming.

modifying data and creating report queries, stored proceedures.

And it's really required, given that I've seen SSMS GUI assembled Maintenance plans generate incorrect T-SQL code.

So I would say it's closer to development then say writing a batch file.

I never considered writing batch routines using stsadm.exe to be development. Just Job creation for Share Point management.

Curt Spanburgh
Microsoft Certified Business Solution Specialist.
Dynamics CRM MVP
Contributing Editor, Windows IT Pro

He that is walking with wise persons will become wise, but he that is having dealings with the stupid ones will fare badly.
Proverbs 13:20


Go to Top of Page

jhicks
Here To Stay

USA
283 Posts
Status: offline

Posted - 04/10/2012 :  3:46:51 PM  Show Profile  Visit jhicks's Homepage  Reply with Quote
I'll admit that depending on the product and environment, you may have to do more "programming" to get something done in PowerShell because there isn't decent cmdlet coverage. For example, in PowerShell v1 there were no cmdlets from Microsoft for managing AD, but you could script or "program" using the .NET System.DirectoryServices classes. Not easy or admin friendly. But PowerShell is flexible and strong enough to handle both approaches.

Jeffery Hicks
Windows PowerShell MVP

http://jdhitsolutions.com.blog
http://twitter.com/JeffHicks
http://www.ScriptingGeek.com
Now Available: Managing Active Directory with Windows PowerShell: TFM 2nd ed.
Go to Top of Page

JamesNT
Moderator

USA
3150 Posts
Status: offline

Posted - 04/10/2012 :  9:22:26 PM  Show Profile  Visit JamesNT's Homepage  Click to see JamesNT's MSN Messenger address  Reply with Quote
This discussion seems to be very opinion oriented and everyone has made excellent points.

JamesNT

James Summerlin
www.jamessummerlin.com
Go to Top of Page

wobble_wobble
Honorable But Hopeless Addict

Ireland
4516 Posts
Status: offline

Posted - 04/11/2012 :  02:22:49 AM  Show Profile  Visit wobble_wobble's Homepage  Look at the Skype address for wobble_wobble  Reply with Quote
Scripting is something I do for work and gets the job done.

Programming is something I do in college and really really dislike.

Joe

After everything that has happened during the month of Jan 07, I do believe that pigs fly backwards!

http://whatismyv6.com/
Go to Top of Page

DennisMCSE
Moderator

Canada
2400 Posts
Status: offline

Posted - 04/11/2012 :  12:48:45 PM  Show Profile  Visit DennisMCSE's Homepage  Look at the Skype address for DennisMCSE  Reply with Quote
One of the things I've heard a few people complain about, kind of relates to this question (between scripting and programming). When they ask for training, they can get training for learning C# or Visual Basic, because it's a "programming" language and programming is hard. Scripting? That sounds too easy, here's a book, go and learn on your own. Yes I'm paraphrasing, but the response some friends of mine get from their managers is along those lines.


DennisMCSE

Blog: http://itprofirewalker.wordpress.com/



Follow me on Twitter http://twitter.com/Firewalker96


Go to Top of Page

jhicks
Here To Stay

USA
283 Posts
Status: offline

Posted - 04/11/2012 :  1:06:29 PM  Show Profile  Visit jhicks's Homepage  Reply with Quote
And this goes beyond training. The point managers and others need to get their heads around is that PowerShell is a management tool that their staff needs to be proficient in. The scripting part is just icing on the already moist and delicious cake.

Jeffery Hicks
Windows PowerShell MVP

http://jdhitsolutions.com.blog
http://twitter.com/JeffHicks
http://www.ScriptingGeek.com
Now Available: Managing Active Directory with Windows PowerShell: TFM 2nd ed.
Go to Top of Page

JeffWouters
Here To Stay

Netherlands
147 Posts
Status: offline

Posted - 04/11/2012 :  4:56:50 PM  Show Profile  Visit JeffWouters's Homepage  Click to see JeffWouters's MSN Messenger address  Look at the Skype address for JeffWouters  Reply with Quote
From my personal experience:

I used to script (VBS, batch, Kix, etc...). All of which was like Dennis wrote: Get a book and learn it yourself.
Now with PowerShell I did basically the same and not so long after I started blogging about PowerShell, Jeffery Hicks posted a comment on my blog explaining to me that I was still thinking VBS yet using PowerShell code ;-)
So after some investigating my eyes were opened (and still every day I find something 'new'). Also a session from Don Jones at TechNet_Live in 2011 in The Hague (Netherlands) about PowerShell Remoting was an eye-opener for me... so I asked my 'boss' if I could follow a class. Since his first question was: "what certification can you get with that?" I had to give a "None" back. Notice that back then NO requests for PowerShell scripters were here in The Netherlands.
So, stuborn as I am, I did it the old fashioned way... self-study. But instead of books I took on webcasts, blogposts... and every single thing I had to do during business hours that took me more than 5 repetitive clicks, I started to script in the evening ;-) Those webcasts by MVP's such as Jeffery Hicks, Don, Jeffery Snover and Tobias Weltner were especially useful for me since they involved practical information and the WHY (since the HOW is something I can find out for myself...).

This took a me a heck a lot of time, but now I can pick the fruits from that labor. Where others are cursing about specific functionalities that are not in the GUI, I grab a shell and not much later I've got a script which can do what they, or I, want. And of course, non-Posh folk click every day/weel/month where I create a script and let it run while I'm getting some coffee ;-) For my current customer I'm hired to build a new Hyper-V / SCDPM / SCVMM environment yet also their Citrix guys come to me when they want something scripted ;-) Not only something... and yes, it's also not so bad for my ego ;-) For me as a freelancer, this is the best impression one could ever leave behind!

I seriously see, and experience, the benefits of even the simplest PowerShell knowhow up till more advanced scripts... and this is where, for me, the PowerShell Scripting Games come into play; specificaly the comments from the judges. 'cause good comments make you (or atleast ME) think, investigate and learn :-) And for people looking up against 'this much time and effort' to put into learning a new technology... do it like I do, make it into a contest with yourself. Every script you finish is a succes in itself, especially when it takes some investigating and you've learned something from writing it.

P.S. I'm a scripter, not a programmer... type & execute, please! ;-)

Greetsz,
Jeff.
Go to Top of Page

anthony
Moderator

USA
2373 Posts
Status: offline

Posted - 11/16/2012 :  4:43:17 PM  Show Profile  Reply with Quote
I agree with a lot of what everyone just said. However, I feel like Dennis' last comment really hit home. I don't have the ability to spend nights and weekends getting the basics. I learn much better in a deep dive class environment. I know Don Jones does some instructor led training. Do you know of any other good ones. My boss has agreed to pay for it. On top of that - he has agreed to give me a substantial bonus if I can use powershell to completely automate one substantial thing we do every day.

I just need some instructor led training.... reading books is not cutting it for me.

So other than Don Jones' class (which I'm still considering) is there anything instructor led out there you could recommend?

anthony

There should be only one World's Greatest Dad shirt. And you should have to kill the previous owner to wear it.
Go to Top of Page

JSCLMEDAVE
Administrator

USA
6113 Posts
Status: online

Posted - 11/16/2012 :  5:01:22 PM  Show Profile  Visit JSCLMEDAVE's Homepage  Click to see JSCLMEDAVE's MSN Messenger address  Reply with Quote
Jeff has some Train Signal courses and he is usually readily available to answer questions that you may have, but if it is class room only I would go with Don...

What is it you need to automate?

Tim-

“This too shall pass"
Go to Top of Page

JeffWouters
Here To Stay

Netherlands
147 Posts
Status: offline

Posted - 11/17/2012 :  08:27:30 AM  Show Profile  Visit JeffWouters's Homepage  Click to see JeffWouters's MSN Messenger address  Look at the Skype address for JeffWouters  Reply with Quote
Just read this topic again... just amazing what on little question can cause :-D

Greetsz,
Jeff.
Go to Top of Page

wim
Honorable But Hopeless Addict

Netherlands
1552 Posts
Status: offline

Posted - 11/18/2012 :  1:39:09 PM  Show Profile  Visit wim's Homepage  Click to see wim's MSN Messenger address  Reply with Quote
I think the discussion on what is what mostly turns out in religious discussions. I would keep it simple. Scripting is basic automation of stuff without too much intelligence build in. Programming involves a lot more logic and complexity. Arguments like 'it has to be compiled' don't really hold ground I think. I used to use a basic interpeter long ago. So is that scripting but when I compile the code it is suddenly programming? I also have (helped) writting entire software distribution and monitoring systems for hundreds of systems using vbscript. Is it a script or a program now?

Also, error from vbscript:
'Microsoft VBScript compilation error '800a0411' '

Hey wait, compiling a script? :)

So back to what I said:

Simple automation: Scripting
Complex logic: Programming

I am sure someone disagrees though ;)

I hear and I forget, I see and I know, I do and I understand.
Go to Top of Page

JamesNT
Moderator

USA
3150 Posts
Status: offline

Posted - 11/18/2012 :  8:55:08 PM  Show Profile  Visit JamesNT's Homepage  Click to see JamesNT's MSN Messenger address  Reply with Quote
On a whim, I have to agree with wim.

Do excuse me. I'm working with deployement services and must now mount my wim.

Glad to have you back on the forums, wim!

JamesNT

James Summerlin
www.jamessummerlin.com
Go to Top of Page

joe_elway
Honorable But Hopeless Addict

Ireland
7393 Posts
Status: offline

Posted - 11/19/2012 :  11:16:59 AM  Show Profile  Visit joe_elway's Homepage  Reply with Quote
I'll say: compilation is the line. When you end up with a .EXE program, then you were programming :) And damned if I know what the hell a Windows Store App is :)

Aidan Finn
MCSE, MVP (Virtual Machine)

IT Blog: http://www.aidanfinn.com
My Photography: http://www.aidanfinnphoto.com/
Books: WS2012 Hyper-V Installation & Config Guide, MSFT Private Cloud Computing
Twitter: http://twitter.com/joe_elway
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Mark Minasi's Reader Forum © 2002-2011 Mark Minasi Go To Top Of Page
This page was generated in 0.23 seconds. Snitz Forums 2000