Code as War Crime
-
[Reads first line of code] Is that Visual Basic?? There's your problem right there! :laugh: Let the flame war begin (or fizzle out because nobody noticed/cared). :rose:
I still contend that Object Pascal is the better language! There, feel better? :D
-
I've seen people try that - it normally fails, horribly.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
Ignoring the legal implications (server usage of Microsoft Office apps violates the license), the Office apps fail in odd ways or cause unusual server failures when used in this fashion.
Software Zen:
delete this;
-
I haven't been on these forums in a while. But I've come across a coding atrocity so horrible, so offensive, that I have to document it. This is a Windows service. Can you see how the developer accesses database data? (Answer below)
Dim ResultDS As New SqlDataSource
ResultDS.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("JaguarReportingConnectionString").ToString()
ResultDS.SelectCommand = ""ResultDS.[Select](DataSourceSelectArguments.Empty)
Dim dg As New GridView
dg.DataSource = ResultDS
dg.DataBind()
Dim dv As New DataView
Dim dt As New DataTable
dv = ResultDS.Select(DataSourceSelectArguments.Empty)
dt = dv.ToTable()Hint: GridView is from the Web UI control namespace. Did I mention this is a Windows service?
-
I still contend that Object Pascal is the better language! There, feel better? :D
-
Nope. Befunge is the best. There is no better 2D programming languge. If there is any.
Greetings - Jacek
That's a win for Jacek! http://en.wikipedia.org/wiki/Befunge[^]
-
I haven't been on these forums in a while. But I've come across a coding atrocity so horrible, so offensive, that I have to document it. This is a Windows service. Can you see how the developer accesses database data? (Answer below)
Dim ResultDS As New SqlDataSource
ResultDS.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("JaguarReportingConnectionString").ToString()
ResultDS.SelectCommand = ""ResultDS.[Select](DataSourceSelectArguments.Empty)
Dim dg As New GridView
dg.DataSource = ResultDS
dg.DataBind()
Dim dv As New DataView
Dim dt As New DataTable
dv = ResultDS.Select(DataSourceSelectArguments.Empty)
dt = dv.ToTable()Hint: GridView is from the Web UI control namespace. Did I mention this is a Windows service?
You know that a Windows service can be allowed to interact with the desktop in which case you can use and you need UI controls. I don't know what the intention is from those few line of codes but this is far from a War Crime, so I think you're exaggerating. Yes, I know that :
Quote:
In most cases, it is recommended that you not change the Allow service to interact with desktop setting. If you allow the service to interact with the desktop, any information that the service displays on the desktop will also be displayed on an interactive user's desktop. A malicious user could then take control of the service or attack it from the interactive desktop.
I have seen worse.
giuchici