473,854 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

code portability

My question is more generic, but it involves what I consider ANSI standard C
and portability.

I happen to be a system admin for multiple platforms and as such a lot of
the applications that my users request are a part of the OpenSource
community. Many if not most of those applications strongly require the
presence of the GNU compiling suite to work properly. My assumption is that
this is due to the author/s creating the applications with the GNU suite.
Many of the tools requested/required are GNU replacements for make,
configure, the loader, and lastly the C compiler itself. Where I'm going
with this is, has the OpenSource community as a whole committed itself to at
the very least encouraging its contributing members to conform to ANSI
standards of programming?

My concern is that as an admin I am sometimes compelled to port these
applications to multiple platforms running the same OS and as the user
community becomes more and more insistent on OpenSource applications will
gotcha's appear due to lack of portability in coding? I fully realize that
independent developers may or may not conform to standards, but again is it
at least encouraged?

11.32 of the FAQ seemed to at least outline the crux of what I am asking.
If I loaded up my home machine to the gills will all open source compiler
applications (gcc, imake, autoconfig, etc....) would my applications that I
compile and link and load conform?
Aug 1 '06
239 10375
Richard Heathfield posted:
Keith Thompson said:
>Frederick Gotham <fg*******@SPAM .comwrites:
>>>
I like my style though.

Ok. What about anyone else who reads your code?

If you don't like it, don't read it.

I don't like it, so I won't read it.

But how he writes his code is up to him. If he doesn't need other people
to read it (e.g. to help him out), then as long as he can read it,
that's all that matters.
<OFF-TOPIC>
I started my new style of definitions when I delved deep into template
programming in C++. Some of my definitions were three lines long (when
word-wrapped), and so I separated the lines like as follows:

export template<class NumT, class StrT>
typename Assum<NumT,StrT >::CharT const
*Assum<NumT,Str T>::TextProcess (Letters<NumTco nst &stls)

It's a lot clearer to me like that.

It made sense to overhaul my entire style once I'd seen the light.
</OFF-TOPIC>

--

Frederick Gotham
Aug 8 '06 #121
Frederick Gotham wrote:
Al Balmer posted:

>>>Perhaps you'd like to post some of your own code, and I'll point out the
flaws?

I wouldn't bother, since you and I obviously have very different ideas
as to what constitutes good code.

I'll just say that if you presented the examples you've shown in a
code review here, you'd be told to fix them.

Who said anything about a code review? My programming doesn't undergo a
"code review", and so I don't have to dumb it down and suck the efficiency
out of it to satisfy the politics of whomever I work for.
What a load of twaddle.

Are you claiming

static inline int Func(...

is less efficient than

int inline static Func(...

Which was the style issue under discussion.
>
God forbid they might actually adopt my style.
+1 to that.

--
Ian Collins.
Aug 8 '06 #122
Richard Heathfield <in*****@invali d.invalidwrites :
Keith Thompson said:
>Frederick Gotham <fg*******@SPAM .comwrites:
>>I like my style though.

Ok. What about anyone else who reads your code?

If you don't like it, don't read it.

I don't like it, so I won't read it.

But how he writes his code is up to him. If he doesn't need other people to
read it (e.g. to help him out), then as long as he can read it, that's all
that matters.
Absolutely. But he's shooting himself in the foot, and I have some
vague hope that I might be able to help him realize that.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Aug 8 '06 #123
Frederick Gotham wrote:
Al Balmer posted:
>>Perhaps you'd like to post some of your own code, and I'll point out the
flaws?
I wouldn't bother, since you and I obviously have very different ideas
as to what constitutes good code.

I'll just say that if you presented the examples you've shown in a
code review here, you'd be told to fix them.

Who said anything about a code review? My programming doesn't undergo a
"code review", and so I don't have to dumb it down and suck the efficiency
out of it to satisfy the politics of whomever I work for.
Of the code I have completely rejected at review:
Some was reused and failed exactly as I said it would. I actually
rejected it before the review, then someone else reviewed it and
let it through.

Some I rewrote and the original author agreed my rewrite was better.

Code reviews do not mean the code has to be dumbed down. They are about
ensuring quality.
>If the second review wasn't drastically improved, there wouldn't be a
third.

If my second try was 40% less efficient the second time around, would it
make the cut?
Where I used to work someone would sit down with you and rewrite it to
be correct, maintainable, conforming to our standard and reasonably
efficient. Of course, we would only expect to do this with someone still
learning to program and it would be quietly suggested to the technical
authority on the project that s/he should spend more time with this
person obviously still in need of lots of training.
>So, do your own thing, but I hope no one else ever has to deal with
it.

God forbid they might actually adopt my style.
Why should they when for so many the more common style reads more easily?
--
Flash Gordon
Still sigless on this computer.
Aug 8 '06 #124
Ian Collins posted:
>Who said anything about a code review? My programming doesn't undergo a
"code review", and so I don't have to dumb it down and suck the
efficiency out of it to satisfy the politics of whomever I work for.
What a load of twaddle.

Are you claiming

static inline int Func(...

is less efficient than

int inline static Func(...

Which was the style issue under discussion.

No, I was referring to how people who work as programmers tend to suck all
the efficiency out of their code so that it will pass a code review.

--

Frederick Gotham
Aug 8 '06 #125
Frederick Gotham wrote:
Ian Collins posted:

>>>Who said anything about a code review? My programming doesn't undergo a
"code review", and so I don't have to dumb it down and suck the
efficiency out of it to satisfy the politics of whomever I work for.

What a load of twaddle.

Are you claiming

static inline int Func(...

is less efficient than

int inline static Func(...

Which was the style issue under discussion.

No, I was referring to how people who work as programmers tend to suck all
the efficiency out of their code so that it will pass a code review.
Not in my shop.

--
Ian Collins.
Aug 8 '06 #126
Ian Collins wrote:
>
Not in my shop.
I forgot to say we don't do code reviews.

--
Ian Collins.
Aug 8 '06 #127
"Frederick Gotham" <fg*******@SPAM .comwrote in message
news:4Z******** ***********@new s.indigo.ie...
Ian Collins posted:
>>Who said anything about a code review? My programming doesn't
undergo a "code review", and so I don't have to dumb it down and
suck the efficiency out of it to satisfy the politics of whomever
I
work for.

What a load of twaddle.
....
No, I was referring to how people who work as programmers tend to
suck all the efficiency out of their code so that it will pass a
code
review.
Efficiency only matters after you've established correctness. If I
can't determine if your code is correct, it fails. If it is correct
and the lack of clarity has measurable positive effects on efficiency,
then I'd pass it as long as it was commented well enough that another
coder would be able to maintain it later.

However, most "efficiency " claims I've seen to justify bad code are
not only unjustified (it has no positive effect on performance), but
they often tend to be _wrong_ as well, as the "efficient" coder has
managed to (a) rely on non-portable assumptions that will break when
the code is ported or under various edge cases, or (b) confuse the
compiler enough that the code is actually slower than a clearer
idiomatic implementation.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking

--
Posted via a free Usenet account from http://www.teranews.com

Aug 8 '06 #128
Keith Thompson said:
Richard Heathfield <in*****@invali d.invalidwrites :
>Keith Thompson said:
>>Frederick Gotham <fg*******@SPAM .comwrites:
I like my style though.

Ok. What about anyone else who reads your code?

If you don't like it, don't read it.

I don't like it, so I won't read it.

But how he writes his code is up to him. If he doesn't need other people
to read it (e.g. to help him out), then as long as he can read it, that's
all that matters.

Absolutely. But he's shooting himself in the foot, and I have some
vague hope that I might be able to help him realize that.
He doesn't strike me as a learner, somehow. Let's hope we're wrong.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Aug 8 '06 #129
On Tue, 08 Aug 2006 21:01:52 GMT, Frederick Gotham
<fg*******@SPAM .comwrote:
>Ian Collins posted:
>>Who said anything about a code review? My programming doesn't undergo a
"code review", and so I don't have to dumb it down and suck the
efficiency out of it to satisfy the politics of whomever I work for.
So, you're an amateur, coding strictly for your own ends. OK, that's
fine.
>>>
What a load of twaddle.

Are you claiming

static inline int Func(...

is less efficient than

int inline static Func(...

Which was the style issue under discussion.


No, I was referring to how people who work as programmers tend to suck all
the efficiency out of their code so that it will pass a code review.
Now, just how would you know that, since you have no truck with code
reviews? In any case, it's just one more thing you "know" that isn't
true.

--
Al Balmer
Sun City, AZ
Aug 8 '06 #130

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1848
by: Lefevre | last post by:
Hello. I recently discovered that this kind of code : | struct Object | { | string f() { return string("Toto"); } | } | | int main( ... )
0
9752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10685
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10763
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10371
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9518
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4162
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.