<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Joseph Hoppe on Medium]]></title>
        <description><![CDATA[Stories by Joseph Hoppe on Medium]]></description>
        <link>https://medium.com/@JosephHoppe?source=rss-bc1b7e5fd22f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_r5-oRun8MCzRcdKCLMc_g.jpeg</url>
            <title>Stories by Joseph Hoppe on Medium</title>
            <link>https://medium.com/@JosephHoppe?source=rss-bc1b7e5fd22f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:10:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@JosephHoppe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Will AI Affect the Cost of Software Development in 2026?]]></title>
            <link>https://medium.com/@JosephHoppe/lets-say-your-software-engineer-earns-155-000-year-cdbd2b6b63f1?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdbd2b6b63f1</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 22:27:03 GMT</pubDate>
            <atom:updated>2026-01-16T21:52:59.671Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s say your software engineer earns <strong>$155,000/year.</strong></p><p>If AI gives him or her <strong>20% productivity gains</strong> –<br> And you spend <strong>$1k in AI tools per developer</strong> –</p><p><strong>You may argue that he is now worth 20% less</strong>, $124,000/year. Yes, his benefits package may be 30% of his salary. But there is also value in having full-time employees on staff.</p><p><strong>Costs</strong></p><p><strong>If you factor in the cost of AI, that may raise your spend from $124k to $125k.</strong></p><p>As the technologies improve and economies of scale kick in, the cost of AI tools may decrease.</p><p>But with the current trends in the factors below, <strong>I only see the cost of AI tooling increasing:</strong></p><ul><li>AI tool training</li><li>Vendor lock-in</li><li>Rising compute, hardware, and energy costs</li></ul><p><strong>What do we do with newfound efficiency?</strong></p><p>Let’s not forget that in a capitalist society, <strong>society doesn’t truly reap productivity gains</strong>. It instead <strong>aggressively implements them to compete with each other</strong>. We do not lazily enjoy our new efficiencies.</p><p>If the costs rise from $1k per developer to $10k, that increases your cost from $125k to $135k.</p><p>In this post, we decreased the cost of software development from $155k to $135k.</p><p><strong>What we’ve really done is shift revenue from software developers to AI tooling… which requires new jobs, including software developers, to build them.</strong></p><p><strong>Supply of Developers</strong></p><p>We’re also scaring the youth away from learning software development, <strong>increasing scarcity.</strong></p><p>Let’s not get into politics — But in the USA: the recent changes in H1-B Visas, and anti-immigration policies may <strong>slowly decrease the number of developers in the country</strong>.</p><p><strong>Thirst for Software Development</strong></p><p>We’ve had a seemingly endless thirst for software development. Tickets in the backlog are often never gotten to. Tech debt does not get addressed. Aside from investment money being redirected to other technologies, <strong>will the demand for software development ever decrease</strong>?</p><p>Outsourcing, offshoring, near-shoring, remote work… It’s always been an interesting time to be a software engineer!</p><p><em>Originally posted on </em><a href="https://dev.to/joehoppe/how-will-ai-affect-the-cost-of-software-development-in-2026-a22/edit"><em>dev.to</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdbd2b6b63f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing a Really Simple Neuron in TypeScript]]></title>
            <link>https://medium.com/@JosephHoppe/developing-a-really-simple-neuron-in-typescript-3d26591dcadd?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d26591dcadd</guid>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 00:41:28 GMT</pubDate>
            <atom:updated>2025-07-23T00:41:28.598Z</atom:updated>
            <content:encoded><![CDATA[<p>Neural networks, at their core, are complex systems built from simple mathematical units called neurons (or perceptrons).</p><p>Today, we will implement a very simple neuron in TypeScript.</p><p>For context, a neural network is composed of one or more layers. Each layer is composed of one or more neurons. But we’ll save neural network layers for another blog post.</p><h3>Building a Simple Neuron / Perceptron</h3><p>The simplest form of a neuron is the <em>perceptron</em>. Let’s create a perceptron service:</p><pre>export class PerceptronService {<br>  #weights: number[];<br><br>  constructor(<br>    private activationService: BinaryStepService,<br>    inputSize: number = 0,<br>  ) {<br>    this.#weights =<br>      inputSize &gt; 0 ? Array(inputSize).fill(0).map(() =&gt; Math.random() * 2 - 1) : [];<br>  }<br>}</pre><h3>Inputs, Weights, Biases, and Random Initialization</h3><ul><li><strong>Inputs:</strong> A neuron takes one or more inputs. Each input is evaluated against a corresponding, preconfigured weight.</li><li><strong>Weights:</strong> Weights determine how much influence each input has on the neuron’s output. In a future post, we’ll <em>train</em> the network by tweaking weights to improve output quality.</li><li><strong>Random Initialization:</strong> We initialize weights randomly within the range -1 to 1 to ensure the model starts in a state producing <em>seemingly random</em> responses. Training then adjusts these weights.</li><li><strong>Bias:</strong> Many neurons use a bias term instead of a threshold. For simplicity, we will omit bias here.</li></ul><h3>Activation Functions: Binary Step Activation</h3><p>A neuron must decide whether to “fire,” a process called <strong>activation</strong>.</p><p>One of the simplest activation functions is the <strong>binary step function</strong>.</p><p>It compares the input against a threshold: if the input exceeds the threshold, the neuron activates by returning 1; otherwise, it returns 0.</p><pre>export class BinaryStepService {<br>  constructor(private threshold: number = 0) {}<br>  activate(input: number): number {<br>    return (input &gt; this.threshold) ? 1 : 0;<br>  }<br>}</pre><p>The threshold controls sensitivity: lower values make the neuron more likely to fire, higher values make it more selective.</p><h3>Predictions — What the Neuron Does with Inputs and Weights</h3><p>Neurons compute a weighted sum of inputs and decide activation based on it.</p><p>Typical process:</p><ol><li><strong>Dot Product Calculation:</strong> Multiply each input by its weight and sum the results (see below).</li><li><strong>Activation:</strong> If the dot product exceeds the threshold, the activation function returns 1, else 0.</li></ol><pre>predict(inputFeatures: number[]): number {<br>  if (this.#weights.length === 0) {<br>    throw new Error(&#39;Weights not set or initialized&#39;);<br>  }<br>  <br>  if (inputFeatures.length !== this.#weights.length) {<br>    throw new Error(`Input features length (${inputFeatures.length}) does not match weights length (${this.#weights.length})`);<br>  }<br><br>  const dotProduct = this.dotProduct(inputFeatures, this.#weights); <br>  return this.activationService.activate(dotProduct);<br>}</pre><h3>Dot Product — The Core of the Computation</h3><p>The dot product performs the weighted sum: multiply paired input and weight values, then sum them.</p><p>Every neuron performs this calculation. Neural networks may optimize or customize it.</p><pre>private dotProduct(a: number[], b: number[]): number {<br>  if (a.length !== b.length) {<br>    throw new Error(&#39;Vectors must have the same length&#39;);<br>  }<br><br>  return a.reduce((sum, val, i) =&gt; sum + val * b[i], 0);<br>}</pre><h3>Weight Management</h3><p>Training updates weights, so external algorithms need access:</p><pre>setWeights(weights: number[]): void {<br>  this.#weights = weights;<br>}<br>getWeights(): number[] {<br>  return [...this.#weights];<br>}</pre><p>The getter returns a copy to prevent accidental modifications.</p><h3>Putting It All Together</h3><p>Complete code with usage examples:</p><pre>export class BinaryStepService {<br>  constructor(private threshold: number = 0) {}<br><br>  activate(input: number): number {<br>    return (input &gt; this.threshold) ? 1 : 0;<br>  }<br>}<br><br>export class PerceptronService {<br>  #weights: number[];<br><br>  constructor(<br>    private activationService: BinaryStepService,<br>    inputSize: number = 0,<br>  ) {<br>    this.#weights =<br>      inputSize &gt; 0 ? Array(inputSize).fill(0).map(() =&gt; Math.random() * 2 - 1) : [];<br>  }<br><br>  setWeights(weights: number[]): void {<br>    this.#weights = weights;<br>  }<br>  <br>  getWeights(): number[] {<br>    return [...this.#weights];<br>  }<br><br>  predict(inputFeatures: number[]): number {<br>    if (this.#weights.length === 0) {<br>      throw new Error(&#39;Weights not set or initialized&#39;);<br>    }<br>    <br>    if (inputFeatures.length !== this.#weights.length) {<br>      throw new Error(`Input features length (${inputFeatures.length}) does not match weights length (${this.#weights.length})`);<br>    }<br><br>    const dotProduct = this.dotProduct(inputFeatures, this.#weights); <br>    console.log(dotProduct);<br>    return this.activationService.activate(dotProduct);<br>  }<br><br>private dotProduct(a: number[], b: number[]): number {<br>    if (a.length !== b.length) {<br>      throw new Error(&#39;Vectors must have the same length&#39;);<br>    }<br><br>    return a.reduce((sum, val, i) =&gt; sum + val * b[i], 0);<br>  }<br>}</pre><h3>Example: Neuron Does Not Fire / Activate</h3><pre>// Activation threshold at 0.7; neuron fires only if weighted sum &gt; 0.7<br>const activation = new BinaryStepService(0.7);<br>const neuron = new PerceptronService(activation, 2);<br><br>neuron.setWeights([0.5, 0]);<br><br>const output = neuron.predict([0.8, 0.4]);<br>console.log(`Neuron output: ${output}`);</pre><p><strong>Output:</strong></p><pre>Neuron output: 0 (is not activated)</pre><p><strong>Explanation:</strong></p><ul><li>Input 1: 0.8 × Weight 1: 0.5 = 0.4</li><li>Input 2: 0.4 × Weight 2: 0 = 0</li><li>Sum = 0.4 + 0 = 0.4 &lt; threshold 0.7 → no activation</li></ul><h3>Example: Neuron Fires After Weight Update (“Training”)</h3><pre>neuron.setWeights([0.5, 0.9]);  // Increase second weight to 0.9<br>const output2 = neuron.predict([0.8, 0.4]);<br>console.log(`Neuron output: ${output2}`);</pre><p><strong>Output:</strong></p><pre>Neuron output: 1</pre><p><strong>Explanation:</strong></p><ul><li>0.8 × 0.5 = 0.4</li><li>0.4 × 0.9 = 0.36</li><li>Sum = 0.76 &gt; threshold 0.7 → neuron fires</li></ul><h3>Why TypeScript? Why Not Python?</h3><p>Python is the industry standard for AI and neural networks, boasting strong libraries and community support.</p><p>However, this is a quick prototype for TypeScript developers to get a clear conceptual start.</p><p>For production or intensive research, I recommend Python due to its mature ecosystem (NumPy, TensorFlow, PyTorch, etc.), but TypeScript is excellent for learning.</p><p>This blog was originally published on <a href="https://dev.to/joehoppe/neural-networks-developing-a-really-simple-neuron-in-typescript-4fc1">dev.to</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d26591dcadd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Universal Language Translator with Python and LangChain]]></title>
            <link>https://medium.com/@JosephHoppe/building-a-universal-language-translator-with-python-and-langchain-a774d0a4ac09?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a774d0a4ac09</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[translation]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Sat, 12 Jul 2025 01:57:30 GMT</pubDate>
            <atom:updated>2025-07-12T01:57:30.041Z</atom:updated>
            <content:encoded><![CDATA[<p>Want to convert any text into any language? Let’s create a simple Python script to do it!</p><h3>What We’re Building</h3><p>Our translator will be a Python script that:</p><ul><li>Prompts the user to specify their target language</li><li>Accepts text input for translation</li><li>Uses OpenAI’s GPT model through LangChain to perform the translation</li></ul><p>With the Artificial Intelligence APIs available today, it is incredibly simple.</p><p>Instead of validating the name of the language that the user inputs, let’s leave it open-ended for some creativity. I.e., we can translate to natural language descriptions such as “Spanish,” “French,” or “Shakespearean English”, or even “Chandler Bing” (from the TV show Friends).</p><h3>Prerequisites</h3><p>Before we dive in, you’ll need:</p><ul><li>Python 3 installed on your system. This was written with 3.13.</li><li>An OpenAI API key (available at <a href="http://platform.openai.com/">platform.openai.com</a>)</li></ul><p>I purchased $5 worth of OpenAI credits to play around with.</p><h3>Setting Up Your Environment</h3><p>First, let’s install the required dependencies. Open your terminal and run:</p><p>pip install langchain-openai python-dotenv</p><p>This blog post was written with these specific package versions:</p><pre>pip install langchain==0.3.15 python-dotenv==1.0.1</pre><p>These packages provide:</p><ul><li>langchain-openai: Integration between LangChain and OpenAI’s models</li><li>python-dotenv: Loading the environment variables from a .env file</li></ul><p>Next, create a .env file in your project directory to store your OpenAI API key securely:</p><pre>OPENAI_API_KEY=your_api_key_here</pre><p>Replace your_api_key_here with your actual OpenAI API key. This approach keeps sensitive information out of your source code.</p><h3>The Translation Script</h3><pre>from dotenv import load_dotenv<br>from langchain_openai import ChatOpenAI<br>from langchain_core.messages import HumanMessage, SystemMessage</pre><pre>load_dotenv()</pre><pre>language = input(&quot;Enter the language to translate into: &quot;).strip()<br>text_to_translate = input(&quot;Enter the text to translate: &quot;).strip()</pre><pre>try:<br>    model = ChatOpenAI(model=&quot;gpt-4o-mini&quot;)<br>    messages = [<br>        SystemMessage(&quot;You are a translator. Translate the given text into the specified language. Respond with the translation and no other text.&quot;),<br>        HumanMessage(f&quot;Translate &#39;{text_to_translate}&#39; into {language}&quot;),<br>    ]<br>    print(model.invoke(messages).content)<br>except Exception as e:<br>    print(f&quot;Translation failed: {e}&quot;)</pre><h3>Breaking Down the Code</h3><p>Let’s examine each component of our translator:</p><h4>Environment Setup</h4><pre>from dotenv import load_dotenv<br>load_dotenv()</pre><p>The load_dotenv() function reads our .env file and makes the OpenAI API key available to the application without hardcoding sensitive information.</p><p>load_dotenv()</p><p>load_dotenv()```</p><p>The load_dotenv() function reads our .env file and makes the OpenAI API key available to the application without hardcoding sensitive information.</p><h4>User Input Collection</h4><pre>language = input(“Enter the language to translate into: “).strip()<br>text_to_translate = input(“Enter the text to translate: “).strip()</pre><p>We collect two pieces of information from the user: the target language and the text to translate. The .strip() method removes any leading or trailing whitespace.</p><h4>Model Initialization</h4><pre>model = ChatOpenAI(model=”gpt-4o-mini”)</pre><p>There is a whole world of AI models to choose from. Let’s choose gpt-4o-mini.</p><h4>Message Construction</h4><pre>messages = [<br>        SystemMessage(&quot;You are a translator. Translate the given text into the specified language. Respond with the translation and no other text.&quot;),<br>        HumanMessage(f&quot;Translate &#39;{text_to_translate}&#39; into {language}&quot;),<br>]</pre><p>LangChain uses a message-based approach. The SystemMessage provides instructions to the model, while the HumanMessage contains the actual text to translate.</p><h4>Translation and Output</h4><pre>print(model.invoke(messages).content)</pre><p>We invoke the model with our messages and print the translated content directly to the console.</p><h4>Error Handling</h4><p>The try-except block ensures our application handles errors gracefully:</p><pre>try:<br>    # Translation logic<br>except Exception as e:<br>    print(f&quot;Translation failed: {e}&quot;)</pre><p>This catches various potential issues such as network connectivity problems, API rate limits, or invalid API keys.</p><h3>Running Your Translator</h3><p>Save the script as translate.py and run it from your terminal:</p><p>python3 translate.py</p><p>The script will prompt you for:</p><ol><li>Target language (e.g., “French,” “Japanese,” “Italian”)</li><li>Text to translate</li></ol><p>Example interactions:</p><pre>python3 .\translate.py<br>Enter the language to translate into: Spanish<br>Enter the text to translate: Where is the black cat?<br>¿Dónde está el gato negro?</pre><pre>python3 .\translate.py<br>Enter the language to translate into: Chandler Bing<br>Enter the text to translate: Did you go to the store today<br>Could I *be* any more curious if you hit up the store today?</pre><h3>Cost Considerations</h3><p>The OpenAI API charges based on token usage. The more you run this script, the more of your OpenAI credits you will use!</p><h3>Conclusion</h3><p>Building a universal language translator with Python and LangChain demonstrates the power of modern AI tools in solving real-world problems. With just a few lines of code, we’ve created a flexible translation system that can handle any language pair and provides natural, contextually appropriate translations.</p><p>The simplicity of this approach makes it an excellent starting point for more complex multilingual applications. Whether you’re building a customer service tool, a content management system, or a personal productivity app, this foundation can be extended to meet your specific needs.</p><p>And remember — AI doesn’t always get it right!</p><p>Here is <a href="https://github.com/joehoppe/universal-translator">my GitHub repository with the Universal Translator script</a>.</p><p>This article was originally published on <a href="https://dev.to/joehoppe/building-a-universal-language-translator-with-python-and-langchain-212h">dev.to</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a774d0a4ac09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing VPN Connectivity Issues with T-Mobile Home Internet]]></title>
            <link>https://medium.com/@JosephHoppe/fixing-vpn-connectivity-issues-with-t-mobile-home-internet-7ff8b1169abd?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ff8b1169abd</guid>
            <category><![CDATA[network-connectivity]]></category>
            <category><![CDATA[aws-vpc]]></category>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[t-mobile-home-internet]]></category>
            <category><![CDATA[vpn]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Sat, 07 Jun 2025 13:23:20 GMT</pubDate>
            <atom:updated>2025-11-22T00:42:42.754Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been happy with <strong>T-Mobile Home Internet</strong>. I use it for remote work, and my family often streams a couple of TV shows, all concurrently, without any issues. About two weeks ago, in May 2025, I started encountering “<strong>server took too long to respond</strong>” errors when accessing cloud resources such as <strong>AWS OpenSearch </strong>or a <strong>PostGresSQL database</strong>. After researching online, it appears to be a common error for T-Mobile Home Internet users. Here is a step-by-step guide on how to restore your connectivity.</p><p><strong>Nov 18 2025 Update:</strong> Added Remote PostGresSQL databases as another component that may experience issues, and that this article resolves.</p><p><strong>The Problem: T-Mobile Home Internet + VPN = Timeouts</strong></p><p><strong>Scenario:</strong> You can connect to your VPN, and the VPN tunnel establishes successfully. But when accessing cloud resources, you get timeout errors in your browser. When you try to access the same resources over other ISPs, they work smoothly without any issues.</p><p>Connecting over a T-Mobile hotspot worked, maybe, once or twice, but no more than that.</p><p><strong>Root Cause:</strong> From what I’m reading, T-Mobile Home Internet uses Carrier-Grade NAT (CGNAT), which adds packet overhead and can interfere with VPN traffic, especially when using standard MTU sizes.</p><p><strong>Initial Symptoms and Diagnostics</strong></p><p><strong>What Works vs. What Doesn’t</strong></p><p><strong>✅ Working:</strong></p><ul><li>The VPN connection establishes successfully</li><li>Basic network connectivity through VPN</li><li>Command-line tools like curl and openssl s_client can connect</li><li>Resources accessible when using other ISPs</li></ul><p><strong>❌ Not Working:</strong></p><ul><li>Browser requests to web applications result in timeout errors (in this case, with AWS OpenSearch over VPC)</li><li>Specific error: “server took too long to respond”</li><li>Interactive dashboards and web interfaces fail to load</li><li>Database queries result in: “The connection attempt failed. SSL error: Read timed out”.</li></ul><p><strong>Initial Diagnostic Commands</strong></p><p>Before diving into solutions, establish what’s working:</p><blockquote># Test SSL/TLS connection (this often works)</blockquote><blockquote>openssl s_client -connect your-resource.amazonaws.com:443</blockquote><blockquote># Test HTTP connection (this usually hangs)</blockquote><blockquote>curl -I <a href="https://your-resource.amazonaws.com/path">https://your-resource.amazonaws.com/path</a></blockquote><p>At first, this stumped me. How can I connect to the port, but not get a response from a CURL HTTP request?</p><p>If openssl s_client works but curl hangs, it indicates that it is an application-layer timeout issue, not a transport/network connectivity problem.</p><p><strong>If this is not your issue, or the solution below does not resolve your issue, some suggestions are:</strong></p><ul><li>Review your ACL/IAM permissions</li><li>Try different DNS servers</li></ul><p><strong>The Solution: MTU Optimization</strong></p><p><strong>Understanding the MTU Problem</strong></p><p><strong>Maximum Transmission Unit (MTU)</strong> determines the largest packet size that can be transmitted over a network, without fragmentation. T-Mobile’s CGNAT infrastructure adds overhead to packets, causing fragmentation when using standard MTU sizes (1500 bytes).</p><p><strong>The Fix:</strong> Reduce the MTU on your VPN tunnel interface to accommodate T-Mobile’s packet overhead.</p><p><strong>Step-by-Step MTU Fix</strong></p><p><strong>Step 1: Identify Your VPN Interface</strong></p><p><strong>After connecting to your VPN</strong>, find the tunnel interface. We will modify the VPN interface settings directly. This will allow us to connect these cloud resources over VPN, while maintaining the default, optimal setting for most other use cases.</p><p>Searching for `tun` is commonly used to find VPN tunnels:</p><blockquote># On macOS/Linux:</blockquote><blockquote>ifconfig | grep -A 2 tun</blockquote><blockquote># Look for an interface with your VPN IP, example output:</blockquote><blockquote># utun4: flags=8051&lt;UP,POINTOPOINT,RUNNING,MULTICAST&gt; mtu 1500</blockquote><blockquote># inet 192.168.123.456 → 192.168.654.987 netmask 0xfxff0f00</blockquote><p><strong>Step 2: Temporarily Set MTU</strong></p><blockquote># Replace ‘utun4’ with your actual interface name</blockquote><blockquote>sudo ifconfig utun4 mtu 1200</blockquote><blockquote># Verify the change:</blockquote><blockquote>ifconfig utun4 | grep mtu</blockquote><p><strong>Step 3: Test Immediately</strong></p><p># Test your connection right after changing MTU:</p><p>curl — connect-timeout 30 — max-time 60 -I <a href="https://your-resource.amazonaws.com/path">https://your-resource.amazonaws.com/path</a></p><p><strong>Step 4: Test in Browser</strong></p><p>Open your browser and try accessing the resource that was previously timing out!</p><p><strong>Step 5: Find Your Optimal MTU</strong></p><p>I am reading that these different networks may require different MTU values, and that these are common values and the context in which to use them:</p><ul><li><strong>1200</strong>: Most conservative, works on nearly all networks</li><li><strong>1300</strong>: Good balance of compatibility and performance</li><li><strong>1380</strong>: Higher performance if it works on your network</li><li><strong>1400</strong>: Maximum recommended for problematic networks</li></ul><p>My connection has been working well with an MTU setting of 1300, and I will play around with increasing it for kicks.</p><p>You may notice that your ethernet or WiFi network adapters may not support an MTU value lower than 1280. But we can make these changes directly on your VPN interface, which will not impact other network connections.</p><p><strong>Step 6: Remember to execute this command each time you connect to your VPN (after establishing the connection)!</strong></p><blockquote># Replace ‘utun4’ with your actual interface name</blockquote><blockquote>sudo ifconfig utun4 mtu 1200</blockquote><p><strong>Making MTU Changes Permanent</strong></p><p>Some VPN clients may support configuring your MTU size. Look for an MTU or “Maximum Segment Size” setting in your VPN client’s configuration.</p><p>My VPN provider did not easily support this, so I execute this command whenever I need to connect to the troublesome resources. This should last for the whole VPN session:</p><blockquote>sudo ifconfig utun4 mtu 1300</blockquote><p><strong>But Why?</strong></p><p><strong>What Happens Without MTU Optimization</strong></p><p>T-Mobile Home uses CGNAT, which creates multiple layers of network address translation.</p><p>Each layer adds packet overhead. The sum of PACKETSIZE + VPN + CGNAT makes the original packet larger than the MTU size (1500). The packets then need to be fragmented into more packets. Received packets must then be reassembled, and if necessary, sorted into the correct order. Now that more packets need to be generated, they are less likely to arrive in the correct order. And if they do not arrive within the TCP timeout window, the HTTP requests will fail.</p><p>If we set the MTU value optimally, the network interfaces do not have to send a large number of small packets, nor reassemble a large number of large packets. This also optimizes the CPU utilization.</p><p><strong>With the original MTU value of 1500, latency may be increased:</strong></p><ul><li>Packet fragmentation: +50–200ms</li><li>Fragment reassembly: +20–100ms</li><li>Retransmission delays: +1000–5000ms (timeouts)</li></ul><p><strong>Why does this affect VPN traffic more than others</strong></p><p>Without visibility into the encrypted network traffic, T-Mobile can’t inspect and optimize the packets, and cannot execute traffic shaping.</p><p><strong>Conclusion</strong></p><p>I resolved my VPN connectivity issue with T-Mobile Home Internet, which is reportedly caused by packet fragmentation due to CGNAT overhead. Reducing the MTU on your VPN tunnel interface to 1200–1400 bytes worked for me.</p><p>Originally published at <a href="https://dev.to/joehoppe/fixing-vpn-and-vpc-connectivity-issues-with-t-mobile-home-internet-4gn1">https://dev.to/joehoppe/fixing-vpn-and-vpc-connectivity-issues-with-t-mobile-home-internet-4gn1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ff8b1169abd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t code a new website for your blog]]></title>
            <link>https://medium.com/@JosephHoppe/dont-code-a-new-website-for-your-blog-e72b2c1a9538?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e72b2c1a9538</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[blogging]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 22:26:34 GMT</pubDate>
            <atom:updated>2024-12-11T22:26:34.470Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Coding your own blog may become more of a nuisance than a fun hobby</strong><br>Like many, I wanted a coding side project to showcase my skills. I decided to code a new website to host my blog.</p><p>It would enable me to post blog entries. It would also give me a landing page to link to my LinkedIn, PluralSight, and LeetCode profiles, and other curated online personas. You may have a few of these, and the links will bloat your resume.</p><p>A blogging website was not my passion. I did not intend to revolutionize the blogging industry.</p><p>And it did become a nuisance.</p><p>My friend showed me <strong>a really simple</strong> alternative.</p><p><strong>And with all of the problems in the world, do you want to spend your time writing code to enable a single person to publish blog articles?</strong></p><h3>A simple alternative — GitHub Pages</h3><p>One day my friend Brandon Boone presented me with a quick and easy way to get a free landing page with a clean subdomain: <a href="https://pages.github.com/">GitHub Pages</a>.</p><p>It can host and serve an HTML page. Or, similar to <a href="http://dev.to/">dev.to</a> — it can convert a Markdown file to markdown with minimal setup. And you get a free GitHub subdomain in the form of <a href="https://_username_.github.io/">https://_username_.github.io</a>.</p><p>You can also easily point a new domain to your GitHub pages with a CNAME record.</p><h3>It’s this easy:</h3><p>1. Clone the new repository</p><blockquote>git clone <a href="https://github.com/username/username.github.io%60">https://github.com/username/username.github.io</a></blockquote><p>2. Create an index.html file with content<br>3. Commit and push<br>4. Launch your favorite browser and navigate to <br> <a href="https://**username**.github.io/">https://**username**.github.io</a>.</p><h3>Want to use Markdown instead of HTML?</h3><p>Unite instead of div.<br>1. Create a README.md with content (instead of an index.html)<br>2. Add this <a href="https://github.com/joehoppe/joehoppe.github.io/blob/main/_config.yml">YAML Jekyll file</a> to the root of your repo</p><pre>theme: jekyll-theme-slate<br>kramdown:<br>  input: Kramdown</pre><h3>Still want to have a blog?</h3><p>Link from the markdown file to your blog or blog posts on an established blogging platform such as [medium.com](medium.com) or [dev.to](dev.to). They will be free, feature-rich, and may even market your posts for you.<br> <br><strong>Don’t code your own blog</strong>. Do something more meaningful with your life. Maybe publish a new GitHub repository to solve a problem that hasn’t been solved yet, join an open-source project, etc.</p><p>Check out <a href="https://joehoppe.github.io/">my simple GitHub Pages landing page</a> at <a href="https://joehoppe.github.io](https://joehoppe.github.io).">https://joehoppe.github.io</a>. Leave a comment with what you think, or suggest improvements to my own!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e72b2c1a9538" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS — Properly delete messages between Lambdas and SQS Queues]]></title>
            <link>https://medium.com/@JosephHoppe/aws-properly-delete-messages-between-lambdas-and-sqs-queues-54db2c55106a?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/54db2c55106a</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[aws-sqs]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Mon, 06 May 2024 00:37:47 GMT</pubDate>
            <atom:updated>2024-05-06T00:37:47.869Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS — Properly delete messages between Lambdas and SQS Queues</h3><p>A lot of people may already know this, but posting for some who need clarity after sifting through the conflicting information that I found on the net.</p><h3><strong>Quick Summary (TLDR)</strong></h3><p>When using <strong>SQS Event Triggers</strong>, the default behavior is that SQS messages will be <strong>automatically</strong> <strong>deleted</strong>. There are certain conditions that also need to be met.</p><p><strong>Prior to the release of SQS Event Triggers in 2018</strong>, the opposite was true — messages used to need to be deleted explicitly, or the message would become visible again after the visibility timeout.</p><p>Back then, a common pattern would be to poll an SQS queue for messages, possibly using a chron lambda trigger. The SQS message would become invisible to other consumers, and when successfully processed, the <strong>lambda would need to explicitly delete the message from the queue.</strong></p><p>Because of this paradigm shift in 2018, there is information on the internet stating that lambdas “automatically delete the message after processing”, and also information that they “do need to manually delete SQS messages”, without clearly specifying. The truth is that it depends on the lambda trigger.</p><p>SQS Events are the de factor trigger for many use cases. To reiterate, for this popular use case today, if specific conditions are met, the lambda will automatically delete the messages on completion.</p><h3><strong>The Backstory (2017 and earlier)</strong></h3><p>Way back when, developers had to manually wire up the code to poll an SQS queue. One approach would be to:</p><ol><li>Have a lambda execute on a chron schedule. Use the ReceiveMessage API to manually poll and retrieve messages.</li><li>After processing the message, the lambda would then be responsible for explicitly deleting the message from the SQS queue using the DeleteMessage API.</li></ol><p>If the message was not deleted, and the message visibility timeout elapses, the message would become visible to other consumers.</p><h3><strong>SQS Event Triggers are released in 2018</strong></h3><p>AWS greatly simplified the process by adding a new event source to streamline this process in 2018. The new process became:</p><ol><li>Create an Event Source Mapping (ESM) connecting the Lambda function to the SQS queue. This triggers the lambda when messages are received, and pushes the messages to the queue as the SQS message body.</li><li>The lambda does not need to explicitly delete the message from the queue.</li></ol><p>No code is needed to explicitly poll the queue or delete the message, and can focus on the core processing logic.</p><h3><strong>More on SQS Event Triggers</strong></h3><p><strong>If I do not need to explicitly delete the SQS messages, why are messages being routed to the Dead Letter Queue (DLQ)?</strong></p><p>If the lambda throws an uncaught error, the message(s) in the batch will be retried after the message visibility timeout. If the maxReceiveCount is met, the message will be routed to DLQ.</p><p><strong>But how do I retry a subset of messages that came in a batch?</strong></p><p>First, ReportBatchItemFailures must be enabled on the lambda trigger itself.</p><p>If a message should <strong>not</strong> be deleted, the lambda must return an <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting">SQSBatchResponse</a> object (if using TypeScript) containing an array of message ids that should <strong>not </strong>be deleted. The return type is below, with itemIdentifier being the messageId:</p><blockquote><em>export interface SQSBatchResponse {</em></blockquote><blockquote><em>batchItemFailures: SQSBatchItemFailure[];</em></blockquote><blockquote><em>}</em></blockquote><blockquote><em>export interface SQSBatchItemFailure {</em></blockquote><blockquote><em>itemIdentifier: string;</em></blockquote><blockquote><em>}</em></blockquote><p>A few more nuances to be aware of (from the AWS Documentation):</p><blockquote>Success and failure conditions</blockquote><blockquote>Lambda treats a batch as a complete success if your function returns any of the following:</blockquote><blockquote>An empty batchItemFailures list</blockquote><blockquote>A null batchItemFailures list</blockquote><blockquote>An empty EventResponse</blockquote><blockquote>A null EventResponse</blockquote><blockquote>Lambda treats a batch as a complete failure if your function returns any of the following:</blockquote><blockquote>An invalid JSON response</blockquote><blockquote>An empty string itemIdentifier</blockquote><blockquote>A null itemIdentifier</blockquote><blockquote>An itemIdentifier with a bad key name</blockquote><blockquote>An itemIdentifier value with a message ID that doesn&#39;t exist</blockquote><p>For more information, see the AWS Documentation on <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting">Reporting partial batch responses</a>, which is a subsection of the page: <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html">Using Lambda with Amazon SQS</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54db2c55106a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overcoming Keyboard Wrist Pain]]></title>
            <link>https://medium.com/@JosephHoppe/overcoming-keyboard-wrist-pain-9b9cfa3ffbdf?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b9cfa3ffbdf</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[wrist-pain]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Sat, 30 Dec 2023 13:19:32 GMT</pubDate>
            <atom:updated>2023-12-30T13:19:32.474Z</atom:updated>
            <content:encoded><![CDATA[<p>TLDR — It turned out that I was sleeping in an awkward position, which put pressure on my wrists. Read more to find out what I tried, how I found this bad habit, and how I stopped.</p><p><strong>When it Started</strong></p><p>As a software developer of about 32 years of age, I started to get wrist pain. I would sit most of the day at my desk, typing away, and they would get dull aches that slightly increased each day. Although I did some overtime, in my opinion it was not enough hours to be the source of the problem.</p><p>I wasn’t sure what caused the pain.</p><p><strong>What I Tried</strong></p><p>I had about an hour commute on the train, each way — 4 days a week. To make the most of it, I regularly pulled out my laptop on the way home. I spent time writing code to sharpen my skill set. I would tether my phone through Bluetooth to my laptop (hot spots cost money back then, and this was a workaround, using PDANet at the time) and bang away on the keyboard.</p><p>Typing on the train could not have been good for my wrists. Being 6&#39;3&quot; did not leave me much room on the NJ Transit trains, either.</p><p>I did take frequent breaks from this activity to see if it would help. Sadly, it did not do much.</p><p>I had an x-rays taken, which confirmed that it was not carpal tunnel syndrome.</p><p>I then bought a <a href="https://www.amazon.com/Freestyle2-Ergonomic-Keyboard-Standard-Separation/dp/B00CMALD3E?th=1&amp;_encoding=UTF8&amp;tag=josephhoppe-20&amp;linkCode=ur2&amp;linkId=5c839c7f5cb0ee153f03c9110acb75e9&amp;camp=1789&amp;creative=9325">Kinesis Freestyle 2 keyboard</a> and a <a href="https://www.amazon.com/gp/product/B0759V6FZC/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&amp;amp;psc=1&amp;_encoding=UTF8&amp;tag=josephhoppe-20&amp;linkCode=ur2&amp;linkId=3a53161862b08a70b02ea4d2f3b65663&amp;camp=1789&amp;creative=9325">J-Tech vertical mouse</a>. They both helped, and I still use them both today. But they did not do enough to get rid of the pain.</p><p>I read about ergonomics. I adjusted my monitor height, stopped using wrist supports, elbow rests, and raised my chair.</p><p><strong>I was worried.</strong></p><p>I thoroughly enjoyed being a software developer and did not know what else I would want to do with my life. Would the pain get worse, and I’d have to find a new career? I had a co-worker who became a manager solely to avoid wrist pain. Would that be me?</p><p><strong>The Root Cause</strong></p><p>Over the years, when I slept, I felt comfort compressing a part of my body. Especially as a youngin, sleeping on my stomach, I would tuck my arms under me. If I slept on my side, I would tuck my hand under my pillow. The pressure was relaxing and likely made me feel “present”.</p><p>We have all heard that our joints hurt more as we get older. And unluckily I learn that more and more each day. But it turns out the pressure I was putting on my wrists in these sleeping positions was causing the pain.</p><p>But how on earth would I stop doing something that I did subconsciously in my sleep? I was very peeved that this was the root cause, because I did not have an idea on how to fix it. Is this something I can even resolve?</p><p>I tried to avoid falling asleep in such a position, but it did not help much. I had not excelled at sleeping since I was a teenager — I roll around a lot, and I would still wind up in these positions.</p><p>It’s hard to change habits that you already have, and this was no exception.</p><p>Thankfully, over time, I found two paths forward.</p><p><strong>Comfy Wrist Braces</strong></p><p>First, I bought <a href="https://www.amazon.com/gp/product/B074MKSSHK/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&amp;amp;th=1&amp;_encoding=UTF8&amp;tag=josephhoppe-20&amp;linkCode=ur2&amp;linkId=f893102481d7fadd81d3ca8a9e93778a&amp;camp=1789&amp;creative=9325">“comfy” wrist braces</a>. They were a little softer than hard Rollerblade wrist guards. They had some fabric covering, but still had a metal insert to give support.</p><p>I put them on at night right before going to sleep for at least 3 months. My wife probably thought I was crazy. Eh, she already did before then.</p><p>It helped some. But I’d still try to tuck them under me. The Velcro and stiffness of the brace would poke me, and wake me up. But they did discourage the behavior.</p><p><strong>The Solution — Arm Positioning while Sleeping</strong></p><p>I roll around in my sleep, so I often sleep on my side, in addition to on my back.</p><p>To avoid poking myself with the braces, I often put my arms at a right angle, or greater, away from my face. This seemed to discourage the infamous tuck I was talking about earlier.</p><p>Over time, I found that if I extended my arm to be at a right angle, or even better — at 90 degrees — I was less likely to tuck them under my pillow.</p><p>After a few months passed, the pain became less and less.</p><p>I took off the braces, and was able to focus more clearly at work.</p><p>I still use the Kinesis keyboard and vertical mouse and still get to do the job I love.</p><p>I am not a doctor, and your mileage may vary. But I am sharing my story in case it helps you, or someone you know.</p><p><strong>Disclaimer</strong></p><p>As an Amazon associate, I may earn from qualifying purchases if you click on the links above. If you purchase item(s) after clicking on these links, this may result in a commission payment to me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b9cfa3ffbdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The free tier of GitHub Codespaces permanently changed my workflows as a developer]]></title>
            <link>https://medium.com/@JosephHoppe/how-the-free-tier-of-github-codespaces-permanently-changed-my-workflows-as-a-developer-b85d61af983b?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b85d61af983b</guid>
            <category><![CDATA[github-codespaces]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Sat, 02 Dec 2023 02:44:17 GMT</pubDate>
            <atom:updated>2023-12-30T13:10:23.034Z</atom:updated>
            <content:encoded><![CDATA[<p>I remember the GitHub Codespaces announcement. It sounded innovative and exciting, but I did not have a specific need for it. I enjoy having a native desktop browser customized with my specific settings. I did not work on microservices that could be easily spun up. I did not do much coding while travelling.</p><p><strong>Comparing Different Files with Each Other on a Pull Request</strong></p><p>Then one day I had to do a code review, and I needed to compare two <strong>different</strong> files. GitHub is great for comparing versions of a single file, but lacks a simple way to compare a file to another in the same branch, or on a different branch.</p><p>I didn’t feel like switching branches locally. Although I’ve been using git for years, on occasion I still forget to stash my changes and have a bunch of merge conflicts. Or I pull a branch into the wrong one locally — creating an annoyance.</p><p>Sometimes I clone the repository to a second directory, but that clutters my recently opened project lists. Or, if I name it poorly, it interferes with my command line auto-complete statements that I am used to using. I can easily rename the other folder, that’s another to do, in addition to deleting it when done.</p><p>Then, I clicked <strong>Open in Codespaces </strong>link on the top right of my PR on github.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*zrFcOTO0WjBH9abayEvXew.png" /></figure><p>It created a new Codespace. which cloned my repository auto-magically in a container in the cloud, in my own browser. In the same tab, I now had VS Code open to the source branch of the pull request. It was loaded, and the keyboard shortcuts were bound within 20 seconds. I used the ‘copy the path to the file’ button on the PR. Then I used the Command+P keyboard shortcut to navigate to the file. VS Code synced the left navigation, so I was able to immediately see the file in the left navigation.</p><p>This was a data fix script prefixed with the date. I shift clicked the file and the adjacent data fix — it was adjacent with a recent date — and clicked compare. <strong>I was able to quickly and easily compare the files using VS Code’s built in file comparison feature.</strong></p><p>Wow… that was a lot easier than cloning the repo IMO. Or switching branches (if you have uncommitted files).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dXJOoqDkQ0SQk7tzbDdUXQ.png" /></figure><p><strong>Fixing Minor Merge Conflicts</strong></p><p>Another day, I had some minor merge conflicts in a PR. The GitHub UI lacked color coding, and can be a pain to fix merge conflicts in.</p><p>I decided to open up Codespaces again. The last time I used Codespaces, I had simply ‘stopped’ my previous Codespace. Since this was on the same repo, I reused the existing Codespace, which preserved some settings tweaks I had done in my last use of the Codespace.</p><p>I clicked the VS Code popup to periodically run fetch. I then ran git checkout branch xyz. I pulled in the target branch to the branch. Using VS Code’s conflict resolution UI, which is superior to github.com’s, I fixed the merge conflicts, committed the changes, and pushed up the changes to the PR — all from the Codespace. I didn’t have to login to GitHub in the Codespace— the Codespace took care of that for me.</p><p>If you have private npm packages, I believe that you would need to set up a token in your workspace if you want to install them.</p><p>GitHub Actions ran my build checks (build and unit tests), and once approved, was ready to merge.</p><p><strong>Final Thoughts</strong></p><ol><li>In general, Codespaces can save time if you do not want to change branches locally.</li><li>If your laptop is broken, you may be able to quickly get back to coding in a Codespace while waiting for it to be fixed.</li><li>It has a free tier. I set my maximum billing allowance on GitHub to be $0, so I can safely use Codespaces without worrying about getting billed, or seeing my employer receive a bill. If you use too many resources in a billing period, Codespaces will let you know, and you won’t incur charges.</li></ol><p>You may prefer your own current workflow. But who doesn’t like options?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b85d61af983b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[State of Linting in TypeScript: August 2023]]></title>
            <link>https://medium.com/@JosephHoppe/state-of-linting-in-typescript-august-2023-551a99e0b3b3?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/551a99e0b3b3</guid>
            <category><![CDATA[linter]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[eslint]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Fri, 04 Aug 2023 20:58:29 GMT</pubDate>
            <atom:updated>2023-08-04T21:01:15.357Z</atom:updated>
            <content:encoded><![CDATA[<p>We’re all familiar with <a href="https://eslint.org/">ESLint</a> and maybe <a href="https://typescript-eslint.io/">TypeScript-ESLint</a>, but what else is out there for TypeScript after <a href="https://www.npmjs.com/package/tslint">TS-Lint</a> was deprecated?</p><p>Here I’ll compare three linting tools: SonarLint, Rome, and TypeScript-ESLint.</p><h3><a href="https://www.sonarsource.com/products/sonarlint/">SonarLint</a></h3><ul><li>Lacks a CLI. Much of the TypeScript / JavaScript community is command line driven, so this is disappointing.</li><li>It instead relies on IDE Plugins, i.e. this <a href="https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarlint-vscode">SonarLint plugin for VSCode</a>. From experience, the VSCode plugin crashes frequently.</li><li>To integrate into a build process, you need to install Java into the build pipeline.</li></ul><p>Final Opinion on SonarLint: As a companion tool for SonarQube, the SonarLint plugin is great. The fact that it crashes frequently is disappointing, but it can pull in analysis from SonarQube. As a standalone linter, I cannot recommend it.</p><p>I do believe you can easily use SonarLint and SonarQube in conjunction with other linters.</p><h3><a href="https://docs.rome.tools/linter/">Rome</a></h3><ul><li>Founded by the creator of Babel and Yarn.</li><li>It is an opinionated tool that does more than linting. Also does formatting and bundling.</li><li>I was shocked that their <a href="https://github.com/rome/tools">GitHub Repo</a> has 24k stars for something that I’ve never heard of.</li><li>It boasts performance improvements over ESLint because it is written in Rust.</li><li>Also boasts that it does not need to trade off accuracy against performance because of its great performance.</li><li>It has a <a href="https://marketplace.visualstudio.com/items?itemName=rome.rome">VS Code Plugin</a> and can be configured as the default formatter for VSCode.</li><li>For IDE support, you are currently locked into VSCode. It does not have WebStorm support, or support for other IDEs. But developers can fall back to npm and command line scripts.</li><li>One feature I found particularly lacking is the lack the ability to annotate the violations directly in pull requests on GitHub. TypeScript-ESLint has this feature.</li><li>It currently has <a href="https://docs.rome.tools/lint/rules/">150 rules</a>.</li></ul><h3>How to setup Rome</h3><ul><li>npm install — save-dev — save-exact rome</li><li>npx rome init</li><li>Rome.json is the config file</li></ul><p>Formatting is enabled by default.</p><h3>Rule Suppressions</h3><p>If you want to ignore a rule as a one off for a single line of code, as opposed to the entire code base, add a comment such as the following. Use the correct rule name, of course.</p><ul><li>// rome-ignore lint/style/noNonNullAssertion: &lt;explanation&gt;</li><li>Use the correct rule name, of course</li><li>The VSCode plugin has a ‘quick fix’ shortcut that will do this.</li></ul><p>To disable a rule entirely, add the rule to rome.json</p><p>“suspicious”: {</p><p>“noCommentText”: “off”</p><p>},</p><p>“style”: {</p><p>“noUnusedTemplateLiteral”: “off”</p><p>}</p><h3>Auto-fix</h3><p>Rome can fix issues that they ‘guarantee’ will not break your code. It can also attempt to auto-fix additional rules (apply-unsafe), but they do not make guarantees on those.</p><p>On a small sample repo, apply-unsafe reduced 128 violations to 82.</p><h3><a href="https://typescript-eslint.io/">TypeScript-ESLint</a></h3><h3>Overview</h3><ul><li>It is a plugin for ESLint</li><li>The GitHub repo has <a href="https://github.com/eslint/eslint">GitHub Repo</a> 24k stars</li><li>It is not recommended to use for formatting code. It recommends using prettier, dprint, or other for tools for formatting.</li></ul><h3>Setup</h3><ul><li><a href="https://typescript-eslint.io/getting-started">https://typescript-eslint.io/getting-started</a></li><li>npm install — save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint typescript</li><li>Create a config file .eslintrc.cjs</li></ul><h3>Rule Suppressions</h3><p>If you want to ignore a rule as a one off, as opposed to the entire code base, add the following comment:</p><ul><li>// eslint-disable-next-line no-use-before-define</li><li>The plugin will allow that was a VS Code ‘Quick Fix’</li></ul><p>To disable a rule for the entire codebase, add the rule to .eslintrc.cjs.</p><p>“eslintConfig”: {</p><p>“rules”: {</p><p>“jsx-a11y/accessible-emoji”: “off”</p><p>}</p><p>},</p><h3>Rule List</h3><ul><li>TypeScript-ESLint currently brags “<a href="https://typescript-eslint.io/rules/">Over 100 rules</a>”</li></ul><h3>Comparison of Rome Tools and TypeScript-ESLint</h3><h3>Rome</h3><h4>Advantages</h4><ul><li>Has surprisingly many GitHub stars.</li><li>Has an active Discord channel.</li><li>Is a viable alternative if you have had a bad experience with ESLint.</li></ul><h4>Disadvantages</h4><ul><li>Documentation and internet presence is sparse.</li><li>It’s unclear how large the community is, but it does have a lot of GitHub stars and an active discord channel.</li><li>I couldn’t find any published rule configurations to pick from. It would be nice to have a few style options and recommendations on which to choose from. But, I couldn’t find any such popular config files.</li></ul><p>One of the best practices for linting is to pick a set of established rules, and do not spend much time debating the rule choices. Even if a rule adds value to your organization, you have to ask, is it enough value to spend time and resources of your organization to evaluate and implement? It is disappointing that Rome does not have this community effort yet.</p><h3>TypeScript-ESLint</h3><h4>Advantages</h4><ul><li>Well known / popular</li><li>Extensions for many IDEs</li><li>Popular, shareable configs exist with different combinations of preset rules. You don’t necessarily need to evaluate all of the rules. There are popular rule config files that you can choose to most closely align with your coding style.</li></ul><p>The shareable configs should lessen the time that is needed to invest in tailoring the rules to your style.</p><ul><li>Renowned author <a href="https://www.amazon.com/Learning-TypeScript-Development-Type-Safe-JavaScript/dp/1098110331">Josh Goldberg</a> (and <a href="https://github.com/JoshuaKGoldberg">TypeScript-ESLint</a> contributor) commented, “You’re considering something other than ESlint?”</li><li>This popular Node best-practices GitHub repository recommends, “Use eslint” <a href="https://github.com/goldbergyoni/nodebestpractices#-31-use-eslint">GitHub — goldbergyoni/nodebestpractices: :white_check_mark: The Node.js best practices list (July 2023)</a></li></ul><p>“ESLint is the de-facto standard for checking possible code errors and fixing code style, not only to identify nitty-gritty spacing issues but also to detect serious code anti-patterns like developers throwing errors without classification. Though ESLint can automatically fix code styles, other tools like prettier are more powerful in formatting the fix and work in conjunction with ESLint.</p><p>Otherwise: Developers will focus on tedious spacing and line-width concerns and time might be wasted overthinking the project’s code style”.</p><h4>Disadvantages</h4><ul><li>Not all ESLint plugins are compatible with TypeScript-ESLint.</li><li>Reviews say that ESLint can be inaccurate because it chooses performance over accuracy. But if a violation is inaccurate, you can always disable that violation for that specific line of code.</li></ul><h3>Conclusion</h3><p>I chose to stick with TypeScript-ESLint, but it’s great to see we have a viable alternative. If you’ve had a bad experience with TypeScript-ESLint, you may want to jump on Rome Tools.</p><p>Hopefully the competing technologies will drive each other forward!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=551a99e0b3b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Removing unnecessary using statements from a large solution is a quick and easy way to improve the…]]></title>
            <link>https://medium.com/@JosephHoppe/removing-unnecessary-using-statements-from-a-large-solution-is-a-quick-and-easy-way-to-improve-the-cb672702f0e6?source=rss-bc1b7e5fd22f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb672702f0e6</guid>
            <category><![CDATA[visual-studio]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[compilers]]></category>
            <dc:creator><![CDATA[Joseph Hoppe]]></dc:creator>
            <pubDate>Fri, 19 Apr 2019 11:13:31 GMT</pubDate>
            <atom:updated>2019-04-19T12:28:43.630Z</atom:updated>
            <content:encoded><![CDATA[<h3>Removing unnecessary using statements from a large solution is a quick and easy way to improve the time it takes to do a build… right?</h3><p>I decided to do an experiment with using statements in the .NET Framework.</p><p>I have a very large solution, and attempted to remove all unnecessary using statements from the it. It may decrease the computing power needed for a build, save on build time, and then I can move from building to testing more quickly. Removing all of the compiler namespace using statements, which are like namespace shortcuts, will be a quick and easy way to surely improve the build time… right?</p><p>In C#, at the top of the file, using directives inform the compiler which namespaces are referred to in the class.</p><pre>using System.Text;<br>using static System.Math;<br>using MyNamespace.MyClass1;</pre><p>The developer can then reference classes in different namespaces without having to write the namespace each time.</p><p>Instead of:</p><pre>System.Math.Sqrt(x);</pre><p>You can write:</p><pre>Math.Sqrt(x);</pre><p>As namespaces can get very long, this can make code much more readable, and quicker to type.</p><p>When you add a class to a project, C# automatically adds some using directives for you to the class. Often, some or all of these using statements are not used by the code you write in the class.</p><pre>using System;<br>using System.Collections.Generic;<br>using System.Linq;<br>using System.Text;<br>using System.Threading.Tasks;</pre><p>As you add code to your class, and later remove it, you often find that you have using statements in your project that are no longer needed. Luckily C# highlights (most) of these for you, and then you can remove that at your will.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/151/1*2rJ4nD8pj3nRsL1cpPZZ2g.png" /><figcaption>The second using directive is not being used, which is indicated by the dimmer font color</figcaption></figure><p>I thought, what if I remove all of these unnecessary using statements? Will it decrease the build time? I could be a hero!</p><p>Here are some details about the solution I tested it on:</p><ul><li>It has over 300 projects</li><li>~3,500 files in the solution</li></ul><p><strong>I removed unnecessary using statements from 1,325 of the files in the solution.</strong></p><p>What impact did it have?</p><p>I took a sample of 20 files from the commit, and found that:</p><ul><li>Some had 12 using statements removed by this exercise</li><li>Some had zero (I used the remove and sort command in PowerCommands for Visual Studio 2017, which sorted the using statements in addition to removing the unnecessary ones)</li><li>The median of these files impacted had 1 using statement removed</li><li>We can then estimate that I removed about a file from all in the commit, so possibly 1,325 using statements!</li></ul><p>Previously, my CI/CD build time often took between 10 and 12 minutes long.</p><p>And… there was no discernible difference in the build time. It may have made it seconds faster… But because the build had a variance of two minutes, it may not be perceivable.</p><p>Well, the code looks cleaner!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb672702f0e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>