Personal Technology Information

15 Good Programming Habits


1. Before sitting down for coding, you must have formal or a paper-napkin design of the solution to be coded. Never start coding without any design unless the code is trivial one.

2. Good code documentation is as important as good knowledge of a programming language. Write brief logic for each major block of your code as comments in source code file itself. Its good to mention creation and modification dates of your program along-with why modification was required.

3. Maintaining versions of your program is another important task. Some present-day programming tools already have a built-in version management. Whenever you make any change to your program, they save its copy as .bak file.

My approach is to maintain 3 versions of a program. Say, I have a file program.c which is used by other project team members also. I copy this file as program.c.old as backup and make another copy as program.c.wrk where I do modifications. When modifications are successfully compiled, replace program.c with .wrk file.

You can also append a date or some explanation phrase to your program versions like program260505.c or programReadFnWrking.c .

4. If your project contains multiple source files then maintain a README file stating purpose of each source files, data files, intermediate and log files (if any). You may also mention the compilation and execution steps.

5. Ever wondered why your IF statement is not working as it should do. May be your are using single equal i.e. "=" instead of "==" in the condition check. A good approach is to write condition in reverse order. So, your condition should read something like this:

if ( 10==i) ....So, if you put single equal sign by mistake then it will be detected at compilation time only as an error.

6. While using loops and conditional statements, always first put closing braces corresponding opening braces and then write the inner statements i.e.

1) for(int i=0;i


MORE RESOURCES:

04/20/2024
You Can Clamp Your Phone Into Razer’s Fancy New Game Controller
Plus: GMC has a new great big electric pickup, Meta adds instant AI image generation to WhatsApp, and everyone’s talking about the new audio app Airchat.


more info


04/20/2024
My Life Outside of the Apple Vision Pro
Apple's mixed-reality headset is impossible to ignore and, one WIRED writer finds, can create a wall of isolation between partners.


more info


04/20/2024
AI-Controlled Fighter Jets Are Dogfighting With Human Pilots Now
Plus: New York’s legislature suffers a cyberattack, police disrupt a global phishing operation, and Apple removes encrypted messaging apps in China.


more info


04/20/2024
How One Corporation Is Cashing In on America’s Drought
In an unprecedented deal, a private company purchased land in a tiny Arizona town—and sold its water rights to a suburb 200 miles away. Local residents fear the agreement has “opened Pandora’s box.”


more info


04/19/2024
The Best Hair Straighteners to Iron Out Those Kinks
Curls and waves are beautiful. But when you want to smooth them out, these hot tools—irons, brushes, and combs—work wonders.


more info


04/19/2024
The 47 Best Shows on Netflix Right Now
From "3 Body Problem" to "Ripley," these are our picks for the best streaming titles to binge this week.


more info


04/19/2024
The 51 Best Movies on Netflix This Week
From "Spaceman" to "Suzume," here are our picks for the best streaming titles to feast your eyes on.


more info


04/19/2024
These Are Our Favorite Computer Monitors
The Gear team spends countless hours in front of displays while writing for you. So we reviewed those too (including a few portable screens).


more info


04/19/2024
The Biggest Deepfake Porn Website Is Now Blocked in the UK
The world's most-visited deepfake website and another large competing site are stopping people in the UK from accessing them, days after the UK government announced a crackdown.


more info


04/19/2024
Bitcoin Miners Brace for the ‘Halving’—and Race to Cash In
The Bitcoin halving is imminent. Crypto mining companies are reaching for every trick in the book to survive it.


more info


04/19/2024
20 Great Deals on Eco-Friendly Products to Celebrate Earth Day
We've rounded up deals on WIRED-tested electric bikes, organic mattresses, and even backpacks made of recycled plastic.


more info


04/19/2024
The Best Mechanical Keyboards for Work and Play
Whether you’re looking to boost your productivity or your ‘Fortnite’ stats, these are the top typing peripherals for the job.


more info


04/19/2024
How to Stop ChatGPT’s Voice Feature From Interrupting You
ChatGPT’s conversation tools are fantastic—when the chatbot isn’t constantly talking over you. Try these tips for a better AI audio experience.


more info


04/19/2024
Tesla Recalls Cybertruck Over Trapped Pedals—Its Worst Flaw Yet
Tesla has issued a voluntary recall for nearly 4,000 Cybertrucks because the accelerator pad could get trapped, pushing the car to full speed.


more info


04/19/2024
This Chinese Luxury Hybrid SUV Combines a Tank, a Bentley, and a Boat
Meet the tank-turning, 4-ton Yangwang U8 from BYD. It's the world’s most powerful SUV—and yes, it floats on water.


more info


04/19/2024
The Taylor Swift Album Leak’s Big AI Problem
When "The Tortured Poets Department" leaked, some Taylor Swift fans swore it must be AI. Expect that to be a common refrain.


more info


04/19/2024
A Wave of AI Tools Is Set to Transform Work Meetings
An AI-powered wearable from startup Limitless promises to make meetings more productive. It’s the beginning of a wider transformation of human interactions.


more info


04/19/2024
Nas’ 'Illmatic' Was the Beginning of the End of the Album
Nas’ critically revered "Illmatic" hit record store shelves 30 years ago today. The digital age has ensured that there will never be another album like it.


more info


04/19/2024
Unruly Gut Fungi Can Make Your Covid Worse
An infection can upset your microbiome, and if certain gut fungi run riot, this can kick the immune system into overdrive.


more info


04/19/2024
She Painted a Few Champagne Bottles. Then Came Meta’s Customer Support Hell
A fashion influencer’s struggles to unblock her Instagram account highlight a long-standing problem with Meta’s lackluster customer service. Users and regulators say the company must step up.


more info


04/19/2024
Environmental Damage Could Cost You a Fifth of Your Income Over the Next 25 Years
The world is already committed to warming that will undercut the global economy by 20 percent between now and 2050. That’s six times the price of limiting warming to 2 degrees Celsius.


more info


04/18/2024
Meta Is Already Training a More Powerful Successor to Llama 3
The open source Llama 3 AI model released by Meta today is just the start, according to the company’s chief AI scientist, Yann LeCun. He said a new, much larger version is in the works.


more info


04/18/2024
NASA Confirms Where the Space Junk That Hit a Florida House Came From
Space law just got a little more complicated.


more info


04/18/2024
We Finally Know Where Neuralink’s Brain Implant Trial Is Happening
After months of secrecy, Neuralink revealed that the partner site for its brain implant study is the Barrow Neurological Institute.


more info


04/18/2024
The Trump Jury Has a Doxing Problem
One juror in former US president Donald Trump’s criminal case in New York has been excused over fears she could be identified. It could get even messier.


more info



home | site map | contact us