Saturday, April 30, 2005

Coding Horror: October 2004 Archives

Coding Horror: October 2004 Archives: Who needs Stored Procedures, anyways?

It's intended as sarcasm, but I believe this Daily WTF entry on Stored Procedures should be taken at face value:

I'm sure we've all heard, over and over, that inline SQL is generally a bad practice, and that we should use Stored Procedures when possible. But let's be realistic for a minute. Who wants to write a stupid stored procedure for every stupid little simple query needed.

Have you ever worked on a system where someone decreed* that all database calls must be Stored Procedures, and SQL is strictly verboten? I have, and this decision leads to incredible development pain:

1. Stored Procedures are written in big iron database "languages" like PL/SQL (Oracle) or T-SQL (Microsoft). These so-called languages are archaic, and full of the crazy, incoherent design choices that always result from the torturous evolution of ten years of backwards compatibility. You really don't want to be writing a lot of code in this stuff. For context, JavaScript is a giant step up from PL/SQL or T-SQL.
2. Stored Procedures typically cannot be debugged in the same IDE you write your UI. Every time I isolate an exception in the procs, I have to stop what I am doing, bust out my copy of Toad, and load up the database packages to see what's going wrong. Frequently transitioning between two totally different IDEs, with completely different interfaces and languages, is not exactly productive.
3. Stored Procedures don't provide much feedback when things go wrong. Unless the proc is coded interally with weird T-SQL or PL/SQL exception handling, we get cryptic 'errors' returned based on the particular line inside the proc that failed, such as Table has no rows. Uh, ok?
4. Stored Procedures can't pass objects. So, if you're not careful, you can end up with a zillion parameters. If you have to populate a table row with 20+ fields using a proc, say hello to 20+ parameters. Worst of all, if I pass a bad parameter-- either too many, not enough, or bad datatypes-- I get a generic "bad call" error. Oracle can't tell me which parameters are in error! So I have to pore over 20 parameters, by hand, to figure out which one is the culprit.
5. Stored Procedures hide business logic. I have no idea what a proc is doing, or what kind of cursor (DataSet) or values it will return to me. I can't view the source code to the proc (at least, without resorting to #2 if I have appropriate access) to verify that it is actually doing what I think it is-- or what the designer intended it to do. Inline SQL may not be pretty, but at least I can see it in context, alongside the other business logic.

So why use Stored Procedures at all? Conventional wisdom says we do it because:

* Stored procedures generally result in improved performance because the database can optimize the data access plan used by the procedure and cache it for subsequent reuse.
* Stored procedures can be individually secured within the database. A client can be granted permissions to execute a stored procedure without having any permissions on the underlying tables.
* Stored procedures result in easier maintenance because it is generally easier to modify a stored procedure than it is to change a hard-coded SQL statement within a deployed component.
* Stored procedures add an extra level of abstraction from the underlying database schema. The client of the stored procedure is isolated from the implementation details of the stored procedure and from the underlying schema.
* Stored procedures can reduce network traffic, because SQL statements can be executed in batches rather than sending multiple requests from the client.

And many people buy into this philosophy, lock stock and barrel:

At just about every talk I give I always try to make several consistent statements. One of which is: ‘Whenever possible use stored procedures to access your data’.

However, there's one small problem: none of these things are true in practice. The benefits are marginal, but the pain is substantial.

IEEE Software: Best Practices - July 1996

IEEE Software: Best Practices - July 1996: "Build daily. The most fundamental part of the daily build is the 'daily' part. As Jim McCarthy says (Dynamics of Software Development, Microsoft Press, 1995), treat the daily build as the heartbeat of the project. If there's no heartbeat, the project is dead. A little less metaphorically, Michael Cusumano and Richard W. Selby describe the daily build as the sync pulse of a project (Microsoft Secrets, The Free Press, 1995). Different developers' code is allowed to get a little out of sync between these pulses, but every time there's a sync pulse, the code has to come back into alignment. When you insist on keeping the pulses close together, you prevent developers from getting out of sync entirely.

Some organizations build every week, rather than every day. The problem with this is that if the build is broken one week, you might go for several weeks before the next good build. When that happens, you lose virtually all of the benefit of frequent builds."

One day at a time, Daily Build wins converts - India Trends - Express Computer India

One day at a time, Daily Build wins converts - India Trends - Express Computer India: "Microsoft Windows NT consists of more than six million lines of code spread across 40,000 source files. Hundreds of software engineers spent thousands of hours writing this code. But how many users ever wonder about the mammoth complexities that a project of this size would have generated? The fact is that it takes a tremendous amount of discipline and effort to complete such a gargantuan task—even though there will be bugs even in the final product. What is it that Microsoft does right? “Microsoft religiously adheres to the practice of Daily Build and that is the secret,” says Rajeev Agarwal, principal, MAQ Software."

Perfection is not achieved when nothing more can be added but when nothing more can be removed.

Friday, April 29, 2005

Techworld.com - Friendster scales the network with open source

Thursday, April 28, 2005

Guide to Retail Technologies

GRAMMERSoft Group website is now up

GRAMMERSoft

Aoccdrnig to a rscheearch at an Elingsh uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht frist and lsat ltteer is at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae we do not raed ervey lteter by itslef but the wrod as a wlohe

am i missing something

today will be a different day than yesterday

gotta think only of myself, what i want, what i want to do, what matters to me most

gotta need to differentiate each day with other days


i'm planning it whole year last year, nothing happens, that's pitiful enough

need to take action now

deeply-rooted ang anxieties ko, andaming reasons kung bakit ang pakiramdam ko yung Michael Buen today is still the same Michael Buen as 5 years ago

bottomline is i want to be financially independent, na maski hindi na ako maging employee it won't matter much. i just love programming

Tuesday, April 26, 2005

babala: wag bumili ng nagyeyelong mineral water

pabyahe ako lucena, sa santo tomas bumili ako ng nagyeyelong mineral water, nasa lucena na ako lahat-lahat di pa rin halos natutunaw yung inumin ko, gasino lng nainom ko. pano maiinom ang yelo?

Monday, April 25, 2005

ang aga ko nagising today

supposedly pag natutulog ka, relax dapat ang pakiramdam mo, sa akin baliktad. sa tagal ko bago naka-graduate, hanggang ngayon i'm still haunted by dreams na hindi pa raw ako gumagraduate sa college, lalo na noon 2000 na maski graduate na nga ako, halos araw-araw pa rin ako nananaginip ng frustrations. sa panaginip ko, naiinis and na-fru-frustate ako bakit di ko pa natatapos yung dalawang natitirang subjects ko, thesis b and automata. pag nagigising lng ako and after regaining consciousness of reality saka ako mas narerelax, back to reality, i graduated May 5, 2000. minsan maigi pa talagang laging gising at kumikilos. speaking of May 5, mag-f-five years na pala Love Bug

Movie Lines

Guess Who

"I don't want to do things for you, I wanna do things with you"

Sunday, April 24, 2005

The test of a first-rate intelligence is the ability to hold two opposing ideas in mind at the same time and still retain the ability to function.

Friday, April 22, 2005

nakabitan n s bahay ng dsl :)

i'm one happy geek now :) hunting code snippets across the internet all night long

Monday, April 18, 2005

Lonely Frog

Lonely and desperate for some female company, a frog telephones the Psychic Hotline to find out what his future holds.

His personal psychic advisor tells him, "You are going to meet a beautiful young girl who will want to know everything about you."

The frog is thrilled and says,
"This is fantastic! Where will I meet her? At work? At a party?"

"No," says the psychic. "In a biology class."

Sunday, April 17, 2005

destination

if u can go somewhere really far ... go then -- Franco M. Rayela

Saturday, April 16, 2005

3D Stereograms - eyetricks.com

Thursday, April 14, 2005

The Code Project - Determining the version number of a DLL or Executable - DLLs

The Code Project - Determining the version number of a DLL or Executable - DLLs

Programmatically register an ActiveX control or DLL

Programmatically register an ActiveX control or DLL: "Programmatically register an ActiveX control or DLL
All ActiveX DLL or OCX export two functions: DllRegisterServer and DllUnregisterServer. They are used to register and unregister the ActiveX in the Windows registry, and are usually invoked from regsvr32.exe at registration time.

However, you can register and unregister these files programmatically whenever you want to, provided that you know the name of the DLL or OCX at compile time. All you have to do is prepare two aliased functions, as in the following example, that shows how to register and unregister the COMCTL32.OCX file:


'function to call to register the ActiveX
Private Declare Function RegComCtl32 Lib 'COMCTL32.OCX' Alias _
'DllRegisterServer' () As Long

' function to call to unregister the ActiveX
Private Declare Function UnRegComCtl32 Lib 'COMCTL32.OCX' Alias _
'DllUnregisterServer' () As Long
Const ERROR_SUCCESS = &H0

Note that the two functions work only if the DLL is in the system path or in the current directory. Therefore, if you want to register a DLL located elsewhere on your hard disk, you must use ChDrive and ChDir commands to make that directory the current one. For example, say that the you have a Test.DLL file in the C:\MyApp directory. Here's the code you need to register it:


Private Declare Function RegisterTestDLL Lib 'Test.Dll' Alias _
'DllRegisterServer' () As Long
Dim retCode As Long

On Error Resume Next

' move to the DLL's directory
ChDrive 'C:'
ChDir 'C:\MyApp'
' register the DLL
retCode = RegisterTestDLL()

If Err <> 0 Then
' probably the DLL isn't there
MsgBox 'Unable to find the Test.Dll file'
ElseIf retCode <> ERROR_SUCCESS Then
' the registration run and failed
MsgBox 'Registration failed'
End If"

Real Love 2 -- John Lennon; 2 version of lyrics

Real Love

All my little plans and schemes
Lost like some forgotten dream
Seems like all I really was doing
Was waiting for you

Just like little girls and boys
Playing with their little toys
Seems like all they really were doing
Was waiting for love

Don't need to be alone
No need to be alone

It's real love
It's real, yes it's real love
It's real

From this moment on I know
Exactly where my life will go
Seems that all I really was doing
Was waiting for love

Don't need to be afraid
No need to be afraid

It's real love
It's real, yes it's real love
It's real

Thought I'd been in love before,
But in my heart I wanted more
Seems like all I really was doing
Was waiting for you

Don't need to be alone
No need to be alone

It's real love
Yes it's real, yes it's real love
It's real, yes it's real love...

------------------------------


REAL LOVE


All the little girls and boys
Playing with their little toys
All they really needed from you
Was maybe some love

D F#m
All the little boys and girls
D7 F/C#
Living in this crazy world
G G/F# Em A
All they really needed from you
D Gm D
Was maybe some love


D Gm
Why must we be alone
D G
Why must we be alone
D Bm Em(III) F#m(V)
Real life
D Bm G A
Yes it is real

(instrumental)

D Gm
I don't expect you to understand
D Gm
The kingdom of heaven is in your hand
D Gm
I don't expect you to wake from your dreams
D Gm
To late to rise now so it seems

All the little plans and schemes
Nothing but a bunch of dreams
All they ever needed from you
Was maybe some love


F/C#: x x 3 2 2 1
Em(III): x x 0 4 5 3
F#m(V): x x 0 6 7 5

Monday, April 11, 2005

Hidden Emoticons

Sunday, April 10, 2005

Small Business - The Fresh Prince of Software - FORTUNE SMALL BUSINESS

Saturday, April 09, 2005

AskMen.com - Larry Ellison

Slashdot | Migrating Visual Basic Applications?

Feature: No More Free BitKeeper

Feature: No More Free BitKeeper: "What Went Wrong
Discussing what led to this decision, Larry explained, 'this is really an open source community problem and I have to say that the open source community couldn't have failed more than they have.' He pointed out that as a long-time open source fanatic and the CEO of BitMover, 'we represent as open-source friendly a commercial organization as you are *ever* going to see', cautioning that the events that have caused BitMover to phase out its free product could also result in other companies never even bothering to make products available on Linux. 'back at Sun they had a saying 'it's the apps, stupid'. Which meant that all the 'my OS is better than your OS' rhetoric was nothing compared to having more applications on your platform than the other guy's platform. That's true for Linux as well and the point is that no company is going to port their applications to a platform who's stated goal and track record is to reverse engineer everything they find useful. At some point the open source world needs to either decide they'll tolerate commercial software and respect the fact that commercial companies are entitled to make money off their efforts or step up and take on the challenge of providing open source versions of *every* application.'

He continued, 'our position is that we don't think we have any chance of changing how the 'open source community' behaves. Unlike the Marine corp, the open source community is more than willing to ignore their bad apples as 'not my problem' (the Marine corp punishes the group for the behavior of the bad apples, pretty soon there are no bad apples). Maybe that will get fixed some day but until then we have to do what makes sense for our business and letting the open source guys put us out of business doesn't make sense.'"

Thursday, April 07, 2005

Great Hackers

Great Hackers: "The Final Frontier

After software, the most important tool to a hacker is probably his office. Big companies think the function of office space is to express rank. But hackers use their offices for more than that: they use their office as a place to think in. And if you're a technology company, their thoughts are your product. So making hackers work in a noisy, distracting environment is like having a paint factory where the air is full of soot.

The cartoon strip Dilbert has a lot to say about cubicles, and with good reason. All the hackers I know despise them. The mere prospect of being interrupted is enough to prevent hackers from working on hard problems. If you want to get real work done in an office with cubicles, you have two options: work at home, or come in early or late or on a weekend, when no one else is there. Don't companies realize this is a sign that something is broken? An office environment is supposed to be something you work in, not something you work despite.

Companies like Cisco are proud that everyone there has a cubicle, even the CEO. But they're not so advanced as they think; obviously they still view office space as a badge of rank. Note too that Cisco is famous for doing very little product development in house. They get new technology by buying the startups that created it-- where presumably the hackers did have somewhere quiet to work.

One big company that understands what hackers need is Microsoft. I once saw a recruiting ad for Microsoft with a big picture of a door. Work for us, the premise was, and we'll give you a place to work where you can actually get work done. And you know, Microsoft is remarkable among big companies in that they are able to develop software in house. Not well, perhaps, but well enough."

Great Hackers

Great Hackers: "More than Money

I know a handful of super-hackers, so I sat down and thought about what they have in common. Their defining quality is probably that they really love to program. Ordinary programmers write code to pay the bills. Great hackers think of it as something they do for fun, and which they're delighted to find people will pay them for.

Great programmers are sometimes said to be indifferent to money. This isn't quite true. It is true that all they really care about is doing interesting work. But if you make enough money, you get to work on whatever you want, and for that reason hackers are attracted by the idea of making really large amounts of money. But as long as they still have to show up for work every day, they care more about what they do there than how much they get paid for it.

Economically, this is a fact of the greatest importance, because it means you don't have to pay great hackers anything like what they're worth. A great programmer might be ten or a hundred times as productive as an ordinary one, but he'll consider himself lucky to get paid three times as much. As I'll explain later, this is partly because great hackers don't know how good they are. But it's also because money is not the main thing they want.

What do hackers want? Like all craftsmen, hackers like good tools. In fact, that's an understatement. Good hackers find it unbearable to use bad tools. They'll simply refuse to work on projects with the wrong infrastructure."

NUTRIENT BREAKDOWN: "213"

Egg Protein & Egg Protein Powder - Egg White Protein

Egg Protein & Egg Protein Powder - Egg White Protein: "Nutrition Value of Eggs, Egg White, & Egg Yolk
An average sized egg (~50g), contains 39g water, 6.5g protein, 5.6g fat, 0.5g carbohydrates, and a host of vitamins and minerals. Egg yolk and egg white make up the egg, and have distinctly different nutrition values.
Egg Yolk Nutrition Fact: *
Large size - 17g
Water - 8.893g
Energy kcal - 54.740
Energy kj - 228.820
Protein - 2.696g
Total lipid (fat) - 4.512g
Cholesterol - 209.78mg
Carbohydrate- 0.610g
Egg White Nutrition Facts: *
Large size - 33g
Water - 28.898g
Energy kcal - 17.160
Energy kj - 71.280
Protein - 3.597g
Total lipid (fat) - 0.056g
Carbohydrate - 0.241g
* Values taken from the USDA Nutrition Database
As you can see the egg white contains more protein with almost no fat content, and no cholesterol, while the egg yolk has less protein, and all the fat and cholesterol! This has been the major reason why so many people eat egg whites and throw away the egg yolk. 'Just think of all the fat and cholesterol', is what most people think.
Well, I should clear up a common misconception. Although egg yolks contain high amount of fat, it has only 1.6g of saturated fat (the bad kind), and the rest is poly and monosaturated fats which are the good fats.
Fat content in eggs - 5.6
Inc saturated - 1.6g
Monounsaturated - 2.4g
Polyunsaturated - 0.6g
Despite what you're taught to believe, a large portion of the fats in egg yolk are good fats! So eating just one yolk a day isn't going to do any harm. obviously for serious lifters who eat several up to dozens of eggs a day, its wise to eat only the egg white and just 1 or 2 egg yolks.
Studies have found that saturated fats is the leading cause of high"

Wednesday, April 06, 2005

Moore's law - Wikipedia, the free encyclopedia

FAQ: Forty years of Moore's Law | CNET News.com

Fairchild Semiconductor - Wikipedia, the free encyclopedia

Tuesday, April 05, 2005

DOING BUSINESS IN THE PHILIPPINES

Mabuhay! Welcome to the Philippines: "DOING BUSINESS IN THE PHILIPPINES"

Sunday, April 03, 2005

Officer.com Police & Law Enforcement Forums - Designer Whey worth the extra $$ compared to other wheys?

Officer.com Police & Law Enforcement Forums - Designer Whey worth the extra $$ compared to other wheys?

amorous - definition of amorous in General

Protein & Amino Acids- Ask the Dietitian

Howstuffworks "How Calories Work"

Saturday, April 02, 2005

may landline na ulit kami

nakabitan n kmi ng phone ng pldt ngayong sabado. nkkpag-internet na though dialup lng.

pwede na uli ako mag-internet sa bahay. netizen na uli ako both at office and at home :-)

mas makakapagtrabaho na ako sa ofc, pagdating ng ofc di na cguro ako mag-iinternet, syempre sawa na sa bahay. mami-minimize ko na rin panonood ng tv. ang di ko lng mami-minimize yung panonood ng full house.

Friday, April 01, 2005

Neutron Sports - Terry Keys