|
Connecting to databases other than MSSQL is not "horrible" - generally it is identical, but with different class names: MySqlConnection, or SqlCeConnection instead of SqlConnection and so forth.
While it works well, the concept of SqlConnection and SqlCommand is visually difficult, needs to be encased in using blocks, and is prone to SQL Injection attacks if you don't do it properly.
I agree that Linq to SQL does make this process easier, but it is another thing for people to learn - and not everybody does (I am only just started on learning the details of Linq myself, and I have been using .NET for a while now).
I think what the complaint was about, was the use of Oracle as the DB when there are "better" alternatives rather than the use of SQL and .NET
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
and also setup oracle server in windows is hell of a job.
|
|
|
|
|
By not working I assume you mean not compiling? due to the missing semi-colon
Besides, I would be more concerned about the hard-coded connection string and lack of error handling
Illogical thoughts make me ill
|
|
|
|
|
no it was compiling i am the one who misplaced the semi-colon.
|
|
|
|
|
My rule of thumb is "4 method parameters are fine, 6 is questionable, 8 are a problem".
Here I present you what I have to deal with:
long BunnyInitSub( BunnyType eBunnyType,
long lBunnyIndex,
CString sBunnyLabel1,
long lBunnyColor1,
bool bBunnyAutoScale1,
bool bBunnyAutoMin1,
bool bBunnyAutoMax1,
double dBunnyMin1,
double dBunnyMax1,
bool bBunnyLogScale1,
bool bOverlap,
long lBunnyPlotFirst,
bool bEnableSecondPlot,
long lBunnyPlotSecond = EASTER_LINE,
bool bEnableSubBunny = false,
CString sBunnyLabel2 = _T(""),
long lBunnyColor2 = black,
bool bBunnyAutoScale2 = true,
bool bBunnyAutoMin2 = true,
bool bBunnyAutoMax2 = true,
double dBunnyMin2 = 0,
double dBunnyMax2 = 0,
bool bBunnyLogScale2 = false );
Thank you, Visual Assist, for coping with this horror!
(No it's not Bunny in the original code. Changed to protect the nocent.)
Yes, this is more or less two times the same information. Which are, internally, stored in a struct with similar layout as the method. Serialized raw, requiring two-way-compatibility. Which, due to some mishap with "storage size optimizations" don't even have identical alignment, so can't be replaced with two instances of half the struct. Gaaaaaaah!
|
|
|
|
|
Didn't you happen to work with Excel COM API? For example Microsoft.Office.Interop.Excel.Dialog.Show has 30 parameters. Cool, isn't it? They are optional of course, but in languages like C# before 4.0 you've got to specify them all
|
|
|
|
|
Someone there has no f***ing idea how to pass object, object reference or pointer to object as a function parameter.
There is only one Ashley Judd and Salma Hayek is her prophet!
Advertise here – minimum three posts per day are guaranteed.
|
|
|
|
|
That's what I wished for: one struct per "bunny" with good initializers, and an Init method taking one or two of them.
The guy would have done better with some guidance. It's a rarely used part of the API - I've already fixed the more common parts.
What hurts most is that even without those objects, he could have folded three of the bools into the two doubles. Twice.
|
|
|
|
|
I think you should send your rule over to Microsoft. some of their developers are still using the classic rule of...
40 method parameters are fine, 20 is questionable, 10 is a problem
Illogical thoughts make me ill
|
|
|
|
|
You never worked in the kernel then...
NTSTATUS ZwCreateFile(
__out PHANDLE FileHandle,
__in ACCESS_MASK DesiredAccess,
__in POBJECT_ATTRIBUTES ObjectAttributes,
__out PIO_STATUS_BLOCK IoStatusBlock,
__in_opt PLARGE_INTEGER AllocationSize,
__in ULONG FileAttributes,
__in ULONG ShareAccess,
__in ULONG CreateDisposition,
__in ULONG CreateOptions,
__in_opt PVOID EaBuffer,
__in ULONG EaLength
);
"It is a remarkable fact that despite the worldwide expenditure of perhaps US$50 billion since 1990, and the efforts of tens of thousands of scientists worldwide, no human climate signal has yet been detected that is distinct from natural variation."
Bob Carter, Research Professor of Geology, James Cook University, Townsville
|
|
|
|
|
Still 11 < 23
Not much worse than Win32 CreateFile. My rules of thumb would get some leeway (say a +2..+4 modifier) for a C-StyleAPI, so the scratch by.
Also, it's a rule for orientation - if one in 100 methods violates that, it's fine, if one in ten does, it's a problem.
|
|
|
|
|
Top that? Easily. Here is just one of endlessly many similar static methods in an application I just replaced (including comments and documentation):
public static int DoSomethingWithBunnies(int auswahl, string artnr, string artbez, string lnam,
string lnr, string lartnr, string wg, string mkenz, string ean,
string gab, bool ges, bool bug, bool bau, bool eks, int stanort,
string uid)
{
}
Edit: It's not the number of parameters that's the problem here. Much worse that all methods are static, usually at least 1000 lines of the worst spaghetti code long and often redundant. There are at least two more versions of this particular method here with '2' and '3' added to the name with little to no apparent differences in the copied code. All without any comments except for those I added or any documentation.
"I have what could be described as the most wide-open sense of humor on the site, and if I don't think something is funny, then it really isn't." - JSOC, 2011
----- "Friar Modest never was a prior" - Italian proverb
|
|
|
|
|
I see so much "wonderful" code over here, so I'd like to put my 5 cents as well.
Once I had the "pleasure" of working with Japanese guys (I have nothing agains Japanese, put those were especially "talented"). Can you imagine a class named "Cmoag1000Helper" containing the method "getKakko"? But they created such a masterpiece. Especially I like method name. The folks around who speak Russian already have got the point, I think. For the rest of you I'll explain. The word "kakko" sounds very close to the Russian word which, when translated to English, actually means (sorry for being rude, but it's only the truth) "turd" ("sh*t", "excrements", whatever you wish to call it, the sence is the same).
So I had to work with the class that was capable of retrieving sh*t, that was just great .
|
|
|
|
|
It also sounds very like the English word cack, which comes from the the Dutch Word Kak (meaning Sh*t). Khaki is related IIRC (sh*t coloured)[edit: no it doesn't, it means dust-coloured. That's a comprehensive education for you....] and poppycock (from the Dutch meaning soft Sh*t).
I'm full of useful sh*t today!
|
|
|
|
|
Interesting (or not) as this may be I think there is a similar sounding word in many languages.
The german word is "Kacke" which translates to sh*t with "kacken" being the verb and a equally favorite adjective "kack".
Too ... much ... information
|
|
|
|
|
English is closely related to Dutch (its base grew out of the same root language) and further back German, Dutch and English had a common ancestor. English only sounds different because it was smattered through with a little Scandinavian, a bit of French and some Latin later (Latin came through the Monasteries) plus it's been shedding inflections like billy-o since Anglo-Saxon times.
They are probably still related to the word Khaki, this is Urdu apparently, and European languages had a common ancestor with Indian ones. It's telling that the Urdu word means dust/earth if Wikipedia is to be trusted, so they even have a similar meaning.
|
|
|
|
|
Yeah, I do remember something about stem of indo-germanic languages. There was this bit with "Ma" for mother which has homophones in these languages: Ma, Mama, Mom, Mother, Mutter, mater, madre etc.
|
|
|
|
|
Oh, man. Will I see any responces from languages like French, Italian, Spanish... For your information, there is appropriate verb in Russian - "какать" (it's in Cyrillic, I hope you have Unicode), means "to take a sh*t".
|
|
|
|
|
Wow, that's just cool. I see you're full of vital knowledge too
|
|
|
|
|
I really hope the class (in in the very least, an instance) was named "golgothan".
|
|
|
|
|
Maybe it's a new Toyota safety feature. So if you have a car crash and Kakko your pants, there's no mess to clean up.
[edit] Actually if you've seen the hi-tec toilets they sell over in Japan... getKakko wouldn't be that an uncommon method
"You get that on the big jobs."
modified on Monday, February 14, 2011 10:48 PM
|
|
|
|
|
It's not that new, I worked on that code in the end of 2009. Put perhaps they sold it to Toyota after we finished business I think they wanted to create a firmware for carpet-producing macnines (so that carpet would automatically wipe driver's ass after crash), they didn't tell exactly. But there is a bug in this software. Some of you might have heard about new Toyotas which don't stop when they're told to (by using brake pedal). Instead they hit poor trees. And officials say there is a problem with driver's carpet. Well, it's the truth. Because of bug in "getKakko" function in carpet-producing machines firmware, carpets do not, I repeat, do not wipe driver's ass in case of crash. Instead they lubricate themselves with crap (from reserve storage) and become. you know, a little slimy... I presume you've got the point
|
|
|
|
|
|
I have registered to a site. Finally it asked me to check my mail. My mail got a activation link like this
"Welcome To .....
To activate your account click the below link http:\\www.xxxxxxx.com\activate\id\2356 . When I try using nearest random numbers for the id, it still works.
I think I came across lot of sites like this in the internet world
|
|
|
|
|
Some developers have way too much trust in the people of the web
Shame on you for trying to use another number!
Illogical thoughts make me ill
|
|
|
|
|