If you use C to do OO, you're pretty much admitting you chose the wrong tool IMO. Someone already extended C to support OO, I heard.
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Is C a 'good' programming language?
Collapse
X
Collapse
-
Originally posted by MaryPoppinsI'd still not breastfeed a naziOriginally posted by vetranUrine is quite nourishing -
Originally posted by d000hg View PostIf you use C to do OO, you're pretty much admitting you chose the wrong tool IMO. Someone already extended C to support OO, I heard.
I can't understand why anybody would ever use C over C++. C++ can do everything that C can do, and there's no memory or performance overhead to any of the OO stuff where you don't use it.Will work inside IR35. Or for food.Comment
-
Originally posted by zeitghostCan you fit C++ code into 8k of rom?Will work inside IR35. Or for food.Comment
-
Originally posted by VectraMan View PostOf course you can. The runtime is the same as C.Comment
-
I'd expect C++ compilation to be bigger by default, but that you can fiddle with settings to get around it.
But as soon as you use C++ features you add in extra stuff I suppose.
Embedded is one case where C is the best choice... in many cases I think it's the only choice though as nobody has written a C++ compiler.Originally posted by MaryPoppinsI'd still not breastfeed a naziOriginally posted by vetranUrine is quite nourishingComment
-
I didn't realise C required a runtime. Doesn't the C compiler provide options to output nothing but (non-portable) native code, sans a monster runtime?Comment
-
Originally posted by DimPrawn View PostI thought the runtime for C++ was bigger as it uses the C runtime but adds to it?
OOP won't add any extra stuff to the standard library, or to the size of the code for that matter, except where you use extra stuff. A virtual function has an overhead, but if you don't use them it won't matter and if you do use them the overhead would be much the same as implementing the same in C. Data hiding and non-virtual members are done by the compiler, nothing to do with the output.
There's no downside to C++ that I see, so you may as well write your C code the same but using the C++ compiler and have the benefit of being able to use OOP features.Will work inside IR35. Or for food.Comment
-
Interesting thread. Embedded systems programming has been mentioned a few times and I'll chime in and agree that C definitely has its place in this field. My background is electronics hardware and from that I moved into using assembler and C for PICs and ARM processors. I suppose on limited embedded platforms like these, "assembler with tits on" is exactly what you want from a programming language, and nothing more! I'm used to the concept of managing memory resources yourself and selecting the libraries to match the processor variant and peripherals you're using. I enjoy using C, and don't believe that lack of OOP features make it 'bad'.Comment
-
Originally posted by zeitghostAll the C compilers I've used produce machine code (eventually)...
However, including printf is usually fatal, immediately using all the code space for the library support...Comment
-
Originally posted by zeitghostIndeed... and squirt the debugging stuff out of the nearest available serial port, if any...
Ah.
Dear dead days beyond recall...
FFS!Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Comment