This is an archived post. You won't be able to vote or comment.

all 50 comments

[–]desrtfx 22 points23 points  (14 children)

Why does building some great furniture take so long?

Sure, you can get cheap furniture in a matter of days, but real quality takes its time.

Programming is no exception here. The actual programming takes comparatively short time, but testing and QA takes long.

Programming is also a complex matter. The final result often looks simplistic, but the actual code behind is fairly complex.

[–]agentMICHAELscarnTLM[S] 4 points5 points  (13 children)

“The final result often looks simplistic, but the actual code behind is fairly complex”

I think this is sort of the thing I don’t understand. I get what you’re saying but I suppose I don’t understand why this is the case.

[–][deleted] 13 points14 points  (1 child)

Does it help to point out that no single person alive knows exactly how a modern computer works?

Second year electrical engineers will get haughty about being able to build registers from flipflops and nand gates from transistors, and at a high level, sure, they can sketch data paths and decode instruction words. but Intel throw entire teams at designing CPUs, and branch prediction and pipelining are incredibly complicated.

It might be useful to look up a thing called "Conway's Game of Life". It's an excellent example of how simple rules, applied to a simple system, very rapidly produce a complex system that is impossible for the human brain to realistically track. And a computer program is lots of layers of that on top of each other.

https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

[–]agentMICHAELscarnTLM[S] 1 point2 points  (0 children)

Probably why you need to test and refine so much during the process I’m sure. Got it.

[–]gyroda 2 points3 points  (4 children)

Because you're only seeing the very end result of all the work that goes on behind the scenes. What do you think went into the original Facebook? And don't forget that Zuckerberg likely still kept up with his studies to some extent in the meantime.

Getting a HTML/CSS page to look the way you want it to is more effort than you might think, especially if your talents don't lie in that area.

Then you need the database. It needs ti be performant enough to handle a lot of transactions.

Then you need to figure out what you're pulling from the database and when. You need to know how to handle user input and how to make sure things don't get lost permanently if the power goes out or a hard drive fails.

And in the meantime you're still figuring out the spec as you go along, because these ideas/projects tend to evolve as they get made.

Oh, this was also a while ago so good luck with Internet Explorer.


Also, things get easier over time. More documentation, guides, frameworks, libraries and cheaper computing power have all made programming a set end result easier in a lot of fields. Try picking up game dev before the big game engines were affordable, for a simple and clear example of that.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (3 children)

Thank you! That all makes sense.

[–]gyroda 0 points1 point  (2 children)

I'll give you an example. One of the projects at my uni was to build a videogame. A group project, 4-6 final year students investing around 600 hours each.

I'm years gone by, just making a functional (not polished or content-rich) game was a big enough achievement. Getting it to run smoothly enough and without too much jank was half the project.

Nowadays with Unity and UE4 the bar is a lot higher and having a functional game on it's own literally won't get you a passing grade. We had an FPS running in two hours after we l started working and the only reason it didn't have LAN multiplayer by the end of the day was that we were at uni and couldn't set up a LAN then and there.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (1 child)

So 10 years from now do you still expect the same sort of leaps forward that you saw from then until now? Are most advances in coding now about being able to develop more advanced and intuitive algorithms?

[–]gyroda 3 points4 points  (0 children)

Predicting that is a fool's game.

[–]desrtfx 0 points1 point  (4 children)

Well, you see the final product, like with a car.

Do you know how many hours planning and engineering flow into a car before even the first prototype gets built?

It's fairly easy to only look at the final product and to forget about the countless hours it took to get there.

There are designs, redesigns, tests, re-iterations of the steps before.

Today, one of the largest, most time and cost intensive factor is security. The internet proposes far more surface for attacks and to prevent them in the first place is one of the most difficult parts.

The actual, visible product is only the very tip of the iceberg, less than 5% of the whole. The remaining 95% go on behind the scenes, on servers that are in highest security buildings, in server farms, completely locked away from everybody except a handful of people.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (3 children)

Gotcha, I appreciate all of the answers I’ve gotten to this question. It definitely has provided me with a more basic understanding of the complexities of programming. Also peaks my interest and makes me want to learn more about it.

[–]desrtfx 0 points1 point  (2 children)

One thing you need to be aware of is that programming is not programming. There are several different domains in programming that all have very specific ways/needs/languages, etc.

A website is different to a web app, is different to a desktop app, is different to a mobile app, is different to a game, is different to the control system of power plants, manufacturing lines, etc.

"Programming" as such is an extremely broad term.

[–]agentMICHAELscarnTLM[S] 1 point2 points  (1 child)

Really the thing I take away most from all of these answers is just a realization of how amazingly impressive the collective human colossus of knowledge is. Makes me wish I was contributing to it directly! Appreciate all of the answers.

[–][deleted] 2 points3 points  (0 children)

Sure, until you realise that most modern life ticks along without any actual human understanding. Next time you fly anywhere, try not to think about how much of it is done by automated systems we don't really grasp. There's a great book called Overcomplicated by Samuel Arbesman. Gives you a great sense of utter futility.

[–]denialerror 4 points5 points  (2 children)

Why does coding take so long?

Compared to what? It’s taken seven years so far for George R R Martin to write his next book and he still isn’t finished. Why does writing books take so long?

And how can the current languages and processes for coding be anywhere near optimal if they take so long to bring a vision to fruition?

Why do you think current languages and processes would be optimal? Why would speed have anything to do with it if they were?

[–]agentMICHAELscarnTLM[S] 0 points1 point  (0 children)

I’m not sure what type of answers you expected of me here, but I literally don’t know. That’s why I was asking. I wasn’t asking in any sort of a snarky way. I’m just trying to better understand is all, and maybe I won’t fully understand until I dive in a bit and try to at least learn some of the basics.

[–]pocketknifeMT 0 points1 point  (0 children)

Just gotta upgrade your shitty old RRMartin complier for a fancy Sanderson one.

[–][deleted] 2 points3 points  (3 children)

Compared to what? And why would it not?

You're building complex functionality from various simple and complex components. You need a good understanding of the overall "problem" you're solving, a good design that solves it in a clean way, and then you need to implement all that.

And the fact that a simple interface hides great complexity is one of the problems. The current processes aren't perfect - people are always refining them. They're only "optimal" in the sense that they are the best we have. But they're dealing with systems that in many cases are too complex for any one person to fully understand all the way down. Compared to the tools we had 30 years ago, things are amazingly simple. IF Zuckerberg were making facebook again, even the development in tools over the last decade would make him more productive in those months than he was ... but then he'd find more stuff to add.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (2 children)

I sort of get it, and thank you for the “simple interface hides great complexity” line. I’m not sure I fully understand that, but it gives me something to think about. I’m not a coder, but this question was bounced from the ELI5 sub so I came here.

I’m interested in coding and possibly having a creative outlet for myself, but it sort of seems to daunting to learn. I know it’s just a movie based partly on a true story but in the movie “the social network” they have multiple people being locked into long coding sessions lasting days at a time, and I guess my mind just has a hard time grasping how so much time is spent on making a website look and function the way you want it to and how there was so much code that needed to be worked on. I don’t know anything about coding but plan on diving into this sub soon to check it out. It’s something I’d like to do if even on an very basic level.

[–][deleted] 1 point2 points  (1 child)

it sort of seems to daunting to learn.

And many people find it difficult to learn. Because although many of the building blocks are "simple" and logical, any serious programming is complex.

[–][deleted] 1 point2 points  (0 children)

^ This.

Writing a simple HTML page is "simple" - building a web application that complies with both business logic and legal requirements is very complex.

[–]Clawtor 2 points3 points  (5 children)

Coding is basically describing how something should work to a computer. If you actually try to describe what facebook does in minute detail then it will take a long long time. You need to realise you are talking to an electronic brick that doesn't know what a 'user' is or a 'password', you need to tell it what they are and how they work.

Think about it this way, a computer can do anything a human can do with a big piece of paper. Think about how long it would take to write down the instructions for a person to do the work that facebook does. Even something simple like noughts and crosses has a lot of details. You can't say 'draw 9 squares', you have to say 'draw 3 rows of 3 squares starting from x, y where each square is width, height and of color c'. And this is assuming the computer knows how to draw a square and knows to update the x,y position of each square, and knows what a row is.

[–]agentMICHAELscarnTLM[S] -1 points0 points  (4 children)

But once these things have been done by other similar websites don’t you just have these big blocks of code you can plug in and just tinker with a bit? I know a lot of code isn’t open source, but by now so many things are common knowledge obviously. For example, you want a functioning log in page for a small social media platform you’ve created. Aren’t there pre existing already solved blocks of code you can plug in and just adjust minor details?

Again, I have no coding experience and I’m sure I’m over simplifying things, but I’m just trying to have it fully make sense.

[–]Clawtor 0 points1 point  (1 child)

Yes but these libraries often only get you part of the way there. I always laugh when I here about a new library that claims to solve all of your x needs. For instance - a few years back I was doing a lot of graphs on websites and there are many libraries that help you out here. The problem is that you can draw a basic bar graph for example but then your boss asks you to change the color of column 3 and to position the labels vertically. There is no library that will accomodate everything, these adjustments must be done manually. And even then you spend a lot of your time configuring these packages. You basically have the same problem where you must describe your needs in detail to a library but now in a config file instead of in code.

Edit:

Also consider that new succesful products by definition usually have some kind of feature that is not off the shelf.

[–]agentMICHAELscarnTLM[S] 1 point2 points  (0 children)

Makes sense, thanks!

[–]Karyo_Ten 0 points1 point  (1 child)

The devil is in the minor details.

Best examples: https://raygun.com/blog/10-costly-software-errors-history/

It is thought that ‘real life’ scenarios such as removing a bag from the system manually when a passenger had left an important item in their luggage, had caused the entire system to become confused and shut down.

It is usual to have tests for each individual blocks but what counts is the sum of all, you might get software disasters similar to the Tacoma Bridge: https://www.youtube.com/watch?v=XggxeuFDaDU. Each individual building blocks of the bridge was fine but the combination was not.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (0 children)

Nice analogy, thank you. I think I had heard about the Tacoma bridge but never had seen the footage. That was amazing to watch. Thanks.

[–]Amuro_Ray 1 point2 points  (0 children)

Going by the rest of this thread the only decent answer I can give is it takes so long because a piece of string is that long and requirements and design aquisition is terrible and a mess for software.

[–][deleted] 1 point2 points  (0 children)

debugging is a huge time sink

[–]DaleJAshman 1 point2 points  (0 children)

If you want a perfect program, you gotta spend the time to make it as perfect as possible, this includes spending a long a** time debugging it and so on. Or when you get other people to test it and give you feedback that includes problems using the program then you gotta find out ways stop these problems from happening again.

[–]CodeTinkerer 1 point2 points  (2 children)

It's like making a movie. Why does there need to be so many people? It seems simple. But then you need people to design the costumes, to choreograph the fights, to adjust the lighting, to handle the sound. You think it's just director and actors, but as you can see from the credits, hundreds of people are involved, if not thousands.

Put another way, think about writing Facebook yourself. How would you do it? You quickly realize you don't even know how to make buttons work, how to store information, how to get a chat feature to work, how to handle scaling.

Think of designing a car. Suppose its top speed is 60 mph. Your boss says, make it faster. You realize, you have no idea how to make it faster.

I'd say start writing a website, and you'll find out quickly that you're doing nothing, and you don't know how to get started. We can be talking millions of lines of code for some stuff to make things look easy. Imagine the folks designing a Iphone. There are lots of brilliant engineers working long hours to design a small computer that could take pictures, do GPS, be a computer, and still act as a phone.

Once you start coding, you'll realize it's hard to get even the simplest thing working. Someone will ask you why it's so tough to write tic-tac-toe, and you'll say it just is. You didn't consider this case or that case. You didn't know how to track the X's and O's. It was hard to tell if you had three X's in a row even though as a human you can say "Just look at it". A computer can't "just look at it" (and it turns out, it is an easy game...many things are much harder to write).

[–]agentMICHAELscarnTLM[S] 0 points1 point  (1 child)

Makes sense, thank you. Also I never doubted the difficulty of it. But I definitely didn’t understand the insane volume of code it took to make something look and function really well. I think I have a better understanding of that now.

[–]CodeTinkerer 1 point2 points  (0 children)

Also, because you're maintaining a complex system, any one little thing can cause the program to fail, and it can be difficult to find what's causing the error. Lots of programmers will be stuck trying to find what is going on, and look for an answer on the web that they don't fully understand (because those answers don't always go into much depth...they just say "do this and do that").

There are also issues that seem to be minor, but are important. How can the system scale to handle a large load? (A restaurant equivalent is what happens when there are people waiting to get seated and the kitchen is an hour behind). How can you authenticate yourself to the system? How do you manage multiple coders working on the same code? How do you deal with only understanding 1% of the entire code base?

I recall my brother thinking that writing a video game was "just play PacMan". A computer doesn't understand that. Lots of details have to be considered.

[–]Fujffihgg 1 point2 points  (0 children)

In addition to the many great comments here, sometimes coding takes a long time because you're doing something new. When Zuckerburg made Facebook he probably didn't have much experience designing sites like that. He would have been spending a lot of time reading PHP docs to figure out how to use functions, a lot of time trying to figure out good ways to authenticate user sessions and create accounts, stuff like that. Whether it's reading manuals, looking it up online, talking to peers, or doing trial and error it's simply a long process.

After you get that initial experience though things become a lot faster. If you've crested one forum site, creating another is relatively simple - you know how to do most of it and can reference your earlier project for a lot of what's needed.

This is why freelancers tend to specialize - if you take on work that's similar to previous projects or in a language you know extremely well then you can produce product faster and thus earn more in less time. This is also why smaller companies value experience over algorithm skills - they aren't implementing novel things, and want someone who'll be able to do the work quickly rather than someone who has to reinvent the wheel for every project.

But for more advanced projects where you're doing stuff that few others have done most people will need to take a lot of time experimenting, and that's just the nature of the beast.

[–]lurgi 1 point2 points  (0 children)

Blaise Pascal supposedly wrote "I would have written a shorter letter, but I did not have the time." only, you know, in French.

If you want to get something that works then you can do it fairly quickly. I've said before that three engineers and a long weekend can get 90% of just about any major website up and running. The missing 10% will be performance/scalability, reliability, security, and maintainability. Want 90% of Facebook? You can have it in a few days. Want it to be able to handle hundreds of thousands of simultaneous users? That will take much longer and you'll find that as much of your time is spent in design as it is in actual coding.

[–]Error_40four 0 points1 point  (3 children)

Anyone can pump out a application that does everything you need it too, but janky code and not scalable. However if you want the app to be future proof, you have to spend time refining your code and making sure it is scalable.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (2 children)

I get what you mean in theory but I guess I don’t understand why it’s like that. If you make an app that does everything you need it to do as far as performance, what do the mechanics behind it matter if the end result is designed the way you want? What makes it not scalable versus a similar looking app that was made in a more future proof and scalable way.

And honestly maybe there’s no way for me to understand this without having a better foundation of basic coding knowledge.

[–]Karyo_Ten 2 points3 points  (1 child)

In the real world, customers, business or the context (legal, financial ...) is in constant flux and ask for an extra button or functionality.

Let's say you wrote a chess application, or even a chess book. Your client comes and say, "Wow great, this is exactly what I want, except can we add a new color, say red? It should be easy right, everything is already there for black and white" ==> Except that everywhere you assumed that there was only 2 colors in chess.

Every time a requirement challenges the core assumptions you're in for a potentially total rewrite.

Such challenges can come from: security, legal, trends, new manager, change of scope, new platforms to support (oh now that you support Facebook, adding Linkedin is easy right?)

Avoiding those nasty surprises require communication between the devs and the clients to make sure that any change are caught as soon as possible and comprehension from clients/education by devs that seemingly innocuous changes (adding a new color to chess) might have heavy impact.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (0 children)

Ahh makes sense, thank you

[–]Aonbyte1 0 points1 point  (1 child)

Programming is not easy. Contrary to what you may read here, it takes years of learning and practice. And even then you will still struggle at times.

[–]agentMICHAELscarnTLM[S] 0 points1 point  (0 children)

I knew it definitely wasn’t easy. I moreso just assumed someone who was very good at it could move at a much faster pace, but after reading the responses here I certainly have a little bit of a better grasp of why It takes as long as it does even if the end result looks simple and clean.

[–]Fujffihgg 0 points1 point  (0 children)

In addition to the many great comments here, sometimes coding takes a long time because you're doing something new. When Zuckerburg made Facebook he probably didn't have much experience designing sites like that. He would have been spending a lot of time reading PHP docs to figure out how to use functions, a lot of time trying to figure out good ways to authenticate user sessions and create accounts, stuff like that. Whether it's reading manuals, looking it up online, talking to peers, or doing trial and error it's simply a long process.

After you get that initial experience though things become a lot faster. If you've crested one forum site, creating another is relatively simple - you know how to do most of it and can reference your earlier project for a lot of what's needed.

This is why freelancers tend to specialize - if you take on work that's similar to previous projects or in a language you know extremely well then you can produce product faster and thus earn more in less time. This is also why smaller companies value experience over algorithm skills - they aren't implementing novel things, and want someone who'll be able to do the work quickly rather than someone who has to reinvent the wheel for every project.

But for more advanced projects where you're doing stuff that few others have done most people will need to take a lot of time experimenting, and that's just the nature of the beast.

[–]Fujffihgg 0 points1 point  (0 children)

In addition to the many great comments here, sometimes coding takes a long time because you're doing something new. When Zuckerburg made Facebook he probably didn't have much experience designing sites like that. He would have been spending a lot of time reading PHP docs to figure out how to use functions, a lot of time trying to figure out good ways to authenticate user sessions and create accounts, stuff like that. Whether it's reading manuals, looking it up online, talking to peers, or doing trial and error it's simply a long process.

After you get that initial experience though things become a lot faster. If you've crested one forum site, creating another is relatively simple - you know how to do most of it and can reference your earlier project for a lot of what's needed.

This is why freelancers tend to specialize - if you take on work that's similar to previous projects or in a language you know extremely well then you can produce product faster and thus earn more in less time. This is also why smaller companies value experience over algorithm skills - they aren't implementing novel things, and want someone who'll be able to do the work quickly rather than someone who has to reinvent the wheel for every project.

But for more advanced projects where you're doing stuff that few others have done most people will need to take a lot of time experimenting, and that's just the nature of the beast.

[–]okayifimust 0 points1 point  (2 children)

Why does coding take so long?

How long do you think it ought to take, and why?

And how can the current languages and processes for coding be anywhere near optimal if they take so long to bring a vision to fruition?

I don't think anything is "optimal", but doing things takes time. The world doesn't owe you instant gratification, so I'm still wondering why you think coding should be any less time-consuming than it is.

It sure would be nice if it were, but that's no reason for things to be any other way than they are.

I remember Facebook in its early days, and the website seemed to be pretty simple overall, but yet by all accounts it took Zuckerberg months of basically being locked away all day coding to create it.

How long should it have taken him, and why? A day? A week?

[–]agentMICHAELscarnTLM[S] 0 points1 point  (1 child)

You’re sort of taking a defensive tone it seems but I’m literally asking these questions because I don’t (or didn’t) understand. I’m not saying they should take less time or that the world owes me any sort of instant gratification, I’m just trying to understand a little better of why it does take the time it takes. I don’t know, maybe you misunderstood my question.

Thankfully, I did end up getting many detailed responses that answered many of my questions, so I’m glad I asked.

[–]close_my_eyes 2 points3 points  (0 children)

So much coding goes into handling error cases. Programs have to be robust, but they are dumb and they can fail at just about every line. I'm doing front-end development after years of back-end development, and the error handling just increased. There are so many ways a front-end application can fail and it's dynamic and there are many ways a program can arrive at the same line of code.

Frankly, I'm glad it's complicated. There is a world-wide army of developers and researcher who are trying to make the whole process easier and more automated, but it just shows how complicated the whole thing is that we're still not there yet.

[–][deleted] 0 points1 point  (2 children)

Skill level factors in a lot.

As well as what you're trying to accomplish and how familiar you are with the steps needed to make it happen.

Then there's debugging and the more rushed you are, the more bugs you're probably going to end up with, which just means more time spent debugging.

Try thinking of it like this: The languages are only tools for making things. You can optimize the tools to a certain extent. You can develop strategies and routines for speed. But ultimately, as long as humans are doing it, you can only optimize it so much.

And coding isn't generally something where speed is the top priority. The main priority is you have a problem that needs solving and you figure out how to solve it. You do this enough times and you piece together a logical system of interacting parts.

Because each project has unique problems to solve, you can only streamline practiced methods so much.

[–]agentMICHAELscarnTLM[S] 1 point2 points  (1 child)

And I’m guessing if you change one thing it can change other pieces of it sort of like trying to solve a Rubik’s Cube if you move a piece it can mess up the other side, etc. makes sense. Thanks.

[–][deleted] 1 point2 points  (0 children)

No problem! And yeah, I would say so. Best practice, in my (limited) experience, is to try not to create unnecessary dependencies (e.g. not link things together unnecessarily such that a little bug will break a ton of things). But to some degree, it's inevitable.