Ornery.org
  Front Page   |   About Ornery.org   |   World Watch   |   Guest Essays   |   Contact Us

The Ornery American Forum Post New Topic  Post A Reply
my profile login | register | search | faq | forum home

  next oldest topic   next newest topic
» The Ornery American Forum » Ornery U » Ornery U: Computer Programming 101

 - UBBFriend: Email this page to someone!    
Author Topic: Ornery U: Computer Programming 101
Psudo
Member
Member # 6403

 - posted      Profile for Psudo   Email Psudo   Send New Private Message       Edit/Delete Post   Reply With Quote 
This thread will be for any and all questions about computer programming and computer science. Feel free to ask whatever you want, and I'll answer as best as I can.

Other programmers, please jump in when you have a comment or a correction to mine; I very much doubt I can answer everything myself.

I guess I'll start with a little introduction to programming.

-----
There are main two systems for computer programming: programming languages and markup languages.

Markup languages (like HTML, XML, and SVG) take plain text and add context, meaning, and relationship to it with the use of tags. The simplest example is the the HTML Bold tag. You type this:
code:
Text between b tags <b>becomes bold</b>.

And the web browser displays this:
quote:
Text between b tags becomes bold.
The UBB Code this forum uses for bold, quotes, urls and such is a kind of simplified markup language. It's unusual in that it uses square brackets [] instead of angle brackets <>, which is intentional to keep it from conflicting with the more complex markup languages used on the site itself.

Programming languages (like C, Java, and Basic) describe some very precise set of instructions for the computer to follow to organize data in some useful way (like interpreting an audio file into speaker movements that produce sound). When the computer is following these instructions, they've been converted to a sequence of numbers (called "machine code") that means nothing to humans (unless they've dedicated a good portion of their lives to fairly useless memorization) but tells the computer's CPU exactly which of it's set of operations it should run. To make it easier for humans to read, these instructions are written in programming languages that look a least a little more like English. This "code" (it's still not really English) is then translated into machine language by other computer programs (compilers or interpreters) into machine code.

Because it's eventually going to be read by a machine that is completely incapable of intuition or judgment, programming languages tend to have VERY strict system of syntax. Small typos will often cause programs to fail to compile at all, throw errors when used, or simply function wrong. This scares a lot of people away, but don't worry too much about it: if that happens, you only have to fix the typo and try again. You're not going to break your computer or lose your data from little newbie mistakes.

To summarize, markup languages are for documents and programming languages are for data processing.

Any questions? If so, they're top priority. If not, I'll write another little lesson/essay next weekend.

Posts: 229 | Registered: Jan 2009  |  IP: Logged | Report this post to a Moderator
scifibum
Member
Member # 945

 - posted      Profile for scifibum   Email scifibum   Send New Private Message       Edit/Delete Post   Reply With Quote 
How would you write a search engine in perl?

[Razz]

Posts: 6847 | Registered: Mar 2003  |  IP: Logged | Report this post to a Moderator
JoshuaD
Member
Member # 1420

 - posted      Profile for JoshuaD   Email JoshuaD   Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:

#!/usr/bin/perl

use CPAN::GOOGLE;

print "google(ARGS)\n";

Duh.
Posts: 3742 | Registered: Dec 2003  |  IP: Logged | Report this post to a Moderator
TomDavidson
Member
Member # 99

 - posted      Profile for TomDavidson   Email TomDavidson   Send New Private Message       Edit/Delete Post   Reply With Quote 
Okay, I'm doing a .NET webapp in C#, and I need to create a fileshare (with underlying directory) and DFS link on a remote server as part of a user provisioning process. The fileshare needs both physical directory and share permissions set. The app is in .NET 3.5, meaning that there SHOULD be an API for this nowadays. I just can't find it.

Suggestions? I'd like to avoid interop, where possible.

Posts: 22935 | Registered: Nov 2000  |  IP: Logged | Report this post to a Moderator
TomDavidson
Member
Member # 99

 - posted      Profile for TomDavidson   Email TomDavidson   Send New Private Message       Edit/Delete Post   Reply With Quote 
Turns out that this is harder than it sounds (or should be), and basically required me to use P/Invoke against WMI.
Posts: 22935 | Registered: Nov 2000  |  IP: Logged | Report this post to a Moderator
scifibum
Member
Member # 945

 - posted      Profile for scifibum   Email scifibum   Send New Private Message       Edit/Delete Post   Reply With Quote 
When I googled, the only examples I found that were at all promising seems to use either ASDI calls or win32 APIs. Couldn't find anything that strictly used .NET classes. (Although I think you could probably manage the permissions themselves using the DirectoryServices classes, not that I've done it or know exactly how.)
Posts: 6847 | Registered: Mar 2003  |  IP: Logged | Report this post to a Moderator
JoshuaD
Member
Member # 1420

 - posted      Profile for JoshuaD   Email JoshuaD   Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
programming languages are for data processing.
[Eek!] . That's like saying Magic in D&D was for summoning fireballs. Yea sometimes it's used that way, but it's much cooler than that.

Programming languages are magic.

Posts: 3742 | Registered: Dec 2003  |  IP: Logged | Report this post to a Moderator
Psudo
Member
Member # 6403

 - posted      Profile for Psudo   Email Psudo   Send New Private Message       Edit/Delete Post   Reply With Quote 
I would argue that the data processing is magic. You turned seemingly random 1s and 0s into an interactive audio/visual experience (such as World of WarCraft)! You created something from virtually nothing! That is the definition of magic, as far as I'm concerned.

"Data processing" just sounds way more boring than it's results actually are.

By the way, that's the best search engine in Perl I've ever seen. =]

[ January 25, 2009, 03:21 PM: Message edited by: Psudo ]

Posts: 229 | Registered: Jan 2009  |  IP: Logged | Report this post to a Moderator
Wayward Son
Member
Member # 210

 - posted      Profile for Wayward Son   Email Wayward Son   Send New Private Message       Edit/Delete Post   Reply With Quote 
I heard about Visual Basic but know nothing about it.

Is it similar to the old BASIC programming language? Is it radically different? Can it be used to make simple computer programs? How powerful is it? How does it work? Is it easy to learn? Is it worth buying?

IOW, can you tell me anything about it?

Posts: 8681 | Registered: Dec 2000  |  IP: Logged | Report this post to a Moderator
TomDavidson
Member
Member # 99

 - posted      Profile for TomDavidson   Email TomDavidson   Send New Private Message       Edit/Delete Post   Reply With Quote 
Visual Basic is not particularly like BASIC. It can be used to make both simple AND complex computer programs, and is a fully functional modern programming language (although, as it evolves to be closer and closer to C# as a member of the .NET family, it loses some of its distinctiveness and charm.) It is slightly easier to learn, IMO, than C#, but I think C# is a better use of your time. That said, Office products have a history of supporting VBA (Visual Basic for Applications, a stripped-down version of the language) for automation code; if you want to write macros for Microsoft Office products, VBA is very useful.

If you intend to write Windows code for a living, you should definitely buy Visual Studio.

Posts: 22935 | Registered: Nov 2000  |  IP: Logged | Report this post to a Moderator
Psudo
Member
Member # 6403

 - posted      Profile for Psudo   Email Psudo   Send New Private Message       Edit/Delete Post   Reply With Quote 
Very ancient versions of Visual Basic from the DOS days were very much like other versions of Basic (GWBasic, QBasic, etc), but as Win3.x and Win9x became the norm, Visual Basic followed into the windowed paradigm and the other Basics did not.

Yay for trivial historical information.

Posts: 229 | Registered: Jan 2009  |  IP: Logged | Report this post to a Moderator
scifibum
Member
Member # 945

 - posted      Profile for scifibum   Email scifibum   Send New Private Message       Edit/Delete Post   Reply With Quote 
If you need to track an IP address, build a GUI in Visual Basic.
Posts: 6847 | Registered: Mar 2003  |  IP: Logged | Report this post to a Moderator
JoshuaD
Member
Member # 1420

 - posted      Profile for JoshuaD   Email JoshuaD   Send New Private Message       Edit/Delete Post   Reply With Quote 
I think Scifibum meant to say "Don't use Visual Basic." In fact, I'm sure of it. [Wink]

[ January 28, 2009, 02:01 PM: Message edited by: JoshuaD ]

Posts: 3742 | Registered: Dec 2003  |  IP: Logged | Report this post to a Moderator
scifibum
Member
Member # 945

 - posted      Profile for scifibum   Email scifibum   Send New Private Message       Edit/Delete Post   Reply With Quote 
Nope. Just ask the folks on CSI NY.
Posts: 6847 | Registered: Mar 2003  |  IP: Logged | Report this post to a Moderator
JoshuaD
Member
Member # 1420

 - posted      Profile for JoshuaD   Email JoshuaD   Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by scifibum:
Nope. Just ask the folks on CSI NY.

Oh dear. [Exploding]
Posts: 3742 | Registered: Dec 2003  |  IP: Logged | Report this post to a Moderator
LoverOfJoy
Member
Member # 157

 - posted      Profile for LoverOfJoy   Email LoverOfJoy   Send New Private Message       Edit/Delete Post   Reply With Quote 
How do you pronounce C#? See sharp? See pound? Something else entirely?
Posts: 3639 | Registered: Nov 2000  |  IP: Logged | Report this post to a Moderator
JoshuaD
Member
Member # 1420

 - posted      Profile for JoshuaD   Email JoshuaD   Send New Private Message       Edit/Delete Post   Reply With Quote 
See Sharp.
Posts: 3742 | Registered: Dec 2003  |  IP: Logged | Report this post to a Moderator
JoshuaD
Member
Member # 1420

 - posted      Profile for JoshuaD   Email JoshuaD   Send New Private Message       Edit/Delete Post   Reply With Quote 
See Sharp Run.
Posts: 3742 | Registered: Dec 2003  |  IP: Logged | Report this post to a Moderator
The Drake
Member
Member # 2128

 - posted      Profile for The Drake   Email The Drake   Send New Private Message       Edit/Delete Post   Reply With Quote 
See Sharp Run Slow
Posts: 7707 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
JoshuaD
Member
Member # 1420

 - posted      Profile for JoshuaD   Email JoshuaD   Send New Private Message       Edit/Delete Post   Reply With Quote 
[LOL]
Posts: 3742 | Registered: Dec 2003  |  IP: Logged | Report this post to a Moderator
   

Quick Reply
Message:

HTML is not enabled.
UBB Code™ is enabled.

Instant Graemlins
   


Post New Topic  Post A Reply Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Ornery.org Front Page

Powered by Infopop Corporation
UBB.classic™ 6.7.1