A Scripter at Heart

I’ve done Basic (interpreted and compiled), Cobol, C, Perl, Javascript, PHP, whatevah. And I’m not talking hobby-coding, but actual business experience.

It’s all programming. Scripting doesn’t require compilation. Having to go through compile/link cycles might make you a bit more careful, but the experience of just run and encounter the bug after you’ve trashed your data has a similar effect.

The barrier to entry might be lower with scripting languages, but at some point the complexity of the job forces you to either start becoming a real programmer or find another profession.

Learning C helps. A lot. But I also see young developers that have managed to become perfectly decent programmers without ever having touched anything else but scripting languages. Of course, those are exactly the guys that want to learn C, sooner or later…

they are updated every day, sometimes every hour

There are a lot of applications that need software that is validated before shipping. Would you want to be laying in an CT scanner knowing that they updated the software every hour? You tend to forget that there is more to programming than making a web application. Like others said, there are ways to structure a large application so that you don’t need to rebuild it all to compile, link and test your code. For what I am doing, it often takes longer to reboot the application that it does to compile and link my DLL.

If you can’t grok C, then you can’t program. Period. You might be able to cite from memory which package you should be importing, or why oneshould be using System.IO.StringReader, but THAT’S NOT PROGRAMMING. I shouldn’t have to wade through hundreds of links and spend 20 hours just to output to the damned console.

C is simple, and it forces you to think about indirection. It doesnt’ mask things from you or hide things from you and most of all, it hurts less than a root canal - which isn’t something I can say for some modern scripting languages.

[Giant I’m not trying to start a holy ware here sign]

You had an Amiga-1000. You tried learning C from the KR, you failed, you turned out a Microsoft guy. Reading CodingHorror wont be the same from now on :wink:

(I think I’ve busted my floppy drive swapping disks trying to run Lattice-C on an unexpanded Amiga500).

So what computers are these screenshots of? I’d guess that the first is an Apple ][, the second an Atari [468]00(XL)?, and the third a C64. Right?

(Atari 600XL was my first computer. 16 KB RAM. Yay! And I also learned C on the Amiga and have now switched over to Python more or less exclusively - it’s just a hobby for me, and I haven’t had that much fun programming since I was a teenager…)

Ah, I see - the filenames of the images give it away…So at least I guessed right…

I disagree [1]. For writing great programs in scripting languages you will need to have “real programming” knowledge.

You’ll write shit-script-code if you don’t know about data encapsulation: you won’t make use of powerful things like object oriented features of language like Perl or Python. Not only in C, but in scripting languages too you can introduce deadlocks and race-conditions when you are running your code in multiple threads or processes. You will face the same problems maintaining hundreds of thousands lines of script language code as with the same amounts of “real programming” langauge code.

I believe it is wrong and harmful to divide coders into two camps: the scripters and the real programmers. Whether you are programming C, C++, Python, PHP, Java, C#, Visual Basic, Javascript, Erlang, ADA, D, x86 Assembly, Tangram, Delphi, or whatever programming language of your choice: we all face the same challenges, so let’s face them together.

[1] http://www.code-muse.com/blog/?p=46

‘Scripting’ is programming. There’s no difference. There are no ‘real’ and ‘fake’ programming languages, if they let you solve problems and express algorithms, they’re all real.

And to be frank, between a programmer that doesn’t know what a pointer is but knows what higher-order functions are, and another that knows pointers but doesn’t know higher-order functions, I’d pick the former. Pointers are just an implementation detail, which are not by any way imperative to express algorithms. They’re clumsy, unsafe, and frankly I don’t care how much of a leet hacker they make you feel, they’re still responsible for a myriad of unnecessary bugs in thousands of applications.

Is that what we want from our programmers? To solve the same problem again and again, instead of dealing with new, novel problems? Ok, so you know pointers. Great. Encapsulate them into a nice library implementing the most important data structures useful for coding(vectors,lists,stacks,dictionaries,tuples), and start programming using those structures, not messing every minute with every dirty pointer trick in the book, which leads into undefined behaviour and memory leaks 90% of the time. That’s what ‘scripting’ languages do. They use the best bits of low-level languages, and then expose that functionality into a high-level environment. They’re intented for human programmers, not human compilers.

And yeah, I know C.

When I was a kid I read somewhere that C is a great and professional language, so I was really determined to try and learn it. That time I had a small 8-bit machine with a tape recorder as a storage device. As strange as it may sound, there was a C compiler for this technological wonder. It was called Hisoft C and trying to do anything with it was quite a torture. How to compile your program? Simple - rewind the tape to the beginning of stdio.h, press play. If you’re lucky, the compiler will load stdio. Then it will start compiling the program. If there are no errors (and usually there were either syntax or tape loading errors), rewind the tape to the beginning of the standard lib, etc.

On the other hand, Hisoft Pascal was a very good compiler (considering the limitations) - the compiler + editor + program could fit nicely in 32KB of memory and I could run my programs without the constant tape rewinding.

I guess this is why I used to think C was made for rich people who can afford expensive computers with good disk drives, while for everyone else there is Pascal and Basic. :slight_smile:

What do you think Perl, Python, and PHP are implemented in? C of course. And that, I think, is the niche where C really is the best choice: when you really need to write your own object system, or your own garbage collector. Those low-level bits that are needed for a language runtime.

The differentiation is more how it’s used than the language itself.

There are C interpreters–all of them seem to say that their purpose is to add a Scripting ability to your app–In that case, C is a scripting language, how could you possibly say it wasn’t?

It used to be that compiled languages took longer to see a response after an edit, now almost any app in eclipse runs the second you hit the button, so that’s meaningless.

You can SORT of make a connection between compiled/not compiled and runtime speed, but that’s really flaky (Compiled languages tend to be about 100x faster from what I’ve seen), but that opens up the whole area of VMs which can be nearly as fast as C (Java) to as slow as interpreted (Old versions of basic, the tokenizing has to count as VM as far as I can see.). If a language is on the faster side of that range, it’s almost certainly not going to run without a compilation step of some sort.

I really think the biggest reason to differentiate is so that programmers can inflate their egos by partitioning Them from Us to prove how much better we are than them.

I remember Mr. Atwood’s out-of-character post at The Daily WTF, as it was inspiring, as was many of the other posts here that encourage one to improve one’s skills. I keep hoping this blog will turn into something like Raymond Chen’s Old New Thing, you know, this is why Windows is crufty, because we had 16 bit conventions and we liked keeping customers.

I’m not disappointed that this blog is different, but still it seems like you are swinging a baseball bat through a china shop with your metaphors, with commenters spinning off on trivialities. Ah, there he goes breaking another one. I find it appealing in a different way, like watching a car crash with a scripted explosion. :wink: uuuh.

WTF am I typing. Oh, Mr. Atwood should be jumping onto things like Clojure, because the promise is that low-level concurrency primitives are abstracted away (one has to discard assumptions about mutable programming though). Higher and higher we go, let go of memory control, now let go of concurrency control.

Mr. Atwood’s main point is that he rather stay in the higher abstraction strata, with non-deterministic resource cleanup, getting things done, no earth shattering kaboom. Which is perfectly fine, creating stackoverflow.com has garnered more better kudos ™ for Mr. Atwood that this blog. (I am pressing the C++ tag multiple times a week. The answer is RAII).

I take umbrage at your revelation that your programming as mere scripting, though. Is this as deep as this blog will go? I feel like you’re channeling a reminiscent Scotty, sitting on the mock-up bridge of the Enterprise on the ST:NG Holodeck. No more tech manuals for you.

What happened to all those inspiring posts of old? :-/ Why not point the spotlight on what is up and coming in programming? Things like Clojure are a step towards in your awaited paradigm shift (OMG douse me with hype-suppression). Don’t get stuck on your limits. Explore. And make sure to report back here.

Quit making lame excuses for not learning C!

The people who insist that programmers should know/learn C usually give some very specific reasons for it, which I don’t think can be trivialized by redefining the problem away (as I’m a scripter, not a programmer does).

If the people insisting on C are actually using C to solve their day-to-day programming questions, then obviously you’d need to learn C to work with them. If they are insisting on C in a more general if you know C you understand how the machine works way, then figure out a way to explain that you do understand the machine without knowing C. For my part, I’d say: I used to do assembly language on 6502/6510 chips. C is a higher level language than assembly.

BTW, have you heard of Windows PowerShell? It basically allows you to call .NET APIs just by typing commands in a command prompt. So you can have all the power of .NET right at your fingertips. And yes it allows scripting as well. Add P/Invoke support and it would be perfect.

Whether a script or a compiled file or a stack of punch cards, it’s not the medium that makes one a programmer. You differentiate programmer from scripter where you mean to differentiate programmer from engineer (or architect). Just as you can write readable/unreadable code in any language, you can program or architect in any language, whether hand-assembled native instruction code or the highest-level scripting language. It’s not the with, it’s the what.

It’s funny, I’ve noticed that compiled-language programmers typically have a bit more disdain for interpreted-language programmers then vice versa. I’d argue against the idea that ‘scripting’ is somehow not ‘real programming’, as well as the notion that one type of language is ‘more powerful’ then the other - like most things, it’s really a question of project scope and medium.

Javascript and Flash AS3 have extremely similar syntax, but one is by nature compiled, and the other interpreted - but I think of both of them as ‘scripting’, and myself no less a programmer for wielding them as opposed to Python or C. (or whatever the kids are using these days)

I work in a compiled language, but thanks to the features of my IDE, I get the quick turnaround of interpreted languages (most of the time).

Print Hello world!
Run

Now that is a powerful computer language. It just does it, nothing fancy needed.

Both sides have advantages and disadvantages.

Interpreted stuff is an easier environment that holds your hand nicely and sort of guides you along, as long as slower execution times and having no idea what is going on under the hood isn’t a problem for you.

Compiled stuff is a pain to get started in but gives you the fastest code you can get without switching overdrive to Assembler and lets you shoot yourself in the foot in any number of exotic ways.

I myself switched from Basic to C three times before it stuck. I was using one of the first versions of a really old compiler (Computer Innovations? Desmet? I forget, it was the precursor to the one Microsoft eventually bought out to release as their own compiler) and my first program resulted in a Dorlop error. I had written such a lousy program that it bugged out and spit out the weird message Dorlop error, obviously some weird bug, but kind of funny none the less.

I kept trying to finish projects in C but kept switching back to my old Basica standby till i got a firm graps on it and was ultimately rewarded with a program that was 1/3 of the size and 10X faster than its Basic equivlent and never looked back.

But its really all just tools. A carpenter isn’t going to build an entire house using only a hammer, and a programmer isn’t going to build EVERYTHING in their career using only a single language, well hopefully.

Need to create 1000 users on your Server? You’re not going to write a C program to do that, you’re going to script it. Likewise if you are building a raytracer or video game engine you won’t script it.

The one thing I learned about those 8 hour hair pulling lessons is that you will NEVER forget the lessons learned. Formal education teaches you how to do something (like setting up a compiled environment) but practical experience usually ends up teaching you how not to do something (and many ways at that). Each are equally valid.

I spent about 30 hours trying to draw a dot on the screen in Assembly language by reading listings from an old IBM PC techncial reference bios listing. I finally learned about default number bases and that 10H didn’t mean 10D and that different compilers had different default number bases. And that one simples example ended up teaching me about 25 things instead of the original goal of drawing a dot on the screen.

I never forgot that, even 27 years later. Painfull leassons tend to stay in memory much longer.

I had kind of opposite experience. As hobbyist I wanted to be immediately productive, so I started with QBASIC and VB6. But after mastering GOTO/IF-ELSE, I just couldn’t come to terms with the QBASIC/VB syntax. Loops just seemed totally incomprehensible to me in BASIC/VB. VB was worse, someone didn’t tell me a GUI designer doesn’t make learning programming any easier. I tried VB.NET too when it came out, and the result was same. My programming ambitions didn’t go much after after that.

In the first year of my CS Diploma, I just had to learn C. Till then I was put off by the idea of learning C/C++, as I always heard C/C++ is too hard not very productive. Like you I started with the real C book, but what nobody tells you that it isn’t a book for someone who doesn’t know programming before coming to C (even though the authors say in the preface that it’s not an introductory programming manual). C syntax probably suited me a bit better I guess, because this time I got to switch, which I didn’t understand with BASIC syntax. But I was again having a hard time understanding loops. Fortunately I stumbled upon the C Primer Plus, 5th Edition (www.amazon.com/Primer-Plus-5th-Stephen-Prata/dp/0672326965), which is an excellent introductory programming book which uses C as the teaching language (although at 900 pages and with C99 coverage it’s a good reference book as well). I had little difficulty understanding loops with C Primer Plus, and programming seemed possible again. I will forever owe my programming career to that book. I didn’t learn C very deeply, and nowadays I mostly do web programming. But the lessons I learned from C are still invaluable. So what matters it not the language you learn programming with, but whether the resources you are using to learn programming are the right one for you.

I do hope to go through the KR book once again, hoping this time I’ll be able to appreciate it more like many others before me have. And early trauma does matter. I’m highly unlikely to ever touch any BASIC dialect again.