• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

Programming Help

Unnamed said:
It's not the first time you mention that (Gossip), but Wikipedia and Google came empty again. Where can I find information about it?
You can't. Well, if you PM me I'll send you the spec. It's my own language, which compiles to TAWK. TAWK is an extended version of AWK produced by Thompson Automation. Unfortunately, they don't support it any longer.

~~ Paul
 
You are correct about Python, but Perl is the work of the Devil's Mentor.

Purely out of curiosity, why such disdain for Perl?

I'd never use it for a major project, but I find its easy to learn the basics and there's more free documentation than you can shake a stick at. I use it much in the same way I'd use a Swiss Army knife, handy and great for small and/or repetitive tasks.
 
I've used some Python for writing build scripts using SCons. SCons is a daddified build system, BTW. I'll never use make again, if I can help it.

I like Python a lot. I REALLY like it that indent determines scope. No sloppy indenting in code, since it wouldn't even work that way. I've had a much easier time reading Python code because of that.

Oh yeah, and I've used AWK... that's some weird (but powerful) stuff.
 
Last edited:
Purely out of curiosity, why such disdain for Perl?

I'd never use it for a major project, but I find its easy to learn the basics and there's more free documentation than you can shake a stick at. I use it much in the same way I'd use a Swiss Army knife, handy and great for small and/or repetitive tasks.

Conversely, I found Perl had a very steep learning curve initially. It's fine if you're already familiar with the stuff it's designed to replace like sed, grep and awk, but otherwise, it takes a bit of getting used to.

For small tasks like extracting information from text files, I now use Ruby exclusively. The problem with Perl is that simple tasks often become somewhat less than simple, and with any sort of structured data, you end up juggling arrays of hashes of hashes and whatnot. Ruby makes this all so much easier to deal with.
 
I like Python a lot. I REALLY like it that indent determines scope. No sloppy indenting in code, since it wouldn't even work that way. I've had a much easier time reading Python code because of that.

I've started using Python as a replacement for Java for some small projects. It has some very annoying quirks (especially compared to Ruby), but it's mature and fast (and even faster if you can JIT it with Psyco). I never find myself using it for scripting, though, It falls down on regex support - if you don't have baked-in regex support like =~ in Perl and Ruby, it hurts.
 
Microsoft now offers free versions of most of their compilers in a promotion called "Express" - available for download.

VB.NET 2005 Express
C#.NET 2005 Express
VC++ 2005 Express

and so forth

If you are fairly familiar with BASIC then VB.NET might not be that big of a step for you (truthfully, making the step from old BASIC to any windows development platform wont exactly be trivial but its not something that cant be overcome in your case with an hour spent with the tutorials getting a simple console application up, running, and calculating.)
 
Conversely, I found Perl had a very steep learning curve initially. It's fine if you're already familiar with the stuff it's designed to replace like sed, grep and awk, but otherwise, it takes a bit of getting used to.

Fair enough-- I'm a life-long UNIX geek and its easy for me to forget that not everybody is familiar with grep, sed, and awk.
 
If you're looking for a quick and dirty solution for simple math, why not just use Excel? It has VBA behind the scenes if you have logic that can't easily be done in spreadsheet.
 
You can't. Well, if you PM me I'll send you the spec. It's my own language, which compiles to TAWK. TAWK is an extended version of AWK produced by Thompson Automation. Unfortunately, they don't support it any longer.
Thanks for the offer, but I was just curious to see an example.

It's cool that you have a language. I always wanted to design one, but never learned enough to actually do it. My compliments.
 
If you're looking for a quick and dirty solution for simple math, why not just use Excel? It has VBA behind the scenes if you have logic that can't easily be done in spreadsheet.

Well if hes going to be using VBA then he might as well just use the built-in VBScript that is on every windows platform since I guess Windows 95, and not bother with a 2nd program such as Excel.
 
Zizzy said:
Purely out of curiosity, why such disdain for Perl?
It's a classic example of some guy's twisted language design that he foisted on the world. Anyone who can't tell me the collective term for the characters $, @, %, and & has no business using the language. And even with that, Wall misused the term. It's an abomination of hacks and kludges. Maybe the total redesign that is Perl 6 will be better.

I'm an old-school language guy. I like some formality to my languages.

~~ Paul
 
Unnamed said:
Thanks for the offer, but I was just curious to see an example.
Here's some code that gets a list of files in a directory (all_files), builds a set of the .pdf files (pdf_file), determines a special sort order for the files (pdf_sort) along with an explanatory note, and then lists the files in that order. determine_file_note() is an example of a function that returns multiple values. You need to know that in a function, undefined names of 1 or 2 letters* are automatically defined as local variables.

Code:
#macro emit (rest body)
  format(#body, standard_output)
#mend


constant file_format = "  ~18S  ~S\n";

function file_report ()
{
  local all_files := directory_files(pdf_file_dir);

  foreach f in all_files do
    pdf_file[downcase(file_name(f))] := nil if file_ext(f) = "pdf";

  foreach f in pdf_file do {
    (pdf_file[f], s) := determine_file_note(f);
    pdf_sort[s] := f;
  }

  if empty? pdf_file then fatal("No PDF files in the directory.");

  foreach s in alphameric_order pdf_sort do
    emit(file_format, pdf_sort[s], pdf_file[pdf_sort[s]]);
}

* This is controlled via a pragma.
 
Last edited:
Personally, I'd recommend using Visual Basic 6.0.

VB6 can be considered a bit 'outdated', but since this doesn't sound like a program that has to be leading edge, it will do you fine. And your past experience with Basic will help.

You can actually get a free version of the VB compiler in various text books. (It has a complete interface, and can do virtually everything but create a stand-alone executable. You can run the program from the development environment.)

One book that I used when I taught college was VB6 How to Program by Deitel.
http://www.amazon.ca/Visual-Basic-6...f=sr_1_37/702-0864852-3465613?ie=UTF8&s=books
 
Religion, programming language, religion, programming language.

Who says programmers don't have enough sects?
 
If you are on a budget, C++ is the way to go. You can get a compiler for free. For XP I would either grab the free version of VC++, or go with MinGW, which is the port of gcc to Win32.

There are also a ton of free libraries for math programming. Check out, for example, the gnu scientific library (GSL). For that matter, I even wrote a C++ math library.

The point is, while C++ is not the easiest language for math programming, it is the most powerful (which is to say, it is equally as powerful as anything else available), and you can do pretty much anything you need for free.

Dr. Stupid


I personally would _not_ recommend C++ at all. I vastly prefer C; it's a lot less obfuscated. If you need object oriented programming, use C#; it performs this task a lot more sanely. This is my personal preference though, obviously.

If you decide to program in C, Dietel and Dietel's "How to Program in C" is absolutely excellent. You can set yourself up with Cygwin or MinGW; I personally use the Cygwin package.

If you want to learn C#, use the free online Visual C# Express. I personally prefer C (only because it isn't Microsoft's .NET; for no other reason), however Visual C# Express has an excellent debugger, and it is much easier to make GUI's through forms using the windows API than it is manually making one using SDL with C (Ironically, I do the latter anyway, since it is more portable). These are just my suggestions; sorry about the lack of links... 13 more posts to go :P

EDIT: Also please don't use visual BASIC, or anything with the word BASIC in it for that matter. In words of one greater than I, "It is practically impossible to teach good programming style to students that have had prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." (Edsger W. Dijkstra: Selected Writings on Computing: A Personal Perspective)

That might seem a little dank considering you've already used BASIC in depth, however there is still hope for you! :P
 
Last edited:
If you decide to program in C, Dietel and Dietel's "How to Program in C" is absolutely excellent.
Just to stick my oar in one more time: The D&D book is entirely adequate if you like textbook-style books - it has more coloured boxes and checklists (and questions, if you like that sort of thing) than you can shake a stick at. It also rejoices in what seems like a billion different typefaces to illustrate the different parts of a program. This has the opposite effect of what's intended - making it harder to read the code than if it was unadorned.

Also, it's about twice as expensive as similar books (e.g. Stephen Kochan's book), twice as heavy, and only half of the book is actually about C - the rest of it being an entirely pointless excursion into C++ and Java. I can't imagine what sort of a person could expect to learn all that from one book. I would consider it if money was no object, or you can get it from a library.

To be honest though, I wouldn't bother with C at all (although I do agree it's probably a better choice for what the OP is wanting than C++).
 
Marting said:
Who says programmers don't have enough sects?
But at least no crusades or jihads yet. :D

JamesM said:
It also rejoices in what seems like a billion different typefaces to illustrate the different parts of a program. This has the opposite effect of what's intended - making it harder to read the code than if it was unadorned.
Absolutely right on, man! I often ask authors why they want to use bold for language keywords. "It helps to read the programs." If the reader doesn't understand the language well enough to recognize the keywords, he's got bigger problems, my friend.

~~ Paul
 
EDIT: Also please don't use visual BASIC, or anything with the word BASIC in it for that matter. In words of one greater than I, "It is practically impossible to teach good programming style to students that have had prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." (Edsger W. Dijkstra: Selected Writings on Computing: A Personal Perspective)

Take everything Dijkstra writes with a grain of salt. Hes an extremist language bigot.

This is the same guy who absolutely refuses to use a GoTo even when a GoTo is the best tool for the job. He would have had a point if languages offered a flow control paradigm for every job.. but they don't.. and he has absolutely no point in regards to modern Basic designs which is actualy forgivable considering he wrote all that junk prior to modern Basic design.
 
Rockoon said:
This is the same guy who absolutely refuses to use a GoTo even when a GoTo is the best tool for the job. He would have had a point if languages offered a flow control paradigm for every job.. but they don't.. and he has absolutely no point in regards to modern Basic designs which is actualy forgivable considering he wrote all that junk prior to modern Basic design.
For example, a tokenizer with state transition logic. Jump around between those states, baby!

Without gotos you have to use an outer loop with a case statement in it. Not that bad, really, but rather artificial.

That said, I haven't used a language with goto in about 20 years.

~~ Paul
 

Back
Top Bottom