tags:

views:

315

answers:

7

Hi all, 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,...).

A: 

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.

buratinas
A: 

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.

stackunderflow
This seems to answer the opposite question .... ?
Billy ONeal
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
+6  A: 

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
+1 Yes, I concur with you
eee
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
+14  A: 

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
Actually, it doesn't run "natively" in 32 bit versions of windows either; such executables can only run on NTVDM. But +1
Billy ONeal
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
Ha ha, that's actually the first time I've heard it called the "penalty box", +1 for making my day.
paxdiablo
+4  A: 

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, I'll always select the best (that would be GCC for me).

paxdiablo
Ha ha ha, Enchilada. It's Embarcadero :-)
James McNellis
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
Amigable Clark Kant
+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.
Amigable Clark Kant
And how on _earth_ could they change their name from Borland? That sounds so cool.
Amigable Clark Kant
+2  A: 

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
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
@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.
Amigable Clark Kant
+2  A: 

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.

kaustubh