Learning programming to contribute?
Posted by siri-bad@reddit | linux | View on Reddit | 18 comments
Hey guys, fairly new Linux user here.
I've wanted to acquire the expertise required to contribute to Linux in some technical way, so how would you recommend I start to learn the process?
I'm not at all experienced in this, only having basic programming knowledge from computer science classes in high school which were a shitfest, but that's another story. I have been using Linux as a daily driver for a few weeks after I reinstalled on my new pc. So I would be considered an enthusiast among my peers, for what it's worth.
I am willing to spend a good amount of time as I have a vacation coming soon, and I wanted to learn how to program anyway so decided I might as well learn how the OSS community works in the same timeframe lol.
All tips are appreciated :)
Wentyliasz@reddit
Expectation setter: You're not gonna get maintainer level proficient over holidays That said, learning C is what you'd want to do, and while helping out with the kernel or similar is a noble goal, it's also a legitimate career path. Best advice I can give you at this point is: It's not gonna be a hobby, you've got years ahead of you. seriously pick something as far from the kernel as possible to contribute, he'll make the 10000th htop clone. And I know from the bottom of my heart that if you genuinely want to, you'll absolutely get there one day. Also yes, pointers are that fucked up, it's totally normal to be confused, don't worry, it will click at some point (tbh C syntax kinda sucks IMO)
ChampionshipIcy7602@reddit
Start with just using your pc. You'll notice sometimes there are annoyances you want to fix for your self. Fix them first, usually with just config (dot) files. Then there will be times where it can't be fixed with just configs, you start looking for alternatives. Eventually you'll run out of alternatives, then you have to start digging into the tools code base yourself, and try to hack something together. When your hack is satisfied enough, create a patch and ping the maintainer for review.
siri-bad@reddit (OP)
Yeah I've definitely hit this already, but I hadn't really gotten the expertise nor the time at that point. I plan on trying to fix that problem whenever I do get the chance later on.
AmarildoJr@reddit
This will vary wildly, depending exactly on what you want to help with. For example, I think the Kernel is one of the places that least need help at the moment, but if you were to contribute you may find it extremely difficult to do so, because it is such a complicated piece of software. The amount of knowledge (and work) to either create a functionality from zero, or to identify problems in one and send a patch (and have it approved) is no joke.
One area that could use a bit of help would probably be Wayland. For instance, I think the Linux Mint team has like 3 core developers and about 12 people total, and they could use some help bringing Cinnamon to Wayland quicker than what their efforts currently allow.
But honestly, jumping to any project when you only have "the very basics of a shitsfest programming course in high school" might not be the best idea, in my humble opinion. Can someone even learn enough during a vacation in order to meaningfully help a software project?
That is a question I ask myself, because I'm learning C programming but it's so basic I'd probably just try to take a bigger step than my legs allow and would probably just end up actually hurting and annoying the people who are actually doing work in these projects.
So at least for me, it may not be a question of "trying to help with programming right now", but keep learning so I can actually help in about 1 or 2 years.
In the mean time I find it best to donate money (instead of crappy patches) to those projects so they can actually hire competent developers to keep the work.
My 2 cents.
siri-bad@reddit (OP)
Yeah I'm obviously not going to be of much use right now, but I want to develop myself to be of use in about an year or so. We all have to start somewhere lols.
I wanna keep working for the community whenever I do get time later on, I just happen to have a good amount of free time rn that's why I mentioned it.
I'll look into development for Wayland. Thanks for the suggestion 👍
UnluckyDouble@reddit
Step one: master C in normal non kernel applications. Get really familiar not just with how to construct a functional project but all the features of the language. Study existing C codebases for major open source projects to see how to structure a large, complex program well.
You should also have a good idea of how operating systems in general and Linux in particular work. Get a high level overview of how the kernel is structured, and get familiar with general kernel programming concepts like interrupts, virtual memory, and scheduling.
As for your actual contribution, your best bet is to write drivers for devices that are not yet supported. This is by far where the majority of work goes due to the core systems being largely mature. Unfortunately it also poses an entirely new array of difficulties. At worst you might have to figure out the interface to a piece of hardware while legally not being able to request the documentation of it. Pick your battles wisely, or attach yourself to an existing team.
siri-bad@reddit (OP)
Omg contributing to the drivers is a great idea, I had completely forgotten the struggle I went through trying to setup my offbrand dualshocks 😭
Any videos or other recommendations to learn the structure of Linux??
UnluckyDouble@reddit
Truthfully, studying the code and its included documentation is the only complete resource, I'm afraid. I find that it helps to first understand what the kernel does and then try to find the part responsible for whichever task you're interested in.
siri-bad@reddit (OP)
Damn alr I'll do what I can Thanks for the help :)
proexterminator@reddit
you can go on to github and filter issues. there's tags like 'good first issue'. if you find something doable just reply and ask if you can take it up, mostly they will say sure go ahead. once you do that you can just fork the repo, change whatever you need and send a merge request. make sure you match your code style to the one used by the repo and follow the rules/conventions in their CONTRIBUTING.md file.
I highly suggest you learn how to code and take your time with it, using ai from the start will be much faster but comes with many problems.
If you use ai anyways, atleast be honest add 'created with cursor' or something like that in the commit and pr, but in many communities sending AI generated code will put a black mark on your name.
As for how to learn to code, if you're completely new i would say just pick up a python video or book and learn the basic syntax and conventions. once you do that you can just start with easy public issues already. Don't wait and postpone thinking that you can't do it yet, or that you need more experience. you can ask AI for stuff like how to approach the problem and things, but you should try your best to find and do the fix yourself.
siri-bad@reddit (OP)
I don't plan on using AI to completely write my code, except maybe pointers to solve specific issues. I still wanna learn programming loles
I know a bit of basic python and pretty familiar with most of the conventions and the usual syntax.
Thanks for the advice :))
proexterminator@reddit
once you learn the basic conventions in open source communities and understand coding, you can pick up c, cpp, rust etc, and start contributing to bigger projects, kernel, etc.
JerryRiceOfOhio2@reddit
you can probably find projects in a lot of different languages. I'm going to try to take on a python project that's been abandoned once i retire/get fired/have AI take my job
AvonMustang@reddit
Start learning C and/or Rust and pick a project.
siri-bad@reddit (OP)
Aight thanks for the tip
Inevitable-Bat7173@reddit
start with something smaller than kernel itself - maybe pick userland tool you actually use and find bugs or missing features. diving straight into kernel c code from high school programming is like trying to deadlift 400lbs when you can barely bench the bar
also documentation patches are good way to get familiar with submission process without needing to be coding wizard yet
siri-bad@reddit (OP)
Yeah thought learning the kernel itself might be too much rn that's why I asked for guidance lol. Thanks for the tips guys
ParachutingPiglets@reddit
I want to learn Rust