Re: C coding
Jon Paris <[email protected]>
| Newsgroups | gmane.comp.lang.as400.c |
|---|---|
| Message-ID | <[email protected]> |
Really? Sorry - just can't agree. I would have said that C was brilliant if your aim was to shoot yourself in the foot and C++ does a better job of protecting you. Admittedly an awful lot of C++ code is written in non-OO mode and as a "better C". Simple? Yes - if you mean that writing invalid syntax is nearly impossible. As to portability I know many IBMers tasked with porting C code to IBM i who wish it were that portable. If you write for IBM i then (OS specifics excluded) it will port most anywhere because the compiler is pretty strictly ANSI adherent. Try bringing code from AIX or Windows and it is a very different story. On 2014-02-13, at 5:05 AM, John E <[email protected]> wrote: > Compared to C++, C is quite elegant, simple, and not overly complex as C++. > And if you're building a big system (not some one-off utility or tool), and > therefore have a need for OOP, choose Java or something else. > > And C is also very platform independent, meaning you can compile your C > source without issues (if the code is a bit disciplined) on any known > platform known to man. Not so for C++. > > > > > On Wed, Feb 12, 2014 at 7:55 PM, Jon Paris <[email protected]> wrote: > >> Just a couple of quick comments - why C ? Other than folks writing >> operating systems is anyone using it that much any more when there's C++? >> >> As to training the C folks in RPG - we've done a lot of that lately and >> most of them love it. Just ensure that you ONLY show them free-form and >> that you keep them well away from SEU. Free-form and RDi only! >> >> >> On 2014-02-12, at 1:28 PM, frank kolmann <[email protected]> wrote: >> >>> Thank you Marc and Buck >>> >>> Much appreciate your feedback. >>> The key information I am hearing is to use C appropriately and >>> in a disciplined manner. >>> One can then leverage on the existing large C skill-set and >>> bring on expertise to the IBM i that would not usually be available, >>> at the same time I would introduce the C experts to the power >>> and simplicity of RPG and so have a win/win situation all round. >>> >>> I think I have stumbled onto an interesting avenue to explore. >>> >>> Thanks to all who have replied. >>> >>> Regards >>> Frank >>> >>> date: Tue, 11 Feb 2014 16:11:48 -0800 >>> from: Marc Hunter <marc-G5HfMHItY0AlJZD/[email protected]> >>> subject: Re: [C400-L] C coding >>> >>> We do a lot of C++ coding and primarily benefit from its >>> cross-compilability between with windows and Linux (if you do it in a >>> disciplined fashion). It also allows us to leverage existing tools and >>> skill sets across the organization. We even use it for a fair bit of >>> database access as we've wrapped the SQL api's into a nice reusable >>> object. That said - most of the coding in our department is 'tools' >> coding. >>> >>> HTH, >>> >>> Marc >>> >>> >>> On 2/10/2014 2:45 PM, Buck Calabro wrote: >>>> On 2/10/2014 4:59 PM, frank kolmann wrote: >>>> >>>>> So I am prompted to ask, is anyone doing serious coding in C on the >>> AS400. >>>>> And if so what is the application and more interesting to me what style >>> of >>>>> C code is being used? >>>> I have C code in production that I used for ASN.1 serialise/deserialise >>>> operations. Also, for socket operations. Both of these are wrappered >>>> so that ILE RPG programs can call the functions. >>>> >>>> Today I'm not sure I'd recommend using C for sockets; there are plenty >>>> of RPG examples these days (thanks Scott!) But there are some >>>> programming chores which C works well for, AND for which one can find >>>> examples on the web. >>>> >>>> Generally speaking, I do all my IBM i database work in RPG. I'd use C >>>> for tool / interface type work. At home I use C to program PIC >>>> microprocessors; another chore that uses no database. ish. >>>> --buck >>> -- >>> This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) >> mailing list >>> To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] >>> To subscribe, unsubscribe, or change list options, >>> visit: http://lists.midrange.com/mailman/listinfo/c400-l >>> or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] >>> Before posting, please take a moment to review the archives >>> at http://archive.midrange.com/c400-l. >>> >> >> Jon Paris >> >> www.partner400.com >> www.SystemiDeveloper.com >> >> >> >> >> -- >> This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) >> mailing list >> To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] >> To subscribe, unsubscribe, or change list options, >> visit: http://lists.midrange.com/mailman/listinfo/c400-l >> or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] >> Before posting, please take a moment to review the archives >> at http://archive.midrange.com/c400-l. >> >> > -- > This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list > To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/c400-l > or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] > Before posting, please take a moment to review the archives > at http://archive.midrange.com/c400-l. > Jon Paris www.partner400.com www.SystemiDeveloper.com -- This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/c400-l or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/c400-l.