<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Max Shapira</title>
    <description>The latest articles on DEV Community by Max Shapira (@xshapira).</description>
    <link>https://dev.to/xshapira</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F869195%2F044765ab-2817-4189-b371-0a7c862472ee.png</url>
      <title>DEV Community: Max Shapira</title>
      <link>https://dev.to/xshapira</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xshapira"/>
    <language>en</language>
    <item>
      <title>Skills vs AI</title>
      <dc:creator>Max Shapira</dc:creator>
      <pubDate>Wed, 23 Aug 2023 11:00:09 +0000</pubDate>
      <link>https://dev.to/xshapira/skills-vs-ai-280h</link>
      <guid>https://dev.to/xshapira/skills-vs-ai-280h</guid>
      <description>&lt;p&gt;Being a skilled developer requires a careful balance in this fast-paced AI era. You should refine your skills naturally while still leveraging AI. It's not easy, as it takes practice to ask the right questions and create a fresh perspective (if you're stuck in old habits). Let me share a few ideas for striking the right balance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use AI for Understanding, Not Just Answers&lt;/li&gt;
&lt;li&gt;Break Down Your Problem&lt;/li&gt;
&lt;li&gt;Ask for Resources, Not Direct Solutions&lt;/li&gt;
&lt;li&gt;Request Feedback&lt;/li&gt;
&lt;li&gt;Use the Socratic Method&lt;/li&gt;
&lt;li&gt;Self-Reflect Before Asking&lt;/li&gt;
&lt;li&gt;Reduce Frequency&lt;/li&gt;
&lt;li&gt;Real-World Example&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Use AI for Understanding, Not Just Answers
&lt;/h3&gt;

&lt;p&gt;When using AI assistants, it's important to prioritize learning over easy answers. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpkl4phsiuj3gise7t07w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpkl4phsiuj3gise7t07w.png" alt=" " width="460" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead of directly asking ChatGPT to answer a problem, ask it to explain the concept. This encourages learning and understanding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad&lt;/strong&gt;: "Write a function to sort a list in Python."&lt;br&gt;
&lt;strong&gt;Good&lt;/strong&gt;: "Can you explain how sorting algorithms work?"&lt;/p&gt;

&lt;h3&gt;
  
  
  Break Down Your Problem
&lt;/h3&gt;

&lt;p&gt;Tackling complex problems piece by piece can prevent over-reliance on AI. Break your problem into smaller parts and try to solve each yourself. If you get stuck, ask ChatGPT about that particular issue. This way, you won't depend on the AI for the whole solution, just help in a specific part.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad&lt;/strong&gt;: "I want to build a chat application. How do I do it?"&lt;br&gt;
&lt;strong&gt;Good&lt;/strong&gt;: "I'm having trouble setting up WebSockets for real-time communication in my chat application. Can you explain how WebSockets work?"&lt;/p&gt;

&lt;h3&gt;
  
  
  Ask for Resources, Not Direct Solutions
&lt;/h3&gt;

&lt;p&gt;AI can help you find educational materials like documentation, articles, and tutorials. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ebguc1mtm3ff3wp7zjm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ebguc1mtm3ff3wp7zjm.png" alt=" " width="700" height="1022"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For instance, ChatGPT can point you toward useful resources like documentation, articles, or tutorials. Going through these can give you a better understanding of your problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad (overly broad)&lt;/strong&gt;: "How do I create a web API with FastAPI?"&lt;br&gt;
&lt;strong&gt;Good&lt;/strong&gt;: "Can you recommend some good resources or tutorials to get started with FastAPI?"&lt;/p&gt;

&lt;h3&gt;
  
  
  Request Feedback
&lt;/h3&gt;

&lt;p&gt;Another approach is to get AI feedback on your own work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwonsrdedm91s2yq4b6sq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwonsrdedm91s2yq4b6sq.png" alt=" " width="460" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rather than having ChatGPT generate a solution for you, come up with one yourself and get its feedback. You're doing the work, but AI is helping you refine and improve it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad&lt;/strong&gt;: "Write a SQL query to get the total sales from this database."&lt;br&gt;
&lt;strong&gt;Good&lt;/strong&gt;: "Here's my SQL query to calculate the total sales. Can you review it and suggest improvements?"&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the Socratic Method
&lt;/h3&gt;

&lt;p&gt;Chat with AI in an exploratory dialogue. Don't just get the answers; have a conversation to explore ideas further. Ask "why" often. This encourages better understanding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You&lt;/strong&gt;: "How does a linked list work?"&lt;br&gt;
&lt;strong&gt;ChatGPT&lt;/strong&gt;: "A linked list is a data structure in which elements, known as nodes, are connected by pointers. Each node contains data and a reference (or pointer) to the next node in the sequence."&lt;br&gt;
&lt;strong&gt;You&lt;/strong&gt;: "Why would someone choose a linked list over an array?"&lt;br&gt;
&lt;strong&gt;ChatGPT&lt;/strong&gt;: "Linked lists have several advantages over arrays... (and so on)."&lt;/p&gt;

&lt;p&gt;Another example might be if you ask, '&lt;strong&gt;How does a hash table work in Python?&lt;/strong&gt;' as opposed to just accepting the explanation, follow up with '&lt;strong&gt;Why is hashing used?&lt;/strong&gt;' and '&lt;strong&gt;How does hash table insertion improve lookup time complexity compared to a list?&lt;/strong&gt;'. Asking clarifying questions will lead you to gain a deeper understanding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self-Reflect Before Asking
&lt;/h3&gt;

&lt;p&gt;It's beneficial to reflect on your own process before using ChatGPT. Hence, take the time to explain the problem clearly, and consider it thoroughly. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0xzzomhd1kxxmvawdjb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0xzzomhd1kxxmvawdjb.png" alt=" " width="460" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Defining the problem can often help you find the answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Self-Thought&lt;/strong&gt;: "I'm trying to filter this list, but the standard loop isn't efficient. Maybe there's a built-in function or a different data structure that's more efficient?"&lt;/p&gt;

&lt;p&gt;If you haven't found the answer after thinking it over, then your question for ChatGPT will be more specific and focused.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reduce Frequency
&lt;/h3&gt;

&lt;p&gt;This part is hard, but you really want to be intentional about when you turn to AI. Set a personal rule for when you'll consult ChatGPT to help you stay persistent and build your problem-solving skills.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2by1jed3ixlqxzo676x2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2by1jed3ixlqxzo676x2.png" alt=" " width="460" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consider what timeframe works for your learning style and current skill level. For instance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you're a beginner, limit AI use to only after you've spent 60-90 minutes thoroughly trying to solve a problem yourself. As a beginner, you likely need more time wrestling with new concepts yourself before seeking help.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you have intermediate skills, perhaps 30-45 minutes of self-attempting is enough before consulting AI for hints. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you're pretty advanced, maybe 15-30 minutes of self-attempting is sufficient before getting AI input. You likely can grasp new concepts faster, so minimize wasted time.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exact minutes aren't important; get a decent mental workout, but don't burn out. The key is to challenge yourself based on your abilities. As you improve, reduce the time you allow before AI help. This pushes you to grow your skills and self-sufficiency. But have a limit to avoid unproductive struggles.&lt;/p&gt;

&lt;p&gt;Finding the right timeframe takes some trial and error. If you frequently reach your time limit with no progress, extend it. If you rarely hit the limit, shorten it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-World Example
&lt;/h3&gt;

&lt;p&gt;Jane was new to Python and Django. She was building a simple blog site and got stuck setting up the URL routes. Rather than asking ChatGPT to write the routes for her, she asked it to explain Django URL routing and show examples.&lt;/p&gt;

&lt;p&gt;After reading ChatGPT's explanation, Jane tried creating a few routes in her &lt;code&gt;views.py&lt;/code&gt; file but got confused about the syntax. She asked ChatGPT specific questions about the route syntax as she coded, so she could understand how to structure them properly.&lt;/p&gt;

&lt;p&gt;If you noticed, there was originally a mistake in this example, mentioning routes in &lt;code&gt;views.py&lt;/code&gt; instead of &lt;code&gt;urls.py&lt;/code&gt;; great catch! This was a small trick to demonstrate that AI, like ChatGPT, sometimes provides incorrect information. As helpful as AI can be, you should continue using your own critical thinking skills to identify potential errors. AI shouldn't be relied on 100% - stay focused, notice mistakes, and keep sharpening your own knowledge.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Combining these strategies into your learning can create a balance between relying on yourself and using AI tools. But hey, don’t feel you need to overhaul everything at once; it doesn’t have to be an all-or-nothing approach. Try out a suggestion or two, see what works for you, and build from there. &lt;em&gt;Remember, &lt;strong&gt;the goal is always to understand, not just to get the answer&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>coding</category>
      <category>ethics</category>
    </item>
    <item>
      <title>archive</title>
      <dc:creator>Max Shapira</dc:creator>
      <pubDate>Fri, 18 Aug 2023 08:51:47 +0000</pubDate>
      <link>https://dev.to/xshapira/skills-vs-ai-how-developers-can-strike-the-right-balance-59hn</link>
      <guid>https://dev.to/xshapira/skills-vs-ai-how-developers-can-strike-the-right-balance-59hn</guid>
      <description></description>
    </item>
    <item>
      <title>Using tkinter with pyenv: A Simple Two-Step Guide</title>
      <dc:creator>Max Shapira</dc:creator>
      <pubDate>Sat, 03 Jun 2023 09:14:37 +0000</pubDate>
      <link>https://dev.to/xshapira/using-tkinter-with-pyenv-a-simple-two-step-guide-hh5</link>
      <guid>https://dev.to/xshapira/using-tkinter-with-pyenv-a-simple-two-step-guide-hh5</guid>
      <description>&lt;p&gt;I began a course taught by Christian Koch called "&lt;a href="https://www.udemy.com/course/learn-python-by-creating-10-apps/" rel="noopener noreferrer"&gt;Learn Python by Building 10 Apps with tkinter&lt;/a&gt;". I soon realized I couldn't use &lt;code&gt;tkinter&lt;/code&gt; even though it's a built-in Python module. Wait, what?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Traceback &lt;span class="o"&gt;(&lt;/span&gt;most recent call last&lt;span class="o"&gt;)&lt;/span&gt;:
  File &lt;span class="s2"&gt;"/Users/maxshapira/Development/public/tkinter-basics/main.py"&lt;/span&gt;, line 1, &lt;span class="k"&gt;in&lt;/span&gt; &amp;lt;module&amp;gt;
    import tkinter as tk
  File &lt;span class="s2"&gt;"/Users/maxshapira/.pyenv/versions/3.11.0/lib/python3.11/tkinter/__init__.py"&lt;/span&gt;, line 38, &lt;span class="k"&gt;in&lt;/span&gt; &amp;lt;module&amp;gt;
    import _tkinter &lt;span class="c"&gt;# If this fails your Python may not be configured for Tk&lt;/span&gt;
    ^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named &lt;span class="s1"&gt;'_tkinter'&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Well, if you use &lt;code&gt;pyenv&lt;/code&gt; to manage your Python versions (which you should), you'll run into this issue. I spent a lot of time trying to figure out the right solution, so I wanted to share it with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Installing Necessary System Packages
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;tkinter&lt;/code&gt; with &lt;code&gt;pyenv&lt;/code&gt; can be tricky due to missing dependencies.&lt;/p&gt;

&lt;p&gt;First, let's make sure we have installed the necessary system packages for &lt;code&gt;tkinter&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In most Linux systems, you can install them with the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;tk-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On macOS, you can use Homebrew to achieve the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;tcl-tk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Linking the Correct Tcl/Tk Versions
&lt;/h2&gt;

&lt;p&gt;Next, make sure you link the correct versions of Tcl/Tk when installing Python. &lt;code&gt;pyenv&lt;/code&gt; builds Python in your environment, but if you don't have the required dependencies, like the Tk/Tcl libraries, it'll build Python without them.&lt;/p&gt;

&lt;p&gt;If the Python version you want to use is already installed on your system, you'll need to uninstall it before proceeding. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pyenv uninstall 3.11.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When installing a new Python version with &lt;code&gt;pyenv&lt;/code&gt;, use the following commands:&lt;/p&gt;

&lt;p&gt;For Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; make build-essential libssl-dev zlib1g-dev libbz2-dev &lt;span class="se"&gt;\&lt;/span&gt;
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev &lt;span class="se"&gt;\&lt;/span&gt;
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

&lt;span class="nb"&gt;env &lt;/span&gt;&lt;span class="nv"&gt;PYTHON_CONFIGURE_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"--enable-shared"&lt;/span&gt; pyenv &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;version&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For macOS, after installing tcl-tk with brew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;openssl readline sqlite3 xz zlib

&lt;span class="nb"&gt;env &lt;/span&gt;&lt;span class="nv"&gt;LDFLAGS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-L&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; openssl@1.1&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib -L&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; readline&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib -L&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; sqlite3&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib -L&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; xz&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib -L&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; zlib&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib -L&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; tcl-tk&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nv"&gt;CPPFLAGS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-I&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; openssl@1.1&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/include -I&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; readline&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/include -I&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; sqlite3&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/include -I&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; xz&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/include -I&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; zlib&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/include -I&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; tcl-tk&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/include"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nv"&gt;PKG_CONFIG_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; openssl@1.1&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib/pkgconfig:&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; readline&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib/pkgconfig:&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; sqlite3&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib/pkgconfig:&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; xz&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib/pkgconfig:&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; zlib&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib/pkgconfig:&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt; tcl-tk&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/lib/pkgconfig"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
pyenv &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;version&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;&amp;lt;version&amp;gt;&lt;/code&gt; with the version of Python you want to install. After that, you should be able to import &lt;code&gt;tkinter&lt;/code&gt; in your &lt;code&gt;pyenv&lt;/code&gt; Python environment.&lt;/p&gt;

&lt;p&gt;Note that I couldn't get ﻿&lt;code&gt;tkinter&lt;/code&gt; to work with ﻿&lt;code&gt;pyenv&lt;/code&gt; on Python ﻿&lt;code&gt;3.11.0&lt;/code&gt;, but it worked perfectly on &lt;code&gt;﻿3.11.2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These steps should help you fix the ﻿&lt;code&gt;tkinter&lt;/code&gt; and ﻿&lt;code&gt;pyenv&lt;/code&gt; issue.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>chill beats to focus to</title>
      <dc:creator>Max Shapira</dc:creator>
      <pubDate>Wed, 31 May 2023 18:18:56 +0000</pubDate>
      <link>https://dev.to/xshapira/chill-beats-to-focus-to-3bbf</link>
      <guid>https://dev.to/xshapira/chill-beats-to-focus-to-3bbf</guid>
      <description>&lt;p&gt;Focus. &lt;/p&gt;

&lt;p&gt;We all want to find our focus and get into the zone. A great way to do that is with noise-canceling headphones and some relaxing music. Studies have shown that instrumental music such as classical, jazz, or ambient is best for relaxation and focus. Lo-fi beats are a great pick, as they don't have lyrics, and the tempo keeps you engaged without making you sleepy.&lt;/p&gt;

&lt;p&gt;The South China Morning Post interviewed a psychologist who said that music, particularly lo-fi, can help block out distractions and keep you focused. He suggested sticking with slow, ambient tunes without lyrics, or at least those in a language you don't understand.&lt;/p&gt;

&lt;p&gt;One study from Cardiff Metropolitan University adds some science to the mix. It found that listening to music you don't like can make you less productive, while your favorite tracks might also be distracting. The best bet is to go with music that you don't have strong feelings about either way.&lt;/p&gt;

&lt;p&gt;When creating your own study playlist, here are some tips: make it ahead of time, keep it around 40-50 minutes long to remind you to take breaks, and avoid radio shows or anything with lots of talking. Also, don't crank up the volume too high - a moderate level is best. Lastly, try to stick with the same playlist to get used to the tunes and focus on your task.&lt;/p&gt;

&lt;p&gt;I put in some effort to make a lofi mix with the right tracks and transitions between beats that will help you get focused and code your way to the top.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=2bPkFUnPf_w" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=2bPkFUnPf_w&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>codenewbie</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Fire up your productivity: VS Code Themes to try right now (Updated)</title>
      <dc:creator>Max Shapira</dc:creator>
      <pubDate>Fri, 21 Apr 2023 12:16:33 +0000</pubDate>
      <link>https://dev.to/xshapira/code-your-way-to-the-top-supercharge-your-productivity-with-these-vs-code-themes-378c</link>
      <guid>https://dev.to/xshapira/code-your-way-to-the-top-supercharge-your-productivity-with-these-vs-code-themes-378c</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy14gn2gzeeaxfci3bf2n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy14gn2gzeeaxfci3bf2n.png" alt="Fire-up-your-productivity" width="800" height="474"&gt;&lt;/a&gt;&lt;br&gt;
As programmers, we can be a bit obsessive-compulsive. It's not always bad, but sometimes it stops us from actually getting stuff done. And what's that stuff, you ask? Well, it's coding. Of course, we spend much time reading code too, but real learning happens when we dive in and start typing.&lt;/p&gt;

&lt;p&gt;When we were coding newbies, any old default dark theme would do the trick. But as we get more experienced, we get insanely choosy in our workspace. I bet you can relate to the thoughts that go through our heads when we're trying to pick a new theme:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;"This one doesn't have enough contrast." &lt;br&gt;
"Doesn't support Python syntax? No thanks." &lt;br&gt;
"Too dark." &lt;br&gt;
"Too bright." &lt;br&gt;
"Too colorful." &lt;br&gt;
"Too ugly."&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It's a real headache. We waste so much time trying to find the "perfect" theme, only to return to our old favorite theme. Don't get me wrong, finding the right theme can increase productivity, creativity and be a fun way to connect with other coders. But balancing the search for the "perfect" theme with actual work is essential to avoid getting distracted and losing focus on what truly matters - achieving success!&lt;/p&gt;

&lt;p&gt;I've rounded up some of the most sophisticated themes out there so you can focus on what really matters. You don't need to scroll through countless options; I've got you covered.&lt;/p&gt;

&lt;h2&gt;
  
  
  1) &lt;a href="https://marketplace.visualstudio.com/items?itemName=Hermitter.oh-lucy-vscode" rel="noopener noreferrer"&gt;oh-lucy&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u2mqrduxnre05rulj0f.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u2mqrduxnre05rulj0f.JPG" alt="oh-lucy" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbgs94ia777z41vzh7n4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbgs94ia777z41vzh7n4.png" alt="lucy code snap" width="800" height="554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2) &lt;a href="https://marketplace.visualstudio.com/items?itemName=bale.theme-darkplusplus" rel="noopener noreferrer"&gt;Dark++ Theme&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzvz1bypx10rxv7p25ij.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzvz1bypx10rxv7p25ij.JPG" alt="dark++" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdv14vr7swt9uwbh17g8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdv14vr7swt9uwbh17g8.png" alt="dark++ code snap" width="800" height="554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3) &lt;a href="https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-community-material-theme" rel="noopener noreferrer"&gt;Community Material Theme&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm2rgxjtdxbrrr24kmd1.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm2rgxjtdxbrrr24kmd1.JPG" alt="Community Material Theme" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfwiwrcjz73e4h1g7j9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfwiwrcjz73e4h1g7j9z.png" alt="Community Material Theme code snap" width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4) &lt;a href="https://marketplace.visualstudio.com/items?itemName=miguelsolorio.min-theme" rel="noopener noreferrer"&gt;Min Theme&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8suq7z2289uk394c6jmh.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8suq7z2289uk394c6jmh.JPG" alt="Min Theme" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff974jipf0dq8n5tpy6tw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff974jipf0dq8n5tpy6tw.png" alt="Min Theme code snap" width="800" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5) &lt;a href="https://marketplace.visualstudio.com/items?itemName=hiukky.flate" rel="noopener noreferrer"&gt;Flate&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nij6jvpumgyrfljzxu9.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nij6jvpumgyrfljzxu9.JPG" alt="flate theme" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qgm81caz0il7om2oqxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qgm81caz0il7om2oqxi.png" alt="flate code snap" width="800" height="597"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6) &lt;a href="https://marketplace.visualstudio.com/items?itemName=alexandernanberg.horizon-theme-vscode" rel="noopener noreferrer"&gt;Horizon Theme&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgbaptzbwf1uuos5mxwx.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgbaptzbwf1uuos5mxwx.JPG" alt="horizon theme" width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0dfmt1cf8ofy4mpt1a4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0dfmt1cf8ofy4mpt1a4.png" alt="Horizon Theme code snap" width="800" height="637"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7) &lt;a href="https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark" rel="noopener noreferrer"&gt;Atom One Dark Theme&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm40e6imr7xfup4lialbt.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm40e6imr7xfup4lialbt.JPG" alt="Atom One Dark Theme" width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fox3gr8a12ucreia9e8wc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fox3gr8a12ucreia9e8wc.png" alt="Atom One Dark Theme code snap" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8) Honorable mention: &lt;a href="https://marketplace.visualstudio.com/items?itemName=xshapira.joey-theme" rel="noopener noreferrer"&gt;joey&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb9durx8g8cos80qpghf.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb9durx8g8cos80qpghf.JPG" alt="joey-theme" width="800" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqs1k97gb5alfoiqpzim.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqs1k97gb5alfoiqpzim.png" alt="joey-theme-code-snap" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why is &lt;a href="https://marketplace.visualstudio.com/items?itemName=xshapira.joey-theme" rel="noopener noreferrer"&gt;joey theme&lt;/a&gt; an honorable mention? It's because it's my jam! I took a solid theme, and after three years of tinkering, I ended up with a theme that helps developers focus like a ninja. I won't strong-arm you into using it and say, "You have to use it!" because it's about personal preference. But you should give it a shot. If it works for you, then I've done my job. &lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=Hermitter.oh-lucy-vscode" rel="noopener noreferrer"&gt;oh-lucy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=bale.theme-darkplusplus" rel="noopener noreferrer"&gt;Dark++ Theme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-community-material-theme" rel="noopener noreferrer"&gt;Community Material Theme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=miguelsolorio.min-theme" rel="noopener noreferrer"&gt;Min Theme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=hiukky.flate" rel="noopener noreferrer"&gt;Flate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=alexandernanberg.horizon-theme-vscode" rel="noopener noreferrer"&gt;Horizon Theme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark" rel="noopener noreferrer"&gt;Atom One Dark Theme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=xshapira.joey-theme" rel="noopener noreferrer"&gt;joey&lt;/a&gt; (honorable mention)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Code time, tune in, zone out!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>productivity</category>
      <category>codenewbie</category>
      <category>themes</category>
    </item>
    <item>
      <title>Mastering Functions: How to Write Functions That Will Take Your Skills to the Next Level</title>
      <dc:creator>Max Shapira</dc:creator>
      <pubDate>Sat, 15 Apr 2023 14:09:31 +0000</pubDate>
      <link>https://dev.to/xshapira/mastering-functions-how-to-write-functions-that-will-take-your-skills-to-the-next-level-g6</link>
      <guid>https://dev.to/xshapira/mastering-functions-how-to-write-functions-that-will-take-your-skills-to-the-next-level-g6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4bulkx1vc1wlxhw7sv5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4bulkx1vc1wlxhw7sv5.png" alt="mastering-functions" width="800" height="474"&gt;&lt;/a&gt;&lt;br&gt;
I'm on the verge of finishing a great course called "&lt;a href="https://www.udemy.com/course/writing-clean-code/" rel="noopener noreferrer"&gt;Clean Code&lt;/a&gt;" by Maximilian Schwarzmüller. &lt;/p&gt;

&lt;p&gt;I stumbled upon the concept of writing good and clean functions and wanted to share some valuable principles which will be especially handy for beginners. So you can see this blog post as an informative summary of that course section.&lt;/p&gt;

&lt;p&gt;Let's dive in by looking at &lt;strong&gt;eight main points&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Functions are like little helpers in our code that we can repeatedly use to do something specific.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A good function should only do one thing. It shouldn't be trying to do too much all at once.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can also think about levels of abstraction, which means how high or low we are in terms of how much detail we deal with.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High-level operations are like big-picture ideas that we can express with a few words or phrases, while low-level operations are more detailed and specific.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A good function should only be responsible for work that is one level of abstraction below its name. This means that if the function has a descriptive name, it should only deal with operations that are one level more detailed than that name suggests. Use verbs or short phrases with adjectives to name functions correctly (e.g., &lt;code&gt;send_data&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When we write a function, we should give it a descriptive name that tells us what it does.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If a function is doing too much, we can break it down into smaller functions that each does one specific thing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By breaking down functions into smaller pieces, we can make our code easier to understand and maintain.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Consider this simple function that calls &lt;code&gt;collect_coin&lt;/code&gt; and adds 1 to the player's coin count.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;collect_coin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;coins&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's an example of a lousy function that's trying to do too much:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;play_game&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enemies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;walls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;enemy&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;enemies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;colliderect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;enemy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
            &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hitpoints&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hitpoints&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;game_over&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]()&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;wall&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;walls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;colliderect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wall&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
            &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;move_back&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]()&lt;/span&gt;
    &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;coins&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function calls &lt;code&gt;play_game&lt;/code&gt;, which checks for collisions with enemies and walls, adjusts the player's hitpoints and coin count, and even ends the game if the player's hitpoints reach zero.&lt;/p&gt;

&lt;p&gt;To illustrate, we can fix the &lt;code&gt;play_game&lt;/code&gt; function by breaking it down into smaller functions that each does one specific thing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check_for_enemy_collision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enemies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;enemy&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;enemies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;colliderect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;enemy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
            &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hitpoints&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hitpoints&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;game_over&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check_for_wall_collision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;walls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;wall&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;walls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;colliderect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wall&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rect&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
            &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;move_back&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;collect_coin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;coins&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;play_game&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enemies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;walls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;check_for_enemy_collision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enemies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;check_for_wall_collision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;walls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;collect_coin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;strong&gt;Side Note:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rect&lt;/code&gt; and &lt;code&gt;colliderect&lt;/code&gt; are attributes and methods of a &lt;code&gt;Rect&lt;/code&gt; object, which is a built-in class in the &lt;code&gt;pygame&lt;/code&gt; module used for handling rectangular areas.&lt;/p&gt;

&lt;p&gt;So, the expression &lt;code&gt;player.rect.colliderect(enemy.rect)&lt;/code&gt;  checks if the player is hitting the enemy by comparing the position and size of the two objects using the &lt;code&gt;colliderect&lt;/code&gt; method.&lt;/p&gt;

</description>
      <category>python</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
