Why you shouldn't inherit someone else's code...
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
Application.DoEvents() is used to keep a Winforms GUI responsive, otherwise in a tight loop it will freeze. Agree with you on the English Windows version, just can't stand Windows Dutch translation :)
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
Quote:
And I REALLY don't know what to make of this
Simple: it's a chunk of code which says "I have absolutely no idea what the :elephant: I'm doing".
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
Seems like it would be a very unresponsive message pump, given the half second interval between processing events.
Explorans limites defectum
-
Seems like it would be a very unresponsive message pump, given the half second interval between processing events.
Explorans limites defectum
You can even listen to a song during that time: The Half Second Song[^] :-\
-
Application.DoEvents() is used to keep a Winforms GUI responsive, otherwise in a tight loop it will freeze. Agree with you on the English Windows version, just can't stand Windows Dutch translation :)
I know what DoEvents does, but why would you need it in the first place? X| And in a loop? With a Thread.Sleep? I should add that the class in which it is used is not even a Form.
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
"Application.DoEvents" ... i remember that one well; it was a mantra we used to sprinkle liberally on VB code (the dinosaur VB of the late neolithic, that is) when things got weird (and, they always got weird).
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
It could be worse in case of c++... I faced the situation when inherited from a class which implement a method "Sleep". For a lazy implementation while inheriting from that class I called Sleep in the assumption I'm calling the W32 Sleep. But instead of, it ended in something like this:
for (i = 0; i < 5; i++)
{
ProcessMessages();
::Sleep(0.2 * cnMilliseconds);
ProcessMessages();
}I could kill that beast X|
It does not solve my Problem, but it answers my question
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
Some smtp systems don't like receiving too many send requests too close together, so you got to spread them out if say sending bulk individualized email. (if you're relying on your ISP's mail handlers to send they purposely force inter-message delays to avoid spammers - often they'll let 5-10 go but then force you to wait before the next one will be allowed.) I dealt with such myself for a client, needed to send monthly billing invoices (tens to few hundreds each day). Luckily in my case this ran overnight [batch job] so while I did have to incorporate a single (not loop of) 1/2 second sleep between messages. Actually I could reduce that down to 1/10th second, but being overnight why ride the edge? I didn't want to push it and get bitten by say network spikes etc - at 1/2 sec worst possible case would be couple of hours. As to doing it in a loop (not defending it, just saying) - amateurish way to enable easier tuning i.e. "perhaps 9 loops of 450 will still be OK" ... big-wheel-small-wheel tuning. Something like the [old non digital] radios that have 2 tuning knobs: "tuning" & "fine tuning."
Message Signature (Click to edit ->)
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
I prefer the projects that have been going for a few years, and which has had multiple developers. You learn more from a brownfield than from a greenfield. Some applications contain more man-hours in knowledge than I can afford to spend. So, you might not enjoy that particular work, but that's not a good generic reason for everyone to decline such an inheritance (which is what the title seemed to suggest to me).
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
I prefer the projects that have been going for a few years, and which has had multiple developers. You learn more from a brownfield than from a greenfield. Some applications contain more man-hours in knowledge than I can afford to spend. So, you might not enjoy that particular work, but that's not a good generic reason for everyone to decline such an inheritance (which is what the title seemed to suggest to me).
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
Manning | Brownfield Application Development in .NET[^] Sidenote; I reviewed the book before it got published.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
I just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match) X| I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable. And I REALLY don't know what to make of this :~
smtp.Send(mail)
For n = 1 To 10
Thread.Sleep(500)
Application.DoEvents()
NextI wanted to apply the boy scout rule, but that's a full time job X| There's new work (and a new customer) in it for me though. Probably a new web or mobile application hosted in Azure :D
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
When I was teaching at a tech college, the class was split into four project groups for a four-stage project, all working from the same specifications and requirements. This was the last project in their bachelor study. I wanted them to get accustomed to what they must expect when they enter working life: Take over someone else's code. So for each of the four phases, the results produced by each group was rotated to another group, as a starting point for the next work phase. This was met by so much disgust and hatred that I was happy that these students would be out of college within a few months. I never tried to repeat anything like that. Still, I think Computer Science students should have been "forced to" work with the code of other programmers - that is, average middle class programmers, not the near-ideal source code of highly recognized open source systems, which does everything right, follows standards conistently etc. The code handed over to you from an overworked colleague who never had time to clean it up, it never had a clean design but has grown uncontrollably like an amoebae, with lots of loose ends and age-old TODOs... That is far from the idealized, academic open-source code. And then think of all the _non-_idealized code of the zillions of open source offerings made by less than perfect programmers, but thrown out to the world in the hope that someone will volunteer to clean it up...
-
Some smtp systems don't like receiving too many send requests too close together, so you got to spread them out if say sending bulk individualized email. (if you're relying on your ISP's mail handlers to send they purposely force inter-message delays to avoid spammers - often they'll let 5-10 go but then force you to wait before the next one will be allowed.) I dealt with such myself for a client, needed to send monthly billing invoices (tens to few hundreds each day). Luckily in my case this ran overnight [batch job] so while I did have to incorporate a single (not loop of) 1/2 second sleep between messages. Actually I could reduce that down to 1/10th second, but being overnight why ride the edge? I didn't want to push it and get bitten by say network spikes etc - at 1/2 sec worst possible case would be couple of hours. As to doing it in a loop (not defending it, just saying) - amateurish way to enable easier tuning i.e. "perhaps 9 loops of 450 will still be OK" ... big-wheel-small-wheel tuning. Something like the [old non digital] radios that have 2 tuning knobs: "tuning" & "fine tuning."
Message Signature (Click to edit ->)
However, notice that the SMTP call is NOT in the loop ;) It's just a single email, unless it's called from within a loop (which happens at least once, but at least three times it's just a single email). So... I guess it may be what you're saying, but handled very poorly? :laugh:
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
Manning | Brownfield Application Development in .NET[^] Sidenote; I reviewed the book before it got published.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
I prefer the projects that have been going for a few years, and which has had multiple developers. You learn more from a brownfield than from a greenfield. Some applications contain more man-hours in knowledge than I can afford to spend. So, you might not enjoy that particular work, but that's not a good generic reason for everyone to decline such an inheritance (which is what the title seemed to suggest to me).
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
Not this project. Unless you want to learn how NOT to do things... X| Such inheritance is often a bad deal since you'll be spending two to three times as much time as the old party to fix bugs while the chances of introducing new bugs increases. Meanwhile, you're working half price since you can't invoice all the hours you're making. And if you introduce enough bugs you may end up with an unhappy client. "But the former programmer made a mess out of things!" is not a valid excuse. Like today I had to "just fix a form, everything worked except a value was not saved to the database." Opening the form revealed it had all kinds of buttons that did nothing (or worse, did something) and shouldn't be there. There was binding in place, but everything was inserted directly into the controls. So I added something to the binding, then the application crashed because you can't do both, then I removed the binding and the designer thought it necessary to reflect that... Long story short, after trying to make it work for about an hour I started over, finding not even the database schema was correct. It took me about four hours in total (which should've been a "quick fix"), which is more than the customer is going to pay me for this one :rolleyes: If that was all, I could've gotten away with it, but this is one of many such changes.
Eddy Vluggen wrote:
that's not a good generic reason for everyone to decline such an inheritance
Of course. I inherited is as well, after all. You just need a damn good reason (and I know a lot of companies that simply don't, ever) :rolleyes:
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
When I was teaching at a tech college, the class was split into four project groups for a four-stage project, all working from the same specifications and requirements. This was the last project in their bachelor study. I wanted them to get accustomed to what they must expect when they enter working life: Take over someone else's code. So for each of the four phases, the results produced by each group was rotated to another group, as a starting point for the next work phase. This was met by so much disgust and hatred that I was happy that these students would be out of college within a few months. I never tried to repeat anything like that. Still, I think Computer Science students should have been "forced to" work with the code of other programmers - that is, average middle class programmers, not the near-ideal source code of highly recognized open source systems, which does everything right, follows standards conistently etc. The code handed over to you from an overworked colleague who never had time to clean it up, it never had a clean design but has grown uncontrollably like an amoebae, with lots of loose ends and age-old TODOs... That is far from the idealized, academic open-source code. And then think of all the _non-_idealized code of the zillions of open source offerings made by less than perfect programmers, but thrown out to the world in the hope that someone will volunteer to clean it up...
That's the evilest thing I can imagine! :laugh: It should be a very good lesson though. Especially with students, so they get to see other code as well. Perhaps even the most valuable lesson they get. I learned a lot from other code, also how NOT to do things :thumbsup:
Member 7989122 wrote:
This was met by so much disgust and hatred
They're students, let them suck it up and tell them that's how it's going to be! X| I salute and support your unorthodox and cruel teaching methods! :laugh:
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
Seems like it would be a very unresponsive message pump, given the half second interval between processing events.
Explorans limites defectum
At least emailing is something that the user expects to take a few moments... X|
Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly
-
I could say it is, but that sounds like an ad :D If you have to work with inherited code, then it might be a good investment for your team-library :thumbsup:
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
When I was teaching at a tech college, the class was split into four project groups for a four-stage project, all working from the same specifications and requirements. This was the last project in their bachelor study. I wanted them to get accustomed to what they must expect when they enter working life: Take over someone else's code. So for each of the four phases, the results produced by each group was rotated to another group, as a starting point for the next work phase. This was met by so much disgust and hatred that I was happy that these students would be out of college within a few months. I never tried to repeat anything like that. Still, I think Computer Science students should have been "forced to" work with the code of other programmers - that is, average middle class programmers, not the near-ideal source code of highly recognized open source systems, which does everything right, follows standards conistently etc. The code handed over to you from an overworked colleague who never had time to clean it up, it never had a clean design but has grown uncontrollably like an amoebae, with lots of loose ends and age-old TODOs... That is far from the idealized, academic open-source code. And then think of all the _non-_idealized code of the zillions of open source offerings made by less than perfect programmers, but thrown out to the world in the hope that someone will volunteer to clean it up...