A real Mess
-
:WTF: is your problem?? All I did was bring up something I saw in a documentery about artillery and it's reliablilty and maintainability, and you think I'm picking on the Germans? Dude, back then, during the war, they tended to over-engineer their weapons. That's all I'm saying...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I agree with you ;) And what's about an italian like me? Would you like me to speak about spaghetti code? :laugh: Luckly italian people does not always write spaghetti as they eat!! :P
-
Well, that code brings me back to the 90's. Typical "journeyman programmer" production. The journeyman programmer doesn't care about software engineering or improving the skills in their trade, just hack away until it works... eventually they work up their way to be project manager and leave the crap to someone else to maintain X|. Don't let it get to you too much the first 20 years are the worse :laugh:
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
Did the author die? ;P
GSoC 2009 student for SMW! --- My little forums: http://code.bn2vs.com --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
-
Did the author die? ;P
GSoC 2009 student for SMW! --- My little forums: http://code.bn2vs.com --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
-
Did the author die? ;P
GSoC 2009 student for SMW! --- My little forums: http://code.bn2vs.com --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
Well I have his home address, but I believe he's already dead, at least his brain was when he 'coded' this.
-
:WTF: is your problem?? All I did was bring up something I saw in a documentery about artillery and it's reliablilty and maintainability, and you think I'm picking on the Germans? Dude, back then, during the war, they tended to over-engineer their weapons. That's all I'm saying...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008French code smells cheese and has blue spots... :laugh:
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
-
I agree with you ;) And what's about an italian like me? Would you like me to speak about spaghetti code? :laugh: Luckly italian people does not always write spaghetti as they eat!! :P
-
Hoorray! I fixed it!!!! Well when the procedure found a time over 4 hours for a day it used to skip the next records for that day :doh: I am so proud that I can not resist to post the fixed method :-D
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.V
Arnaud Lhopiteau wrote:
I am so proud that I can not resist to post the fixed method Big Grin
No, 571 line long method can be considered non-broken.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains. -- Pride and Prejudice and Zombies
-
Arnaud Lhopiteau wrote:
I am so proud that I can not resist to post the fixed method Big Grin
No, 571 line long method can be considered non-broken.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains. -- Pride and Prejudice and Zombies
Well I can see I am not the only one practicing irony here, am I?
-
In fairness, a lot of bad implementations are done in other languages, I dare say there are as many shocking apps developed in C# as there are VB.Net.
yup, I second that.
{}*
-
French code smells cheese and has blue spots... :laugh:
And Danish code is just sweet!...
"God doesn't play dice" - Albert Einstein "God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
-
yup, I second that.
{}*
-
Well this code has been made in Switzerland...
Snif :'( I vote for removing the Swiss citizenship of this programmer ;)
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
-
This is just one method, but do not expect it to be short... :sigh: I spent my days debugging this kind of code... X|
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim i As Integer
Dim r As Integer
Dim sEmployeeID As String
Dim dDateFrom As DateTime = Convert.ToDateTime(DateFrom.Text)
Dim dDateTo As DateTime = Convert.ToDateTime(DateTo.Text)
Dim dDateCurrent As Date = dDateFrom
Dim sConsultantInfoDay As String = ""
Dim sProjectInfo1 As String = ""
Dim sProjectInfo2 As String = ""
Dim sProject As String = ""
Dim DateEnd As Object
Dim DaysNoticeExt As Object
Dim sColor1 As String = "#FFFFFF"
Dim sColor2 As String = "#FFFFFF"
Dim PreviousColor As String = "#FFFFFF"
Dim hl As New HyperLink
Dim lb As New Label
Dim lb2 As New Label
Dim iDayofWeek As Integer
Dim sDayName As String
Dim sExit As String
Dim bgColor As Drawing.Color
Dim sColorProject As String = "#FFFFFF"
Dim bTSClosed As Boolean
Dim Hours As Double
Dim HoursClientMonth As Double
Dim HoursMonth As Double
Dim HoursTBPMonth As Double
Dim HoursInternalMonth As Double
Dim DailyHoursTBP As Double
Dim TSID As Integer
Dim oEmpDateStart As Object
Dim oEmpDateEnd As Object
Dim bClientProject As Boolean = False
Dim bProjectFoundMonth As Boolean = False
Dim WorkPerc As Double
Dim sHoliday As String
Dim ProjectID As Integer
Dim TotalHoursMonth As Double
Dim dteRenewal, dteCurrentNotification, dteCurrentEndProj As DateTime
Dim intRenewalCpt As Integer = -1
Dim blnIsFirstTime As Boolean = True
Dim intRenewsEachNbMonths As IntegerSelect Case e.Row.RowType Case DataControlRowType.Header Dim iMonth As Integer e.Row.Cells(0).Visible = False e.Row.Cells(1).Visible = False e.Row.Cells(2).Visible = False e.Row.Cells(3).Visible = False e.Row.Cells(iColDaysStart - 1).Width = ConsultantColWidth e.Row.Cells(iColDaysStart - 1).Text = sEmployeeHeader e.Row.Cells(iColDaysStart - 1).Font.Size = iFontSizeEmployees e.Row.Cells(iColDaysStart - 1).Font.Bold = True e.Row.Cells(iColDaysStart - 1).ForeColor = Drawing.Color.White e.Row.Cells(iColDaysStart - 1).BackColor = Drawing.Color.DarkBlue i = iColDaysStart Do While dDateCurrent <= dDateTo iMonth = dDateCurrent.Month sDayName = WeekdayName(DatePart("w", dDateCurrent), True, Microsoft.VisualBasic.FirstDayOfWeek.Sunday) e.Row.Cells(i).Text = String.Concat(Left(sDayNam
-
:WTF: is your problem?? All I did was bring up something I saw in a documentery about artillery and it's reliablilty and maintainability, and you think I'm picking on the Germans? Dude, back then, during the war, they tended to over-engineer their weapons. That's all I'm saying...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008that's just too funny. I guess he's a bit cranky. I happen to be a bit of an armor historian buff, and the big, bad German tanks of ww2 were mostly junk. Credit to the 88 and the high velocity 75, but reliability is everything. The Tiger 2 and Panther broke down at horrendous rates. The panther's armor was spotty at best with mediocre quality of the armor plate, etc. Kelly's Heroes Tiger Tank - YouTube[^] Reliability was key. So, I appreciate the comment on the complexity of the arty pieces. I just wish some of the defense contractors in the US would learn.
Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.