<?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: Bailey Matthews</title>
    <description>The latest articles on DEV Community by Bailey Matthews (@bailey).</description>
    <link>https://dev.to/bailey</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%2F92532%2F0e0f255a-9f50-47c0-b22d-8997df77bdc9.jpeg</url>
      <title>DEV Community: Bailey Matthews</title>
      <link>https://dev.to/bailey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bailey"/>
    <language>en</language>
    <item>
      <title>My love hate relationship with Python</title>
      <dc:creator>Bailey Matthews</dc:creator>
      <pubDate>Sun, 05 May 2019 20:20:33 +0000</pubDate>
      <link>https://dev.to/bailey/my-love-hate-relationship-with-python-3j3</link>
      <guid>https://dev.to/bailey/my-love-hate-relationship-with-python-3j3</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally posted on &lt;a href="https://bailey.guru/my-love-hate-relationship-with-python/"&gt;bailey.guru&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Python was the first language I learned back when I was 8 and I loved it. I could make a cool console based game or pretend I was hacking, who wouldn't want to do that? I have a few of my early creations I found lying around on my old computer hosted on my &lt;a href="https://gist.github.com/baileyjm02"&gt;Github Gist&lt;/a&gt; page. And they honestly were super cool! I loved the fact I could type maybe 5-10 lines and still have something cool to show - it was simple. It didn't have any of the complicated structures of C# or other C languages. &lt;/p&gt;

&lt;p&gt;But now I've changed and I've learnt languages such as JavaScript and Go and I just &lt;em&gt;can't&lt;/em&gt; go back - it's &lt;strong&gt;too&lt;/strong&gt; simple. I found that while programming my &lt;a href="https://github.com/baileyjm02/GCSE-Python-Programming-Project"&gt;GCSE Project&lt;/a&gt; I loved using Python again &lt;strong&gt;but&lt;/strong&gt; hated the lack of structure... where are my brackets?&lt;/p&gt;

&lt;p&gt;If I could do something like below, then I would be in love with Python.&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;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="n"&gt;do&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Brackets
&lt;/h1&gt;

&lt;p&gt;So, naturally to add a sense of self security and structure to my Python project, I decided to Google something along the lines of "How to get curly brackets in Python", to which I found an article on Stack Overflow titled "Is it true that I can't use curly braces in Python?". It seems whoever wrote that seemed a little upset. Nevertheless, I clicked on it and started reading. There were many sarcastic responses such as:&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;if&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;#{
&lt;/span&gt;    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;it&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s true&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="c1"&gt;#}
&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;#{
&lt;/span&gt;    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;it&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s false!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="c1"&gt;#}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which I did actually find quite funny but there was one the caught my eye, I saw an import function 👀. It said: &lt;br&gt;
"You can try to add support for braces using a future import statement, but it's not yet supported, so you'll get a syntax error." and preceded to show this snippet:&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="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;__future__&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;braces&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;stdin&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="nb"&gt;SyntaxError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;chance&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you look closely you can see the syntax error "not a chance". It turns out this is a little easter egg from the developers behind Python of essentially saying "Nope, we're never adding it!" which kind of makes me a little sad but then I suppose good on them for sticking to their simple design scheme. &lt;/p&gt;

&lt;h1&gt;
  
  
  Further Research
&lt;/h1&gt;

&lt;p&gt;So, although I now knew brackets were never going to be a part of Python, I decided to see if anyone had made a compiler or pre-processor for this sort of thing. And to my amaze, they had! I found &lt;a href="https://github.com/mathialo/bython"&gt;Bython&lt;/a&gt; - Python with braces. And from what the project says, it looks pretty easy to configure, you install and use a separate command instead of Python to run. &lt;em&gt;And&lt;/em&gt; it comes with a command to convert Python to Bython. Pretty neat huh! &lt;/p&gt;

&lt;p&gt;Although I will probably never use Python again (or at least for a while), it's nice to know that Bython is a thing. And Mathias sums this article up pretty well: Because Python is awesome, but whitespace is awful.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
  </channel>
</rss>
