Move forward from using Turbo C IDE / Turbo C++ IDE
Roy Antony Arnold G
Advanced Certified ScrumMaster(A-CSM?), Agile Coach, Certified Blockchain Solution Architect & Industry Academia Collaboration Specialist
The last version of Turbo C++ is 3.0 and it was released in the year 1992. But, still Turbo C / C++ is more vibrant in most of the educational institutions. Most of the educators still recommending/using this software to teach C / C++ programming languages for their students. The purpose of this particular post is to highlight the limitations and issues on using this IDE.
Old is Gold
Adhering to this proverb most of the institutes are still using Turbo C / C++ IDE. Some reasons for that:
- Simplicity : Easy to remember the menu items and shortcut keys
- Debugging is comfortable
- Less environment settings
- Requires less memory. Hence, this will work fine even in old computers.
- Easy and Quick Compilation
- Educators are more comfortable with this IDE while explaining the basic programming concept as they have used this in their college days.
- No assistance while typing the keywords, function, class, etc. as in modern IDEs like Visual Studio, Netbeans, Eclipse etc. Most of the faculty prefer this model as this makes the learners to remember syntax and rules.
Both Turbo C and Turbo C++ were released before the standardization of C and C++ languages.
Turbo C / C++ releases:
1987: Turbo C 1.0
1987: Turbo C 1.1
1988: Turbo C 1.5
1989: Turbo C 2.0 (‘blue screen’ version with integrated debugger)
1990: Turbo C++ 1.0
1991: Turbo C++ 1.01
1991: Turbo C++ 2.0
1992: Turbo C++ 3.0 [still you can find easily this version in most of the institutes in India]
In 2006, Borland's successor, Embarcadero Technologies, re-released Turbo C and the MS-DOS versions of the Turbo C++ compilers as freeware. Now, this is also retired from the market with new C++Builder XE5.
C in Turbo C and Modern Compilers
Following program will work fine in Turbo C but not in the latest C compilers.
main()
{
printf("hello, world\n");
}
For modern compilers to have to change this program as given below adhering to the C standards:
#include <stdio.h>
int main(void)
{
printf("hello, world\n");
}
Some are using Turbo C++ to execute C programs
Following program will work fine in Turbo C++ but not in the latest C++ compilers.
# include <iostream.h>
void main()
{
cout << "Hello, world!\n";
}
For modern compilers to have to change this program as given below adhering to the C++ standards:
# include <iostream>
int main()
{
std::cout << "Hello, world!\n";
}
OR
# include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!\n";
}
Common mistakes made by a Turbo C++ programmer while programming C++ in industry recommended IDEs:
Using main():
void main() – This is a valid statement in Turbo C++ but as per the new standard in C++ following is the right one.
int main()
Using header files:
#include<iostream.h> is a valid statement in TC++ but as per the new standards following is the right one.
#include<iostream>
Using clrscr():
In TC ++,
#include<conio.h>
….
clrscr(); //to clear the screen
This is valid but not in the new standardized C++. The header file is no more supported in the latest version of C++ as well as clrscr() function.
In new version of C++,
Instead of clrscr() you may use system(“cls”);
Using getch()
#include <iostream.h>
#include <conio.h> // not supported as per C++ new standards
void main(){
cout << "Hello World!" << endl;
getch(); // not supported as per C++ new standards
}
This should be written as follows in the new C++ compilers.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
cin.get();
return 0;
}
In new C++ we have a function which will wait until the user pressed a specified character. Example is given below:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
cout << "Press Q to quit." << endl;
cin.ignore(numeric_limits<streamsize>::max(), 'Q');
return 0;
}
Don’t come to a conclusion that only these are the differences between Turbo C++ and Modern C++.
Limitations of Turbo C / C++:
1. Lack of support for new standards and new hardware: Ironically, Turbo C++ 3.0 IDE is the final version. Hence, institutes are using more than twenty years old IDE. And as a very old compiler cannot adhere to the ANSI C and C++ standards which are released after v3.0 i.e. in the year 1999 (C99 standard) onwards. Also this can’t support the hardware which are introduced after the v3.0 such as SSE instructions, 64-bit instructions.
2. Compatibility issues: Turbo C is an old 16-bit compiler. The backward compatibility for Turbo C is removed from the Windows 7 onwards. Can’t run on 64 bit Windows. The Emulated 64 bit of Turbo-C++ is available at 64-bit Turbo C Build
3. Memory Allocation issues: In Turbo C/C++ the memory / size allocated for an integer type variable is 2 bytes. Whereas, 4 bytes will be allocated in newer implementations / standards. The maximum amount of memory could be used by the programs in Turbo C++ IDE is only 64 KB, which is very small compared to the current programs.
4. CUI: Turbo C IDE is completely a character user interface i.e. pointing devices will not work in that. Also all the text will be displayed only in a single color. [default color is Yellow]
5. Lack of support for new concepts: The new concepts in C++ such as Templates, Exceptions, Standard Template Library (STL), Runtime Polymorphism (RTTI), namespaces are not supported in Turbo C++ IDE. New model of type casting also not supported by it. Supports only C style casting. Never supports third party libraries on database, graphics, networking, etc.
Find below the list of notable features available in C++14 version compared to Turbo C++ v3.0.
- New data types like char16_t, char32_t, long long int, etc.
- Automatic type detection (auto type variables)
- Keyword literals C++: true, false and nullptr
- Range-based for loop
- Container Library Array
- Exception Handling
- Uniform Initialization and Constructor Delegation
- Resource Acquisition is Initialization (RAII) OR Objects Own Resources
- Pimpl For Compile-Time Encapsulation
- Containers - Examples: vector<int>, array <int, 5>, deque<int>, list<int>, etc.
- Algorithms through Standard Template Library (STL) - Examples: for_each, find_if, lower_bound etc.
- Smart Pointers from STL - Examples: unique_ptr, shared_ptr, etc.
- Lambda Expressions
- Override and final
- Deleted and Defaulted functions
- Move Semantics
- Multithreading
- RValue References
These features are brought into the Modern C++ to improve language expressiveness, usability, performance, and safety.
List of IDEs which support Modern C++
- Code::Blocks IDE + MinGW Compiler [All OS] : Download
- CodeLite IDE : Download
- Visual Studio Express 2013: Download [needs .NET and a copy of Windows 7 or later operating systems]
- GCC for Linux and other OS : Download
- Eclipse IDE for C/C++ Developers : Download and Eclipse CDT : Download
- Open Watcom : Download
- Anjuta IDE for Linux/Unix : Download
- Oracle Solaris Studio : Download
- NetBeans for C and C++ Development : Download and visit Tutorial Page
- C++Builder XE5 (Trial Version) : Download
- Bloodshed Dev-C++ : Download
- Quincy 2005 IDE : Download
- Ultimate++ : Download
- Digital Mars C and C++ IDE : Download
- DJ Delorie's C++ development system for DOS/Windows (GNU C++) : Download
Though Turbo C++ IDE v3.0 could be used for learning purposes, industry expects the learner should have knowledge in latest C++ IDE’s and Modern C++. Without learning new concepts in C++, students would find lot of difficulties in answering the questions during their interview. Moreover, all programming contests in C++ are adhering to Modern C++ standards only.
Welcome Change