|
so it is upgrade time; or refactor time; or both...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Perhaps. If I have time tomorrow, I'm also going to convert a massive VB.net project (which was converted from VB6 code) to C#.
|
|
|
|
|
aspdotnetdev wrote: VB6
is that the language where variables got called like Excel cells: A, A1, A2, ..., B, B1, etc?
Now which one do you prefer?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
How does the use of that class look like? Perhaps
OrderBatchCustomerOrderOrderShipToOrderShipCarrierInstructions myCurrentObjectOfOrderBatchCustomerOrderOrderShipToOrderShipCarrierInstructionsForCustomerNumber1 = new OrderBatchCustomerOrderOrderShipToOrderShipCarrierInstructions()
|
|
|
|
|
That proves he indeed should go for c#
|
|
|
|
|
|
verbose, no semi-colons, no curly brackets; my bet is on VB.NET
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Nope, just bad C#. The VB.Net would actually be shorter in this case (assuming the "var" C# keyword can't be used):
Dim myCurrentObjectOfOrderBatchCustomerOrderOrderShipToOrderShipCarrierInstructionsForCustomerNumber1 As _
New OrderBatchCustomerOrderOrderShipToOrderShipCarrierInstructions()
|
|
|
|
|
"Small is beautiful, but BIG is wonderful".
(John Holmes)
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
that sounds very American
|
|
|
|
|
WiGgLr wrote: that sounds very American
The american version goes: Small is beautiful, but big is better.
|
|
|
|
|
At least it is not:
public class OrdrBtchCustmrOrdrOrdrShpToOrdrShpCarrInstrs {}
|
|
|
|
|
public class OBCOOSTOSCInstrs { }
|
|
|
|
|
Apple code always used to have very long field and function names
|
|
|
|
|
Still it's better than using shorthands like OBCOOStoOSCI
Greetings - Jacek
|
|
|
|
|
aspdotnetdev wrote: The word "Order" appears 4 times
Was it in bold? Maybe it was a (re)tired Web Developer who wrote this. [^]
Greetings - Jacek
|
|
|
|
|
Oh that kind of size, I see
|
|
|
|
|
A table in the live production environment:
CREATE TABLE setPaymentPlans
(
[cppDivision1] [varchar](12) NOT NULL,
[cppDivision2] [varchar](12) NULL,
[cppDivision3] [varchar](12) NULL,
[cppDivision4] [varchar](12) NULL,
[cppDivision5] [varchar](12) NULL,
[cppDivision6] [varchar](12) NULL,
[cppDivision7] [varchar](12) NULL,
[cppDivision8] [varchar](12) NULL,
[cppDivision9] [varchar](12) NULL,
[cppDivision10] [varchar](12) NULL,
[cppDivision11] [varchar](12) NULL,
[cppDivision12] [varchar](12) NULL,
[cppDivision13] [varchar](12) NULL,
[cppDivision14] [varchar](12) NULL,
[cppDivision15] [varchar](12) NULL,
[cppDivision16] [varchar](12) NULL,
[cppDivision17] [varchar](12) NULL,
[cppDivision18] [varchar](1) NULL,
)
Perhaps they thought adding another table for a one to many relationship would be one too many tables.
Also, you'll note the prefix of "cpp". I guess they changed the name of the table at some point and didn't feel like changing the prefix. Some people really need to learn how to use table aliases.
And I have no idea why that last one is a varchar(1) rather than a varchar(12).
|
|
|
|
|
FTFY
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Here I came to a code, which looks like a Horror Movie of C#:
public bool IsMatched(string str)
{
if(str.ToString().Equals("Customer"))
{
return true;
}
return false;
}
What this means? Is it really require? Go to hell.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Does that compile? or should it be public bool IsMatched(string str) .
If it is a bool then this function does the same as if (str=="Customer") maybe they wanted to write
public bool IsCustomer(string str)
{
return (str=="Customer");
}
|
|
|
|
|
Yes, it's "public bool".
My point here is in this line: if(str.ToString().Equals("Customer"))
What is the significance of doing ToString() in a string? I am going mad... Ahh!!!
Why people does this ToString() in a string variable?
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
no point, but it doesn't do any harm other than making the code slightly less readable. Also no need to call Equals directly could call ==
|
|
|
|
|
ARopo wrote: it doesn't do any harm
Unless the string happens to be null.
|
|
|
|