Advantages To Using The .NET Like Operator Versus A RegEx?

Jul 19, 2010

Other than perhaps enhanced readability for very simple patterns, why would someone choose to use the Like operator in VB.NET over regular expressions for string pattern matching? Are there any advantages?

View 1 Replies


ADVERTISEMENT

C# - What Are The Advantages To Wrapping System Objects (File, ServiceController, Etc) Using The Adapter Pattern Versus Detouring For Unit Testing?

Feb 9, 2011

Consider the following method that stops a service:

Public Function StopService(ByVal serviceName As String, ByVal timeoutMilliseconds As Double) As Boolean
Try
Dim service As New ServiceController(serviceName)
Dim timeout As TimeSpan = TimeSpan.FromMilliseconds(timeoutMilliseconds)

[code]....

I agree that for domain model code that using the "traditional" unit testing approach makes the most sense as this would lead to a design that is easiest to maintain. However, for code that deals with the .net implementation of Windows API related stuff (file system, services, etc), is there really an advantage to going thru the extra work to get "traditionally" testable code?

It's hard for me to see the disadvantages of using Microsoft Moles for things such as ServiceController (or the File object). I really don't see any advantage of doing the traditional approach in this case.

View 2 Replies

.net - Using Regex OR Operator To Solve 2 Conditions?

Apr 10, 2012

I am trying to combine 2 regular expressions into 1 with the OR operator: |

I have one that checks for match of a letter followed by 8 digits:

Regex.IsMatch(s, "^[A-Z]d{8}$")

I have another that checks for simply 9 digits:

Regex.IsMatch(s, "^d{9}$")

[Code]...

Apparently I am not combining the two correctly and apparently I am horrible at regular expressions.And for those wondering, I did take a glance at How to combine 2 conditions and more in regex and I am still scratching my head.

View 5 Replies

[2005] Today.date Versus Now Versus DateTime.Now?

Jan 16, 2009

just want to know what is the difference between these date values?Once some one told me that its difference is server date and client date but not sure which one he meant.Below is 3 type of date currently I'm using and don't know what is the difference between them.

DateTime.Now is from System.DateTime.Now
Now is from Microsoft.VisualBasic.DateAndTime
Today.date is also from System.DateTime

View 4 Replies

Advantages Of OOP In .NET?

Apr 17, 2010

What's the basic Advantages of OOP in VB.NET?

View 1 Replies

.net - Principal Advantages Of C# ?

Apr 18, 2011

What are the most important functional differences between C# and VB.NET?

C#'s edge over VB

I'm programming in VB.net because I'd former experience in VB 6.0 and I've familiar with its syntax. I know that C# is preferred by the biggest part of .net programmers. I know that C performance had superior performance against many other languages, but there is a good advantage in the same .net framework? There is a quite good reason for advicing me if should I migrate right now from VB to C#?

View 2 Replies

Asp.net - Advantages Of Not Specifying Control IDs?

Jan 22, 2012

Reading over TRULY UNDERSTANDING VIEWSTATE the author suggests:

[Code]....

What advantages could one gain by not specifying control IDs? My quick searching didn't turn anything up.

View 1 Replies

Error: Option Strict On Disallows Operands Of Type Object For Operator '='. Use The 'Is' Operator To Test For Object Identity

Jan 27, 2010

I am tightening up my coding with the Option Strict set to ON. It has now produced alot of errors. An example of this is:

If AllocatedDGV.Rows(i).Cells("RoomNumber").Value = RoomsAvailableDGV.Rows(j).Cells("RoomName").Value Then

It gives me the following error: Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity.

View 6 Replies

Option Strict On Disallows Operands Of Type Object For Operator Use The 'Is' Operator To Test For Object Identity

Apr 6, 2012

I need to write an interface to get data to/from our data files.

We have a low level class that holds field values for each record read from the files.

This just holds two values, the value read from the file (DBValue) and the updated value that may need to be written back to the file (CurrentValue).

These values may be any of the standard value types (integer, date etc) or a string.

Either value (DBValue or CurrentValue) may be null if not defined.

I have written the class to manage this data which works fine while option strict is NOT on.

But we have an office policy of having option strict on all the time.

When I put option strict on, my object value comparisons fail with the error: "Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity."

Question, how should I change the following code to handle option strict on ...

This is all running on Visual Studio 2010

[Code]...

View 1 Replies

Coalesce Operator And Conditional Operator In .NET?

Mar 10, 2009

Possible Duplicate: Is there a conditional ternary operator in VB.NET?

Can we use Coalesce operator(??) and conditional ternary operator(:) in VB.NET as in C#?

View 5 Replies

.net - Advantages / Disadvantages Of Using C# In The Workplace?

Jun 27, 2012

At a colleague's workplace, a decision is trying to be made about whether to use both languages in the workplace or to standardize on one? There are some VB.Net developers and some C# developers. What advantages or disadvantages would there be to using both or to using one? Edit: To clarify this question, the question is not asking the advantages of one over the other, rather what are the advantages/disadvantage of standardizing on both languages versus standardizing on one. For instance, one point could be that C#/VB.Net may have more third party tools available and hence it may make sense to standardize all developers on that language.

View 9 Replies

Uses Of Reflection - Advantages / Disadvantages?

Apr 22, 2009

I wanted to gain knowledge about the following params.
1. Use of Reflection?
2. What is the advantage of reflection?
3. What is the disadvantage of reflection?

View 5 Replies

VS 2010 - Advantages Of Migrate From VB 6 To .NET

Jan 10, 2012

I have some questions: 1) What's the learning curve for someone with good background in VB6? 2) what are the main advantages of VB.Net compared to VB6 and what will I be missing from VB6? 3) With VB.NET 2010 "ultimate" edition is it possible to make stand alone apps or they will be depending on net anyway even for the EXEs?

View 12 Replies

What Are The True Advantages Of Using #Region

Jun 25, 2010

What are the true advantages of using #Region?

View 6 Replies

What's The Advantages Of VB Programming Language

May 3, 2010

I want to learn programming, many people in website say visual basic is a good start. What's the advantages of it? As i know, there are a lot of people use c# in china, but few people use visual basic, why? Any great book to learn it?

View 16 Replies

Advantages Of .net Over Vb6 For CRUD Application Development?

Dec 13, 2009

What are the improvements in vb.net compared to vb6 that make developing such an application easier?

View 3 Replies

Windows - What Are The Advantages Of Using Bonjour In A Program

Oct 19, 2010

What are the advantages of using Bonjour in a program (vb.net), is it even possible? Couldn't I get the same end result using just what I program?

View 1 Replies

FAQ Describing Its True Advantages In VB Application Design?

Jul 7, 2011

I simply leave the GUID text blank in Properties/ Application. Can someone give the advantages of using the GUID? I have done a few searches on Google and VBFORUMS but have not found a FAQ describing its true advantages in VB Application design.

View 3 Replies

What Is The Advantages And Disadvantages Of Using Public Interface In A ClassLibrary

Jun 21, 2011

What is the advantages and disadvantages of using Public Interface in a ClassLibrary?

View 2 Replies

.net - Advantages And Disadvantages Of Including PDB Files With Release Application

May 13, 2010

I've got a VB.net application. Currently the release version of the application is produced without a PDB file. This gives me error logs lacking useful details such as line numbers. I'm looking at including the PDB files with future builds but i'd like to know what the advantages and disadvantages of this are (performance wise, size wise, code security wise)

View 4 Replies

Concatenating A Variable With A Regex Group Match In Regex.replace?

Apr 5, 2012

I am having an issue where I am using regex.Replace to replace part of a string. The basic idea is that I want to capture the beginning of the string then replace the end of the string with a value from code. For an example pretend I have a string that says "Test Number " followed by number and I want to increment that number. I capture the "Test Number " but when I try to concatenate that capture with the new number it treats the capture ($1) as a literal and replaces the entire string with $1[new number].

[code]...

This will output "We are on Test Number 2", as expected. how I can use a variable in the replacement string portion of the Regex.Replace when including a captured group?

View 1 Replies

Advantages Of Property Keyword Over Using A Private Field With Getters And Setters?

May 21, 2011

In VB.NET, what are the advantages of using the Property keyword rather than:[code]Coming from Java I tend to use this style rather than Property...End Property - is there any reason not to?

View 4 Replies

Advantages Of Protected Modifiers In Console Application In Visual Basic?

Feb 15, 2010

Any advantages of protected modifiers in console application in Visual Basic .NET

View 2 Replies

Regex: Take Text & Some Special Characters Between The Xml Tags Using Regex On C#.net?

Feb 23, 2012

I want to take the text and some special characters between the xml tags.. My input file contains:

[Code]...

now i want the Regex to take text and the special characters between the tags <line>,<inline>..

View 2 Replies

Increment Regex Match Using Regex.Replace

Jun 21, 2012

I'm creating a program in VB.NET to output multiple images. Some images will have the same file name. If there is multiple files with the same name I want to add "_1_" to the end of the file name. If the "_1_" file already exists I want to increment the 1 to be "_2_". If this file already exists I want to continue incrementing the number ultil it doesn't exist. So for example "filename", filename_1_", "filename_2_", etc. Here is the code that I have tried

[Code]...

View 1 Replies

Regex Builder That Actually BUILDS RegEx From A Highlight

Nov 17, 2011

I've been working straight since yesterday trying to get this to work. I'm a noob to RegEx and I've tested out about 5 different RegEx "builders" but each of them require you to navigate through the options to build the Regex...each of them has failed when I try to use them.Is there an application out there free/paid where you select the line you want to grab and the RegEx is auto generated from that highlight rather than having to try to build the line of code? [code]

View 1 Replies

How To Use Operator As A Comparison Operator

Nov 11, 2009

I want to perform equality comparison in VB.NET and cannot get it to work. Error: value of type Boolean can not be converted to System.Drawing.PointF

[code]...

View 4 Replies

What Are The Advantages Of The "Using" Keyword Other Than Showing The Coder When The Object Goes Out Of Scope

May 31, 2012

Using vb.net 2008.I have used the "Using" keyword before in C# with objects that implement iDisposable.Can you use that keyword in vb.net also? What are the advantages of the "Using" keyword other than showing the coder when the object goes out of scope.I am under the impression that the "Dispose()" function is called at the IL level when you use "Using" instead of, for examplel, calling the Dispose() in the .net code.

View 1 Replies

.net - X=x+1 Versus X +=1?

Apr 30, 2009

I'm under the impression that these two commands result in the same end, namely incrementing X by 1 but that the latter is probably more efficient.If it is correct, why should the latter be more efficient? Shouldn't they both compile to the same IL?

View 17 Replies

IDE Versus EXE Performance In .NET?

Oct 5, 2009

I've developed a .NET application that, among other things, does the following:Uses WebClient to retrieve data from a remote server.
Serves as a socket server to 2 'satellite' applications run on the same machine or on a LAN.When I run the app in the VS IDE, it works great. It quickly gets the data from the remote server and communicates perfectly with the 2 satellites.However, when I build it and run it as an EXE, the response from the remote server is very slow and its communication with the 2 satellite applications become very poor.Is there some important difference between running an app in the IDE and running it as an EXE that could effect it like this?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved