30+ years experiance. Focused on C# since 2001. My day job is C#, Web/Win, and MS Dynamics. I also work on a few side projects with AI/ML, mostly around compilers and coding tools.
I've been writing code for 30-years. I have my top 5.
5,000 line IF structure that was copied 5 times with a few simple changes in each of the 5. Apparently, they didn't know how to create a function or invert the IF. This was written by a very well known consulting company and we paid a LOT of money for it.
An integration app that took 7-hours to run. I rewrote it, doubled the volume, and it ran in less than 15-minutes... really. Same company and developer from #1 above wrote it as well.
I once ran into a function that was basically... if key == "A" return 1, elseif key == "B" return 2, elseif key == "C" return 3. Then they did all of the uppercase characters and numbers. It took me awhile to figure out they were capturing the keyboard and converting it to a number. I replaced those hundreds of lines of code with something like return (int)key -65;.
I was hired by an insurance company to come in for 2-weeks and do a project to read an Excel file into a db for another app to use an input. It took me a couple of days to figure out what they were doing and that every year, they hired a consultant to come in for two weeks and tweak the code. The problem was that they hardcoded the column names they were reading, so it had to be tweaked every year. If I recall, they had been doing this for like 10-years. So the first day I figured out how it worked and the second day I rewrote it to make it dynamic and search for the columns it needed before processing them. So after day two I had it working and explained that next year and going forward, they would not need to tweak it. So I packed up and went home after the 3rd day. I guess I could have milked another week and half, but I didn't want to take advantage of them, as it was obvious that the previous contractor had been milking them for years.
And here's one of my own. When I was 18 I got my first programming job writting LISP. I had skipped over trig in highschool because my guidance counsler told me I had to start with College Algebra anyway. She was a... well, she was something. So having not been exposed to trig, I ran into a function that needed cosign and I didn't know what that was. So I wrote my own cosign function.
It was about 300 lines of code. My boss, who was an engineer with about 30 years experiance, looked at it and asked me what on earth I was doing. So I explained to him that I had this point and need to plot an arc with this radius, but I didn't know where it ended. So I figured out that for every x rise, it ran x distance and I computed a constant and used the radius of the arc to determine where it would end. He thought it was funny and sat down and explained cosign and we replaced my 300 lines of code with 1 line of code. But still, I got to create my own cosign function without knowing what it was. How many developers can say that? Yeah, I know... no one should ever have to say that. But I still think that is pretty cool. I really wish I had kept the code... but unfortuneatly I did not. I guess you really do need to know trig after all.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I've been writing code for 30-years. I have my top 5.
5,000 line IF structure that was copied 5 times with a few simple changes in each of the 5. Apparently, they didn't know how to create a function or invert the IF. This was written by a very well known consulting company and we paid a LOT of money for it.
An integration app that took 7-hours to run. I rewrote it, doubled the volume, and it ran in less than 15-minutes... really. Same company and developer from #1 above wrote it as well.
I once ran into a function that was basically... if key == "A" return 1, elseif key == "B" return 2, elseif key == "C" return 3. Then they did all of the uppercase characters and numbers. It took me awhile to figure out they were capturing the keyboard and converting it to a number. I replaced those hundreds of lines of code with something like return (int)key -65;.
I was hired by an insurance company to come in for 2-weeks and do a project to read an Excel file into a db for another app to use an input. It took me a couple of days to figure out what they were doing and that every year, they hired a consultant to come in for two weeks and tweak the code. The problem was that they hardcoded the column names they were reading, so it had to be tweaked every year. If I recall, they had been doing this for like 10-years. So the first day I figured out how it worked and the second day I rewrote it to make it dynamic and search for the columns it needed before processing them. So after day two I had it working and explained that next year and going forward, they would not need to tweak it. So I packed up and went home after the 3rd day. I guess I could have milked another week and half, but I didn't want to take advantage of them, as it was obvious that the previous contractor had been milking them for years.
And here's one of my own. When I was 18 I got my first programming job writting LISP. I had skipped over trig in highschool because my guidance counsler told me I had to start with College Algebra anyway. She was a... well, she was something. So having not been exposed to trig, I ran into a function that needed cosign and I didn't know what that was. So I wrote my own cosign function.
It was about 300 lines of code. My boss, who was an engineer with about 30 years experiance, looked at it and asked me what on earth I was doing. So I explained to him that I had this point and need to plot an arc with this radius, but I didn't know where it ended. So I figured out that for every x rise, it ran x distance and I computed a constant and used the radius of the arc to determine where it would end. He thought it was funny and sat down and explained cosign and we replaced my 300 lines of code with 1 line of code. But still, I got to create my own cosign function without knowing what it was. How many developers can say that? Yeah, I know... no one should ever have to say that. But I still think that is pretty cool. I really wish I had kept the code... but unfortuneatly I did not. I guess you really do need to know trig after all.