Author Topic: Mind over bugs: C pointer edition  (Read 12038 times)

0 Members and 1 Guest are viewing this topic.

Offline Jan Audio

  • Frequent Contributor
  • **
  • Posts: 820
  • Country: nl
Re: Mind over bugs: C pointer edition
« Reply #50 on: July 01, 2021, 04:37:50 pm »
If you look at every line as if it already contained a bug (which it most likely doesn't), and try to figure what the bug can possibly be, and try to fix it even before your write that line, you make your job needlessly hard. If it's not broken, don't fix it.

There is always room for improvement, as you keep learning.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #51 on: July 01, 2021, 04:55:56 pm »
Quote
If it's not broken, don't fix it.

How about when it is broken but it just hasn't triggered a noticeable issue yet? Surely you would want to have it as bug-free as possible rather than waiting for some Bad Thing to occur?

Further, simple finding (or, more likely, being told) a bug is not a good move. There is a fair chance that you are unable to fix the bug without serious rework, and potentially it is not fixable at all. Don't forget that the earlier a bug is caught the cheaper it is to fix.

But also when someone reports the bug to you, your programming reputation will have taken a hit and will take some effort to recover (if it ever does).

No, being told there is a bug is never a positive event. Fixing it can be, but the existence of it is definitely a negative situation.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15479
  • Country: fr
Re: Mind over bugs: C pointer edition
« Reply #52 on: July 01, 2021, 05:42:41 pm »
No, being told there is a bug is never a positive event.

I'm not sure I agree with this. Becoming aware of a bug that was there unnoticed IS a positive event.

Fixing it can be, but the existence of it is definitely a negative situation.

Ah, this is a different thing now. Maybe you didn't express it quite right above. The existence of a bug, is, of course, something that is not positive.

But, becoming aware of one IS a positive event. It gives you the opportunity to fix it, or, if you can't fix it, to at least KNOW about it, and find workarounds for your users. Or, if you can't find any workaround, at least tell them how and when it could manifest itself so they are prepared.

Ignorance, when it comes to bugs, is rarely bliss.
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #53 on: July 01, 2021, 05:49:09 pm »
Quote
If it's not broken, don't fix it.

How about when it is broken but it just hasn't triggered a noticeable issue yet? Surely you would want to have it as bug-free as possible rather than waiting for some Bad Thing to occur?

Sure, but you cannot fix it until you know it exists. That's why you do testing and hire QA people and lure beta-testers. You want to find the bug.

Further, simple finding (or, more likely, being told) a bug is not a good move. There is a fair chance that you are unable to fix the bug without serious rework, and potentially it is not fixable at all.

Finding a bug is a necessary condition for fixing it, but not always sufficient.

Don't forget that the earlier a bug is caught the cheaper it is to fix.

Yes. That's why you should to be happy when a bug is found. If not found, it would persist, causing more harm and more cost in the future.

But also when someone reports the bug to you, your programming reputation will have taken a hit and will take some effort to recover (if it ever does).

Non-sense. Everybody makes mistakes. And the more afraid you are of making a mistake, the more mistakes you make. Show me a programmer who claims his code is always bug free and I'll show you a liar.

No, being told there is a bug is never a positive event. Fixing it can be, but the existence of it is definitely a negative situation.

How so? The bug existed before. If it wasn't found, it would persist, possibly causing harm. The only difference is that you wouldn't know about it. Now, when it's found, you can stop the harm you were causing. Would you really prefer to remain delusional?
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #54 on: July 01, 2021, 06:51:45 pm »
Quote
Quote from: dunkemhigh on Today at 17:55:56

    No, being told there is a bug is never a positive event. Fixing it can be, but the existence of it is definitely a negative situation.


How so? The bug existed before. If it wasn't found, it would persist, possibly causing harm. The only difference is that you wouldn't know about it. Now, when it's found, you can stop the harm you were causing. Would you really prefer to remain delusional?

Perhaps, as someone said of me above, you aren't expressing yourself well.

I don't get the point of discussing bugs during development in this context because they will always be there, and they will typically be fixed. It's after that, when someone else finds the bugs that I assumed we were talking about here. Not during development but when whatever product is being used. Clearly, that's a sub-optimal time. And, yes, getting a reputation for buggy code is really a bad thing, and people remember that even if you clean up your act and don't release buggy code for a long time.

Perhaps you mean 'find' as in QA. I would query whether that's an innocuous time too. Yes, you want to find bugs, which is why you test, but that's when you're writing and creating the stuff, not after it's supposed to be working.

Personally, I get a bigger kick out of writing bug-free code than I do having to fix my mistakes afterwards. OTOH, I get a kick from resolving an issue, which might be due to someone elses bug. But mine just means I was shit at what I was trying to do.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8959
  • Country: fi
Re: Mind over bugs: C pointer edition
« Reply #55 on: July 01, 2021, 07:09:36 pm »
Except for some safety-critical (say avionics or pacemaker), or extremely small and trivial software, bugs are also always in the end product. Customers are totally used to it. Customers are also totally used to bugs not being taken seriously and ever fixed. See Altium Designer for example.

I don't think this is good state of affairs. But it's the reality of software in year 2021. And has pretty much always been, especially on desktop computing.

So no, if you have a bug or two every now and them, react to them seriously and relatively swiftly, and fix the issues, you won't get a bad reputation. Quite the opposite, everybody's happy because you do so much better than basically anybody else. Admit mistakes and serve your customers, and most customers are ready to pay for it.

Publish a bug-ridden piece of shit, never fix anything, and coat the experience by basically saying "fuck you" to your customers, and you are approximately doing average. Like Microsoft Windows. Or Altium Designer.

Nowadays I'm really happy if the software can be used for its intended purpose (with workarounds for bugs) at all. Like Altium, which, after all, can somehow magically produce a set of manufacturing files which turn out to be a working PCB, in a process which is still orders of magnitude easier than hand-writing the gerbers from scratch, despite crashing 47 times with a "Please wait..." window, or copy-paste crashing it if your Windows installation lacks a default printer (how easy it was to figure out that workaround: Altium crashes randomly -> add a printer!).

This also relates to the fact most problems are at a higher level than over-indexing an array. Whoever got this great idea that,
(1) Copy-pasting involves probing for the installed system printers,
(2) Such operation can be assumed successful without checking,
(3) You use the result in some way that results in a crash if the result was invalid,
(4) Yet you don't do anything actual with the result, i.e., you do not print,

introduces this bug without actually writing a single line of code yet.
« Last Edit: July 01, 2021, 07:22:54 pm by Siwastaja »
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #56 on: July 01, 2021, 07:29:57 pm »
Quote
Customers are also totally used to bugs not being taken seriously and ever fixed. See Altium Designer for example.

And see the comments dissing Altium.

I use some software which is actually pretty good, but it has bugs. I notify the developer and he often fixes them reasonably quickly. But whenever something is not right in the software, even if it's actually my fault, my first reaction is "Oh no, another bug". If there were an alternative I would probably switch to it.

So, yes, everyone realises that bugs exist, but that doesn't meant they like them or ignore them. They are a fact of life, but so is getting cold and wet when it rains, and no-one in their right mind looks forward to that, do they?
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #57 on: July 01, 2021, 10:43:17 pm »
You can have bugs at any level, but in the context of C pointers I think we're discussing programming bugs. That is, the behaviour expected of the code by the programmer doesn't occur.
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #58 on: July 02, 2021, 12:15:05 am »
Personally, I get a bigger kick out of writing bug-free code than I do having to fix my mistakes afterwards.

I also write bug-free code. Always. But sometimes there are bugs in it ;)

These bugs are there not because I used some particularly harmful language construction. Nor because I wrote something in a way which is particularly bug-prone. They are not a sign that my programming methods are bad and have to be changed. These are just simple human mistakes - something misspelled, misjudged, or misunderstood. You cannot prevent such mistake from happening. You can only fix them afterwards.

Next time you play golf, stand on the first tee and resolve that you will make birdie on the first hole. Then repeat this for the second hole and for the rest. Not going to happen. Same with bug-free code.

 

Online Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6997
  • Country: fi
    • My home page and email address
Re: Mind over bugs: C pointer edition
« Reply #59 on: July 02, 2021, 12:22:26 am »
As to fear of bugs: I don't avoid writing bugs because they scare me; they do not.  They always happen, just like taxes.  I only want to avoid bugs because they annoy the heck out of me.  So, I trade time and effort for not getting annoyed too often.
Look at that this way. Once you have written software, it will have bugs.  Here, there ... You don't know where they are and therefore you cannot fix it. Your software is buggy and crappy. Then, you encounter a bug. Either you find it yourself, or QA engineer filed a report, or user filed a support ticket. This is good luck for you. This gives you an opportunity to work on it and fix it. This will make your software better, and your software will eventually becomes clean and reliable. If you didn't find the bug, the software would remain crappy.

How can you possibly look at this very positive event as if someone is throwing dog shit at you?
I realized I left out a crucial word there: writing.

The way I usually encounter a bug is when they silently garble my data (which I consider similar to having a nice big streak of poo on your back),  or a process produces unexpected and useless results.  There is usually some pain involved – not just "what now?", but the "hmm, I cannot pinpoint any logical errors in this chain".

Whenever I get a bug report, or a colleague pointing out a typo, thinko, or even a severe misunderstanding (and that last category requires verifiable proof, not just someone quoting the standard as if it was the holy bible; me being a dirty pagan after all), I get ecstatic.

A good bug report, one with a verifiable test case, and showing why a specific behaviour is desired, is in my book worth a very nice Thank You, perhaps a cuppa or a beer depending on the environment; and I am definitely in the habit of telling anyone who has produced a good one for me to fix a bug with, that if they don't get a response quick-ish and they have more of these, to ping me.

I do often go bug-hunting in all sorts of projects.  (In my mind, "avoiding bugs" includes "make bug-hunting raids now and then"; it just doesn't translate well to the English I type out.  Apologies.)  If a friend or acquintance has a problem with a project I'm unfamiliar with, but which uses tools I'm comfortable with (as in, do not need to set up completely new development environments, very specific versions of nonstandard libraries, and such), but can either browse the sources online or pull a git, I *often* help.
(There are members here who've contacted me via PM that I've done exactly this for/with/to. English!  In exchange, I only ask them to pass it forwards.  Since I haven't been active at StackExchange, direct emails from there have dropped down to a trickle, less than one a week.)

I guess my attitude is much better described as "does not ignore known bugs, likes to squash them, and keep their population down".

If you cannot tell where the bugs are after you write the software, you certainly cannot tell where they are before you write the software. Of 100 lines you write, may be one or two will have bugs, may be even none. If you look at every line as if it already contained a bug (which it most likely doesn't), and try to figure what the bug can possibly be, and try to fix it even before your write that line, you make your job needlessly hard. If it's not broken, don't fix it.
Yes, and no.  If I have no reason to suspect a code does not behave as it is supposed to, I don't worry about it.

The suspiciousness when reading code basically boils down to looking at the code critically and asking oneself, Does this code do what it is supposed to do? (split into two sub-questions, Did the original programmer choose a suitable algorithm or approach? and Does the code do what the original programmer intended?) and Are there any expressions here I should be taking a more careful look at?

It is not the same thing as thinking there might be bugs.  It's more like a structural engineer walking through a worksite, and looking at the girders and walls to see if anything seems fishy; not just say cracks in the concrete, but whether the concrete has eroded in places already indicating the mix was incorrect in the first place.

(A typical such "erosion", in my opinion, is a program that takes user parameters, but never checks them (even whether they were parsed correctly or not), and just assumes that they should be, since we haven't crashed yet.  It itself is not necessarily an error, but it indicates that a closer look may be warranted.  Even I use sscanf() to parse user input sometimes, even though it doesn't properly check for all possible errors (numerical overflows in particular); it's just .. hmm... an indication of the sort of neighborhood you are in.  If it is an industrial hall used to store vehicles, it may not need *walls* at all, wallpaper and hardwood floors even less.)

This, too, is a skill that can be cultivated, and does not need any special "aptitude" for it.  I do believe most programmers concentrate too much on *emitting* code, and not enough on *examining* already existing code.  With the sheer amount of existing open source code in public source code repositories, one really only needs some sort of a yardstick to pick some "good ones" and some "bad ones", and start reading, comparing, and trying to understand; it only takes time and effort.

I think the biggest software system defects aren't implementation bugs but requirements / specification / documentation bugs.
Yes, I think I have to agree.  I do feel they occur in a slightly different context, though: instead of silently garbling data, they just refuse to work in an useful manner, or forbid actions or expressions that the user needs to perform their tasks.  (Lots of compiler features in this class!  Yet, I still use C and C++.)

One of the issues I do have, is that people assume terms have a specific meaning without checking.  Worse, if they insist, without trying to find any agreement on the uses.  (And, I do claim, it is the uses that define the meaning, not any particular claims of their meanings, no matter how "authoritative".  Consider Albert Einstein and the cosmological constant.)

If you stick to the compiler or standard definitions, your understanding will be bracketed, limited and defined, by that standard; and there really isn't any reason to believe any committees get the definitions right.  A human mind has to be nimble, and think about the unstated assumptions even they themselves are making, be ready to shift context whenever such a shift is warranted, and just deal with it all.

In physics, outside classical mechanics, even the term mass is problematic, because one cannot be sure if it refers to the invariant or rest mass, or relativistic mass as the analog or extension of classical mass with Lorenz factor "correction".  Electrons do not "orbit", they have "orbitals"; but in many languages the two map to the same words, with much confusion.  In mathematics, you need to tell what each of your variables represent, and if for example you use \$\vec{v}\$ for a generic vector, but \$\hat{v}\$ for an unit vector (like I often do).  In linear algebra, when dealing with matrices and vectors, if you use the \$\vec{v} = (x, y, z)\$ notation for vectors in the text (instead of \$\vec{v} = \left[ \begin{matrix} x & y & z \end{matrix} \right]\$ or \$\vec{v} = \left[ \begin{matrix} x & y & z \end{matrix} \right]^T\$ , you also need to remember to tell whether your vectors are row or column vectors, because one of \$\mathbf{M}\vec{v}\$ and \$\vec{v}\mathbf{M}\$ yields a vector and the other a matrix, and whether the vectors are row or column vectors, determines which.

I seriously wish that more people start realizing that the counterquestion, "What do you mean by Z, exactly?" in science and engineering is completely different to the social accusation it tends to nowadays be in "polite society".  In science and engineering, it is an expression of interest in the subject and mutual discourse, and a request for clarification without any negative connotations.  It must be, because any other interpretation robs us of one of the core tools; that all-important one that makes peer review so valued and respected.  I myself have had to learn to make sure my face expresses both interest and deep thought so in face-to-face the question isn't misunderstood, which is kinda silly and unnecessary waste of the meager efforts my thinking fat is capable of stretching to.

These are just simple human mistakes - something misspelled, misjudged, or misunderstood. You cannot prevent such mistake from happening. You can only fix them afterwards.
I'm not sure I even think of them as proper bugs anymore; they're so common and easy to fix.  I myself like to sleep over an initial implementation, then review it the next day, because those always occur – like taxes! – and I consider it just part of my development workflow, not "bug hunting" per se.

I even do the same to my posts.  I do preview, but after posting, I read it through once.  Then, I do something else, and if I see any responses, I first re-read my own to see if anything needs fixing.  Then I read the responses, and if I see a discrepancy, I re-read my own again to see if it is easily read in a different manner I intended.  English is a lot of work for me, but I am a fast reader.  (And I don't just glance; the speed does not affect my understanding, I don't understand a bit more even if I read slower.  When I read carefully, I consider the ways each paragraph can be understood; that takes considerably more time.)
« Last Edit: July 02, 2021, 12:26:31 am by Nominal Animal »
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #60 on: July 02, 2021, 04:12:22 am »
These are just simple human mistakes - something misspelled, misjudged, or misunderstood. You cannot prevent such mistake from happening. You can only fix them afterwards.
I'm not sure I even think of them as proper bugs anymore; they're so common and easy to fix.

But all bugs are like this. They're your mistakes of various kinds. While you can catch some of them in code reviews, most are best visible when you run your code and observe the effects.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #61 on: July 02, 2021, 09:53:16 am »
Quote
I realized I left out a crucial word there: writing.

I am finding it very difficult to interpret what y'all are on about. I thought we were discussing bugs that we, as the programmer, had introduced. So it is hard to reconcile why you would "get ecstatic" when someone finds you've fucked up, confused them and they've spend some effort generating a report which they wouldn't've had to do if you'd done your job right in the first place.

But then you say "If a friend or acquintance has a problem with a project..." so in the above did you mean some code you didn't write but got a report about? If so, that's a completely different thing and the expected response would be arse about face in comparison.

So, just wtf are we talking about here? Alternatively, can we please either stick on talking about our own generated bugs or other peoples bugs and not mix the buggers up? Otherwise it's like discussing buying stuff vs selling stuff without letting on which it is.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8959
  • Country: fi
Re: Mind over bugs: C pointer edition
« Reply #62 on: July 02, 2021, 02:57:55 pm »
So it is hard to reconcile why you would "get ecstatic" when someone finds you've fucked up, confused them and they've spend some effort generating a report which they wouldn't've had to do if you'd done your job right in the first place.

But "doing your job right" can't mean perfectionism. Show me a developer writing completely bug-free code and I show you a liar, as somebody somewhere said.

If you react "OMG, I fucked up!" to every bug revealed, you are overreacting, and you won't mentally last long. Or maybe you just don't code.

I understand very well the feeling of being happy that somebody has participated and made your life easier by doing a good bug report. The result is good for everyone; the bug will be fixed sooner than with a crappy bug report.

Sure, they are doing "your job", in a sense. But seeing they voluntarily made that bug report without you asking for it possibly is related for the ecstatic feeling, no...?

It may have taken 2 hours of their time. With a crappy bug report written in two minutes, you could waste 2000 hours trying to reproduce it and still not find the bug.

That's why as a customer I want to be able to invest my time writing a good error report and want it to be taken seriously. It's not only limited to bugs, really. It's also when I report to LIDL that the tuna cans had their labels mixed up I spend some time properly documenting the case.
« Last Edit: July 02, 2021, 03:03:16 pm by Siwastaja »
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #63 on: July 02, 2021, 03:31:50 pm »
... someone finds you've fucked up ...

Consider two scenarios:

1. You fuck up
2. Software with the bug ships out
3. Some of the customers encounter the bug
4. Your software gets reputation of buggy (just like Altium in Siwastaja's post)
5. Sales drop
6. The company goes bankrupt
7. You get fired
8. You get on with your life and you never know that you have destroyed the company

or

1. You fuck up
2. Software with the bug ships out
3. Some of the customers encounter the bug
4. One of the customers reports a bug
5. You promptly fix the bug
6. The customers install the update and most of them don't even know that the bug existed
7. The company's revenue increases
8. You get promoted

Which one do you think is better? The differences start from item #4, where you find out that you've fucked up.
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #64 on: July 02, 2021, 03:43:54 pm »
That's why as a customer I want to be able to invest my time writing a good error report and want it to be taken seriously.

Me too. But unfortunately the majority of companies don't accept bug reports. At best you get a support person whose job is to help customers to use the product. She doesn't know how to file a bug report even if she wanted to. This discourages customers and they stop submitting bug reports. This is one of the reasons why software is getting so buggy.
 
The following users thanked this post: Siwastaja

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15479
  • Country: fr
Re: Mind over bugs: C pointer edition
« Reply #65 on: July 02, 2021, 03:51:17 pm »
These are just simple human mistakes - something misspelled, misjudged, or misunderstood. You cannot prevent such mistake from happening. You can only fix them afterwards.
I'm not sure I even think of them as proper bugs anymore; they're so common and easy to fix.

But all bugs are like this. They're your mistakes of various kinds. While you can catch some of them in code reviews, most are best visible when you run your code and observe the effects.

Yep. That's my experience too.
Of course, some "obvious" bugs can be caught in code reviews. That's particularly true for simple bugs, often those introduced by less-experienced developers. Some tools like static analysis can help as well. But they are always limited in what they can catch in the real world.

For any at least moderately complex design, testing is really all you can do to find the most bugs. And I mean, heavy testing under real conditions.

 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15479
  • Country: fr
Re: Mind over bugs: C pointer edition
« Reply #66 on: July 02, 2021, 03:56:10 pm »
That's why as a customer I want to be able to invest my time writing a good error report and want it to be taken seriously.

Me too. But unfortunately the majority of companies don't accept bug reports. At best you get a support person whose job is to help customers to use the product. She doesn't know how to file a bug report even if she wanted to. This discourages customers and they stop submitting bug reports. This is one of the reasons why software is getting so buggy.

Agreed. Many companies just don't give their users the possibility of submitting bug reports in any useful way. They'll tend to ignore bugs, as long as sales don't reflect the problem. Then if sales suddenly drop, they switch to panic mode. Which never really helps product quality either.

Of course that's not true for companies selling safety-critical stuff.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #67 on: July 02, 2021, 03:57:21 pm »
Quote
Consider two scenarios:

Yep, considered them. They are made-up rubbish because the differentiator is step 3. You have no influence on getting to step 4, so from step 3 on it's completely arbitrary and shows nothing except difference user reactions.

Consider, instead, a scenario where you don't get to step 3 at all. Isn't that better?

Sure, we all make mistakes and no-one is perfect. But that's not a reason not to try to get it right, is it? Shrugging at step 3 and thinking "Shit happens, the punter will cope" doesn't seem to me to be an appropriate viewpoint.

And don't forget that the majority of your end users won't say a dicky. But they'll notice, oh yes.

Besides which, I take pride in a job well done. It ain't well done if it's faulty. Consider your viewpoint as a programmer transferred to, say, a cabinet maker. There is no way I would be ecstatic that someone points out one leg of a table is half a millimeter too short, or the support of a bridge is too thin, or the cut is a fraction too far that way, the sliding fit is notchy, etc.
 

Online Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6997
  • Country: fi
    • My home page and email address
Re: Mind over bugs: C pointer edition
« Reply #68 on: July 02, 2021, 04:45:57 pm »
These are just simple human mistakes - something misspelled, misjudged, or misunderstood. You cannot prevent such mistake from happening. You can only fix them afterwards.
I'm not sure I even think of them as proper bugs anymore; they're so common and easy to fix.

But all bugs are like this. They're your mistakes of various kinds. While you can catch some of them in code reviews, most are best visible when you run your code and observe the effects.
Only the simple ones; they are so common and natural that I don't consider them "bugs" per se, just part of the expected, normal work flow.

When helping others with their code, I obviously don't know what is simple to them; it varies from person to person.  So I try to help make all sorts of "bugs" simple to fix and avoid, by using human concepts that aid in such cleanup work (and also in avoiding making any unnecessary mess in the first place, i.e. "buggy" code, or code with lots of unstated assumptions and undefined behaviour the users of the code do not know about).  Sometimes people are offended because they think that by doing that I believe I am belittling them, but I just don't know how else to find out what others are familiar with.

Asking "Do you know Z" does not work in practice, because people often dislike showing unawareness or "lack of knowledge" (it isn't, it is just having a different experience that hasn't encountered Z yet), and either say they do when they've never used it in anger, or misunderstand what is meant by Z... describing the things at the operations or algorithmic level just seems to yield better results in practice.  (But that isn't problem-free either: I recently angered brucehoult here by describing some virtual memory stuff, intending to keep everybody on par with the topic, and definitely not as a suggestion he might not know because I for sure knew he knows that stuff inside-out and was just really interested to uncover his differing opinion because I knew he knows that stuff.  But discussing it at the hoighty-toighty jargon level has just never worked well for me: I always associate it with blatant self-aggrandizement.)

I think we are pretty much everybody here in agreement that whatever you call the errors or issues, to err is human.  It is natural, and even the smartest person, or the best programmer on this planet, make them.  Frequently.  If their work output contains fewer of them than average, it only means their workflow is better equipped to deal with them, not that they make less of them in the first place.  (I've mentioned some of my own approaches, exactly because if I just wing it, I get even the parameter order of memset() often wrong.)

We do not "fix" such errors for ideological reasons –– say, because we think errors are somehow shameful or bad or reflect on the person ––, but because we find they cause unwanted behaviour or have a high enough risk of unexpected/unwanted behaviour.  (For example, consider write-only, unmaintainable spaghetti code: as long as it works as-is, and we have no indications that there is a problem with it, we live with it.  I guess this is the point many wish to emphasize, by saying "if it ain't broken, don't fix it".)

On the emotional level, I guess I do those bug hunts for the same reasons others adopt say a stretch of a highway or a road, and clean the trash out.  (Wait, some people insist on setting up placards telling about their good deeds; I don't mean that, and I dislike that.  Maybe a small note in the corner of a rest stop information board, AKA acknowledgements section.)  Or, when hiking, one makes sure a remote cabin has a bit more emergency resources when you leave compared to when you came, not leaving it without firewood, and so on.



You (and others above) do have a good point, though: I might get results I like better, if I myself change how I think about "bugs" versus documentation and specification et cetera.  It might even make my life easier wrt. language lawyers, and reduce unnecessary friction.

I shall investigate and experiment on this; thank you. :-+
« Last Edit: July 02, 2021, 08:21:26 pm by Nominal Animal »
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #69 on: July 02, 2021, 05:22:48 pm »
Besides which, I take pride in a job well done. It ain't well done if it's faulty.

So, you say you never make any bugs. May I ask how do you know that?
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #70 on: July 02, 2021, 06:06:11 pm »
Besides which, I take pride in a job well done. It ain't well done if it's faulty.

So, you say you never make any bugs. May I ask how do you know that?

Where did I say I never make mistakes? In fact, throughout this thread I've said I do make them. You're making shit up so you can knock it down, and that's not a good way to carry an argument.
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #71 on: July 02, 2021, 06:47:53 pm »
Where did I say I never make mistakes? In fact, throughout this thread I've said I do make them. You're making shit up so you can knock it down, and that's not a good way to carry an argument.

What is a good way to make argument?

I argue that finding a bug is a positive event. Here:

... you encounter a bug. Either you find it yourself, or QA engineer filed a report, or user filed a support ticket. This is good luck for you. This gives you an opportunity to work on it and fix it.

You argue that discovering a bug is a bad thing. Here:

No, being told there is a bug is never a positive event.

When I try to show you why finding a bug is positive and want to hear your side of the story,  you answer that it's better not to have any bugs at all (which, besides being irrelevant, is a total bromide):

Consider, instead, a scenario where you don't get to step 3 at all. Isn't that better?

I take pride in a job well done. It ain't well done if it's faulty.

So, am I going to get any answer why is it bad to find a bug in your code?
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: va
Re: Mind over bugs: C pointer edition
« Reply #72 on: July 02, 2021, 09:50:06 pm »
Quote
You argue that discovering a bug is a bad thing. Here:

Quote from: dunkemhigh on Yesterday at 17:55:56

    No, being told there is a bug is never a positive event.


Acutally, no. Being told there is a bug is a bad thing. Discovering a bug (thus preventing being told about it) is a good thing, but not in the sense that one gets a kick out of it. It's only good because it was fixed early before the code got out.

Quote
When I try to show you why finding a bug is positive and want to hear your side of the story,  you answer that it's better not to have any bugs at all

So you prefer to have bugs than not have bugs? Do you consciously add them just so you can feel ecstatic from fixing them?

That's an outrageous take on your comment, but it is exactly what you are doing to my comments.

And, yes, it is massively better not to have bugs. That isn't saying it won't have, or that one never makes mistakes (which is apparently what you perversely interpreted it to mean). But I'll humour you: why is bug-free code not better than buggy code? Seriously, I cannot think of a single valid reason.

Quote
So, am I going to get any answer why is it bad to find a bug in your code?

WTF? I've stated several times why. Oh, OK! I just twigged.... given the way you twist stuff, ignore stuff, you have to be trolling. Well done, you took me for a ride there.
 

Online NorthGuy

  • Super Contributor
  • ***
  • Posts: 3252
  • Country: ca
Re: Mind over bugs: C pointer edition
« Reply #73 on: July 03, 2021, 01:33:38 am »
Acutally, no. Being told there is a bug is a bad thing. Discovering a bug (thus preventing being told about it) is a good thing, but not in the sense that one gets a kick out of it.

I didn't say anything about kicks. I am a business person and I don't care about emotions. I said it was positive. The person who found a bug in your software and told you about it is helping you. He gives you the information that you wouldn't otherwise have. And you can use this information to improve your software. This is why I think it is positive.

Unfortunately, people often get discouraged by the companies who don't want to hear about their bugs. Customers prefer coping with bugs rather than reporting them to the company. This is not a good situation for the business.

You still didn't say why it's bad when you're told you had a bug.

So you prefer to have bugs than not have bugs? Do you consciously add them just so you can feel ecstatic from fixing them?

That's an outrageous take on your comment, but it is exactly what you are doing to my comments.

Except these are not my comments. I've never said anything about feeling ecstatic.

And, yes, it is massively better not to have bugs. That isn't saying it won't have, or that one never makes mistakes (which is apparently what you perversely interpreted it to mean). But I'll humour you: why is bug-free code not better than buggy code? Seriously, I cannot think of a single valid reason.

I can. If your software has less bugs, people will buy more.

Every time you're told there's a bug, you fix it. This is one less bug in your software. This way the software gets better and better.
 

Online Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6997
  • Country: fi
    • My home page and email address
Re: Mind over bugs: C pointer edition
« Reply #74 on: July 03, 2021, 02:55:44 am »
Do you consciously add them just so you can feel ecstatic from fixing them?
If that's re my comment, I definitely do not.  Chemically, the dopamine kick comes from improving something, and is more than negated by any conscious (and usually even any unconscious and purely accidental) act of damage.

There are many unhealthy human psychopathologies involving breaking things just so you can fix them, but I am very happy to report I personally do not suffer from any of those.

I also seriously dislike insinuations like that.  How would you feel if someone commented to you that perhaps you are a parent only because you have a case of Munchhausen syndrome by proxy?  No, that shit goes too far.  I suggest you edit out your insinuations before you start something you really don't want to finish.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf