Visual Basic .NET (VB.NET) is an object-oriented computer programming language that can be viewed as an evolution of Microsoft's Visual Basic 6 (VB6) but implemented on the Microsoft .NET Framework.
7
votes
2answers
363 views
I need a way to modify this code, so that I will not violate DRY
I've got a couple of utility functions to support memoization for functions with anywhere between 0 to 8 arguments.
Public Shared Function Mize(Of TResult)(ByVal input_f As System.Func(Of TResult)) ...
4
votes
4answers
525 views
Function to test if the current time is within a time window
I have written the following code that tests if the current time is within a time window. It seems to work ok with my test cases, but I would be interested if anyone can see any possible problems or ...
5
votes
1answer
276 views
IF ELSEIF - I need a Cleaner way of writing this code
I need a cleaner way of writing the following piece of code:
For Each value As String In collection
If (value = "MYKEY1") Then
If (TabPageIsVisible(tpImportHealth)) Then
...
1
vote
2answers
224 views
Iterate comparison - How can I write this better?
I would like to write the following piece of code cleaner and more efficient, any comments will be greatly appreciated:
Dim dt As DataTable = SomeDataTable
For Each dr As DataRow In dt.Rows
...
2
votes
1answer
160 views
Refactor a subroutine that divides date range into quarters.
The subroutine below, GetDetailsQuarterly, accepts two dates. Then it writes out each quarter that falls within the date range. It also gives the first and last day of the quarter. I really don't like ...
2
votes
2answers
313 views
VB.NET / ASP.NET: Can this function be improved upon further?
I have a simple quantity display function that runs for every product displayed in our catalog. The MaxQtyDisplay value is set in our web.config file. Part of me thinks the function is as ...