I Learnt a Small Program but When I Tried to Write the Same One Again

Illustration of a programmer coding a new project, with programme language icons hovering around his desk

Many coders say that getting started is the hardest part. Credit: Ostapenko Olena/iStock/Getty

"I don't have time to learn it." We've all said it — some of us are still proverb information technology. Many dream of being more data savvy, so resolve to acquire R (or Python, or C or whatever programming linguistic communication is currently trending). Just when information technology comes down to it, who has fourth dimension to pick upward an entirely new programming language from scratch?

Unfortunately, nothing written here will make you a coding whizz overnight, just nigh coders acknowledge that getting started is the hardest office. If you desire to learn but don't know how, here are a few tricks that take helped me.

1. Fix goals that will immediately help your daily life. I've always been interested in programming. I know that being an experienced developer will make a lot of things much easier. Simply no matter how good my intentions, I cannot will myself to spend all my spare fourth dimension on self-improvement.

Instead, the things I've learnt have come near because I needed to get something done, fast. When I started preparing figures for publication, I learnt how to use ggplot2, a data-visualization packet in R. When I needed to write a 200-page thesis, I learnt about the wonders of the LaTeX typesetting system. Command-line tools (for instance, awk and sed) helped me to speedily dispense large tables and text files. Jupyter notebooks allowed me to go on detailed notes and perform exploratory analysis by testing chunks of Python code. Compute clusters gave me the power to run thousands of computationally intensive jobs in parallel. Instead of learning for the sake of it, y'all should set goals that volition immediately prove useful.

2. Don't try to learn everything at once. Too, don't get intimidated by the prospect of learning a whole new language. You don't need to learn all of R — y'all just need to know enough to complete the specific job that you've set yourself, and then the next one, and so on. You will find that the language'south syntax will become easier with time, and you can always refer to the reference material. The fastest way to learn is to jump straight in and start playing around.

3. Split problems into achievable chunks. Programming is all about problem-solving. Think most what you want to attain, and write downwardly a series of steps that will get you lot to your goal. Then, all you need to practise is work out each step and run up them together. Your first solution doesn't need to be elegant or all-encompassing; it simply needs to work well plenty for you to motility on to the next step.

4. Don't exist afraid to intermission things. The quickest fashion to observe how something works is to break it then effort to fix it. Gear up a workspace with exam files, download some lawmaking snippets and endeavour irresolute i line at a time. Impress the output each time. Then, one time it makes sense to you, attempt to write information technology in a different way, or using a different linguistic communication.

Sometimes, you'll interruption things you don't want to break: we've all been there. Accidentally deleting all the files from an important folder is basically a rite of passage in some operating systems. It'due south OK. You'll make mistakes and learn from them. The worst mistakes tend to go out the biggest impressions, so y'all'll probably never make them once again.

5. Learn most version command. You want to make certain that your truly of import files and scripts are backed upwards. That does not mean saving them with various titles and dates on unnamed USB drives. Version-control systems exist precisely then that yous don't have to worry virtually remembering every change you make to source code or documents. I'g a big fan of Git — because with 5 bones commands and no expert knowledge, I've been able to employ information technology happily for years.

6. Ask other developers. I often think I'd be a better programmer if I didn't take the global cognition of the masses at my fingertips. Only so far, I've never had a coding-related problem that I couldn't eventually solve using online programming communities, such as Stack Overflow or Biostars. Nigh of the time, someone has already asked my verbal question on an online forum.

7. Never repeat anything more than once. Good programmers are hard-working; slap-up programmers are lazy. So lazy, in fact, that they refuse to repeat menial tasks. Demand to rearrange columns in a spreadsheet? A computer tin do that for you lot. Need to repeat an analysis and redo all your figures? An automated pipeline will have that done in no time. You lot might remember it's quicker to practice it manually, specially considering you don't need to call back about it or learn something new. And for a lot of things, that might be true. But the adjacent time you echo that same task, end and recall: practice y'all desire to practice information technology a third time?

8. Schedule 'learning time' into your calendar week. In my PhD lab, we had a Tuesday morning ritual. Between 9 a.thousand. and 10 a.m., nosotros would practise programming in the Become linguistic communication by working through problems on the Rosalind platform, designed for those learning bioinformatics. Afterwards, we would all accept coffee. Anyone who skipped the hacking session had to buy coffee for anybody else. In this mode, we worked together towards a common goal of becoming amend programmers (and, inadvertently, caffeine addicts).

Since so, all of the states take moved labs or countries. Just such regular learning time has remained an essential part of my weekly routine. Each week, I gear up aside an hour to learn something new. Sometimes it's how to use a new R package. Sometimes it's a cool new software tool I've seen on Twitter and have been significant to effort. Sometimes I piece of work in a group; sometimes it's just me. No affair how busy I am, my learning fourth dimension keeps me sane and ensures slow but steady progress.

9. Go to local workshops and meet-ups. Many universities and companies provide introductory workshops for common programming languages and techniques. These are often worth going to, even if y'all're non a beginner: you'll meet fellow coders and can bring your ain questions to ask the demonstrators. A lot of scientists also get together to program, brunch and network, so be certain to check out your local Meetup groups.

ten. Start today. If you're reading this, you might already have learnt something new. If you want to learn more, here are some excellent resources to get you started.

• Codecademy: Good for learning the basics of widely used languages (for example, Python).

• R Tutorial: An introduction to common R-use cases.

• LinuxCommand.org: Bang-up website on basic apply of the command line.

• Coppola Lab Bioinformatics Preparation Resources: An incredibly comprehensive guide for all things bioinformatics.

• Explainshell.com: Useful website for learning shell commands.

• xkcd: A safe haven for when everything stops working.

This is an article from the Nature Careers Community, a place for Nature readers to share their professional person experiences and advice. Guest posts are encouraged. You tin arrive touch with the editor at naturecareerseditor@nature.com.

plumleystriandly.blogspot.com

Source: https://www.nature.com/articles/d41586-019-00653-5

0 Response to "I Learnt a Small Program but When I Tried to Write the Same One Again"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel