<?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: Mary Alice</title>
    <description>The latest articles on DEV Community by Mary Alice (@maryalice).</description>
    <link>https://dev.to/maryalice</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%2F2435029%2F9a8e9117-2289-48ae-87a0-0e51c06cd6f1.jpeg</url>
      <title>DEV Community: Mary Alice</title>
      <link>https://dev.to/maryalice</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maryalice"/>
    <language>en</language>
    <item>
      <title>Python Browser Compilers</title>
      <dc:creator>Mary Alice</dc:creator>
      <pubDate>Mon, 14 Apr 2025 14:05:16 +0000</pubDate>
      <link>https://dev.to/maryalice/python-browser-compilers-5dg5</link>
      <guid>https://dev.to/maryalice/python-browser-compilers-5dg5</guid>
      <description>&lt;p&gt;Ever since JavaScript became the default language for web browsers, the demand for technology that could translate to it has been unending. Assemblers and compilers, two subsets of translators, are the technology used to perform this conversion from another programming language to JavaScript. &lt;/p&gt;

&lt;p&gt;With Python becoming the most common "first language" for developers due to the simple syntax, the demand for a Python compiler is great. Coupled with its powerful back-end capabilities, it is clear why programmers are looking to use it to build an entire application. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's been a dream of many programmers to use Python instead of JavaScript for front-end coding, but there is a simple unmovable obstacle. Browsers all support JavaScript, but not Python”&lt;/p&gt;
&lt;h6&gt;
  
  
  &lt;a href="https://medium.com/@marcnealer/practical-brython-bdcb40062bbd" rel="noopener noreferrer"&gt;Marc Nealer, Practical Brython&lt;/a&gt;
&lt;/h6&gt;
&lt;/blockquote&gt;

&lt;p&gt;My original intent in writing this piece was to delve into three prominent Python-to-JavaScript compilers: Brython, Transcrypt, and Pyodide. I began with Brython because it had the most accessible documentation. As I explored it more deeply, the focus of this post naturally shifted. The length got away from me, and rather than attempt to summarize all three superficially, I decided to give Brython the spotlight it deserved.&lt;/p&gt;

&lt;p&gt;Unlike Transcrypt—which compiles Python to JavaScript ahead of time and is maintained collaboratively with no single project owner—or Pyodide, a WebAssembly-based solution that loads a full Python runtime in the browser, Brython takes a different approach. It inserts Python code directly into HTML and interprets it at runtime, providing a uniquely accessible way to write Python for the browser.&lt;/p&gt;




&lt;h2&gt;
  
  
  Brython
&lt;/h2&gt;

&lt;p&gt;With a name meaning "&lt;strong&gt;Br&lt;/strong&gt;owser &lt;strong&gt;Python&lt;/strong&gt;", it is fitting for Brython to top many lists of these compilers. Straightforward and Python focused, Brython describes itself as an implementation of Python3 running in the browser. Brython is especially appealing to Python developers because it supports the full functionality of Python. Since version 3.8.0, Brython has updated to match the newest version of Python with the same version number. It interfaces directly with the DOM by inserting Python code directly inside HTML5 with script tags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/python"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A full example of a simple HTML page running Python might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/path/to/brython.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/python"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;alert&lt;/span&gt;
        &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mybutton&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;zone&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"zone"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"mybutton"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;click !&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Events cannot be triggered by a script in the HTML. Handling is done inside the Brython code by binding event listener functions to HTML elements. Programmers have the option to bind by id, class, tag, or attribute.&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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bind&lt;/span&gt;

&lt;span class="c1"&gt;# get the element from the document
&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mybutton&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;#set up a function to be called
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;button_clicked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;evt&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mybutton clicked&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#bind the element to the function so it is run when the event occurs
&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;click&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;button_clicked&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pure Python: No need to dive deep into JavaScript.&lt;/li&gt;
&lt;li&gt;Direct DOM Access: Using Python instead of JS syntax.&lt;/li&gt;
&lt;li&gt;Great for Learning: Excellent for Python learners exploring the browser environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance: Because Brython interprets code at runtime, load times are slower than precompiled tools.&lt;/li&gt;
&lt;li&gt;Limited Ecosystem: It doesn’t support many popular Python packages.&lt;/li&gt;
&lt;li&gt;Still Need HTML/CSS: Brython replaces JavaScript, not the rest of the frontend stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quick Glance at Transcrypt and Pyodide
&lt;/h3&gt;

&lt;p&gt;Just to highlight how Brython compares:&lt;/p&gt;

&lt;p&gt;Transcrypt compiles Python to JavaScript before the code ever hits the browser. It offers better performance, access to JS libraries, and even offers React integration.&lt;/p&gt;

&lt;p&gt;Pyodide brings the full CPython runtime into the browser via WebAssembly. It is incredibly powerful for scientific computing but can be heavy and slow to load.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Brython offers a unique approach for developers who want to stay in Python while working on the frontend. It may not be ideal for every production use case, but for rapid prototyping, educational projects, or Python-first workflows, it’s a surprisingly fun and effective tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sources
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://brython.info/index.html" rel="noopener noreferrer"&gt;Brython&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/TranscryptOrg/Transcrypt/blob/master/README.rst" rel="noopener noreferrer"&gt;Transcrypt Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://pyodide.org/en/stable/" rel="noopener noreferrer"&gt;Pyodide Official Site&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/@marcnealer/practical-brython-bdcb40062bbd" rel="noopener noreferrer"&gt;Marc Nealer, Practical Brython&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Photo Metadata Standards: IPTC, EXIF, and XMP</title>
      <dc:creator>Mary Alice</dc:creator>
      <pubDate>Mon, 31 Mar 2025 13:55:58 +0000</pubDate>
      <link>https://dev.to/maryalice/photo-metadata-standards-iptc-exif-and-xmp-4n5d</link>
      <guid>https://dev.to/maryalice/photo-metadata-standards-iptc-exif-and-xmp-4n5d</guid>
      <description>&lt;h3&gt;
  
  
  Data about Data
&lt;/h3&gt;

&lt;p&gt;Metadata is structured information that provides context and details about other data in a way that eases management, understanding, retrieval, and use. The three basic types are descriptive, structural, and administrative.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Photo Metadata
&lt;/h3&gt;

&lt;p&gt;Just like traditional metadata, photo metadata has three main categories. Descriptive and administrative carry over, but in place of structural, photo metadata has a rights category.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Descriptive Metadata&lt;/strong&gt;: This category helps to describe the content, context, and features of the image. It may include titles, captions, keywords, and the creator of the image. This helps people to understand and locate the image easily.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Administrative Metadata&lt;/strong&gt;: This includes technical details like file format, resolution, and camera settings, as well as access controls, and rights management. It’s crucial for managing the image file and ensuring proper usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rights Metadata&lt;/strong&gt;: Unique to photo metadata, this category provides information on copyright, licensing, usage restrictions, and any permissions attached to the image. It is critical for ensuring that creators' intellectual property is protected.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  International Press Telecommunications Council
&lt;/h3&gt;

&lt;p&gt;The IPTC Information Interchange Model (IIM) was developed in the early 90s to optimize the exchange of information to news agencies around the world by standardizing media file structures and metadata attributes. Although originally created for the press, the structure became accepted as the world standard for embedding information by professional photographers. Called “IPTC headers,” this data is encoded and decoded by photo editing software.&lt;/p&gt;

&lt;p&gt;The IPTC template outlines how metadata should be organized and stored within an image file. It consists of key fields like the image’s headline, description, copyright information, keywords, and creator details, all of which enhance the image’s discoverability and legal protection. The IPTC metadata template is typically embedded in the file, ensuring it remains with the image wherever it goes.&lt;/p&gt;

&lt;p&gt;This standardized structure allows photographers, agencies, and organizations to maintain consistency when managing large numbers of images, simplifying processes like search and retrieval, rights enforcement, and licensing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exif (Exchangeable Image File Format)
&lt;/h3&gt;

&lt;p&gt;Exif is a widely used standard for storing metadata in image files. Exif data captures technical details about an image, such as the camera model, exposure settings (shutter speed, aperture, ISO), date and time, and geolocation (when GPS data is available). These details are crucial for photographers, as they provide insight into how the photo was taken and can serve as a reference for future shoots. Additionally, Exif can store information about the orientation of the photo (landscape or portrait) and allow image editing software to automatically rotate images if needed.&lt;/p&gt;

&lt;p&gt;Exif also integrates seamlessly with IPTC, making it an essential part of modern photography workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  XMP (Extensible Metadata Platform)
&lt;/h3&gt;

&lt;p&gt;XMP is an Adobe-developed standard that provides a more flexible and extensible way to store metadata across various types of digital media. It extends the capabilities of traditional metadata standards, allowing for custom fields to be added to an image’s metadata, making it particularly useful in creative industries.&lt;/p&gt;

&lt;p&gt;XMP metadata can be embedded in various file types like images, audio, video, and PDFs, making it a universal standard for digital asset management. It allows for better interoperability between different software platforms and ensures that metadata travels with the file, even across different applications.&lt;/p&gt;

&lt;p&gt;XMP can also contain rights information, geo-tagging, and user-generated metadata, helping photographers and content creators maintain control over their digital assets and better track usage rights.&lt;/p&gt;




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

&lt;p&gt;Metadata might be behind the scenes, but it's an essential component to digital content. Whether it's IPTC helping with organization, Exif showing how a photo was taken, or XMP keeping things flexible across platforms, metadata makes it easier to manage, share, and protect images. Knowing how it works gives photographers and creators the control they need to process and take ownership of their work. &lt;/p&gt;




&lt;h3&gt;
  
  
  Sources
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://iptc.org/standards/photo-metadata/photo-metadata/" rel="noopener noreferrer"&gt;IPTC&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.cipa.jp/e/std/std-sec.html" rel="noopener noreferrer"&gt;CIPA&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Trust the Process (Object)</title>
      <dc:creator>Mary Alice</dc:creator>
      <pubDate>Tue, 18 Mar 2025 04:56:47 +0000</pubDate>
      <link>https://dev.to/maryalice/trust-the-process-object-597g</link>
      <guid>https://dev.to/maryalice/trust-the-process-object-597g</guid>
      <description>&lt;h2&gt;
  
  
  Node.js process object
&lt;/h2&gt;

&lt;p&gt;Node.js has a number of built-in, global objects and object models available across modules. These objects have an important role in Node's runtime environment and server-side JavaScript execution. They allow programmers to interact with the Node.js process by providing information (&lt;code&gt;console&lt;/code&gt; for instance) and control (&lt;code&gt;require&lt;/code&gt;, &lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;setInterval&lt;/code&gt;) for the currently running process.&lt;/p&gt;

&lt;p&gt;Today I'll be diving into the &lt;code&gt;process&lt;/code&gt; object, an instance of the &lt;code&gt;EventEmiter&lt;/code&gt; class. As a whole, EventEmitter allows one to create custom and event-driven programming. Because of this, &lt;code&gt;process&lt;/code&gt; provides information and control over the literal process currently operating in node.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Properties and Methods
&lt;/h2&gt;

&lt;p&gt;Like all objects, &lt;code&gt;process&lt;/code&gt; is composed of properties and methods. They help programmers manage everything from environment variables, event handling, and control over the process lifecycle itself. The process object itself can have as many as 90-100 of these properties depending on the version, so I've chosen four to go over below that pertain specifically to the Process Environment.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. &lt;code&gt;process.env&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Type: Object&lt;/li&gt;
&lt;li&gt;Purpose: Stores environment variables for the current Node.js process. These are often used for configuration, such as storing sensitive data (API keys, login credentials, database access). The data is stored in a .env file in the project repo. For security, the file remains on the programmer's local repo and should &lt;em&gt;never&lt;/em&gt; be pushed to the public bundle.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 'production' or 'development'&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_KEY&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Access the API key from the .env file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. &lt;code&gt;process.on()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Type: Method&lt;/li&gt;
&lt;li&gt;Purpose: Listens for and handles events occurring during the Node.js lifecycle. This is the way to attach operations to &lt;code&gt;process.exit&lt;/code&gt;, as calling that terminates the Node.js process immediately. It can also be utilized with &lt;code&gt;uncaughtException&lt;/code&gt; and &lt;code&gt;SIGINIT&lt;/code&gt; (other events that kill the process) with a callback &lt;code&gt;process.on(event, callback)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;exit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`The process is exiting with code: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;uncaughtException&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;An uncaught error occurred:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. &lt;code&gt;process.argv&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Type: Array&lt;/li&gt;
&lt;li&gt;Purpose: When you run a Node.js script, you can pass arguments directly into the command line. These arguments can later be accessed through &lt;code&gt;process.argv&lt;/code&gt;. 
Command-line arguments in node always contain at least 2 arguments: the path to the Node executable (Node binary) and the path to the script being run. Additional arguments can be passed in after. 
A basic script run with arguments like:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node app.js &lt;span class="nt"&gt;--name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Josh &lt;span class="nt"&gt;--city&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Nola
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Would have a &lt;code&gt;process.argv&lt;/code&gt; containing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/usr/local/bin/node&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Node binary path&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/path/to/app.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="c1"&gt;// Path to the script&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--name=Josh&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;         &lt;span class="c1"&gt;// Arg 1&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--city=Nola&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;          &lt;span class="c1"&gt;// Arg 2&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. &lt;code&gt;process.stdin&lt;/code&gt;, &lt;code&gt;process.stdout&lt;/code&gt;, and &lt;code&gt;process.stderr&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Type: Streams&lt;/li&gt;
&lt;li&gt;Purpose: Standard input, output, and error streams that allow interaction with the console or other processes. They are useful for handling user input, logging, and error reporting.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//reading user input from the terminal&lt;/span&gt;
&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`You entered: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// writing to stdout and stderr&lt;/span&gt;
&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This is standard output&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This is an error message&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Mastery of the process object starts with understanding its most essential properties. We've covered four key ones, but there are many more to explore. From managing environment variables to handling system signals and performance monitoring, these properties give developers powerful control over their Node.js applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nodejs.org/api/process.html#process" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>cli</category>
    </item>
    <item>
      <title>There's Something About Esri</title>
      <dc:creator>Mary Alice</dc:creator>
      <pubDate>Thu, 06 Feb 2025 19:30:01 +0000</pubDate>
      <link>https://dev.to/maryalice/theres-something-about-esri-3o7j</link>
      <guid>https://dev.to/maryalice/theres-something-about-esri-3o7j</guid>
      <description>&lt;p&gt;Since the launch of their first commercial software in 1982, the Environmental Systems Research Institute, Inc (now known simply as &lt;a href="https://www.esri.com/en-us/about/about-esri/overview" rel="noopener noreferrer"&gt;Esri&lt;/a&gt;) has been a dominant force in geospatial technology. Exactly how much of the market Esri controls is debatable (the widely cited 43% dates back to a &lt;a href="https://www.esri.com/about/newsroom/announcements/independent-report-highlights-esri-as-leader-in-global-gis-market/" rel="noopener noreferrer"&gt;report published in 2015&lt;/a&gt;), but its status as an industry leader cannot be denied. Their &lt;a href="https://www.esri.com/en-us/about/media-relations/fact-sheet" rel="noopener noreferrer"&gt;cited&lt;/a&gt; user metrics are staggering:&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%2F207x8z2kvxctm3aa2lct.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%2F207x8z2kvxctm3aa2lct.png" alt="esri factsheet" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyone familiar with Geographic Information Systems would not be surprised by any of these figures. Esri, and its flagship software ArcGIS, are so ubiquitous in the field that they have become nearly synonymous with the concept as a whole.&lt;/p&gt;

&lt;p&gt;My intent with this piece was to pinpoint why Esri is so dominant. The problem is, they do &lt;em&gt;everything&lt;/em&gt; and they always have. So what is that magic touch?&lt;/p&gt;

&lt;p&gt;See line 1 of the table above.&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%2Fsiqbei4m8n3qdf493mt4.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%2Fsiqbei4m8n3qdf493mt4.jpg" alt="Jack and Laura Dangermond" width="500" height="500"&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%2Fv4b6117ewu31ar5vj2e7.jpeg" 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%2Fv4b6117ewu31ar5vj2e7.jpeg" alt="Jack and Laura Dangermond" width="800" height="995"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Early Entry and Continued Innovation
&lt;/h2&gt;

&lt;p&gt;The history of Esri is essentially a history of geospatial technologies as a whole. Founded by husband and wife team Jack and Laura Dangermond in 1969 as a land management firm, Esri was one of the earliest companies in the GIS space. They served private clients and established a strong foothold in the market, and then continued to set standards with crucial software innovations.&lt;/p&gt;

&lt;p&gt;Esri's GIS command-line based workstation ARC/INFO was among the first of its kind to hit the market in 1982. ArcView 1.0 (1991) tackled accessibility with a GUI geared toward users that only needed to view and query the spatial data from their command-line products. &lt;/p&gt;

&lt;h2&gt;
  
  
  Advent of the Shapefile
&lt;/h2&gt;

&lt;p&gt;Through out the 90's Esri focused on improving ArcView, with each release adding new functionality and features. For one, the now ubiquitous &lt;strong&gt;Shapefile&lt;/strong&gt; form (Esri's own digital vector storage type for grouping geographic location data and associated attributes) premiered with ArcView 2.x. Each new iteration saw increased functionality, and with the release of ArcView GIS 3.x in 1997 it had enough capabilities and functions to be considered a true (but limited) GIS platform. Esri also had a programming library (Map Objects) and a relational database system (ArcSDE), but all of these products were a la carte and the interoperability was not there. &lt;/p&gt;

&lt;p&gt;In 1999 Esri combined these crucial components with the release of the ArcGIS software suite. The ArcGIS package bundled three crucial components: functionality and analysis (the Arc/INFO workstation), a visual user interface (new GUI dubbed ArcMap), and a file management system (ArcCatalog). The "one million licensed seats" milestone was met shortly after in 2001. &lt;/p&gt;

&lt;h2&gt;
  
  
  Component Libraries, Tools, and Extensions
&lt;/h2&gt;

&lt;p&gt;The subsequent versions of ArcGIS came packed with extensions and increasing access to online data. Users could perform advanced 3D modeling, complex analysis, and compare across multiple databases.  The 2000 launch of their spatial server ArcIML and ArcXML completely opened up geospatial data once stowed away in government databases to the world.&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%2Fl09tvmpie95yj3c6yjer.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%2Fl09tvmpie95yj3c6yjer.png" alt="Image description" width="652" height="359"&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%2F38054he7oaqjecpky7vv.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%2F38054he7oaqjecpky7vv.png" alt="Image description" width="350" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Modern Platforms and Innovations
&lt;/h2&gt;

&lt;p&gt;Today Esri has two primary platforms: ArcGIS Online and ArcGIS Pro. ArcPRO is the supercharged desktop software with groundbreaking functions and tools. Users can manage their spacial data, perform advanced analytics, and create complex 2D, 3D, even 4D models&lt;/p&gt;

&lt;p&gt;ArcGIS online has data management and analyzation capabilities as well, but with limitations. Where online shines is in the ability to collaborate and quickly share maps and findings.&lt;/p&gt;

&lt;p&gt;Esri continues to integrate with new technologies, such as AI, machine learning, IoT, and 3D modeling. The cover image for this piece is actually one such example, it's an example of Esri's AI-generate art! &lt;/p&gt;




&lt;p&gt;While there are other GIS platforms (e.g., QGIS, Google Earth, MapInfo), ArcGIS's combination of history, functionality, and ecosystem has made it the most widely used and recognized GIS software in the world. &lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.esri.com/arcgis-blog/products/arcgis-living-atlas/mapping/make-this-ai-inspired-topo-landscape-please/" rel="noopener noreferrer"&gt;Cover Image&lt;/a&gt;&lt;br&gt;
&lt;a href="https://help.arcgis.com/en/arcims/10.0/mainhelp/mergedProjects/ArcXMLGuide/elements/introduction.htm" rel="noopener noreferrer"&gt;ArcIMS and ArcXML Images&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.esri.com/content/dam/esrisites/en-us/media/misc/private/wigis-history-of-gis.pdf" rel="noopener noreferrer"&gt;Esri History of GIS timeline&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.esri.com/" rel="noopener noreferrer"&gt;Esri&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gis</category>
      <category>architecture</category>
      <category>learning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Webpack: the six concepts to know to get started</title>
      <dc:creator>Mary Alice</dc:creator>
      <pubDate>Mon, 27 Jan 2025 14:57:50 +0000</pubDate>
      <link>https://dev.to/maryalice/webpack-the-six-concepts-to-know-to-get-started-307</link>
      <guid>https://dev.to/maryalice/webpack-the-six-concepts-to-know-to-get-started-307</guid>
      <description>&lt;h3&gt;
  
  
  &lt;code&gt;npm install&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;To think: a few weeks ago, I didn’t even realize I needed to run an npm install every time I cloned down a repo. "I've already installed node and npm!" &lt;/p&gt;

&lt;p&gt;Turns out installing npm on your machine one time does not magically manage node modules for all your projects. That's where build tools can come into play.&lt;/p&gt;

&lt;p&gt;Build tools operate by creating module bundles that are themselves sent as a group to the browser. Webpack is the leading build tool, a “static module bundler for modern JavaScript applications”. Let's unpack that webpack.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modules
&lt;/h3&gt;

&lt;p&gt;The most basic layer of a module is an independent .js file. They operate independent of other files in the same folder, unless of course we invoke the &lt;code&gt;import&lt;/code&gt; and &lt;code&gt;export&lt;/code&gt; keywords.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export&lt;/code&gt; : allows the module to be public code&lt;br&gt;
&lt;code&gt;import&lt;/code&gt; : passes down public code from module to another.&lt;/p&gt;
&lt;h2&gt;
  
  
  The 6
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Entry Points
&lt;/h3&gt;

&lt;p&gt;This is &lt;em&gt;the&lt;/em&gt; module Webpack uses to build out the internal dependency graph.&lt;br&gt;
By default it’s the index.js file. &lt;br&gt;
To choose a different main module, we can set an entry point property in the webpack configuration file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./entry/file/path.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dependency Graphs
&lt;/h3&gt;

&lt;p&gt;Webpack will take your entry point and process your project for the modules it depends on. From there, it will bundle all the &lt;em&gt;dependencies&lt;/em&gt; into a single file. This allows everything your project relies on (async operations, non-code files, external scripts) to be exported to the browser and executed as a module. &lt;/p&gt;

&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;

&lt;p&gt;Can also be configured in the webpack configuration file. This is the destination of the bundle or bundles. By default it loads to &lt;code&gt;./dist&lt;/code&gt;, and like the entry you can specify an &lt;code&gt;output&lt;/code&gt; in your configuration file. &lt;br&gt;
const path = require('path');&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./entry/file/path.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dist&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-webpack.bundle.js&lt;/span&gt;&lt;span class="dl"&gt;'&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Loaders and Plugins
&lt;/h3&gt;

&lt;p&gt;transform non-code files to be part of the webpack configuration and the dependency graph&lt;br&gt;
converts files such as css, font families, and images into valid JavaScript modules&lt;br&gt;
2 main properties&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;test&lt;/code&gt;: checks if a file needs to be converted&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;use&lt;/code&gt;: decides which loader will do the conversion &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Can set &lt;code&gt;rules&lt;/code&gt; (under &lt;code&gt;module.rules&lt;/code&gt; for &lt;code&gt;test&lt;/code&gt; and &lt;code&gt;use&lt;/code&gt; )&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-webpack.bundle.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;module&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="sr"&gt;txt$/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;use&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;raw-loader&lt;/span&gt;&lt;span class="dl"&gt;'&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Backbone of webpack’s plugin  interface is  the &lt;code&gt;Tapable&lt;/code&gt; utility library. Plugins allow for customization in the compilation process. Plugins have access to a module’s compiler and hook into key events. &lt;/p&gt;

&lt;h3&gt;
  
  
  Modes
&lt;/h3&gt;

&lt;p&gt;3 parameters: &lt;br&gt;
&lt;code&gt;development&lt;/code&gt;: &lt;br&gt;
&lt;code&gt;production&lt;/code&gt; : default mode &lt;br&gt;
&lt;code&gt;none&lt;/code&gt; : to opt out of any default optimization options&lt;/p&gt;

&lt;p&gt;This allows users to specify the node environment and determines how the builtin webpack optimizations should be  deployed. Of course, mode is set in your Webpack configuration file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser Compatibility and Programming Environment
&lt;/h3&gt;

&lt;p&gt;Out of the box, Webpack ensures that your code is ES5-compliant, meaning it will run on older browsers that do not support newer ECMAScript features.&lt;/p&gt;

&lt;p&gt;To use Webpack 5, all you need is Node.js version 10.13.0 or higher. It’s that simple!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tighten.com/assets/images/insights/webpack-drawing-1454537791.png" rel="noopener noreferrer"&gt;Image&lt;/a&gt;&lt;br&gt;
&lt;a href="https://javascript.info/modules-intro#build-tools" rel="noopener noreferrer"&gt;JavaScript.Info&lt;/a&gt;&lt;br&gt;
&lt;a href="https://webpack.js.org/guides/getting-started/#creating-a-bundle" rel="noopener noreferrer"&gt;webpack.js - Getting Started&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Python for Javascript Newbies</title>
      <dc:creator>Mary Alice</dc:creator>
      <pubDate>Mon, 20 Jan 2025 06:44:04 +0000</pubDate>
      <link>https://dev.to/maryalice/python-for-javascript-newbies-1m4n</link>
      <guid>https://dev.to/maryalice/python-for-javascript-newbies-1m4n</guid>
      <description>&lt;p&gt;As a fledgling programmer, you quickly start exploring the endless possibilities—what other projects can I work on? What skills do I need to master? For me, all roads are pointing to Python. Can I really start learning a new programming language when I don't even have a mastery of JavaScript?&lt;/p&gt;

&lt;h2&gt;
  
  
  Scary Name 🐍 Friendly Language
&lt;/h2&gt;

&lt;p&gt;Python is remarkably readable, and the variables feel strikingly similar to those in JavaScript. Proponents of Python laud the concise, clear, and readable syntax. The simplicity of its language makes it a popular first language for burgeoning developers who want to start coding immediately.&lt;/p&gt;

&lt;p&gt;Now I wonder, will their similarities only confuse me? So I'm putting together my first Python primer—a simple cheat sheet designed to help me (and maybe you!) leverage our JavaScript knowledge to get a head start in Python.&lt;/p&gt;




&lt;p&gt;This list will work backward: from the most similar to the drastic differences. Of course, I'll focus on the aspects I think will confuse &lt;strong&gt;me&lt;/strong&gt; the most. &lt;/p&gt;

&lt;h2&gt;
  
  
  Straight Across Similarities
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;High Level Interpreted Programming Languages&lt;/li&gt;
&lt;li&gt;Support functional and imperative paradigms &lt;/li&gt;
&lt;li&gt;Lexical Scoping&lt;/li&gt;
&lt;li&gt;Object Oriented&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Primitive Data-Types
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Strings: sequences of characters wrapped in quotes, immutable.&lt;/li&gt;
&lt;li&gt;Numbers: Python differentiates integers (&lt;code&gt;int&lt;/code&gt;) and decimals (&lt;code&gt;float&lt;/code&gt;) vs. JavaScript's singular &lt;code&gt;Number&lt;/code&gt; type.&lt;/li&gt;
&lt;li&gt;Booleans: JavaScript has &lt;code&gt;true&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt;, Python &lt;code&gt;True&lt;/code&gt;, &lt;code&gt;False&lt;/code&gt;, and a &lt;code&gt;bool()&lt;/code&gt; function.&lt;/li&gt;
&lt;li&gt;No Value: Python employs a simple &lt;code&gt;None&lt;/code&gt; in place of JavaScript's &lt;code&gt;null&lt;/code&gt; and &lt;code&gt;undefined&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Functional Equivalents
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Javascript&lt;/th&gt;
&lt;th&gt;Python&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cases&lt;/td&gt;
&lt;td&gt;🐪 camelCase 🐪&lt;/td&gt;
&lt;td&gt;🐍 snake_case 🐍&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Console Logs&lt;/td&gt;
&lt;td&gt;console.log('hello')&lt;/td&gt;
&lt;td&gt;print('hello')&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pseudocode&lt;/td&gt;
&lt;td&gt;&lt;code&gt;// single line&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;# single line&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;And when you can't be concise&lt;/td&gt;
&lt;td&gt;/* multi - line*/&lt;/td&gt;
&lt;td&gt;''' multi - line '''&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[collections]&lt;/td&gt;
&lt;td&gt;[array]&lt;/td&gt;
&lt;td&gt;[list]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;{key - value structure}&lt;/td&gt;
&lt;td&gt;{object}&lt;/td&gt;
&lt;td&gt;{dict}&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  Conditionals
&lt;/h4&gt;

&lt;h6&gt;
  
  
  if...else if...else  vs  if…elif…else
&lt;/h6&gt;

&lt;p&gt;This one had me laughing at first. Python takes simplicity to the extreme with "elif"...because "else if" is &lt;em&gt;just too long&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So this JavaScript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rainy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;====&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sunny&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;It's a great day to go outside!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cloudy&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;It might be a good idea to carry an umbrella.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rainy&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Don't forget your umbrella!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Be prepared for anything&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Becomes this in 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="n"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;rainy&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sunny&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&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 a great day to go outside!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cloudy&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;It might be a good idea to carry an umbrella, just in case.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;weather&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rainy&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Don&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;t forget your umbrella!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Weather condition is unknown. Stay prepared for anything!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice anything else strange in the code above? Maybe some unfamiliar syntax?&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%2Fjsl0uumcniakazcgz5wb.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%2Fjsl0uumcniakazcgz5wb.png" alt="'AND NOW FOR SOMETHING COMPLETELY DIFFERENT' graphic from Monty-Python's Flying Circus" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  This is where I know I'll get confused
&lt;/h5&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&gt;

&lt;p&gt;Python formatting relies on whitespace. Indentations take the place of semicolons and parentheses. Code block separated with new lines and colons, with curly braces relegated to the key-value {dict} mentioned above. Advocates say this all works in favor of Python's famous simplicity, but I fear this clean code lacks the clarity found in JavaScript. &lt;/p&gt;

&lt;h3&gt;
  
  
  Declaration
&lt;/h3&gt;

&lt;p&gt;Although on its face a simple rule, I chose to put the differences in variable declaration last in this list. Initiating with &lt;code&gt;var&lt;/code&gt; was the first thing I learned in JavaScript, so it feels unnatural leaving it (along with &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt;) out of variable creation. &lt;/p&gt;

&lt;p&gt;We'll still need to declare functions. In Python, JavaScript's &lt;code&gt;function&lt;/code&gt; keyword is replaced with &lt;code&gt;def&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Transitioning from JavaScript to Python offers a unique blend of familiarity and challenge. With its clear syntax and versatility, Python offers an approachable yet powerful language for developers, especially those looking to expand their coding toolkit. As I continue to explore, it’s reassuring to know that with a solid foundation in JavaScript, I'm well on my way to becoming a "snake charmer".&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://python.plainenglish.io/python-101-for-javascript-developers-e7f1987f825e" rel="noopener noreferrer"&gt;Python 101 for JavaScript Developers&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.freecodecamp.org/news/learn-python-for-javascript-developers-handbook/#heading-3-syntax-and-language-features" rel="noopener noreferrer"&gt;How to Learn Python for JavaScript Developers&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/python/python_booleans.asp" rel="noopener noreferrer"&gt;W3schools Python Booleans&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/python/python_intro.asp" rel="noopener noreferrer"&gt;W3schools Python Introduction&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.canva.com" rel="noopener noreferrer"&gt;Image created with Canva&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Strings -- Manipulating the Immutable.</title>
      <dc:creator>Mary Alice</dc:creator>
      <pubDate>Fri, 15 Nov 2024 21:38:20 +0000</pubDate>
      <link>https://dev.to/maryalice/strings-manipulating-the-immutable-253a</link>
      <guid>https://dev.to/maryalice/strings-manipulating-the-immutable-253a</guid>
      <description>&lt;h2&gt;
  
  
  String Theory
&lt;/h2&gt;

&lt;p&gt;In the beginning, we learn about data types. Simple and Complex. Primitive and abstract.&lt;/p&gt;

&lt;p&gt;Primitive is &lt;em&gt;inherently&lt;/em&gt; simple. Two categories are reserved for the alphanumeric characters we are introduced to as children, and the third would not be out of place on a grade school worksheet. &lt;/p&gt;

&lt;p&gt;This permanence is the defining difference between primitive and complex data. Immutability the explicit characteristic of simple data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So how does one one manipulate the immutable?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Methods: Destruction and Creation
&lt;/h2&gt;

&lt;p&gt;JavaScript Methods are “built in” functions that are associated with specific data types. When first learning the basic methods, I wasn't sure if (or when) syntax required an assignment operator. &lt;/p&gt;

&lt;p&gt;The method's manner of data manipulation dictates the presence of an assignment. Destructive methods (🚫 =) manipulate data in place, while non-destructive (✅ =) create new values. &lt;/p&gt;

&lt;p&gt;Simply put, &lt;em&gt;all&lt;/em&gt; string methods are returning a new variable or data value. The original string remains immutable. They all will have assignment operators and return values. &lt;/p&gt;

&lt;h2&gt;
  
  
  Basic String Methods
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;.length&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;returns the length of a string&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = ‘simple’;
var len = str.length;
console.log(len); // logs 6 to the console
console.log(str); // logs 'simple'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;.concat()&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;joins two or more strings&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str1 = 'simple simon';
var str2 = 'pie man';

// string to be concatenated takes joiners
var combo = str1.concat(' met a ', str2); 

console.log(combo) // 'simple simon met a pie man'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;.split&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;returns an array&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = 'A,B,C'

// takes in optional separator
var arr = str.split(',')
console.log(arr)// ["A","B","C"]

// empty quotes returns each value as an index
var arr = str.split('')
// returns["A",",","B",",","C"]

// no separator returns whole string at [0]
var arr = str.split()
// ["A,B,C"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;u&gt;Extraction Methods&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;return a specified portion of a string&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.slice&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = 'simple simon'
// takes a start and end parameter (non-inclusive)
var portion = str.slice(0, 6) // start at 0 index, stop before 6
console.log(portion) // logs 'simple' to the console

// returns empty if start &amp;gt; end
var portion = str.slice(3, 2) // start at 3 index, end before 2
console.log(portion) // logs '' to the console


// negative numbers start count at the end of the string
// lack of stop value indicates portion extends to end of string
var portion = str.slice(-5) // start at 5th index from end
console.log(portion) // logs 'simon' to the console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;.substring&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = 'simple simon'

// like slice (start, end) but &amp;lt;0 is treated as 0
var portion = str.substring(-5)
console.log(portion) // logs 'simple simon' to the console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;.substr&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = 'simple simon'

// takes (start, length) 
// use in place of .slice when end &amp;lt; start 
var portion = str.substr(3, 2) // start at 3 index, take 2 characters
console.log(portion) // logs 'pl' to the console

// negative numbers start parameter like slice
// negative length treated as 0 characters
var portion = str.substr(-1, 1) // start at -1, return 1 character
console.log(portion) // logs 'n' to the console

var portion = str.substr(2, -5) // 
console.log(portion) // logs '' to the console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Simply Transformative
&lt;/h2&gt;

&lt;p&gt;In JavaScript, manipulation is not an exact synonym for how we use it in regular communication. The change occurs because a new value is created, but the original data is retained. &lt;/p&gt;

&lt;p&gt;Although seemingly simple at first, these methods become vital down the road. For example, when looping an array of strings, the methods used on each iteration will be those of strings, not of arrays. Like it's components, string manipulation is straight forward and valuable. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Image Credit&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://eloquentjavascript.net/02_program_structure.html" rel="noopener noreferrer"&gt;Eloquent JavaScript&lt;/a&gt; &lt;/p&gt;

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