Hacker Newsnew | past | comments | ask | show | jobs | submit | more ArrayBoundCheck's commentslogin

Despite what students who never programmed professionally say, memory isn't a problem to a significant amount of C and C++ developers. I think it's been a year since I last access an invalid pointer and that only happened because I forgot that I am not suppose to add elements to array in a `for (auto var : array)` loop. It use to be a for index loop and it didn't take long to figure out the change broke something


I'm one of those who "has never programmed [C/C++] professionally".

Isn't your statement at odds with assessment from many big tech companies that memory safety is the prevailing reason for CVEs? I'm sure you're not suggesting that the folks who make these assessments are not experienced C/C++ programmers, so I'm curious about your thinking on this.


> systems programming language that is not safe?

It sounds like you're saying rust because I don't know what other languages claim both.

Rust is an awful language. That's why. If you're using a systems programming language then chances are unsafeness isn't the problem you're most concerned with


I too love to create kernels/browsers/any network-interacting system that have horrible memory safety issues.


First you need to be experienced enough to know what not to do. Like that you shouldn't write mocks, shouldn't test private functions, shouldn't use a ton of global or static vars etc

Then you should find some sort of coverage tool so you can know if you covered most lines or not. I tend to ignore error handling lines but if its easy to get into that case I'll writ a test for it. Then I'll write test that take <1ms to execute. If something needs a network I'll try to separate the logic so it can work on a file OR I'll it connect to something on my local machine.

Generally I try to get 95%+ coverage (including error cases). I have many test and the entire suite run in <100ms. Maybe my project is easier to do TDD on but that's the way I do it


USBs usually have a CPU inside that sits between the storage and PC. This way the PC doesn't need to know a thing about the storage and the CPU can do whatever it needs to implement the USB protocol. However the CPU can be malicious and modify files


But exceptions do invoke dread in me. Sometimes a goto (or 11) will skip an array bounds check. - This comment is mostly a joke, look at our names. But I did see this happen at least once


I clicked on 7+ pages. I still can not find how to use an array


Bud, there's a search box at the top of the docs...

https://crystal-lang.org/reference/1.5/syntax_and_semantics/...



I don't want to live in a world where someone else makes the world a better place better than we do - Gavin B


Boo hoo. Either use open source of pay for the service. It's bizarre that people think everything should be free and spoonfed to them


While hiring I've done a 15min test before an interview (always looking through their portfolio first) that took some candidates 30-45mins. If they fail or took longer than 45mins it ends there. I then do a 30min interview that sometimes take 45min if they talk a lot or ask me questions about the company

How does this sound? I have no idea if this is ideal but so far we didn't hire any more bad candidates than we did using a different process


What about a take home test that should take 15min or less? Something not as simple as fizzbuzz but still takes < 15 lines of code?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: