|
dan neely wrote: Because when applying that formatting in your favorite word processor you only need to apply bold and italic once each. You don;t have to apply one separately on each side of the other. Having learned how to do the task one way, a user will always try to do a conceptually similar task the same way in other applications.
This is not true, in WordPerfect For DOS you must start a Bold section and then close the bold section. The same for italic and underline.
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
Which would mean that the 5% of lusers who learned word processing on WP would get it right, but the 95% whose first PC had a GUI would still be doing it the wrong way.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
jamie550 wrote: But seriously, why did people decide that HTMLers would be too stupid/lazy to close tags and layer them correctly?
That was an excellent guess, as a matter of fact. People _are_ too lazy to close tags, a chance that some people realized that.
|
|
|
|
|
who decided that tags like <br> didn't have to be closed
Well, that's named HTML, and it have been around for many years. Way before XML was invented...
Now parsers have to waste their time checking for a closing tag
You just have to use an HTML parser, using the right DTD, indicating which tags must be closed and which might be left "open", and what is their scope (closed by another kind of tag), instead of an XML parser...
Incorrect HTML: that's another story, that's why browsers are so tolerant (more or less: a browser might close a div by itself, another will take the div ends at the bottom of the document...).
I don't understand the rant about JS...
Anyway, should I have to parse HTML pages, I would use a good library like TagSoup to handle all these peculiarities.
|
|
|
|
|
Hi all,
I am new to this forum and generally any programming help forum for that matter.
I have a case where i want to maintain both C and C++ api library. So therefore i choose to make my C++ support a thin wrapper around the C code. However, i do not know what is the most effective way to achieve this without unnecessary memory and performance overhead. Below is an example case.
/*Begin Code Sample*/
/*Start time.h*/
struct Time
{
int seconds,
int nanoseconds
};
void timeAdd(struct Time* time, struct Time* delta);
void timeSub(struct Time* time, struct Time* delta);
/*End time.h*/
/*Start timer.h*/
struct Timer
{
struct Time time;
void (*callback)(struct Timer *timer);
};
void timerSetCallback(struct Timer *timer, void (*callback)(struct Timer *timer));
void timerStart(struct Timer *timer);
void timerStop(struct Timer *timer);
/*End timer.h*/
/*Start time.hxx*/
namespace C
{
#include "time.h"
}
class Time
{
public:
Time()
{
m_time.seconds = 0;
m_time.nanoseconds = 0;
};
~Time(){};
int seconds(){return m_time.seconds;}
int nanoseconds(){return m_time.nanoseconds;}
void setSeconds(int seconds){m_time.seconds = seconds};
void setNanoseconds(int nanoseconds){m_time.nanoseconds = nanoseconds};
void add(Time &time){C::timeAdd(&m_time, &time.m_time);};
void sub(Time &time){C::timeSub(&m_time, &time.m_time);};
protected:
C::Time m_time;
};
/*End time.hxx*/
/*Start timer.hxx*/
#include "timer.h"
class Timer : public Time
{
public:
Timer():Time(){m_timer.callback = &Timer::callback;};
~Timer(){C::timerStop(&m_timer);};
start(){m_timer.time = m_time; C::timerStart(&m_timer);};
stop(){C::timerStop(&m_timer);};
protected:
static void callback(struct Timer *timer);
C::Timer m_timer;
};
/*End Code Sample*/
Now while this works for this simple case, it has a few drawbacks like the additional memory used to allocate m_time in class Time when all of struct Time api's would have even worked for struct Timer and hence struct Time m_time could have been "replaced" by struct Timer m_time but instead both exist in class Timer.
It also is the simpler of the cases where the struct sizes are relatively small and the call to Timer::start() was easily managed by a copy of the struct.
So now, my question is how can c++ wrappers be written for such cases without the additional memory overhead? Given their similarity, I definitely want class Timer to be a subclass of class Time!
However, i do have the flexibility to modify both the C and C++ code but i need both the C and C++ code to be equally capable, clean and efficient. How can i do it?
|
|
|
|
|
Kishore Jonnalagadda wrote: However, i do have the flexibility to modify both the C and C++ code but i need both the C and C++ code to be equally capable, clean and efficient. How can i do it?
Posting in the correct forum would be a good start.
Try here[^]
Prepare to be flamed.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
You should have started by reading the header of this forum, specifically where, in bold red letters, it says:
Do not post programming questions in this forum.
|
|
|
|
|
Probably the bold text should be in all capital and font size 36!
|
|
|
|
|
No programming questions in this particular forum
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
My apologies for being on the wrong forum. I have posted again at http://www.codeproject.com/script/Forums/View.aspx?fid=1647
Cheers!
Kishore
|
|
|
|
|
I encountered a project a few years back written by some indian guys in vb (they "apparently" had some c# background). everything was written as a function, no "subs" anywhere whatsoever.. All these functions returned nothing.. Their idea of code reuse was to bung everything into one huge global class and define it in every single page they wrote, even if no functions were used from that class (this was their idea of code reuse) . It was a joke.
On thinking back, this entire project qualifies as a coding horror so I couldnt paste any sample code..
|
|
|
|
|
Is it just me, or does anyone else find the fact that every coding horror written by an Indian gets mentioned, while all the coding horrors written else quietly go by without comment on the national origin of the perpetrator?
Not that I'd hint there's an undercurrent of racism in the programming community.
|
|
|
|
|
Rob Grainger wrote: Is it just me
Nope. Me too. I fully agree with you.
[added]
Private message for my silent troll: don't mind, I didn't forget your daily dish.
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Saturday, July 5, 2008 4:19 PM
|
|
|
|
|
Indeed, in cases like this, the mention of a nation or culture is isn't warranted; it adds nothing to the situation presented.
"Omit needless words" -- Strunk
|
|
|
|
|
Ahh the other part of the community that annoys me, the liberal "Politically correct" brigade.
If anyone bothers to read the post properly, I was describing the background of the said coding horror. Trust me if a contractor from the country I reside in did the same thing, I would throw their code straight back at them as well.. Chances are it would also appear on here as a coding horror..
The fact that annoys me is some contractors (and yes I am being general here!) feel they can get away with generating junk code written on the back of a fag packet, without any proper planning or ability, sellotape over the gaps and pass it off to niave managers as a decent perfectly working system (which then gets accepted by the company) just seriously annoys me.
I, and Im sure plenty of other people on this site, take great pride in constructing good quality code that makes efficent use of a programming language features, It seriously annoys me when so-called "programmers" and "analysts" produce junk and effectively con the end user or company purchasing the product. I have seen it happen so many times now in my 15yrs coding experience in many projects, and now its starting to depress me.. I am starting to ask questions as to why I bother anymore, why am I doing this job? Why do I bother coding to my exact standards and quality? , if managers look at the "pretty picture" rather than the quality of the underlying job.
Believe me, Programming, as it stands now is NOT a job I would reccomend my kids get in to. The Industry is being killed by too many "so-called" programmers, FROM ALL COUNTRIES.
Anyway, back to the topic... Isnt discussing coding horrors the whole point of this forum,or is the Politically correct brigade taking over here too?
|
|
|
|
|
GriffinPeter wrote: if a contractor from the country I reside
Exactly, therefore the race/culture of the idiot isn't relevent, nor is whether or not he was a contractor, so leave them out.
You quite correctly left out age, gender, sexual orientation, and hair color.
GriffinPeter wrote: discussing coding horrors
Absolutely, but leave out the irrelevent details. If for no other reason than to avoid dealing with yet other idiots trying to play the racist card. Don't give them opportunity to crawl from the woodwork.
|
|
|
|
|
PIEBALDconsult wrote: Exactly, therefore the race/culture of the idiot isn't relevent
You sure about that? Given that a lot of cheap outsourcing is done in India and outsourcing often has disastrous results, I think that perhaps you’re overreacting. Trying to save money is the cheapest way to lose money.
Steve
|
|
|
|
|
|
If you had said a French or Italian or English programmer I don't think you would have had the same response.
Some people confuse Indian with race whereas Indian is nationality and very probably culture and in my experience culture has a very definite effect on the quality and method of work.
After all I love German cars as they are engineered fantastically and Japanese bikes as they kick ass - does that then make me racist because of this?
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
From Wikipedia..
According to the United Nations Convention on the Elimination of All Forms of Racial Discrimination,
the term "racial discrimination" shall mean any distinction, exclusion, restriction or preference based on race, colour, descent, or national or ethnic origin which has the purpose or effect of nullifying or impairing the recognition, enjoyment or exercise, on an equal footing, of human rights and fundamental freedoms in the political, economic, social, cultural or any other field of public life
So, if the UN includes nationality as the basis of racism, that's good enough for me.
I'm sure if the OP had said "French, Italian or English" programmer, it wouldn't have had the same response. However, I never see that. The only time I see such references it almost inevitably refers to it as being Indian.
I agree the fundamental problem is out-sourcing resources, in that case refer to that as the actual problem, rather than unneccessarily drawing attention to the place that particular project was outsourced. I've seen, and unfortunately had to work on, some appalling outsourced projects within the UK as well.
|
|
|
|
|
Thanks for that definition Rob as I never realised that nationality plays a part in the definition of "racism" -I always thought it was with regards to race.
Guy
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
If I say I don't like VB as a language am I being Racist?
Come on guys stop being over sensitive.
I am an European Immigrant African living in Cape Town, South Africa what would you call me?
|
|
|
|
|
I think you have a good point, while at the same time from a professional point of view it is important to know what the definition of racism is as I need to know when what I say or do may land me in trouble even if it is an innocent remark.
Personally the racism of apartheid, and segregation in the US as well as the caste system in India are what I consider to be the most obvious and wrong forms of racism - when it comes to nationality it can start to become harder.
The next time someone offers me a cup of tea I will sue them for every penny they have for making a racist remark
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
I agree, but while the most obvious and wrong forms of racism, I still feel that treating a race/nationality or religious group (or gender) differently purely on that basis is unjustified.
Two strong examples spring to mind, still current.
(i) The pay gap - in most Western countries, there is still a disparity between the wages of male and female and workers from ethnic minorities - often simply manifesting as a "glass ceiling", fewer people from these groups get the top jobs.
(ii) The punishment gap. A white offender and a black offender committing the same crime tend to get different punishments. The death penalty in the U.S. is the worst, most drastic, example of this.
All I was originally trying to say is shouldn't we just not mention the nationality of these horrors - the horror itself should be enough.
|
|
|
|
|
Do you people know what racism is?
If in general code isnt as good by a certian group of people isnt that a correct statement?
|
|
|
|
|