{"id":8685,"date":"2024-12-16T02:00:00","date_gmt":"2024-12-16T07:00:00","guid":{"rendered":"https:\/\/www.both.org\/?p=8685"},"modified":"2024-12-01T11:45:23","modified_gmt":"2024-12-01T16:45:23","slug":"5-ways-to-learn-about-programming","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=8685","title":{"rendered":"5 ways to learn about programming"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"8685\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>Open source is about <em>creating a program to solve a problem that&#8217;s interesting to you<\/em>. There are many inroads to learn about programming, there is no &#8220;one true path&#8221; to write your first program. This year, we shared several articles to help new programmers get started. Use these as a starting point for your own journey into programming:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.both.org\/?p=5896\" target=\"_blank\" rel=\"noreferrer noopener\">Learning with the turtle<\/a><\/h2>\n\n\n\n<p>A great way to get started in programming is with a visual programming interface. One popular system is Turtle Graphics, which is available for the Python programming language. Don shares how his experience in learning to use the &#8216;turtle&#8217; module introduced him to Python and opened up a world of creativity and learning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.both.org\/?p=7446\" target=\"_blank\" rel=\"noreferrer noopener\">Learn C by writing a number guessing game<\/a><\/h2>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p>Every time I&#8217;ve learned about a new programming language, I practice by writing a simple game, like a number guessing game. This exercises several things in programming, including how to store values in variables and how to compare values and how to print messages. If you&#8217;re new to the C programming language, or just want to learn more about it, try writing this game to guess a number between 1 and 100.<\/p>\n\n\n\n<p>You can improve your number-guessing game by using <a href=\"https:\/\/www.both.org\/?p=7448\" target=\"_blank\" rel=\"noreferrer noopener\">Random numbers from the Linux kernel<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.both.org\/?p=5850\" target=\"_blank\" rel=\"noreferrer noopener\">Common C programming bugs (and how to avoid them)<\/a><\/h2>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p>Programming in C can provide a lot of flexibility to writing your own command line programs. The trade-off to writing in C is that you need to be more careful. In &#8220;higher level&#8221; programming languages like Rust, Go, or Java, the language helps to protect the programmer from certain common mistakes. But in C, you need to watch for these pitfalls yourself. Here are five common C programming bugs, and how you can avoid them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.both.org\/?p=8051\" target=\"_blank\" rel=\"noreferrer noopener\">Programming across platforms<\/a><\/h2>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p>The C programming language remains an extremely popular language, and you can find a C compiler on most systems, and easily compile your programs anywhere. But that doesn&#8217;t mean that all C implementations are the same. If you&#8217;re writing a C program that should operate on multiple systems, use the C preprocessor to help you write programs across different platforms.<\/p>\n\n\n\n<p>Dig deeper into cross-platform programming practices with <a href=\"https:\/\/www.both.org\/?p=8245\" target=\"_blank\" rel=\"noreferrer noopener\">Writing portable C programs<\/a> and <a href=\"https:\/\/www.both.org\/?p=8248\" target=\"_blank\" rel=\"noreferrer noopener\">Portable programming practices<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.both.org\/?p=7495\" target=\"_blank\" rel=\"noreferrer noopener\">A gentle introduction to ncurses<\/a><\/h2>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p>In days past, Unix programs ran in &#8220;teletype&#8221; mode, reading from <em>standard input<\/em> and writing to <em>standard output<\/em>. Another way that programs can interact with the user is using screen control, by manipulating the screen directly. The classic way to do this is with the <strong>curses<\/strong> library from BSD Unix, but Linux systems provide the same interface using <strong>ncurses<\/strong>, or new curses. Let&#8217;s explore ncurses by writing a &#8220;Hello world&#8221; program.<\/p>\n\n\n\n<p>Learn more about ncurses with <a href=\"https:\/\/www.both.org\/?p=7500\" target=\"_blank\" rel=\"noreferrer noopener\">Terminal size and ncurses<\/a> and <a href=\"https:\/\/www.both.org\/?p=7505\" target=\"_blank\" rel=\"noreferrer noopener\">Write a guessing game in ncurses<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Read these popular articles from the last year to get started on your programming journey.<\/p>\n","protected":false},"author":33,"featured_media":2814,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[512,150],"tags":[152],"class_list":["post-8685","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-both-org","category-programming","tag-programming"],"modified_by":"Jim Hall","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/8685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8685"}],"version-history":[{"count":4,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/8685\/revisions"}],"predecessor-version":[{"id":8788,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/8685\/revisions\/8788"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/2814"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}