14

I always find that some people (a majority from India) are using turbo C. I cannot find any reason to use such outdated compiler... But I don't know what reasons to give when trying to tell them to use modern compiler(gcc,msvc,...).

Damien
  • 1,490
  • 1
  • 8
  • 17
Nyan
  • 2,360
  • 3
  • 25
  • 38
  • 14
    Because computers don't have a "turbo button" any more. – rook Oct 13 '10 at 02:55
  • 8
    It's what they use for teaching in Indian colleges, along with some truly awful reference books ("Let Us C", etc). – Paul R Oct 13 '10 at 06:58
  • 3
    @Paul R, haha! Good thing they have SO now instead of those books. – Prof. Falken Oct 13 '10 at 11:06
  • 2
    I don't have anything to say on the subject of Turbo C but I'm curious why, if you have no reasons for making the argument that people shouldn't use it, you feel compelled to make the argument in the first place? – Larry Lustig Oct 13 '10 at 11:47
  • 5
    @Larry: I don't now about the OP, but for me the main concern is that the Indian colleges are churning out programming graduates who write `void main()`, assume ints are always 16 bits, and think that undefined behaviour is a good thing. – Paul R Oct 13 '10 at 12:42
  • 2
    Turbo C is great to check code portability. – pmg Oct 13 '10 at 13:20
  • 2
    What compiler would you suggest for writing code that will run on an existing product using an 80x186-compatible embedded PC? – supercat Dec 07 '10 at 00:40
  • 4
    @PaulR not only this! lot of them use DOS based versions of "Lex","Yacc","prolog","lisp"...etc. I've seen it with my own eyes, I am an Indian :) Unfortunately the author of "Let Us C" is considered the most intelligent guy on C by a lot of the young programmers here. However I would also like to clarify that the percentage of such students is only 60% of the total Computer Science students that get degrees every year. – Durin Mar 22 '12 at 11:58
  • @LarryLustig : Turbo C support early x86 processors instructions set that moderns compilers doesn’t. You may say it’s outdated, but many embedded systems provide binary compatibility with DOS and those instructions set. *(ex: NEC V30mx)* – user2284570 Mar 26 '15 at 14:04
  • 2
    Possible duplicate of [Why not to use Turbo C++?](http://stackoverflow.com/questions/1961828/why-not-to-use-turbo-c) – Arpit Goyal Dec 28 '15 at 16:02
  • A lot of Indians don't study to learn but to pass exams and get a job. That's why they use TurboC. It's simple to use, helps you pass your exams with little effort and prevents your ass from learning new things about programming. – Somanna Sep 23 '20 at 08:38

7 Answers7

21

Turbo C is a DOS only product. This means that it no longer runs "natively" on 64-bit versions of Windows, and must be run inside the XP compatibility penalty box.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • 3
    Actually, it doesn't run "natively" in 32 bit versions of windows either; such executables can only run on NTVDM. But +1 – Billy ONeal Oct 13 '10 at 02:30
  • That's why I put "natively" in quotes. You can run it on 32-bit Windows without thinking too much about it, but not so on 64-bit. – Greg Hewgill Oct 13 '10 at 02:35
  • 10
    Ha ha, that's actually the first time I've heard it called the "penalty box", +1 for making my day. – paxdiablo Oct 13 '10 at 02:37
14

While there are plenty of reasons not to use Turbo C (it's old, predates standards, generates 16-bit code, etc.), it's not valid to answer a question like "How do I do X in Turbo C?" with "Just use GCC". That would be like somebody asking "How do I do X with my 1992 Toyota?" and you saying "Just get a newer car".

People who are using Turbo C are probably doing so because it's a requirement, not because they don't know about anything better. Odds are it's for a programming class where the assignments they turn in have to work in that compiler. When I was grading C++ assignments, it didn't matter what compiler the students used, but they had to compile and run properly with the compiler I was using.

Gabe
  • 84,912
  • 12
  • 139
  • 238
  • 2
    Actually, I would give a two-pronged answer. The first prong would be a suggestion to move to a better compiler, if possible (with an explanation as to why that's a good idea). The second would be a real answer in case they couldn't move. There's plenty of precedent on SO for answering questions like "How do I write an OS in COBOL?" with an answer like "Don't be an idiot!" (but with more tact, of course). – paxdiablo Oct 13 '10 at 03:03
7

I would say support and standards compliance would be the two big issues for me.

Good luck even finding Borland/Inprise/Borland/Codegear/Embarcadero, or whatever they call themselves nowadays. Even more kudos if you can get them to admit these products exist (although I did at some point get them from the Borland museum on BDN).

Performance can be important but the vast majority of applications I write spend 90% of their time waiting for the user (I don't do genome sequencing, SETI analysis or protein folding - the market is pretty small).

Honestly, if I have the choice between two free products (where obviously money is not an issue), I'll always select the best (that would be GCC for me).

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
  • 2
    Ha ha ha, Enchilada. It's Embarcadero :-) – James McNellis Oct 13 '10 at 02:52
  • I had a laugh, but seriously, they are still there and you can even download Turbo C from their homepage: http://edn.embarcadero.com/article/20841 – Prof. Falken Oct 13 '10 at 10:55
  • +1 for standards compliance. I would also add an argument that Turbo C is _very_ niche these days, and if you want get support from your _peers_ Turbo C is probably not the way to go. Rather something normal like GCC or some Microsoft abomination. – Prof. Falken Oct 13 '10 at 11:00
3

Turbo C generates 16-bit X86 code. Kiiinda nice when you're developing on a 16-bit x86 processor.

Been there. Done that.

The pragmatic reasons for changing are: gcc is under development, with bug-fixes. It deploys on modern operating systems and modern chips natively.

Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
  • Does anyone develop new products nowadays with 16-bit x86 architecture? It seems like the low-end micro world is dominated by MCUs from the likes of Microchip, Atmel, Cypress, Freescale, and TI, all of which use their own (remarkably different) cores. – Nick T Oct 13 '10 at 04:42
  • @Nick T, probably not, but I can imagine hacking old ones. Maybe even things like putting whole boards on FPGAs, including a "soft" 8086, to able to run legacy stuff. – Prof. Falken Oct 13 '10 at 10:58
  • 3
    Some embedded products based upon PCs are still out there, and it's still sometimes necessary to update the code therein. Replacing an embedded PC that has some custom hardware attached is not not as easy as replacing a desktop PC. – supercat Dec 07 '10 at 00:39
  • @NickT : the NEC V30mx designed for embedded systems is one of the reason to develop for the x86 16-bits architecture, and more importantly with instructions set below the 80386 : this is something most modern compilers doesn’t support. In general, those devices run a special DOS compatible OS designed for embedded-systems. – user2284570 Mar 26 '15 at 14:10
2

It was also my first compiler (4 yrs ago), though I switched to gcc soon enough when I learned it didn't follow latest standards and relied on features that are considered deprecated or bad practice. These were enough reasons for me to make the switch.

patentfox
  • 1,436
  • 2
  • 13
  • 28
1

The most important reason you should use decent C compiler is performance. Since GCC optimizes the code aggressively, the compiled programs would have the performance tens of percents higher than before.

sth
  • 222,467
  • 53
  • 283
  • 367
0

Turbo C is much simpler to configure & use, runs on old DOS machines. Also it is compact in size.I guess that is the reason.

However, it does take a very little advantage of modern processors.

shaans
  • 534
  • 2
  • 5
  • 4
    Older, simpler compilers that don't aggressively optimize may be instructive for a compiler construction course where the point is to get working -- but not necessarily efficient -- output. You can look at the output from Turbo C and learn how variables are allocated, loops are constructed, etc. – Barry Brown Oct 13 '10 at 02:34