Tag: Ruby

  • Procs, lambdas, and performance

    The author explores the performance of blocks, procs, and lambdas in Ruby through benchmarking. Initial tests showed blocks to be slower due to method call overhead. After refining the approach, benchmarks indicated that while blocks improved, procs and lambdas remained consistently faster, highlighting the importance of method usage in performance.

  • 99 bottles – go and ruby

    For whatever reason, I thought of a practice problem that we did at Turing today of writing something that will print the song “99 Bottles of Beer”. I think it was a reference someone made to redoing flashcards? I don’t know, it’s not important. Anyway, I went looking for it on my computer because I…

  • Selenium in Rails

    In this content, the author shares their experience integrating automated testing using Selenium in a Rails application. They describe setting up a new Rails project, configuring necessary gems, and creating a contact form with JavaScript functionality. Two tests are illustrated: one checks successful message submission, and the other validates email format.

  • Classes in C#

    The content discusses creating a simple class “Person” in Ruby and C#. In Ruby, it utilizes attr_reader, initializing attributes and defining a method to display information. In C#, it requires defining public properties, using “get” and “set,” and employs Console.WriteLine for output. The implementation demonstrates language-specific differences succinctly.

  • Dynamic vs Static

    The author contrasts C# and Ruby, highlighting C# as a static, compiled language and Ruby as dynamic and interpreted. C# requires variable types to be declared at compile time, catching errors early, while Ruby allows runtime type changes, leading to potential runtime errors. Each language suits different needs: Ruby for speed in small tasks, C#…

  • Method/Function in Ruby and C#

    The author compares method implementation between Ruby and C#. They demonstrate creating a simple addition method and checking for odd numbers in both languages. Ruby’s syntax is more concise with built-in methods, while C# requires explicit logic for operations. The author appreciates C#’s detailed visibility in code structure.

  • C# and Ruby

    I’m thinking that the next few posts are going to focus on the similarities between C# and Ruby, as I work through my notes from being onboarded into a project using C# and .NET. One of the main differences is that C# is a ‘statically typed’ language. It requires explicit declarations, and everything is checked…

  • Linked List

    I have pretty much covered the linked list, at least for now. I know there is more stuff to add. This was interesting to revisit, and I started at the beginning of mod3 and am finishing it in mod4. Going through this, there are some things I would definitely change, but this is an interesting…

  • Includes & Find

    These are the last two methods I’ll probably write about in this linked list series. You know the drill by now, so here are the tests (I’m giving you all of them at once, apologies for the big code block) Alright, so there are quite a few edge cases for find, so we will start…

  • pop & shift

    This post discusses implementing two methods, pop and shift, for a linked list. The pop method removes the last node while shift removes the head node. Tests are created to validate both methods’ functionalities, including handling empty lists and single-element lists. Future improvements to the stringify method are also suggested.