What are the hardest things to program?

Summary
In your opinion, which software is the trickiest to program?
In your opinion, what are the most difficult things to program?

People have said that it's things like operating systems, hardware drivers, physics simulators, and game engines.
 

Klystron

Gold Member
421
446
In your opinion, what are the most difficult things to program?

People have said that it's things like operating systems, hardware drivers, physics simulators, and game engines.
I have designed and written software for all your examples with the exception of 'game engines' without notable difficulty. An unresolved programming issue encountered in artificial intelligence (AI) classes and discussions concerns modeling human emotions.

Creating matrices containing integers that represent an emotion such as anger fail to model the most basic human response to emotional conditions. Consider so-called "lie detectors" that measure pupil dilation, galvanic skin response (gsr), pulse rate, breathing patterns, even micro-tremors and other involuntary speech patterns. None of these measurements reliably indicate emotions, past emotional states or veracity of responses.
 

DavidSnider

Gold Member
457
109
People. People are the hardest thing to program.
Yep. It really boils down to this in the end. Operating Systems, Physics Engines, Games, etc are not written by a single person. Every complex program is a collection of simpler programs and the hard part is getting them to communicate and cooperate with each other. To get the programs to communicate well you have to get the people writing them to communicate well.
 
494
176
If you are making an embedded system the USER INTERFACE is always the hardest to get right in my experience.
 
324
217
IMO, it's not really about the language or the final product. It's more about the development environment, coding standards, debugging tools, specifications and such. It's easy and quick to write bad code, or to code the wrong functions.
 

anorlunda

Mentor
Insights Author
Gold Member
7,164
3,944
The most difficult projects are the ones with the poorest requirement definitions.

I was once forced to make a system A interface with a preexisting system B. But they refused to tell me anything about B.
 
10,719
4,287
There are some mathematical games that defy programming. One was Sprouts the line segment from midpoint to midpoint game where you weren't allowed to cross a line segment.





The difficulty was the program had no sense of spatial connections and would have to exhaustively search for them. So while you might write a program the computer will take way too long to be a formidable player playing the best move.


This gets back to Millenium Problem: P vs NP Conjecture and whether timely solutions can be found or at least verified in a timely fashion.


 
Last edited:
What about an artificial general intelligence (AGI)?
 
10,719
4,287
Well of course, since no one has done it yet. Similarly for an ASI ie Artificial Super Intelligence.
 

Tom.G

Science Advisor
2,686
1,506
Summary: In your opinion, which software is the trickiest to program?

In your opinion, what are the most difficult things to program?
Anything you haven't previously succesfully completed! :nb)
 

Svein

Science Advisor
Insights Author
1,939
593
The hardest things to program...

Since most of my programming lies in the hardware interface ("drivers"), the hardest things to program are the cases where the hardware has some idiosyncrasies that are badly documented or where the higher-level programs have some odd requirements.

The worst case:

An ARM 32-bit processor (cannot remember which one) required all longs to be aligned on a 32-bit memory boundary. Accessing a long on a 16-bit boundary did not give an error message but instead returned a scrambled version of the previous long and the required long.

An Ethernet data packet has a 14 byte header followed by the data payload.

The IPv4 protocol assumes that the protocol header (about 20 bytes) is aligned on a 32-bit boundary.

The malloc function for the ARM processor returns a memory block aligned on a 32-bit boundary.

So - as I had done lots of times for Intel processors - I allocated a memory buffer and told the Ethernet controller to use that buffer. When a data packet arrived, the driver checked the packet type (the leading two bytes) and (discovering that it was an IP packet) gave the IP protocol handler a pointer to the data part of the packet.

The IP protocol failed every time. It did not recognize the IP address even though I could see the correct address in the data packet. It took a while to pin down the fault - the IP data packet was not aligned on a 32-bit boundary. The solution was a real kludge - copy the complete data part on to another buffer that was aligned on a 32 bit boundary. A better solution would have been to have the Ethernet controller start on a 2 byte offset, but hardware limitations precluded that.

Why was the copy solution a bad one? Simply stated: Copying a data block internally took longer than transmitting the data packet across Ethernet!
 

strangerep

Science Advisor
2,957
734
I was once forced to make a system A interface with a preexisting system B. But they refused to tell me anything about B.
Wow, that's an ultimate AI system. Plug it into anything, and it has to learn (all by itself) how the other thing talks and what it does. :wideeyed:
 
14
2
I think the hardest programs are big programs.
As they get bigger you might lose track.
Or you might have underestimated the effort.
 

anorlunda

Mentor
Insights Author
Gold Member
7,164
3,944
I think the hardest programs are big programs.
As they get bigger you might lose track.
Or you might have underestimated the effort.
That's very true. The converse is also true that the move beautiful and coherent programs are those which can be conceived, implemented and tested in a single session. Obviously, that puts limits on how big the program can be. It also explains why all-night sessions are common among software developers, and why the young have the advantage over the old in that profession.

I used to wish that we could hire programmers at age 13, work them mercilessly until age 23, then pay for their primary school and college education after their retirement at 23. But of course, that is not allowed in software, although we come close to that in athletics. Nearly 100 years ago, my uncle was removed from his family and school at age 8 to live at a baseball farm that belonged to the Boston Braves.
 
I think the hardest programs are big programs.
As they get bigger you might lose track.
Or you might have underestimated the effort.
Big programs, like Microsoft Windows 10, has roughly 50,000,000 lines of code.
 
1,316
681
I think the hardest programs are big programs.
Well, I think above a/the (human) limit the difficulty (for an individual) is actually a lot lower, since the load will be distributed to teams instead of individuals and most of the responsibility will be shifted to the engineering phase and testing.
Of course if what the engineering phase produces is a mess then it is #14.
 
In my 40 or so years of experience, the hardest things to program are modifications to other programmers' reports using other programmers' libraries and utilities.
 
10,719
4,287
Especially if the code never worked but no one knew it until you looked at it.
 
Last edited:
Right, but often it only works because of a lot of mistakes cancelling each other out.
 
If you are making an embedded system the USER INTERFACE is always the hardest to get right in my experience.
Probably because there is no universal "right". It is impossible to make everyone happy, and trying is more of an art than a science.
 
10,719
4,287
Two things commonly happen with UI development for a client:

1) The client sees your design and expects the finished product to look exactly like what you showed them in your mockup because it was too precise looking. Some designers I know, advocated showing a client crayon based designs so they couldn't build any unreasonable expectations.

2) The client changes their mind or the project has feature creep which affects the design causing delays and changes to be made.
 

Want to reply to this thread?

"What are the hardest things to program?" You must log in or register to reply here.

Related Threads for: What are the hardest things to program?

Replies
17
Views
785
Replies
8
Views
1K
  • Posted
Replies
22
Views
4K
Replies
2
Views
1K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top