What I don’t get about C is that it can get as cryptic as assembler, and it is slower than BASIC. Intel and AMD have to make faster and faster processors to cover up that fact. What happened to the good ol’ days of Turbo Pascal? Now that was an easy to understand language, and it was very fast too, even on an IBM PC AT. I had a program that sorted 100 randomly generated number lists of various array sizes ranging from 10 to 400, using six common sorting algorithms, and have that program count the number of comparisons and switches it took for each algorithm to sort each list, and print out the amount of exchanges in a separate formatted list. On an IBM PC in Turbo Pascal, I didn’t blink before it printed out the comparison list. In C on a Sun Sparc, it took over 30 seconds. If Borland had figured out how to use network tools in Pascal, we would still be using it instead of C.
Doesn’t Borland’s Delphi use an extension of Pascal? And, for old time’s sake, you can download TP v1.0, v3.02 (the classic version), and v5.5 from their museum. Freeware for registering.
More Python programmers? That’s what I’ve been working on the last few months.
C can be extremely fast if you take full advantage (and your machine does too) of register variables, optimizations (like inlining functions) and so on. On the Sun at work, whose exact model I don’t know, I tested an unoptimized versus an agressively optimized sieve, and found the optimized version to be 40% faster.
I just clicked on “send.”
I didn’t erase my C++ from my computer did I?!
Cryptic, yes. Slower than BASIC? I would guess you were using a pretty crappy compiler. UNIX was largly rewritten in C, a task that BASIC could never do for many reasons, speed included.
I finally finished my program. It’s a “reservation-based channel allocation algorithm using UNIX sockets”, as per the assignment. It’s only 135 lines, but they were hell to write, let me tell you. The man pages are rather inadequate at explaining exactly how you use the socket library functions. Luckily I still have my Linux programming book from another class, which helped some. Some, mind you. This is the giant fucking 5 ton book I mentioned in the OP.
Does anyone here use Perl? I have a couple of books on it so I can teach myself, but I haven’t gotten to it yet. One of the guys in my class likes it a lot.
Perl kicks ass, and IIRC the socket libraries are easier to deal with in Perl.
I decided to learn how to use sockets one day, so I wrote a portscanner to access every machine on the LAN and look for web servers. Little did I know that at the time Windows NT had a bug where if someone connected to any port and sent more than 10 characters or so, the CPU would jump to 100% and the machine would grind to a near halt. Everyone was running around talking about hackers before I figured out it was me.
Stupid OS should be able to refuse the freaking connection.
Perl is awesome, but the Socket module is essentially just a wrapper for Unix sockets. They’re a lot easier to setup and deal with in Perl, but they’re just as bizarre.
I… I… I just don’t get this. I’m sorry, I tried.
So what if it’s got a class for everything? How does a large library prevent you from doing anything? If you want to simulate ducksex (and you don’t have a microwaved cantaloupe, a jar of honey, and a feather pillow handy) and you’re not satisfied with the library, write your own class. There’s nothing stopping you. Subclass ducksex. Write a wrapper class. Go down to the duck singles bar.
You’ve still got options, dude.