Need advice about which tool to choose?Ask the StackShare community!

AWK

546
48
+ 1
0
Ruby

41.3K
21.3K
+ 1
4K
Add tool

AWK vs Ruby: What are the differences?

Developers describe AWK as "A language for text processing, data extraction and reporting". A data-driven scripting language consisting of a set of actions to be taken against streams of textual data – either run directly on files or used as part of a pipeline – for purposes of extracting or transforming text, such as producing formatted reports. On the other hand, Ruby is detailed as "A dynamic, interpreted, open source programming language with a focus on simplicity and productivity". Ruby is a language of careful balance. Its creator, Yukihiro “Matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming.

AWK and Ruby can be primarily classified as "Languages" tools.

AWK and Ruby are both open source tools. Ruby with 16K GitHub stars and 4.29K forks on GitHub appears to be more popular than AWK with 206 GitHub stars and 41 GitHub forks.

According to the StackShare community, Ruby has a broader approval, being mentioned in 3077 company stacks & 6628 developers stacks; compared to AWK, which is listed in 3 company stacks and 7 developer stacks.

Decisions about AWK and Ruby
Andrew Carpenter
Chief Software Architect at Xelex Digital, LLC · | 16 upvotes · 407.7K views

In 2015 as Xelex Digital was paving a new technology path, moving from ASP.NET web services and web applications, we knew that we wanted to move to a more modular decoupled base of applications centered around REST APIs.

To that end we spent several months studying API design patterns and decided to use our own adaptation of CRUD, specifically a SCRUD pattern that elevates query params to a more central role via the Search action.

Once we nailed down the API design pattern it was time to decide what language(s) our new APIs would be built upon. Our team has always been driven by the right tool for the job rather than what we know best. That said, in balancing practicality we chose to focus on 3 options that our team had deep experience with and knew the pros and cons of.

For us it came down to C#, JavaScript, and Ruby. At the time we owned our infrastructure, racks in cages, that were all loaded with Windows. We were also at a point that we were using that infrastructure to it's fullest and could not afford additional servers running Linux. That's a long way of saying we decided against Ruby as it doesn't play nice on Windows.

That left us with two options. We went a very unconventional route for deciding between the two. We built MVP APIs on both. The interfaces were identical and interchangeable. What we found was easily quantifiable differences.

We were able to iterate on our Node based APIs much more rapidly than we were our C# APIs. For us this was owed to the community coupled with the extremely dynamic nature of JS. There were tradeoffs we considered, latency was (acceptably) higher on requests to our Node APIs. No strong types to protect us from ourselves, but we've rarely found that to be an issue.

As such we decided to commit resources to our Node APIs and push it out as the core brain of our new system. We haven't looked back since. It has consistently met our needs, scaling with us, getting better with time as continually pour into and expand our capabilities.

See more
Thomas Miller
Talent Co-Ordinator at Tessian · | 16 upvotes · 232.9K views

In December we successfully flipped around half a billion monthly API requests from our Ruby on Rails application to some new Python 3 applications. Our Head of Engineering has written a great article as to why we decided to transition from Ruby on Rails to Python 3! Read more about it in the link below.

See more
Mike Fiedler
Enterprise Architect at Warby Parker · | 3 upvotes · 224.8K views

When I was evaluating languages to write this app in, I considered either Python or JavaScript at the time. I find Ruby very pleasant to read and write, and the Ruby community has built out a wide variety of test tools and approaches, helping e deliver better software faster. Along with Rails, and the Ruby-first Heroku support, this was an easy decision.

See more
Justin Dorfman
Open Source Program Manager at Reblaze · | 1 upvote · 82K views

If you have a file (demo.txt) that has 3 columns:

Column-1    Column-2    Column-3
Row-1a      Row-2a      Row-3a         
Row-1b      Row-2b      Row-3b
Row-1c      Row-2c      Row-3c
Row-1d      Row-2d      Row-3d
Row-1e      Row-2e      Row-3e

and you want to only view the first column of the file in your CLI, run the following:

awk {'print $1'} demo.txt

Column-1
Row-1a
Row-1b
Row-1c
Row-1d
Row-1e

If you want to print the second column of demo.txt, just replace $1 with $2

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of AWK
Pros of Ruby
    Be the first to leave a pro
    • 605
      Programme friendly
    • 536
      Quick to develop
    • 490
      Great community
    • 468
      Productivity
    • 432
      Simplicity
    • 273
      Open source
    • 234
      Meta-programming
    • 207
      Powerful
    • 156
      Blocks
    • 139
      Powerful one-liners
    • 69
      Flexible
    • 58
      Easy to learn
    • 51
      Easy to start
    • 42
      Maintainability
    • 37
      Lambdas
    • 30
      Procs
    • 21
      Fun to write
    • 19
      Diverse web frameworks
    • 13
      Reads like English
    • 10
      Makes me smarter and happier
    • 9
      Rails
    • 8
      Very Dynamic
    • 8
      Elegant syntax
    • 6
      Matz
    • 5
      Object Oriented
    • 5
      Programmer happiness
    • 4
      Elegant code
    • 4
      Generally fun but makes you wanna cry sometimes
    • 4
      Friendly
    • 4
      Fun and useful
    • 3
      Easy packaging and modules
    • 3
      There are so many ways to make it do what you want
    • 2
      Primitive types can be tampered with

    Sign up to add or upvote prosMake informed product decisions

    Cons of AWK
    Cons of Ruby
      Be the first to leave a con
      • 7
        Memory hog
      • 7
        Really slow if you're not really careful
      • 3
        Nested Blocks can make code unreadable
      • 2
        Encouraging imperative programming
      • 1
        Ambiguous Syntax, such as function parentheses

      Sign up to add or upvote consMake informed product decisions

      What is AWK?

      A data-driven scripting language consisting of a set of actions to be taken against streams of textual data – either run directly on files or used as part of a pipeline – for purposes of extracting or transforming text, such as producing formatted reports.

      What is Ruby?

      Ruby is a language of careful balance. Its creator, Yukihiro “Matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming.

      Need advice about which tool to choose?Ask the StackShare community!

      What companies use AWK?
      What companies use Ruby?
      See which teams inside your own company are using AWK or Ruby.
      Sign up for StackShare EnterpriseLearn More

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with AWK?
      What tools integrate with Ruby?

      Sign up to get full access to all the tool integrationsMake informed product decisions

      Blog Posts

      Nov 20 2019 at 3:38AM

      OneSignal

      PostgreSQLRedisRuby+8
      9
      4659
      Oct 24 2019 at 7:43PM

      AppSignal

      JavaScriptNode.jsJava+8
      5
      961
      Jun 6 2019 at 5:11PM

      AppSignal

      RedisRubyKafka+9
      15
      1654
      GitHubDockerReact+17
      40
      36534
      What are some alternatives to AWK and Ruby?
      Python
      Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
      Perl
      Perl is a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming, GUI development, and more.
      JavaScript
      JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.
      Git
      Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
      GitHub
      GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Over three million people use GitHub to build amazing things together.
      See all alternatives