惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Y
Y Combinator Blog
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Jina AI
Jina AI
B
Blog RSS Feed
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
D
Docker

OSU Open Source Lab

Data Center Migration Update and Fundraising Campaign | OSU Open Source Lab OSL Infrastructure Migration: A Move to Oregon's State Data Center | OSU Open Source Lab Featured: Strong support stabilizes funding for the Open Source Lab | OSU Open Source Lab We're Hiring: Join the OSU Open Source Lab as a Student Systems Engineer! | OSU Open Source Lab Forging Our Future: OSL's Path to Sustainability – A Call for Smart Solutions and Enduring Support | OSU Open Source Lab Future of OSL in Jeopardy | OSU Open Source Lab Now Providing Access to POWER10 for Open Source Projects | OSU Open Source Lab FTP Server Rebuild - March 2024 | OSU Open Source Lab On Leaving the Open Source Lab, Jonathan Frederick | OSU Open Source Lab Reflections on My Time at the Open Source Lab, Travis Whitehead | OSU Open Source Lab OSL Alumnus Matthew Johnson on working at Tesla | OSU Open Source Lab Hiring two DevOps student positions | OSU Open Source Lab TDS Telecom Support of OSU Open Source Lab Tops $5 Million | OSU Open Source Lab Goodbye Letter from Graduating Senior, Cody Holliday | OSU Open Source Lab Mohamed Eldebri on OSL's participation in the Corvallis Maker Fair | OSU Open Source Lab Cody Holliday on the Department of Energy Cyber Defense Competition 2018 | OSU Open Source Lab OSL's Cody Holliday Wins Regional DOE Cyber Defense Competition | OSU Open Source Lab OSL Alumnus Alex Plovi sells CoreOS to RedHat | OSU Open Source Lab Changing the World, One Line of Code at a Time | OSU Open Source Lab Jonathan Frederick on Packer Templates project at the OSL | OSU Open Source Lab Ganeti Production Rebuild - Dec 11-15 & 18-19, 2017 | OSU Open Source Lab Thank You for Supporting our Crowdfunding Campaign! | OSU Open Source Lab A Message from the Director | OSU Open Source Lab New Project: polr | OSU Open Source Lab Donate to Our Crowdfunding Campaign! | OSU Open Source Lab Amanda Kelner on Graduating | OSU Open Source Lab Beaver BarCamp 17: New Horizons | OSU Open Source Lab New Project: libpng Now Mirrored on ftp.osuosl.org | OSU Open Source Lab Network Outage 2016-12-17 Post-mortem | OSU Open Source Lab OSL Summer 2016 Internship | OSU Open Source Lab
Cody Holliday on Why we should stop using C | OSU Open So...
2017-07-31 · via OSU Open Source Lab

by Cody Holliday on Mon, Jul 31 2017

Programming languages are a touchy topic in Computer Science. In certain crowds even mentioning a language will elicit groans and eye-rolling. Conversely, there are crowds that will only use certain languages for all projects.

These people have lost sight of the fact that programming languages are tools. Languages have certain problem sets that they’re really good at and some not so much. If you were to ask me to do some complex math or signal processing, I would point you to MATLAB. Would I use MATLAB for developing a GUI? Not in a million years. So why do we choose C? Well, C is efficient since it’s practically one step above assembly and with a modern compiler it compiles down to a small executable. Plus modern compilers have extremely good optimization algorithms that can optimize your program better than if you wrote it by hand in Assembly. This makes C a great tool for embedded programming and systems level programming, which is why we have been using it for so long in these fields! However, a downside (and upside!) of C is that it’s like assembly. It will let you do whatever you want, even if that means shooting yourself in the foot. There is no type safety, there is no memory protection, and no thread safety built into the language. You have to do all of that yourself with mutexes, semaphores, and checks. It’s good to know about these concepts and be able to design a system that puts these protections in place, but every project should not be an exercise in memory management and complex concurrency. We should move on to tools that help you rather than give you enough rope to hang yourself with. With computers being as important as they are, security should be our number one priority when writing software. If you’re writing an application that does an unbounded copy from input (ex. heartbleed) in your final release, you just added another vector of attack to someone’s computer.

We should be writing code that is safe and avoids all sorts of memory issues that can be solved by using the right tools. Writing C is cool because it’s freeing, but I think we should move to bigger and better tools that save us from our own stupid mistakes and hit us over the head with them.

As for embedded programming, there are other options out there that maybe won’t be as small as C, but will make your device more secure. (Insert plug for Rust here)