Wish me good luck bois.Still trying to figure out how strings work😂

Python scripter learns C for the first time circa 2020 colorised20201108_140212

12 Likes

Learning C isn’t very difficult, but since you come from python, I should pray for your sanity - especially because you’re learning strings!
I do C++; but afaik, C doesn’t have inbuilt string datatypes. You need to use a character array - which isn’t the smoothest thing to work with once you’ve tasted python strings. (absolutely no pun intended :laughing: )

2 Likes

But at least you chose THE classic book!

4 Likes

First edition as well! Purchased by my father in 1988. Printed in 1978

3 Likes

Was just about to start with Rust myself!

20201108_081803

7 Likes

Rust. Oh you mean the video game right?

2 Likes

no, it’s a programming language :sweat_smile:

3 Likes

The first thing to realise is that C does not have strings. It has character arrays. Well, it actually does not even have arrays, it has pointers and a really cool pointer arithmetic, and some syntactic sugar to make them look like arrays.

So, once you figure out pointers, strings will be very simple to understand. Everything in C is very minimalist and simple1 once you understand it.


1Simple in the context of C means “elementary”, not necessarily “easy to do”. While you have plenty of useful functions in the standard library, it’s a good idea to write many of them from scratch while you’re learning, just so you have a solid understanding of what they do. Of course, in most use cases, the functions from the library will be better and more optimised.

5 Likes

No wonder you’re having hard time to figure it out…on Microsoft IDE :rofl:
Come on man, on Linux you deserve better :grin:

P.S. The book is pure gold :upside_down_face:

1 Like

IDEs run on soy. All you need is ed, the standard text editor, and a C compiler. Most of UNIX was written that way. :slight_smile:

This also has an added benefit of making your beard look majestic.

“Beard-care product companies hate him, see how this man grew the most majestic beard ever, using only UNIX”

:bearded_person:

4 Likes

That’ s all, none of this btw I bla bla… with C you do
or don’t do.

You @SuppaMan will benefit greatly the more that you grasp C.

3 Likes

Yes, all joking aside, C is the most useful programming language you can learn.

4 Likes

Hmm perhaps I might have to open my book of C myself then, before jumping in to Rust.

I bought it a while ago, in a bundle with other books, but never gave it much thought, and like @SuppaMan I just started with my Python books…

2 Likes

Rust is cool, a very modern language with a really strict compiler that prevents you from doing stupid things. The C compiler is quite the opposite, it lets you do anything, as long as it is syntactically valid. Want to make a memory leak that crashes any Linux computer? Trivially easy in C (in fact, so easy, you’ll do it without realising :rofl: )

Now, you may think this is a good or a bad thing, depending on your perspective. It’s freedom that comes with responsibility.

In either case, however, C is a solid fundamental language to know. It’s high level enough that it is comfy to write big programs in it, unlike assembler, but low level enough that you get direct access to memory. I might be biased in favour of C, because it was the first programming language I learnt, as a child. I find its minimalism to be quite beautiful.

8 Likes

Yo, VScode is fully open source, and freekin amazing.

Best text editor no doubt. Go away Atom.

1 Like

Vim / emacs boys will be triggered :joy:

5 Likes

Oh gawd. F vim. I hate it.

There, I said it.

Spacemacs is pretty good though.

2 Likes

With that i agree, but to me anything that is not microsoft is better :laughing:
Sublime text, EMACS whatever :upside_down_face:

I quite like vim, it’s my favourite terminal-based text editor. But when I’m in the GUI, I really like Kate.

I don’t care for emacs, though, too lispy.

But really, text editors are in abundance on Linux. There is something for everyone. If you can’t find a text editor you like that runs on Linux, you are the problem, not the text editors.

1 Like

I actually quite like micro.
basically nano with syntax highlighting…
I use it on my raspberry pi and odroid sbc’s.

Can’t get used to the vim keybindings.

1 Like