3 ms·
This is from my personal experience, YMMV. Programs written in Turbo C ran faster than programs written in Turbo Pascal, that's why it lost in the MSDOS world.
by Clubber 10y ago
This is from my personal experience, YMMV.
Programs written in Turbo C ran faster than programs written in Turbo Pascal, that's why it lost in the MSDOS world.
As an example, WWIV was a very popular BBS in the 80s and early 90s that included source code, so it was popular with a large group of hobbyists. It was originally written in Turbo Pascal but when converted to Turbo C and ran noticeably faster. Other BBSes (Telegard) took WWIV code (allegedly) written in Pascal for their software and they ran slower than the Turbo C version of WWIV. We're talking about 286 4/10Mhz machines with a turbo button, so the difference was noticable. The idea that Turbo C was faster than Turbo Pascal is probably why Pascal lost the MSDOS wars.
Visual Basic was marketed better than Delphi, that's why it lost the Windows wars. Delphi was way ahead of it's time. The VCL (the Delphi library) was robust and modern for the TCP/IP stack. There were components for everything. They released a Linux version called Kylix started in the late 90s. Delphi had many features and compiled to machine code, so it was technically superior to VB. It was much faster to develop with than Visual C++ also. Borland got some executives that made some poor branding decisions, like renaming the company to Inprise (??) then naming it back. Once C# gained traction, Delphi slid into obscurity and was purchased by Embarcado. It mainly exists as a tax on companies who haven't migrated to a more common language.
I learned Turbo Pascal and Turbo C in middle school by tinkering with BBS code. I was taught CS in High School using Turbo Pascal and again in college. It was a great little language that runs very fast machine code, and served me well. It is very capable for production environments, but I prefer C syntax now a days though. If Pascal prompts a return from web to native, I'd embrace it. Web is significantly more tedious than the RAD tools for native applications it replaced for front end development.
Interesting aside, Object Pascal conventions state you should prefix class names with a T (for Type I think). So if are rummaging through an API and you see a lot of types that start with T, you know it was written in a Pascal.
- e12e 10y agoOne of the optimization goals for the design of Pascal was compile speed - single pass compilation source > link > binary. That usually also meant less optimizations. On the other hand, Turbo Pascal was really popular as glue code for programs and demos written predominately in assembler for speed... so there's that. I wonder if a rewrite of WWIV from Pascal to Pascal would've yielded similar speedups, or if it really just was the optimization passes that made all the difference. If so, one might think that a Pascal compiler that targeted C might have been an (almost) as good solution at the time.
- Clubber 10y agoGreat points about the compile speed, I had forgotten. Also, Delphi / Pascal used no header files, which was wonderful. I think 20 years ago, Delphi (Pascal) was far superior to Visual C++. It didn't run noticeably slower but had all the RAD tools for fast development time that VC++ lacked. Too bad Microsoft's juggernaut defeated it with VB. WWIV could have been improved algorithmically between the Pascal and C++ versions, certainly. Also, the fact that the processors of the day were so slow, the difference today would hardly be noticeable unless you ran thousands of iterations and timed them in the code.