News for hackers. Stuff that matters.
Re:Rust newcomers are 70x less likely to create vulnerabilit... by baq on Monday November 06, 2023 @01:46PM (#38166900)
And neither is C/C++, in which you have to follow all the borrowing rules except the compiler maybe sometimes warns you about something instead of always erroring out.

Python, go or (a bit less so) typescript are nice beginner languages.

Re:Rust newcomers are 70x less likely to create vulnerabilit... by usrbinbash on Tuesday November 07, 2023 @03:25AM (#38174483)
C++ isn't, but C was my first programming language, and I am thankful for this to this day.

Because C in and of itself, is an incredibly simple language. It is made complex in libs, usually by abusing macros, or by trying to shoehorn it into OOP, FP, or whatever other paradigm is currently being idolized.

> Python, go

Go yes, Python no, and I am saying that as someone who does alot of work in Python and loves both languages.

Because Python isn't simple. It looks simple in trivial code, but hides an enormeous amount of complexity and magic not-so-far beneath the surface. In addition, it completely fails at teaching core concepts of memory, and dances around the topic of types.

Re:Rust newcomers are 70x less likely to create vulnerabilit... by baq on Tuesday November 07, 2023 @08:26AM (#38176452)
But C is anything but simple! It's small but it's so full of undefined behaviors it requires considerable knowledge and experience to stay within the bounds of 'predictable'. It's better nowadays if you are taught to enable all possible warnings and even then you'd better use a static analyzer and valgrind for anything more than hello world.

Python's hiding of memory is a feature when teaching beginners programming IMHO unless you want to start teaching close to the metal. I prefer to start from the algorithmic CS-y side.

Re:Rust newcomers are 70x less likely to create vulnerabilit... by usrbinbash on Tuesday November 07, 2023 @08:48AM (#38176642)
> it requires considerable knowledge and experience to stay within the bounds of 'predictable'

No it really doesn't. Initialize all variables, always check boundaries and free memory when you're done with it. That about covers 90% of it.

Yes, this becomes more difficult the less trivial the codebase becomes. But beginners don't have non-trivial codebases, and teaching these concepts isn't hard.

> Python's hiding of memory is a feature when teaching beginners programming IMHO unless you want to start teaching close to the metal. I prefer to start from the algorithmic CS-y side.

And I prefer to start from the systems-programming, practical side. And in the practical world, memory isn't some abstract thing that may or may not exist, function calls cause overhead, strict typing is a friend, and networks fail.

So yes, teaching a bit closer to the metal has its advantages.