Is rust language good in an educational and marketing sense?

Hello people.

I have been trying to guide my programming studies so that I am not strictly influenced by what the market wants a developer to know. I have had personal issues in qualifying myself to be a web developer. I am not satisfied with the current state of this market, at least in Brazil (where I live), because most of the problems to be solved from the work are not interesting, challenging.

I am pursuing a bachelor's degree in computer science and wish I could work with system programming and network programming. Here in Brazil there do not seem to be many job opportunities in these areas. Is the situation similar in the places where you live?

If I am aiming to work in these areas that I have mentioned above, and wanting to train myself in the best way possible, knowing how to solve the problems as well as possible, is Rust the language that will guide me on this path? Both in the marketing sense, since we have to work for a living, and in the sense of learning.

I say about learning because language helps, by default, to avoid certain problems. Like problems in concurrency . Will using Rust make me know how to handle these problems less? Since, theoretically, I will have help from the language itself. I know that having a "safe by default" language is very important, but in the educational sense is it interesting too?

Thank you in advance for your attention and patience.

The sort of knowledge you may get from using unsafe language is most likely something you won't be interested in doing. I certainly wouldn't. Safety frees you from hunting for issues that are completely irrelevant for the goals your program should achieve, it doesn't stop you from doing anything you may want to do (perhaps just forces certain ways of doing it).

1 Like

If your passion is computers, computer science and programming then I suggest you learn a few languages. But not just any random selection of languages.

Different languages have different approaches. Different philosophies, or values. There are different "classes" of languages, "paradigms" as they say. I'm sure it helps to tackle at least one from each class.

Learn, and practice, some assembler. That gets you a good feel for what is actually going on with the machine. It also teaches you everything you need to know about "unsafe" programming.

Learn C. The epitome of old school procedural programming. In the mold of ALGOL, Pascal and many others since.

Learn Lisp or Scheme. All based on list processing. The elegance of these languages is wonderful.

Learn Haskell or F# and find out what all those "functional programming" guys are talking about.

Learn C++, or even Java, C# to soak up the object oriented programming approach.

Learn Javascript. I mean actually learn it, not just put click handlers in web pages. JS is an amazingly sophisticated language. Inspired by the likes of Self/Scheme but looking like C. By far the best dynamically typed language. Also very useful for quick prototyping of ideas.

And of course learn Rust. With it's anti-aliasing rules and borrow checker it is currently unique among compiled languages.

Do not do what I ended up doing in my career. I have learned and worked in a dozen languages, almost a different one in every project. But they were pretty much all in the same procedural paradigm. Conceptually all the same but with different syntax. A pointless waste of time learning different details to do the same thing the same way!

I can't speak about the job market where you are, or anywhere else, but I feel sure that all those people desperately studying whatever is in vogue today in the hope of good jobs tomorrow are not doing the best thing. Likely they are making themselves miserable studying something they are not passionate about. Sounds like you have already experienced this.

Better to follow your passion and be ahead of the game.

All the best for the future.

5 Likes

This is common advice, but I disagree with the shopping-list approach to learning.

I've learned many programming languages and sure I have preferences and experiences because of them, but I don't think you have to learn them all to learn good habits. And I think moreover there's an opportunity cost to learning all of these.

Learning the ideas behind different paradigms, fundamentals of algorithms and data structures, discrete math, computability and all that are great. University will help with that.

Just learn the languages you need. Instead of focusing on lots of languages, pick some interesting projects. Don't expect to get everything right the first time, but things will come together in the end.

I'm going to somewhat contradict myself as far as languages not being the important bit, because there are some standout exceptions. As for some of the particular languages called out above, I would say:

  • Javascript is used everywhere, so it's worth learning for your career, but unless you're working on the web (which it sounds like you don't want), you almost surely have better choices.
  • C++ is a also a good career choice. At this point probably better than Rust for the same sorts of things. But "Learn C++" is a bit strong of advice, as that can mean years of study. It's fine for what it is, but it's massive and has a lot of rough edges.
  • C. Can be hard to keep track of things unless you're very disciplined. But it's a lot of fun.
1 Like

I'm not sure what you mean by the "shopping-list approach". I was certainly not suggesting "learn them all ". Quite the opposite.

Thing is, high level languages are abstractions over the problem of organizing what actual machines do. Which basically comes down to: sequence, selection and iteration.

Lisp and friends abstract this by making everything a list.

Haskell and friends abstract this by making everything a function.

C and friends, since ALGOL, just stick to that procedural sequence, selection and iteration of machine code as much as possible.

Then there is C++, Java, C#, and others that want to abstract things with classes and objects.

It's got to be good to get a feel for these different ways of looking at the problem of programming. My suggestion is learn more than one high level programming language, but be selective. Rater than learn ten languages of the same paradigm, concentrate on one from each.

Javascript, by the way, is unique and brilliant, web or not. The event driven model of JS is so different from any other language I know.

1 Like

I've written tons of JS. The event model isn't difficult to emulate in another dynamic language. I'll grant that it's simplest to get started with in JS.

class EventSystem
  def initialize
    @event_listeners = {}
  end
  
  def register_listener event, callback
    if @event_listeners[event]
      @event_listeners[event].push callback
    else
      @event_listeners[event] = [callback]
    end
  end
  
  def do_event event
    if @event_listeners[event]
      @event_listeners[event].each &:call
    end
  end
end

e = EventSystem.new
e.register_listener 'world_event', ->{print 'hello,'}
e.register_listener 'world_event', ->{print ' world'}
e.do_event 'world_event'

In Rust you'd need either Rc if you're doing it the way that seems most natural in a dynamic language, or you'd need some kind of typed, symbolic identifier that lets you find the object you've registered the event handler on. Or if I can change the problem a bit, I'd actually rather have separate, structured event queues. And that's not too hard once you're used to the general pattern.

There are event-driven models in all sorts of programming domains and I think it's a great pattern to learn. But that's really my point is to learn patterns over languages. And if you do use Rust while doing so, you get much more helpful error messages than in Js.

To bring my point around into something actually constructive for the original question, here's an interesting project which has tutorials in both Rust and Python: https://tomassedovic.github.io/roguelike-tutorial/

From there, you can explore event systems: http://www.roguebasin.com/index.php?title=Rule_and_Event_Systems (this page is a high-level overview but gives more links in the references); priority queues: http://www.roguebasin.com/index.php?title=A_priority_queue_based_turn_scheduling_system; etc.

“What language should I learn?” is always a personal question, depending largely on your interests or career goals. Unfortunately you only gave us one sentence about those, but it’s enough to say a few useful things:

Assuming we all mean the same thing by “systems programming,” i.e. programs where the low-level details of CPU/memory usage are almost completely in the programmer’s control, then I would say: Rust is by far the best language to learn systems programming with. Even if you want to learn C and/or C++ to be more employable, I’d learn Rust first.

The main reason why is that Rust lets you focus on the essential complexity of systems programming (heap vs stack, memory layout, data structure tradeoffs, target-specific instructions like SIMD, designing concurrent code without deadlocks or unwanted race conditions, etc) without any of the accidental complexity of C/C++, or their tendency to interrupt what you were doing with mysterious segfaults because UB is so easy to introduce by mistake.

Another big reason is that concepts like ownership and thread-safety are absolutely crucial and fundamentally very similar in C/C++/Rust, but only Rust is designed to teach and enforce those concepts correctly from the beginning. Many people report their C/C++ code improving after learning Rust.

But you also mentioned network programming. If you’re thinking primarily of distributed systems issues like leader election and consensus protocols where all the real work is I/O-bound, then you should stick to a simpler language like Javascript or Python; C/C++/Rust would just be a distraction. But if you’re also thinking of things like implementing an IP/TCP/HTTP network stack from the ground up, then that’s 100% systems programming and everything I said about Rust applies again.

Hopefully at least some of that was relevant to your goals.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.