r/AskProgramming • • May 08 '21

What is your opinion on Rob Pike's 5 Rules of Programming?

77 Upvotes

https://users.ece.utexas.edu/~adnan/pike.html

Rob Pike's 5 Rules of Programming

Rule 1. You can't tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you've proven that's where the bottleneck is.

Rule 2. Measure. Don't tune for speed until you've measured, and even then don't unless one part of the code overwhelms the rest.

Rule 3. Fancy algorithms are slow when n is small, and n is usually small. Fancy algorithms have big constants. Until you know that n is frequently going to be big, don't get fancy. (Even if n does get big, use Rule 2 first.)

Rule 4. Fancy algorithms are buggier than simple ones, and they're much harder to implement. Use simple algorithms as well as simple data structures.

Rule 5. Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.

Pike's rules 1 and 2 restate Tony Hoare's famous maxim "Premature optimization is the root of all evil." Ken Thompson rephrased Pike's rules 3 and 4 as "When in doubt, use brute force.". Rules 3 and 4 are instances of the design philosophy KISS. Rule 5 was previously stated by Fred Brooks in The Mythical Man-Month. Rule 5 is often shortened to "write stupid code that uses smart objects".


r/AskProgramming • • Jun 29 '20

Education How to get good in data structure and algorithms?

77 Upvotes

Hey guys,

I am trying to prepare for coding interview. How many problems should I try to solve in a day? What was your game plan when you were preparing for technical interview?


r/AskProgramming • • Jan 03 '19

Are there YouTube Channels or similar resources which explain Source Code of popular open source projects for beginners?

77 Upvotes

r/AskProgramming • • Nov 24 '22

Senior Devs: What do you find yourself explaining to junior / other devs over and over?

76 Upvotes

I was thinking about this the other day and realized that there are a handful of things that I end up 'teaching' other devs about. I was wondering what types of things you all tend to explain over and over?

Here are my top 3:

  1. SSL - I've had to explain how the handshake / verification process works so many times that I literally have a note saved with an explanation I can copy/paste. They apparently don't teach this to new programmers?

  2. Why writing your own encryption method is a really bad idea. Just don't.

  3. Sometimes rewriting IS better than refactoring.

I'm curious to hear what the rest of you are seeing/hearing. Maybe this can turn into a decent knowledge share.


r/AskProgramming • • Apr 07 '21

Engineering What would programming (more specifically software development) be like if everyone actually used "best practices".

76 Upvotes

I hear all the time about the importance of best practices, but never have I worked on a team/assignment/project where we all used best practices. I understand we could all never uniformly agree as to what a best practice is or which one is the "best" one, but what would it be like if developers all used best practices to their best ability? How would software be different if we as an industry did more things the "right way" and the way that it "is supposed to be done"? What if there were more ridged "rules" in software development.

Would it change how software is made? Would it change what type of software would be made? Would we have better security in our devices, databases, and networks? Would it change how we collaborate on projects?


r/AskProgramming • • Mar 15 '21

Have you ever thought to yourself: "Why does this API exist? Why would someone or a company provide the public with this kind of data"?

76 Upvotes

There was a point in time where Yahoo Finance would just let you take their data through an API. I always wondered what they had to gain by letting people use their service and drain their servers without clicking on any ads. Of course, there are other examples that are much stranger. I'd like to hear about them


r/AskProgramming • • Jun 13 '20

Other Programmers of Reddit, what useful programs do you use on your phone?

76 Upvotes

r/AskProgramming • • Oct 21 '22

Chastised for saying black list, anyone else?

75 Upvotes

I was in a meeting with a vendor and asked if we would be able to black list certain ip address ranges and they were horrified I said "black list". I was told that we no longer user that term that we now say "block list". Is this new? Am I just a caveman? I don't want to offend anyone but I didn't know there was any issue with saying this. Has anyone else heard this before?


r/AskProgramming • • Jun 13 '25

I think I'm becoming a vibe programmer, and I hate it.

74 Upvotes

Pretty much just what the title says. I'm an experienced back end dev across several stacks, with tons of devops experience as well, but my front end has always been a bit figure it out as I go. Using the newer AI tooling, I'm now suddenly "full stack" so to speak. I don't really want to invest the time to become a good front-end dev too, as it's not my jam, and there are plenty of roles out there that don't need it, but yeah. Where do I draw the line and actually invest the time to learn a framework? Especially with front-end which seems so fickle that it changes every year or two to some new hotness.

I feel dirty every time I can tell cursor to "Just change this input to a drop down and make it have nice styles" and it not only works, but also fixes surrounding code.

I guess if I had a question here more than a rant, it's when do you decide to invest time to learn something vs. just spitting out LLM generated code that does the job?


r/AskProgramming • • Aug 03 '24

Career/Edu How long can you program a day?

74 Upvotes

Not a programming question. Just a question regarding how long you can sit and stare at the screen all day?


r/AskProgramming • • Sep 08 '23

I suck at coding

74 Upvotes

I'm in my 3rd year of computer engineering, and I have no idea how I made it this far because I absolutely suck at coding. Other than printing "Hello World", I can't write anything else without the help of YouTube. I really want to be able to write simple programs by myself, but when I have multiple assignments and labs along with having to work, I have no time to do that. I'm more focused on completing my assignments for marks instead of grasping the concepts of what I'm doing. I like Java and I want to be proficient in it before branching out to other languages. Where is the best place to properly learn the concepts like private, public, static, etc.? What is the best website to start from because I feel like I have to really understand those concepts, before starting to build small programs.

Edit: I appreciate all your responses! I will definitely try to make more time to do more personal coding. I have decided to take a year off from school after my 3rd year in order to do that. During that time, I hope to get an internship to help me. Thank you all again!

Edit 2: Thank you for all the feedback guys! You have all given me the confidence and motivation to keep going. Just to clarify one thing, this 3rd year is my final year of college. Taking a year off was just to work on my own projects (like most of you have suggested), before heading to a recognized university for a 2 year degree. If I'm able to get an internship during the time off, I will decide against a further education in university. I appreciate all your support once again!


r/AskProgramming • • Dec 28 '21

Other Why do you think people nowadays almost invariably post code as screenshots?

74 Upvotes

It is very annoying to me that people post code as screenshots, whether to mock in places like /r/programminghorror or /r/badcode, or to ask legitimate questions in language-specific places. You can't copy and paste from a screenshot, you can't change the font or indentation, it's invisible to people without their sight so they can't participate through use of their screenreaders, screenshotted code is invisible to search engines...

Is it just somehow easier to some (younger?) people to screenshot a thing and post it? Is it just scary to lose syntax highlighting because Reddit or some other forum or app doesn't support it as readily as their IDE or Github? Some other reason I can't think of?


r/AskProgramming • • Oct 04 '21

This sub is so much better than Stackoverflow. You guys rock

74 Upvotes

In SO you have to think ten times before posting a question, in case they ban you from asking questions lol


r/AskProgramming • • Sep 13 '25

Programmers and Developers Do you have a Computer Science Degree or are you self taught?

73 Upvotes

Bootcamp,YouTube,College ?


r/AskProgramming • • Oct 21 '21

Do any programmers out there get sick of thinking?

73 Upvotes

This is just in general. I've been a professional software developer for around 8 years now, I'm a lead so I have a make a lot of decisions around architecture and how to solve general problems.

Does anyone else get decision fatigue? I come into work some days and my brain winces at the thought of having to do more thinking.

Sometimes I dream of a simpler life, like being a gardener or something (definitely not dissing any gardeners out there) where I don't have to think so damn hard about all the edge cases etc, I can just do.

Does anyone else get this? Does anyone got any tips on how to deal with decision fatigue? I think the answer is obvious and I just need to take a little break from coding, let my mind unwind. Just wanted to see other peoples opinions, see if there's any good ideas


r/AskProgramming • • Feb 05 '21

Other Do you also get into the programming zone?

73 Upvotes

Since the title doesn't exactly describe what I mean, let me explain:

So when I listen to electro music via headphones and drink coffee, I get into a tunnel vision where I ignore all other Input from the outside and focus only on my programming task on my screen. I go into a trance mode where I see/imagine all the logic of the Programm structure with mental eye before I proceed to programm perfect code, that fulfills the current task and is bugfree. This mode/zone continues for like 10 hours straight after which I have completed a workload originally intended for several weeks and after I then finnaly get up and notice that I am dehydrated and my blood sugar level is running close to null.

Anyone else experiencing what I described?


r/AskProgramming • • Oct 22 '20

Careers Does coding become less fun when its a job?

73 Upvotes

I really like coding. Its like a puzzle almost. And I want to work in it not just because I like it but also because I think for the most part I'm good at it. But what I'm concerned about, is that while it may seem fun when you're doing it for yourself, does it become less fun when your working for it?


r/AskProgramming • • Dec 15 '19

Careers How to make a side income programming as a student ?

73 Upvotes

Hey Redditors,

I'm a 20 years old student and I've started programming seriously 3 years ago, I tried my hand at several things, web development, building bots and web scrapers, and web development, I decided to with web development for a while and learned several frameworks to work on the backend and frontend.

I'm looking to make side income (400 - 800$/month) through programming, either web development or building automated scripts.

What I learned:

  • Python (Advanced level, Flask & several libraries for scraping)

  • Javascript & VueJS (+ HTML, CSS..etc)

  • Firebase, some experience with elastic search, several APIs, building REST APIs

  • I tried React Native a little bit.

Python is the main language I use for most of my projects.

What I tried so Far:

  • I tried freelancing when I was 18 years old, I got a few remote gigs here on reddit & upwork, but all that was during summer, as soon as it's 'back to school' I would have no time to continue and lose contact with clients, even though I made a good amount of money but the work it took was too much (one month working almost everyday to make less than 600$ per month) back then I was just starting so that was a great achievement

  • Starting side projects that might make some money, I've always started projects and stopped them because I wasn't able to get attraction at first and worried that all my efforts would go in vein, entrepreneurship is hard, I even started a local app in my country, I have few hundred users per day but I can't make any profit from it yet.

I'm considering to start a blog teaching people how to build automated scripts and bots and scrapers and make money through ads and selling courses to my audience in the future but I don't know if it's a viable business especially that it's a very crowded place.

I can only afford to code/work for 10 hours / week as my schedule as a student is very tough and I have to maintain my academic level as this is important for me

Thank you for your help :)


r/AskProgramming • • Mar 23 '26

Career/Edu 10 years of personal projects work, feels like nobody cares

72 Upvotes

I'm an experienced developer, CS degree, and for the past ten years, I've been heavily invested in dozens of personal projects. I spend an enormous amount of free time working on them. I've learned an incredible amount of information from them, more than I would reading a hundred programming textbooks. Each have been handwritten from scratch, no external frameworks or AI generation.

I've been fortunate enough to have some of my projects get actual attention. One has 30,000 release downloads currently, another project with 2000 downloads, etc. Other tools I've written have small userbases of 100 or less each. Some only are used by myself and have gotten no traffic.

Regardless, even if I continue this until I die, it all feels incredibly pointless. Employers only care about my portfolio to an extremely small degree. Users only care about my software to the extent of it being immediately useful to them, and afterwords it becomes worthless. The general public no longer cares as all non-enterprise code is just 'AI generated slop'. Other developers seem to often come in skeptical and critical.

I enjoy writing software. But it just feels like to the world, I might as well be playing video games or watching TV. Curious how others feel about the meaning of their work.


r/AskProgramming • • Jul 01 '24

Which is the most honest tech company, from an engineering standpoint?

72 Upvotes

I understand that pretty much all of the big tech firms are staffed with first rate software engineers, and guided by some of the best leads and project managers in the game. My question is, out of these elite groups, which is the company least likely to resort to shortcuts, putting a premium on worksmanship and quality? I've heard stories that at one point Steve Jobs and his temper tantrums harassed Apple's team into producing some of the most taut and bulletproof code in the industry. Who would it be now, though?


r/AskProgramming • • Aug 25 '20

Careers Should a person with no prior knowledge of programming study computer science?

72 Upvotes

Programming or computer related stuff. Can I survive?


r/AskProgramming • • Jun 19 '20

How do stock trading companies, like Robinhood, get access to the NASDAQ and NYSE? Is there an API that allows anyone to connect to these exchanges?

72 Upvotes

r/AskProgramming • • Mar 15 '20

Is hackerrank hard or am I just a bad programmer?

72 Upvotes

I've been working through HackerRank (for like almost a year now) and recently I've been focusing on the mathematics, functional programming, and algorithms sections (I've already completed python and regex). It's really demotivating to see a medium question with a 70% success rate and not being able to complete it without extensive googling, or even not being able to solve it with that. Is HackerRank actually that hard or am I just bad?


r/AskProgramming • • Jun 09 '25

In FAANG and those companies that have a clear career ladder, do those high level like Fellow, Distinguished Engineer code better than Senior? even senior has been coding for at least 10 years.

71 Upvotes

In my country and many companies I know, the highest title is just Senior SWE, even you have been coding for 20-30 years.

But I'm curious in the US , they got staff, fellow, L10 etc etc..
Do these people code better than seniors?

Link to career ladder of FAANG: https://imgur.com/a/jMGBXkq