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

C

5.2K
3.7K
+ 1
230
Ruby

22.9K
15.1K
+ 1
3.9K
Add tool

C vs Ruby: What are the differences?

Developers describe C as "One of the most widely used programming languages of all time". . 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.

C and Ruby belong to "Languages" category of the tech stack.

"Performance" is the primary reason why developers consider C over the competitors, whereas "Programme friendly" was stated as the key factor in picking Ruby.

Ruby is an open source tool with 15.9K GitHub stars and 4.25K GitHub forks. Here's a link to Ruby's open source repository on GitHub.

Airbnb, Square, and Codecademy are some of the popular companies that use Ruby, whereas C is used by AdRoll, Twitch, and Redis Labs. Ruby has a broader approval, being mentioned in 2530 company stacks & 1140 developers stacks; compared to C, which is listed in 64 company stacks and 251 developer stacks.

Advice on C and Ruby
Youcef Benamare
Needs advice
on
C#
C++
and
C

include include int main(){ char name[10], pasword[10]; printf("enter you user name :"); gets(name); printf("enter your pasword : "); gets(pasword); printf("your name : %s \n your password : %s \n", name, pasword); if ( name != "youcef") { printf("name undefined\n"); } else { printf("finde name"); }

}

his not working

See more
Replies (1)
Richard Rios
Senior Software Engineer · | 3 upvotes · 185 views
Recommends
C

You will want to do a few things here. First, replace gets with fgets. Then, you're going to want to use strcmp from string.h to compare the input with the desired result. The code listed below has been updated with a working example with the previously mentioned recommendations. This isn't perfect and there are other ways to accomplish the same task. Explore other options that are available when you have a chance and see if you can improve on this example.

#include <stdio.h>
#include <string.h>

int main()
{ 
    char name[10], 
    pasword[10]; 

    printf("enter you user name :"); 

    // Use fgets as gets is insecure and can easily lead to buffer overflow exploits
    fgets(name, sizeof(char) * sizeof(name), stdin);

    // Remove \n from fgets stdin read with null character so as to not have to include
    // in strcmp later.
    name[strlen(name) - 1] = '\0';

    printf("enter your pasword : "); 
    fgets(pasword, sizeof(char) * sizeof(pasword), stdin);

    printf("your name : %s \n your password : %s \n", name, pasword);

    // If strcmp result > 0 || < 0 it's not a match
    if (strcmp(name, "youcef") != 0) 
    { 
        printf("name undefined\n"); 
    } 
    else 
    { 
        printf("finde name"); 
    }
}
See more
Needs advice
on
Ruby
and
JavaScript

I'm new to development, and I've been studying JavaScript and Ruby concurrently, but I'm to a point now where I should really be focusing my effort into learning one language. I'd like a solid foundation and understanding, so that I can move forward with confidence. Everywhere I go, I keep hearing that RoR is a dying breed. However, I really have enjoyed Ruby and Rails...a LOT. Its approachable, fun, and readability is great. I just don't want to set myself up for failure by saddling myself in with a stack that will take me nowhere. What is your opinion on the future of RoR and would it be foolish for me to invest too much time in learning it over others?

See more
Replies (6)
Julien DeFrance
Principal Software Engineer at Tophatter · | 6 upvotes · 28.1K views
Recommends
Ruby

Ruby on Rails is far from being dead. In fact, this is a very popular choice in early-stage startups, given how fast and easily it allows them to launch their product and iterate on it.

Even at more mature companies, you'll still find a ton of opportunities. Not for internal tools or legacy codebases, but for actual production workloads: web apps, APIs, etc...

Some may tell you that Ruby doesn't scale, but is it really Ruby that doesn't scale, or the code they wrote?

Languages have trends. Sometimes, recruiters will try to take you one way or another to meet their own agenda. Don't always listen to what you hear. Long live Ruby! Long live Rails!

See more
Recommends
Ruby

You can’t directly compare RnR and Javascript, since the first is a framework (Ruby would be the language), and Javascript is a language. RnR even uses quite an amount of Javascript. I think that Ruby, and Rails, are design by improving on previous languages, and shifting the perspective from speed to readability and general developer friendliness. Opposed to that, Javascript did not have any design goals at all, and seems to be repeating the errors of all language designs that existed before. “Knowing Javascript” would not be a selling point to me when hiring someone, there should be mentioned specific javascript frameworks. And I’d always try to find someone who has experience in multiple languages. So my advice is to to learn RnR first, you get a head start, Javascript will just come along with it. And you can distinct yourself from other people that claim web development knowledge because they have done one javascript tutorial :-)

See more
Ekapob Ukritnukun
Software Engineer at App47, Inc. · | 4 upvotes · 23.2K views
Recommends
Ruby
JavaScript

I know I'm cheating by recommending both, but that's because I don't think you can go wrong either way.

I've been working with RoR full-time for the past 3.5 years and I really enjoy it. Compared to JavaScript, it's so much easier to read which is amazing from a team collaboration perspective. As for the perception that it's dead, when I recently started looking for new opportunities, I received probably an average of 10-15 calls a week from recruiters looking for people with RoR experience. Also, if you look around for average wages of developers of different languages, Ruby is fairly high up there (higher than JavaScript if I recall correctly), probably because there are fewer of us around and we can command a premium.

However, that said, if your goal is to find a full-time engineering position quickly, then JavaScipt certainly is the flavor of the month and any product with a frontend component will need it. Even our enterprise SaaS platform which didn't use a frontend framework (React, Angular, Vue, etc...) required us to integrate JS packages and write custom ones. JavaScript is probably more versatile than Ruby at the moment and it seems like new frameworks are being written for it all the time, but remember that Ruby was also the preferred language by almost all companies 5-10 years ago.

At the end of the day, I would go with the language that you enjoy writing the most as you'll be using it a lot in your workplace. If you aren't having fun at work, that's a lot of time spent suffering.

See more
pascal carrié
developper at self-employed · | 4 upvotes · 23.3K views
Recommends
Stimulus
Rails

ruby got better and better, rails is outstanding. Listen David Heinemeier Hansson : https://corecursive.com/045-david-heinemeier-hansson-software-contrarian I recommend you to read Otis Meyer https://www.informit.com/store/practical-object-oriented-design-an-agile-primer-using-9780134445601#largeCover and https://eloquentjavascript.net/ Don't bother what's they say, just enjoy programming

See more
Leonardo Ribeiro
Software Developer Consultant at Scalable Path · | 4 upvotes · 23.1K views
Recommends
Ruby
JavaScript

One of the things that we I often hear since I started programming, is that languages will die. Ruby and JavaScript are both one of the most popular languages today. And popular languages just doesn’t go to the top and die.

So, F*** what people say about languages dying. Go ahead and learn both, or choose one to learn. But also learn data structures, design patterns and testing. This is basic for awesome developers and a lot are missing that.

See more
Joost Baaij
Internet creator. at Space Babies · | 3 upvotes · 5.6K views
Recommends
at

Yo Matt,

I've been in the Ruby on Rails game for twenty years. For the last ten, Rails has been declared deceased. ;) But in reality, Rails is still going strong. The jobs are highly paid and fun. All the pros you list are valid. Yes it is a beautiful language, the OO makes sense, it's dynamic and expressive, and the ecosystem is top shelf. What's to dislike? There are a lot of Rails websites out there. And new ones get created every day too.

Now, to address the elephant in the room....

Ruby is quirky. Since the syntax is pretty different from PHP, and core developers being opinionated, some people just see drama. When Node.JS got slightly usable, they moved over to that. Node.JS is very c/PHP-like after all in its syntax. Many engineering managers will just select the ecosystem that is biggest. Node.JS is a lot bigger. But if you don't care about going a little off the beaten path sometimes, Ruby in my opinion still, after all this time, gives me joy when I use it.

Also important: to this day, I can build everything I want. Ruby, Rails and many gems are being actively maintained. Security vulnerabilities are discovered and corrected. New developments still find their way into the language. For myself, I know that the anemic JS standard library would just frustrate me to no end.... every wheel is invented time and again. Ruby's standard library isn't as voluminous, but it's a lot more diverse and useful.

See more
Decisions about C and Ruby

Python has become the most popular language for machine learning right now since almost all machine learning tools provide service for this language, and it is really to use since it has many build-in objects like Hashtable. In C, you need to implement everything by yourself.

C++ is one of the most popular programming languages in graphics. It has many fancy libraries like eigen to help us process matrix. I have many previous projects about graphics based on C++ and this time, we also need to deal with graphics since we need to analyze movements of the human body. C++ has much more advantages than Java. C++ uses only compiler, whereas Java uses compiler and interpreter in both. C++ supports both operator overloading and method overloading whereas Java only supports method overloading. C++ supports manual object management with the help of new and delete keywords whereas Java has built-in automatic garbage collection.

See more
Ing. Alvaro Rodríguez Scelza
Software Systems Engineer at Ripio · | 11 upvotes · 99.7K views

I was considering focusing on learning RoR and looking for a work that uses those techs.

After some investigation, I decided to stay with C# .NET:

  • It is more requested on job positions (7 to 1 in my personal searches average).

  • It's been around for longer.

  • it has better documentation and community.

  • One of Ruby advantages (its amazing community gems, that allows to quickly build parts of your systems by merely putting together third party components) gets quite complicated to use and maintain in huge applications, where building and reusing your own components may become a better approach.

  • Rail's front end support is starting to waver.

  • C# .NET code is far easier to understand, debug and maintain. Although certainly not easier to learn from scratch.

  • Though Rails has an excellent programming speed, C# tends to get the upper hand in long term projects.

I would avise to stick to rails when building small projects, and switching to C# for more long term ones.

Opinions are welcome!

See more
Timm Stelzer
Software Engineer at Flexperto GmbH · | 18 upvotes · 169.2K views

We have a lot of experience in JavaScript, writing our services in NodeJS allows developers to transition to the back end without any friction, without having to learn a new language. There is also the option to write services in TypeScript, which adds an expressive type layer. The semi-shared ecosystem between front and back end is nice as well, though specifically NodeJS libraries sometimes suffer in quality, compared to other major languages.

As for why we didn't pick the other languages, most of it comes down to "personal preference" and historically grown code bases, but let's do some post-hoc deduction:

Go is a practical choice, reasonably easy to learn, but until we find performance issues with our NodeJS stack, there is simply no reason to switch. The benefits of using NodeJS so far outweigh those of picking Go. This might change in the future.

PHP is a language we're still using in big parts of our system, and are still sometimes writing new code in. Modern PHP has fixed some of its issues, and probably has the fastest development cycle time, but it suffers around modelling complex asynchronous tasks, and (on a personal note) lack of support for writing in a functional style.

We don't use Python, Elixir or Ruby, mostly because of personal preference and for historic reasons.

Rust, though I personally love and use it in my projects, would require us to specifically hire for that, as the learning curve is quite steep. Its web ecosystem is OK by now (see https://www.arewewebyet.org/), but in my opinion, it is still no where near that of the other web languages. In other words, we are not willing to pay the price for playing this innovation card.

Haskell, as with Rust, I personally adore, but is simply too esoteric for us. There are problem domains where it shines, ours is not one of them.

See more
Andrew Carpenter
Chief Software Architect at Xelex Digital, LLC · | 16 upvotes · 162.6K 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 · 76K 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 · 44.7K 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
Russtopia Labs
Sr. Doodad Imagineer at Russtopia Labs · | 0 upvote · 64.8K views
Chose
Go
over
C++
C

As a personal research project I wanted to add post-quantum crypto KEM (key encapsulation) algorithms and new symmetric crypto session algorithms to openssh. I found the openssh code and its channel/context management extremely complex.

Concurrently, I was learning Go. It occurred to me that Go's excellent standard library, including crypto libraries, plus its much safer memory model and string/buffer handling would be better suited to a secure remote shell solution. So I started from scratch, writing a clean-room Go-based solution, without regard for ssh compatibility. Interactive and token-based login, secure copy and tunnels.

Of course, it needs a proper security audit for side channel attacks, protocol vulnerabilities and so on -- but I was impressed by how much simpler a client-server application with crypto and complex terminal handling was in Go.

$ sloc openssh-portable 
  Languages  Files    Code  Comment  Blank   Total  CodeLns
      Total    502  112982    14327  15705  143014   100.0%
          C    389  105938    13349  14416  133703    93.5%
      Shell     92    6118      937   1129    8184     5.7%
       Make     16     468       37    131     636     0.4%
        AWK      1     363        0      7     370     0.3%
        C++      3      79        4     18     101     0.1%
       Conf      1      16        0      4      20     0.0%
$ sloc xs
  Languages  Files  Code  Comment  Blank  Total  CodeLns
      Total     34  3658     1231    655   5544   100.0%
         Go     19  3230     1199    507   4936    89.0%
   Markdown      2   181        0     76    257     4.6%
       Make      7   148        4     50    202     3.6%
       YAML      1    39        0      5     44     0.8%
       Text      1    30        0      7     37     0.7%
     Modula      1    16        0      2     18     0.3%
      Shell      3    14       28      8     50     0.9%

https://gogs.blitter.com/RLabs/xs

See more
Get Advice from developers at your company using Private StackShare. Sign up for Private StackShare.
Learn More
Pros of C
Pros of Ruby
  • 64
    Performance
  • 45
    Low-level
  • 33
    Portability
  • 28
    Hardware level
  • 18
    Embedded apps
  • 12
    Pure
  • 9
    Performance of assembler
  • 7
    Ubiquity
  • 4
    Great for embedded
  • 4
    Old
  • 2
    OpenMP
  • 2
    No garbage collection to slow it down
  • 2
    Compiles quickly
  • 600
    Programme friendly
  • 533
    Quick to develop
  • 488
    Great community
  • 467
    Productivity
  • 430
    Simplicity
  • 272
    Open source
  • 234
    Meta-programming
  • 203
    Powerful
  • 157
    Blocks
  • 138
    Powerful one-liners
  • 65
    Flexible
  • 56
    Easy to learn
  • 48
    Easy to start
  • 40
    Maintainability
  • 36
    Lambdas
  • 30
    Procs
  • 19
    Fun to write
  • 19
    Diverse web frameworks
  • 11
    Reads like English
  • 9
    Rails
  • 8
    Makes me smarter and happier
  • 7
    Elegant syntax
  • 6
    Very Dynamic
  • 5
    Programmer happiness
  • 5
    Matz
  • 4
    Generally fun but makes you wanna cry sometimes
  • 4
    Fun and useful
  • 3
    Friendly
  • 3
    Object Oriented
  • 3
    There are so many ways to make it do what you want
  • 2
    Easy packaging and modules
  • 2
    Primitive types can be tampered with
  • 2
    Elegant code

Sign up to add or upvote prosMake informed product decisions

Cons of C
Cons of Ruby
  • 5
    Low-level
  • 3
    No built in support for concurrency
  • 2
    Lack of type safety
  • 2
    No built in support for parallelism (e.g. map-reduce)
  • 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

- No public GitHub repository available -

What is C?

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 C?
What companies use Ruby?
See which teams inside your own company are using C or Ruby.
Sign up for Private StackShareLearn More

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

What tools integrate with C?
What tools integrate with Ruby?

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

Blog Posts

Dec 22 2020 at 9:26PM

Pinterest

+4
9
2213
Nov 20 2019 at 3:38AM

OneSignal

+8
7
3774
Oct 24 2019 at 7:43PM

AppSignal

+8
5
691
Jun 6 2019 at 5:11PM

AppSignal

+9
15
1092
+17
32
28670
What are some alternatives to C and Ruby?
Java
Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!
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.
C#
C# (pronounced "See Sharp") is a simple, modern, object-oriented, and type-safe programming language. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers.
Objective-C
Objective-C is a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime. Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods. It also adds language-level support for object graph management and object literals while providing dynamic typing and binding, deferring many responsibilities until runtime.
Rust
Rust is a systems programming language that combines strong compile-time correctness guarantees with fast performance. It improves upon the ideas of other systems languages like C++ by providing guaranteed memory safety (no crashes, no data races) and complete control over the lifecycle of memory.
See all alternatives