8 Simpleng Trick para Palakasin ang Efficiency ng Coding

Kung nag-subscribe ka sa isang serbisyo mula sa isang link sa page na ito, maaaring makakuha ng komisyon ang Reeves and Sons Limited. Tingnan ang aming pahayag ng etika.

Mayroong kakaibang kababalaghan na lumitaw sa mga publisher ng software. Lumilitaw na may posibilidad na baligtarin ng mga tao ang kanilang pang-unawa sa kung ano ang nagpapaganda ng isang kalidad na produkto, o hindi bababa sa ito ay totoo pagdating sa mga taong gumagawa ng marketing. Ito ay may kasamang mga linya ng: "Ang kanilang produkto ay may isang milyong linya ng code, ngunit ang sa amin ay may dalawang milyon, kaya't ang aming produkto ay dapat na mas mahusay."

No-one knows where this “more is more” kind of thinking came from, when back in the day everyone was working so hard to create a “less is more” philosophy. Probably it started with consumer-grade journalism, because many writers try to impress audiences by quoting big numbers. For most things, this works—this tiny flash drive holds 200 terabytes of data, that CPU can process 48 billion instructions per second—and writers aren’t always technologically savvy enough to understand that the same doesn’t apply to source code.

But efficiency in coding isn’t only about creating tight algorithms. It’s also about being able to reduce waste. This means waste in terms of how much time you spend fixing problems, waste in terms of consuming too many computer resources, and even waste in terms of how many pizza boxes your team has stacked up around the office by the end of the week. Ideally you want to cut down on all these things.

So what we’ll take a look at in this article will be the things you could do to improve efficiency and increase productivity.

1. Bumuo ng isang kaaya-aya na kapaligiran sa trabaho

Ang bawat coder ay gumagana sa natatanging mga pangyayari, at ang aming mga mambabasa ay isang magkakaibang pangkat, kaya mas madali para sa ilan sa inyo na ipatupad ang mga mungkahing ito kaysa sa iba.

If you’re a freelancer, congratulations, because you’re already master of your own work environment. Of course that’s going to change when you go to visit a client and have to work on-site, but it’s still a sweet position to be in if you can make a success of it.

If you’re the manager of a development team, these suggestions can also help to get your team to maximum efficiency. Or if you are a worker on a development team, you may want to suggest some of these ideas to your manager or at least send him or her a link to this page and hope for the best.

Pag-isipang payagan ang mga miyembro ng koponan na mag-telecommute

Programming is partly an exercise in logic, but it’s even more of a creative challenge. The best programmers can employ either side of their brain in equal measure to any task. Science has long acknowledged that creative people do their best work at night, and it’s something we’ve all experienced. So why do most managers insist on a traditional 9 to 5 routine?

Actually, we already know the answer to that. It’s partly about control, and it’s partly about making things more convenient from a business point-of-view (or at least a management one). But that insistence on routine and location is hurting the efficiency and productivity of the team.

What you need to realize is that your coders were probably up all night trying out the latest game, or maybe they went partying, or simply had to socialize with family. It means that when they turn up for work on Monday morning, not only are you not getting them at their peak productivity level, but they’re already drained of energy and dog-tired.

Giving workers a choice about when they work—and ideally also where—is an excellent way to improve productivity and morale. As long as they get the job done and turn in excellent qualtiy results, you shouldn’t care about when, where, or how they achieve it.

The exception is when you need close collaboration, but in truth most coders do better when left to do things in their own way, and the need for close collaboration is rare. The option to come into the office should still be there, but there’s no realistic reason why it should be required unless you’re working on top secret military projects.

As a freelancer you can also see the key point here is that if you do most of your actual coding work at night, you’re likely to get more done. There are fewer distractions late at night, it’s quieter, and you’ll feel more creative.

Iwasan ang musika

We’ve all seen those crazy movie stereotypes where some super-grungy überhacker puts on their headphones and jams along to death-metal while effortlessly churning out screenfuls of code without even stopping to breathe. And all of us who really code in the real world know how ridiculous that image is.

But if you do listen to music while working, be careful. It’s quite easy to find yourself thinking about the music instead of your work, and some kinds of music can have a soporific effect. When you go for a workout at the gym, the right kind of music might inspire you to push out that extra few reps. But no-one has ever managed to create music that will inspire you to find the line with the missing semi-colon, or to make the correct choice between using a for loop or a while loop. The closest we’ve ever got to that is Electric Dreams.

Subukang panatilihing malinis

Clutter can be oddly comforting, but it also can slow you down. You can easily lose 20 minutes looking for something that’s been lost in the mess, and then forget why you wanted it in the first place.

So, for all the inconvenience it causes, why are we—some of us at least—so addicted to clutter? Organizational expert and author, Julie Morgenstern, claims it is because this stuff connects us with our past and plays a role in defining our identity. Marcus Geduld, a teacher and stage director based in New York City, suggests that it’s because clutter is preferable to a “sterile” environment, and likens the chaos of clutter to an affirmasyon ng kalayaan at pagkamalikhain.

There is, however, no doubt that reducing clutter will help you avoid distraction and disorganization. As such, it is a worthy goal to accomplish. By all means, keep a few sacred objects around that make you feel better and less stressed, but don’t overdo it. Decluttering is one of the hardest things to do for most people, and it’s not just our physical desktops na kailangan decluttering, ngunit madalas ang aming computer desktops too. If you really struggle with that, you could try using a minimalist DTE such as Fluxbox, which doesn’t really allow you to have any clutter.

But in the midst of all this tidying, don’t go overboard. There’s plenty of good science suggesting a bit of chaos in the environment may actually be conducive to creativity. One of the most frequently cited bits of research into this is a journal entry in Psychological Science by Vohs, Redden & Rahinel for the University of Minnesota titled Ang Physical Order ay gumagawa ng Malusog na Mga Pagpipilian, Kabutihang-loob, at Pagkakapareho, Samantalang ang Disorder ay Gumagawa ng Pagkamalikhain. Marahil ang dahilan kung bakit ito ang papel na dinikit ng mga mamamahayag ay malinaw na napagpasyahan nito na: "... ang mga kalahok sa isang hindi kaguluhan na silid ay mas malikhain kaysa sa mga kalahok sa isang maayos na silid."

Higit na hindi gaanong popular ang mga dissenting view, tulad ng Ang Karamdaman sa Kapaligiran ay Humantong sa Pagkabigo sa Sariling Pagkontrol (Chaye & Zhu, 2014), na-publish sa Journal of Consumer Research. Natuklasan ng pag-aaral na ito na ang mga taong nagtatrabaho sa mga hindi kaguluhan na kapaligiran ay may kapansanan sa kanilang kakayahang magsagawa ng mga gawain.

So where does this leave you? Should you work in chaos or sterility? The answer seems to be to find a balance where it’s just chaotic enough to keep you inspired, but not so much that you get distracted or have trouble finding things.

Iwanan ang ilang silid sa likuran mo para sa paglabas ng iyong mga saloobin

It’s a good idea to have plenty of room for wandering about when you’re deliberating. Many of the best admirals and generals in history were renowned for the extensive time they spent pacing about the deck while planning battle strategies.

Hindi lamang mga lalaking nakikipaglaban ang sumusunod sa kasanayang ito. Maraming mga Buddhist monghe din ang nagtataguyod ng "paglalakad na pagmumuni-muni", at naniniwala na nakakatulong itong itaguyod ang kalinawan ng isip. Tuwing mayroon kang isang partikular na problema sa knotty na programa upang malutas, maaari mong makita na makakatulong upang mabatak nang kaunti ang iyong mga binti sa isang pagmumuni-muni na paglalakad sa paligid ng deck. Malinaw na narito muli ang isang kakulangan ng kalat ay makakatulong sa iyo na gawin ito nang hindi nagtatapos sa ospital.

Bilang isang boss, gumawa ng maingat na diskarte sa pagpuna sa mga malikhaing pagsisikap

There’s nothing wrong with constructive criticism, but you need to pick the right moment and approach it in the right way, or it can backfire by making your staff less productive in the future. Rather than inspiring them and providing insight, you may actually make them afraid to take risks, which is a good way to kill off creativity. Marieke Roskes, in Mga hadlang na Tumutulong o hadlangan ang Pagganap ng Malikhaing: Isang Pagganyak na Diskarte, ay nagbibigay ng isang balangkas para sa kung paano makitungo sa pagganyak ng mga malikhaing manggagawa, at partikular din kung paano maiiwasan ang hindi sinasadyang pag-demotivate sa kanila (Pamamahala ng Pagkamalikhain at Innovation, Vol 24, Isyu 2, 2015).

2. Magtatag ng isang mahusay na SOP

There’s a lot of catchy trends in business management and programming procedure that sound a lot more sensible in theory than they turn out to be in practice. Whether a particular approach works for you or not depends on your objective, and what you personally consider to be a successful result.

Ang isang halimbawa ng isang pamamaraan na sinubukan ng isang kumpanya na pinagtatrabahuhan ko — at kasing mabilis na bumagsak — ay ang pares na programa (hindi malito sa PEAR program). Habang ang ilang mga tao ay talagang hinahangaan ang pamamaraan ng trabaho na ito at pinupuri ang lugar nito sa maliksi na paradaym ng pag-unlad, nalaman namin na ito ay labis na hindi mabisa. Bilang panimula, nangangailangan ito ng dalawang programmer para sa bawat workstation, kaya't nagbabayad ka ng dalawang beses para sa mas kaunting aktwal na gawaing pag-unlad. Nalaman din namin na mas mabagal itong gumana sa ganitong paraan dahil sa madalas na pagdaloy / pagsisimula ng daloy at pagkahilig sa hindi kinakailangang diyalogo.

The advantages of pair programming were that it did result in more natural documentation and stricter documentation. It also allowed bugs to be spotted more easily and for suggestions to be made about tightening up an algorithm. At the same time, however, the same advantages also created problems because sometimes the tweaks and adjustments weren’t really necessary.

Another risk with this approach is that you can get the effect identified by Roskes, where programmers might be hesitant to try things because they don’t want to be corrected. You may find personality clashes flaring where one developer is very pedantic and traditional, but the other is more creative and spontaneous.

Programmers often state that they prefer pair programming. It’s possible that this is because they enjoy the social interaction that it affords, but this contributes nothing to the efficiency of production, except perhaps as a morale booster.

So what you need to establish is what actually works for your developers and what doesn’t. For the things that don’t work, it’s better to discard them, even if they’re a hotly trending practice. Whatever helps the team to make progress quickly is a good thing. But if they’re weighed down with a methodology that doesn’t suit their style, it will eventually lead to problems.

3. Hikayatin ang dokumentasyon ng verbose

Bagaman maaaring mukhang ang pagiging masidhing salita ay magpapataas ng pagiging hindi mahusay, ang maliit na dami ng oras na kinakailangan upang makapagbigay ng mas detalyado at katumpakan sa mga komento ay maaaring makatipid ng maraming problema habang ang proyekto ay gumulong o sumasailalim sa mga pagbabago.

4. Iwaksi ang hindi kinakailangang dokumentasyon

Well-written code is often self-documenting. If it is perfectly obvious what a function does from the name you give it (which should nearly always be the case), then adding more description is superfluous. The same goes for variable naming and return values. It should be clear from the name what they do, and in those cases where it’s not possible to do that, you ought to include a description of them in comments.

5. White space ang kaibigan mo

Ang paggamit ng puting puwang na naaangkop sa iyong code ay mahalaga sa pagtulong upang gawing mas madaling basahin, suriin, at maunawaan ang code. Napapanood ito sa mahusay na pagdodokumento at pagsulat ng self-documenting code. Dapat ay posible para sa anumang may karanasan na programmer — o marahil kahit isang hindi programmer — na pumili ng isang kopya ng iyong source code at agad na maunawaan kung ano ang layunin ng bawat pagpapaandar at kung paano ito gumagana. Sa isip, ang isang tao ay dapat na matutong mag-program mula sa walang hihigit sa pag-aaral ng iyong mahusay na nakasulat na code.

6. Mas gusto ang pagiging simple kaysa sa pagiging kumplikado

Ang mas kumplikadong ginawa mo sa iyong code, mas mahirap na alisin ito. Ironically nalalapat ito sa mga shortcut sa pagprograma, tulad ng paggamit ng mga maikling kondisyon na kundisyon sa halip na isulat ito nang buo. Makatipid ito ng oras sa pagsusulat, ngunit ang isang hindi gaanong nakaranasang programmer na papasok upang suriin ang iyong code sa paglaon ay maaaring hindi maunawaan ang iyong mga hangarin.

7. Mahusay na subukin

Ang code ay dapat na subukang dagdagan at madalas. Bago mag-deploy ng anumang bagay, dapat kang magsagawa ng mas maraming pagsusuri sa loob ng bahay hangga't maaari, kahit na ang iyong unang paglabas ay itatalaga na Alpha.

8. Gumamit ng kontrol sa bersyon

You’d have to be crazy not to use version control on a major project. Without it, you aren’t protected from your own minor mistakes, and also it’s really easy for another team member to accidentally (or intentionally) sabotage your code by overwriting it with something that doesn’t please you.

By taking these eight key suggestions into account, you will be able to develop you own strategy for extracting the most efficiency for you and any team members you work with. You don’t necessarily have to apply all of them, and certainly some may not even be practical for you, but any combination of them is likely to result in you getting your work done with less hassle. A more productive workflow will pay for itself over time, even if it is just in terms of stress reduction and giving you more time for yourself. That’s a goal worth working towards.

Bogdan Rancea

Si Bogdan ay isang founding member ng Inspired Mag, na naipon ang halos 6 na taong karanasan sa panahong ito. Sa kanyang bakanteng oras gusto niyang mag-aral ng klasikal na musika at galugarin ang visual arts. Medyo nahuhumaling rin siya sa mga fixies. Nagmamay-ari na siya ng 5.

Comments 0 Responses

Mag-iwan ng Sagot

Ang iyong email address ay hindi nai-publish. Mga kinakailangang patlang ay minarkahan *

Marka *

Ang site na ito ay gumagamit ng Akismet upang mabawasan ang spam. Alamin kung paano naproseso ang data ng iyong komento.