728x90

The First Rule of Programming: It's Always Your Fault

You know the feeling. It's happened to all of us at some point: you've pored over the code a dozen times and still can't find a problem with it. But there's some bug or error you can't seem to get rid of. There just has to be something wrong with the machine you're coding on, with the operating system you're running under, with the tools and libraries you're using. There just has to be!

No matter how desperate you get, don't choose that path. Down that path lies voodoo computing and programming by coincidence. In short, madness.

It's frustrating to repeatedly bang your head against difficult, obscure bugs, but don't let desperation lead you astray. An essential part of being a humble programmer is realizing that whenever there's a problem with the code you've written, it's always your fault. This is aptly summarized in The Pragmatic Programmer as "Select Isn't Broken":

In most projects, the code you are debugging may be a mixture of application code written by you and others on your project team, third-party products (database, connectivity, graphical libraries, specialized communications or algorithms, and so on) and the platform environment (operating system, system libraries, and compilers).

It is possible that a bug exists in the OS, the compiler, or a third-party product-- but this should not be your first thought. It is much more likely that the bug exists in the application code under development. It is generally more profitable to assume that the application code is incorrectly calling into a library than to assume that the library itself is broken. Even if the problem does lie with a third party, you'll still have to eliminate your code before submitting the bug report.

We worked on a project where a senior engineer was convinced that the select system call was broken on Solaris. No amount of persuasion or logic could change his mind (the fact that every other networking application on the box worked fine was irrelevant). He spent weeks writing workarounds, which, for some odd reason, didn't seem to fix the problem. When finally forced to sit down and read the documentation on select, he discovered the problem and corrected it in a matter of minutes. We now use the phrase "select is broken" as a gentle reminder whenever one of us starts blaming the system for a fault that is likely to be our own.

The flip side of code ownership is code responsibility. No matter what the problem is with your software-- maybe it's not even your code in the first place-- always assume the problem is in your code and act accordingly. If you're going to subject the world to your software, take full responsibility for its failures. Even if, technically speaking, you don't have to. That's how you earn respect and credibility. You certainly don't earn respect or credibility by endlessly pawning off errors and problems on other people, other companies, other sources.

Statistically, you understand, it is incredibly rare for any bugs or errors in your software not to be your fault. In Code Complete, Steve McConnell cited two studies that proved it:

A pair of studies performed [in 1973 and 1984] found that, of total errors reported, roughly 95% are caused by programmers, 2% by systems software (the compiler and the operating system), 2% by some other software, and 1% by the hardware. Systems software and development tools are used by many more people today than they were in the 1970s and 1980s, and so my best guess is that, today, an even higher percentage of errors are the programmers' fault.

Whatever the problem with your software is, take ownership. Start with your code, and investigate further and further outward until you have definitive evidence of where the problem lies. If the problem lies in some other bit of code that you don't control, you'll not only have learned essential troubleshooting and diagnostic skills, you'll also have an audit trail of evidence to back up your claims, too. This is certainly a lot more work than shrugging your shoulders and pointing your finger at the OS, the tools, or the framework-- but it also engenders a sense of trust and respect you're unlikely to achieve through fingerpointing and evasion.

If you truly aspire to being a humble programmer, you should have no qualms about saying "hey, this is my fault-- and I'll get to the bottom of it."

===============================================================
컴퓨터는 거짓말하지 않는다. 제대로 돌아가지 않는다면 대부분의 경우(95%) 프로그래머의 실수다.

728x90
728x90
혼자서만 일하는 프로그래머가 아니라면 레이아웃과 프리젠테이션은 상당히 중요하다.
띄어쓰기 대괄호의 위치 등 사소한 것들이 엄청난 역할을 해준다. 동일한 레이아웃을 구사한다면 사투리가 없는 동일한 언어를 사용하는 것처럼 편안하게 배울 수 있을 것이다.

우리가 작성한 소스를 읽는 대상은 3종류로 볼 수 있다.
우리자신, 컴파일러, 다른 프로그래머(다른 프로그래머가 진짜 독자라고 생각하라.)

좋은 프리젠테이션이란?
1. 일관성있게
   소스파일을 작성하는 도중에 스타일을 바꾸면 안된다. 만약 다른 사람이 작성한 소스를 부분적으로 수정해야 한다면 원래 있던 소스의 스타일을 따르는 것이 좋다. 소스는 처음부터 끝까지 같은 스타일로 코딩되어야 한다.

2. 관례를 따른다
    자기만의 스타일을 고집하지 마라. 자기만의 스타일을 고집하는 사람은 아무도 같이 일하고 싶어하지 않을 것이다.

3. 간단명료(한눈에 들어오는)
    간단 명료하게 하는 것은 중요하지만 길이를 짧게 만든다고 좋은 소스는 아니다. 결국 알아보기 쉽게 작성하는 것이 최우선이다.
728x90
728x90

사용자 삽입 이미지
유럽연합(EU)이 온라인 광고업체 사상 최대 M&A구글의 31억 달러 규모 더블클릭 인수를 11일(현지시간) 승인했다.

지난해 말 미 연방거래위원회(FTC)의 승인 결정에 이어 EU까지 구글의 손을 들어줌에 따라 더블클릭 인수 이후 제기됐던 온라인광고 독점 시비는 11개월 만에 일단락됐다.

마이크로소프트와 AT&T 등은 구글이 더블클릭을 인수할 경우 온라인 광고 가격을 지배하여 공정한 경쟁을 방해할 우려가 있다고 이의를 제기했으나 EU는 이를 기각했다.

EU의 승인 이후 구글의 CEO 에릭 슈미트는 자신의 블로그를 통해 더블클릭을 구글과 통합하는 과정에서 종업원을 삭감할 수 있다고 언급했다.

그는 미국의 적정한 종업원수를 결정하는 프로세스는 올 4월초까지 완료할 예정이지만, 미국 이외의 지역에 대해서는 한층 더 시간이 걸릴 가능성도 있다고 블로그에 글을 남겼다.

슈미트는 또한 더블클릭 인수 후에도 사용자 프라이버시를 보증한다고 말했다. 구글의 규모와 인프라스트럭쳐는 사용자가 웹페이지를 읽어들이는 시간이 짧아질 것이라는 것을 의미한다고 그는 밝혔다.


사용자 삽입 이미지

야후를 인수하기 위한 마이크로소프트의 입찰 진행에 대해 구글의 CEO인 Eric Schmidt 씨는 양사 간의 있을 수 있는 어떠한 계약도 ‘인터넷 업체들에게 나쁜 소식’이 될 수 있다고 말했다고 BBC 뉴스는 보도했다.

구글의 기업 개발 및 최고 법률가 수석 VP인 David Drummond 씨는 2월 3일자 자신의 블로그에서 양사의 계약이 인터넷 비즈니스의 ‘투명성’에 좋지 않은 영향을 미칠 수 있음을 암시한다고 말했다.

마이크로소프트는 지난 1월 말에 야후 입찰에 446억 달러를 제안했으나 야후의 이사회는 너무 낮은 가격이라고 이를 거절한 바 있다. 마이크로소프트는 제안 금액이 적절하다고 주장, 입찰 금액을 올릴 의도는 없다고 말했다. 마이크로소프트가 야후의 경영진을 바꾸려는 전략을 세우고 있다는 보도도 있었다.

한편, 야후는 마이크로소프트의 적대적 인수를 막기위해 News Corp을 모색하고 있다는 보도도 있었지만, News Corp의 Rupert Murdoch 회장은 마이크로소프트와의 입찰 전쟁에 참여할 계획이 없다고 말했다.

야후는 이번 주 3년 재정 계획을 밝혔는데, 2010년에 88억 달러의 수익을 달성하여 자사의 현재 운영 현금 흐름을 두 배로 만든다는 것이다. 야후는 1사분기 수익을 12억 8,000만 달러에서 13억 8,000만 달러로 예상하고 있으며, 올해 전체 예측은 53억 5,000만 달러에서 59억 5,000만 달러이다. 야후 경영진은 이러한 수치들이 마이크로소프트의 입찰가가 회사를 저평가 하고 있다는 자신들의 결정을 뒷받침한다고 말했다.

728x90
728x90
자신들을 iPhone Dev Team이라고 부르고 있는 해커들이 최근 공개된 iPhone 소프트웨어 개발 키트의 새로운 iPhone 펌웨어에 침입하는데 성공했다고 밝혔다. 이들은 애플의 개발 인증 없이도 이 펌웨어 상에서 어플리케이션을 실행시키는 방법을 찾아냈다고 밝혔다.

이들은 자신들의 작업을 보여주기 위하여 애플이 iPhone 2.0으로 6월에 출하하려고 계획하고 있는 펌웨어의 베타 버전에서 실행되고 있는 어플리케이션의 스크린샷을 게시했다.

애플은 개별 소프트웨어 개발자들에게 자신들의 작업을 제출토록 하여 자사의 온라인 애플 스토어에서 독점 배급하려는 계획을 가지고 있다. 그렇게 되면 개발자들은 자신들의 소프트웨어 가격을 스스로 책정할 수 있지만 애플이 매출의 30퍼센트를 가져갈 것이다. 그러나 만약 해커들의 말이 사실이라면 애플이 iPhone 어플리케이션 개발을 계속 강력하게 통제할 수 있을 지 의문이다.

애플은 개발자들이 애플 엔지니어들이 사용하는 것과 동일한 툴과 어플리케이션 프로그래밍 인터페이스를 제공하기 위하여 지난 3월 이 SDK의 베타버전을 공개했었다. 이 iPhone SDK는 공개된 후 4일 만에 10만 다운로드를 기록했다.

Antone Gonsalves
InformationWeek

Hackers calling themselves the iPhone Dev Team have reported breaking into the iPhone firmware upgrade that ships with the recently launched software development kit for the smartphone.

The group reported late Tuesday it had "decrypted the disk image and jail-broken the firmware." In essence, the hackers had found a way to run applications on the firmware without a development certificate from Apple.

To show its work, the group posted screenshots of applications running on the beta version of the firmware, which Apple plans to ship in its final form as iPhone 2.0 in June. The developers said their applications only work with "hacked activation," which means they won't work on iPhones from exclusive wireless service provider AT&T.

"However, come on, this is like 2 hours ago it happened, you AT&T folk won't be left in the cold," the group said.

If true, the hack calls into question whether Apple will be able to maintain the tight-fisted control it wants on iPhone application development. Apple is requiring independent software developers to submit their work to Apple, which will be the exclusive distributor through the company's new online App Store. Developers can set their own price for the software, but Apple takes 30% of sales revenues.

Apple released the SDK in beta March 6, giving developers the same tools and application programming interfaces that Apple engineers use to develop iPhone software that runs directly on the smartphone's Mac OS X-based operating system.

Before releasing the SDK, Apple tried to keep all application development restricted to the device's Safari Web browser. That plan, however, fell apart as developers complained they needed access to the iPhone's OS in order to build richer software.

Meanwhile, Apple on Wednesday reported more than 100,000 downloads of the iPhone SDK in the first four days following its launch.

The SDK is available in beta through Apple's developer Web site. The toolset is available at no charge and is being distributed first in the U.S. The developer program will be expanded to other countries later in the year.

Apple plans to distribute version 2.0 of the iPhone OS at no charge. The upgrade will include support for applications built with the SDK. Apple also plans to make available at the same time for a "nominal fee" a similar upgrade for the iPod Touch, which uses the same firmware

출처: http://www.eetkorea.com

728x90

+ Recent posts