Windows Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 12 February 2011

Programming Ka-blamming

Posted on 21:15 by Unknown

In the past whatever years I've been developing/writing/hacking/coding or whatever with software programming code, one of the most common questions I hear is this:

How do you know what language to use?

That's easy: It's usually chosen for you.  By that, I mean that forces beyond your control will, at the very least, narrow your selection, if not outright dictate the "choice".  I'm not talking about goober nerds that sit at home beating off to their own uber-awesome code.  I'm talking about the 99.99999 percent of the programmers in this world who have to answer to someone else in order to obtain a consistent paycheck.  Homeless nerds and geeks living at home (or with their buddies but not paying rent) can move on - you won't find anything useful to read here. (and besides: the PPV porn channel has a hot movie on right now I'm sure).

So, what are the forces that most often encompass our decision machinery?  Well, they are usually one or more of the following, but may be in any order based on environmental and cultural parameters.  Clear as mud?  Ok…

  • Project Guidelines - These are written by some obnoxious suit-wearing puke that read some IT crap in the seat pocket magazine during his last flight.  He/she discusses this with other suits on the golf course or at the cocktail lounge (the rest of drink at bars or at home while watching a sports game).  Then they draft up the contract and procedural crap, open your mouth, and insert the spoon repeatedly, until you loudly scream "Mmmmmmmm!" with a smile.  This little dish usually goes by another name, maybe you've heard it before: "Contract Requirements"
  • Retrofit - A secret truth to the world of programming is that a HUGE portion of all the programming work (again, the work that pays money) involves patching or modifying existing code.  You're not likely going to suggest switching to a new language to make some modifications to millions of lines of existing code.
  • Resource Availability - You like some programming language called Beatoff, but unfortunately it requires buying some special software or licensing.  Or you eat bean sprouts, wear sandals in the Winter, drink herbal tea and espouse the virtues of FOSS (that's "open source" to you Windows and Mac noobs).  Unfortunately, the attorney reminds you that indemnity risks, licensing risks, intellectual property risk are simply unknown (or undecided).  You shrug that off.  Then the CFO or CIO says, calmly: "But then we'd be dependant upon YOU to maintain this.  Hiring a replacement will be difficult.  Windows programmers are laying around in every alley, and they can easily step into an existing project - this equates to low risk, high affordability."  Game over.  Just for the record, I have been told this almost verbatim by several CxO types, even while they wore a suit and were absorbing some sort of alcoholic liquid.
  • Culture - You get hired into a company with a team of developers that have all synchronized their menstrual cycles.  You will synchronize yours as well.  It's a fact of life.

There are other forces that come into play even when the obvious, or objective, external forces do not show their face.  These are subjective, but no less influenced by prior external experience and external forces.  Call it prejudice.  Call it habit.  Call it preference.  Call it Veronica.  Whatever, we're human.  We all have habits and opinions, formed over time by happenstance situational influences.

For example, you may have worked on a particular project where you were pushed into learning a particular language.  That worked perfectly well for that project and you were able to accomplish amazing feats of amazement.  Now you come away thinking this language is not only awesome in itself, but awesome enough that it should be used on everything.

Careful.

This is like learning to use a screwdriver, and then thinking (no - wait - BELIEVING) that a screwdriver is the ultimate tool for EVERY task, bar none.

Go ahead and chuckle.  In the world of software development: THIS IS THE RULE - NOT THE EXCEPTION.  Very few programmers understand the subtle intricacies of what makes one language more viable for a set of tasks than another.  Big O factoring.  Modularity.  Refactorability.  OOP and Inheritance, and the like are low-hanging fruit for most coders.  But ask them how it actually gets parsed, recoded, digested, processed and reprocessed  - even down to machine language, considering compiler and execution derivatives - and well, they're a deer in the headlights. 

A classic example of this is to mention FORTRAN to most programmers today and watch them make stupid, anti-get-laid jokes about it, while chuckling and snorting.  They'll insist Ruby, Python, C# or F# or even C++ is the way to go.  Tell that to the folks crunching 3D seisemology data for oil exploration, or projecting multiple trajectories for interplanetary travel.  In case you're lost here: FORTRAN does nothing if not specialize in crunching numbers.  It's a math processing idiom.  In other words, it is a #2 Philips screwdriver for a #2 Philips screw head.  Same goes with AI and LISP or Scheme.  You get the picture.

Capabilities vs Ease

I haven't even gotten to the part about what the languages "can do".  As if I haven't blabbered enough already?  Oh yes.  Now comes the esoteric, aesthetic, academic part: comparing the capabilities.

The most classic of classic examples is the following question:

When should I use a BAT or CMD script instead of a VBscript?

I could dive into all sorts of propeller-head, taped-up glasses, stained t-shirt nerdish minutea, but I'll boil it down to the simplest criteria:

  • Open and Read the contents of files, especially non-ASCII files, in order to process or analyze specific things inside?
  • Read and write to the registry with at least some rudimentary error handling?
  • Read and write to the event log with the ability to filter and sort?
  • Read and write XML data?
  • Interact with relational databases?
  • Perform complicated string manipulation operations?
  • Offer complicated (or pretty-to-look-at) menus and choices?

If any of the above are true, go with VBScript (or PowerShell, etc.).  Before you blow your bongwater through your nose in disagreement, let me say this: Yes, you CAN accomplish these tasks using CMD or BAT code, but it's not as simple or as flexible in most cases as with VBScript (or other languages).  I use BAT and CMD all the time.  Actually, about half the time, and mainly for situations that only need to do things like:

  • Run commands like REG, DIR, DEL, COPY, MD, RD, REGSVR32, ROBOCOPY, FIND, FINDSTR, DSxxx, EVENTTRIGGERS, SC, NET xxx, IPCONFIG, NETSH, SCHTASKS and so on.
  • Create text files by redirecting output
  • For launching multiple scripts at once (such as multiple VBScripts or PowerShell scripts)

As a basic comparison, look at the code required to create a text file, to document environment variables or directory lists, from VBScript (using the Scripting.FileSystemObject library) as opposed to a simple CMD script.  The CMD script is dramatically simpler and easier.

Don't Lose Focus

I will do my best to avoid going off the wagon on another rant about PowerShell qualifying as being a "scripting language".  In all the years I studied at a University, and all the years working thereafter, the intention of "scripting" was to save time.  SAVE TIME.

Repeat those two words over and over for another five minutes.  I'll wait… go ahea…

mmmm, hmmmmm…. hmmmm…. finger's tapping…. hmmmmmm, hmmmmm…

ok, good?

System Administrators are NOT Developers.  Developers work with programming languages and write programs and compile them.  The focus is on complexity versus processing efficiency.  Admins work with scripting languages and write scripts.  The focus is on getting a job done quickly and keeping the learning curve short and relatively low.

Which is better?  Neither.

Doctors need plumbers.  Plumbers need doctors.  That's life.

When you're writing scripts, the goal is to accomplish the task in the least amount of time, with the least amount of effort.  Your responsibility as an Admin is to backup the databases and files, to keep the servers running, to keep connectivity running, to fix the breaks quickly and ultimately: MINIMIZE DOWN TIME.  The goal of Developers is to write programs, usually for other people to use.  They make the programs.  Admins deploy the programs to users.  Or, to put this another way…

Making the tools versus Using or Deploying the tools.

So, going back to the "focus" aspect: The goal for scripting is to solve a problem quickly, so when you have to choose between various languages - choose the one you feel will be the simplest and easiest to work with as it pertains to solving the problem at hand.  Never decide on a language because the language itself is comfortable, that should be secondary to matching it with the problem you are trying to solve.  You can modify the registry in dozens of ways.  But choosing the simplest way that meets the needs of a particular challenge, well, that's the most important perspective.

Choose wisely.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in network administration, programming, scripting, software deployment, software development | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Voting Time: Help Me Out?
    I need to get a better view of how I should manage this blog if I'm going to keep at it. I'd like to know how you typically discover...
  • A World Without Competition
    Try to imagine what things would be like today had there not been fierce competition in certain key parts of our world.  I’ll give you some ...
  • Book Update
    I posted some gibberish a few weeks ago about another book project.  Well, I'm getting close to wrapping it up, so I thought I'd go ...
  • Cost
    Software technology, like any technology, provides a means to solving problems.  Some big. Some small.  Some that help.  Some that hurt.  An...
  • Windows 7: Default User vs All Users
    A lot of confusion seems to occur with understanding the difference between the "Default User" profile, and the "All Users...
  • Time to Give Props
    With the ever-expanding volume and breadth of information on the Internet today, it's easy to focus on my own thoughts, experiences, ide...
  • Table of Contents (Preliminary)
    Here's the preliminary Table of Contents for my new book "The AutoCAD Network Administrator's Bible - 2013 Edition".  I...
  • The Nicest IT and IT Vendor Folks I Know
    I've ranted many times before how it's unfair to "hate" an entire company, without providing a rationale for it based on s...
  • Windows 8
    Two small, yet irritating things, that I hope Windows 8 addresses with respect to Windows 7: Being able to put the Recycle Bin in the S...
  • Stupid Assumptions
    After years of watching sci-fi TV shows, movies, etc. it's finally come to a point where even the so-called brightest of our authors and...

Categories

  • a
  • activation
  • active directory
  • advertising
  • agile
  • agility
  • amazon
  • american
  • apple
  • application virtualization
  • applications
  • art
  • articles
  • asp
  • augi
  • authors
  • autocad
  • AutoCAD Autodesk
  • autodesk
  • autolisp
  • automation
  • automotive
  • backups
  • batch
  • beer
  • beta
  • blackberry
  • blogs
  • bongloads
  • book
  • books
  • Books writing kindle amazon technology business projects
  • browsers
  • business
  • cad
  • career
  • certification
  • chrome
  • city government
  • civilization
  • cloud services
  • cmd
  • cmmi
  • comedy
  • command
  • community
  • computers
  • conferences
  • config manager
  • consultants
  • consulting
  • contracting
  • cranium drainium
  • crapware
  • culture
  • data center
  • data mining
  • databases
  • deployment
  • directx
  • DLL
  • domains
  • dumb
  • earth
  • economy
  • editor
  • education
  • election
  • elections
  • employment
  • engineering
  • entertainment
  • environment
  • error monitoring
  • events
  • exchange
  • facebook
  • family
  • firefox
  • flexnet
  • fud
  • fun
  • funny
  • games
  • gary vaynerchuk
  • gmail
  • google
  • government
  • group policy
  • hampton roads
  • health
  • history
  • holidays
  • home
  • html5
  • humor
  • hyper-v
  • iis
  • industry
  • infrastructure
  • installation
  • installshield
  • internet
  • internet explorer
  • interviews
  • jobs
  • jtbworld
  • kindle
  • kixtart
  • lab setup
  • languages
  • ldap
  • learning
  • legal
  • licensing
  • life
  • lifecycle
  • linux
  • lisp
  • logging
  • management
  • manufacturing
  • marketing
  • markets
  • mdop
  • mdt
  • medical
  • messaging
  • microsoft
  • microsoft access
  • military
  • mountains
  • movies
  • mozilla
  • music
  • nature
  • network administration
  • news
  • nook
  • nothing
  • office
  • open source
  • openoffice
  • opera
  • operating systems
  • oracle
  • osx
  • packaging
  • patches
  • people
  • photos
  • podcasts
  • policy
  • politics
  • powershell
  • predictions
  • process automation
  • products
  • programming
  • projects
  • psychology
  • publishing
  • rail
  • reading
  • registry
  • religion
  • reporting
  • reviews
  • rsat
  • rss
  • safari
  • safety
  • sales
  • satire
  • sccm
  • scheduling
  • science
  • scripting
  • search
  • security
  • servers
  • services
  • sharepoint
  • shopping
  • sms
  • social stuff
  • society
  • softgrid
  • software assurance
  • software deployment
  • software development
  • software packaging
  • sony
  • speaking
  • sports
  • sql express
  • sql server
  • statistics
  • Statistics news marketing
  • steve jobs
  • stories
  • stuff
  • stupidity
  • symantec
  • sysinternals
  • system center
  • systems architecture
  • t-sql
  • taxes
  • technet
  • technical support
  • technology
  • TED
  • ted talks
  • testing
  • textpad
  • thoughts
  • traffic
  • training
  • transportation
  • travel
  • troubleshooting
  • tutorials
  • twitter
  • ubuntu
  • unattend
  • unemployment
  • updates
  • upfront ezine
  • utilities
  • vacation
  • vba
  • vbscript
  • video
  • virginia
  • virginia beach
  • virtualization
  • visual lisp
  • vmware
  • vmware server
  • voting
  • war
  • weather
  • web
  • web browsers
  • web development
  • web sites
  • windows
  • windows 7
  • windows live
  • windows server
  • windows server 2012
  • windows8
  • winpe
  • wise
  • wmi
  • work
  • writing
  • ws08
  • wsus
  • wwa
  • x64
  • xml
  • ze frank

Blog Archive

  • ►  2013 (37)
    • ►  October (1)
    • ►  September (5)
    • ►  August (8)
    • ►  July (2)
    • ►  June (4)
    • ►  May (4)
    • ►  April (2)
    • ►  March (2)
    • ►  February (8)
    • ►  January (1)
  • ►  2012 (120)
    • ►  December (14)
    • ►  November (12)
    • ►  October (10)
    • ►  September (7)
    • ►  August (3)
    • ►  July (2)
    • ►  June (6)
    • ►  May (6)
    • ►  April (20)
    • ►  March (16)
    • ►  February (18)
    • ►  January (6)
  • ▼  2011 (343)
    • ►  December (15)
    • ►  November (23)
    • ►  October (27)
    • ►  September (35)
    • ►  August (29)
    • ►  July (17)
    • ►  June (23)
    • ►  May (20)
    • ►  April (38)
    • ►  March (61)
    • ▼  February (54)
      • MSIEXEC Error Codes
      • IBM and Watson
      • Consulting Rules
      • How to Make Better Drivers
      • Launch IE and Wait for it to be Closed
      • Another Interview, part 2
      • Upgrades and Downgrades
      • New Zealand
      • Group Policy Horrors
      • Standards Needed
      • My Eyes are Permanently Damaged
      • AutoCAD Performance Tips
      • Shitty Web Sites of The Week
      • The %ProgramFiles% Bug, Part 2 / Distrust & Uncert...
      • Microsoft: Too Early, Too Late
      • So far today...
      • Script of the Day - Open IE on Login (Just One Time)
      • Happy Friday
      • IT Jobs
      • Software Licensing
      • Mixing Gravy with Lumps
      • What Goes Up…
      • Tenuous Linking
      • Sys Admin Tips, Part 1
      • Observations
      • Grammy's Get it Right
      • What a slob I am
      • Repeat After Me: Beer is Tasty
      • Programming Ka-blamming
      • Songs I Could Do Without: Forever
      • Parse and Reparse were Sitting on a Fence
      • Happy Friday: Scripting Windows Search
      • Out of the Box and Free
      • Weekly Summary
      • LDAP / AD script stuff
      • Democracy 101
      • Stupidity
      • Food for Thought
      • Misperceptions are Often Impossible to Change
      • Right Way, and Wrong Way
      • Useful SCCM Developer Tip of the Day
      • Avoid Extremes
      • The Day After
      • Stack Overflow in a pinch
      • Attention AD Admins
      • Bugs/Annoyances: TurboTax Online
      • Windows Admin Basics: Security 101
      • Is Computer a Member of a Domain "Laptops" Group
      • Detection Deflection Reflection
      • Let's Put This Another Way
      • Top-Ranked Customer Service
      • SCCM Web Management
      • Fonts: 101
      • How to: Convert MIT Open Courseware to Kindle Reader
    • ►  January (1)
Powered by Blogger.

About Me

Unknown
View my complete profile