To what extent does hardware affect programming?

Asked

Viewed 285 times

12

Nowadays the world is very dependent on the technology and the benefits it brings. Most of the time we are writing several lines of code that will be converted into machine language and thus give life to what we write. But what makes this reality is precisely the machine, or can also be called hardware.

It is the fundamental part to carry out any operation, but nowadays it does not seem that the difference between knowing on which hardware the program will be running is so relevant. But don’t confuse what I just said with the platform on which it will be running, nor the benefits that it brings, I’m saying that looks like that the hardware does not have so much relevance that this issue is discussed at the beginning of each project, or at least be taken with great consideration, perhaps to the point of being made another source code that adapts to a particular hardware.

The question is where is the limit that all this affects the programming, since it is possible to apply, depending on the project, as truth what I said, so it is difficult to define at what point it really matters when programming. I could give you some examples like: Does a well-made code and using the right tools bring more performance and quality than a hardware with cutting-edge technology? If we had the freedom to dictate how the hardware would behave, even if it was more complicated or not, the performance of the program would increase?

The hardware on which a particular program will run affects in several ways how it will behave, but in a general, whether mobile, desktop or even a video game, the extent to which hardware affects programming? What are the consequences of not worrying about it? Using as an example a desktop program, remembering the main question, can certain pieces of hardware make me avoid writing multiple lines of code to optimize the program? or make it run faster?

  • 2

    It does, and how it makes a difference. I work with Angular and Ionic, before I worked only with PHP and Web language. Angular is faster, so the server does not need as much hardware as it would need to wheel the same application in PHP and Web. That’s just one example.

  • 6

    I’ll be honest, and maybe I’ll even leave a lot of people upset, but who "shows" in "ready-made things" doesn’t always necessarily program, usually follow cake recipes, Fws give a lot of things away. On the other hand, who creates the Fws or the script interpreters, these yes program, because they go through the difficult part, which can include understanding of the hardware and Apis of the operating system itself (each system has its own Apis for hard communication) and these programmers return it to them in a simpler way, the bulk is below the views of most.

  • 1

    @William agrees in part bad, programming is a very wide area. When for example working for Iot it is common to be limited by hardware

  • 2

    Dear @Lauromoraes at what point did you say that there were no situations that limited? What I commented is simple, there are many who do not actually program, just follow recipes, I know people who do not even know how to use if right and are trying to solve the treatment of data returned in querys and subquerys that are often to solve simple things, there are people who create complex and repeated ifs in sequence, have a series of examples that only writing an article will give to understand the magnitude of the problem. To sum up, hard is always present, even if you don’t notice, sometimes you have a great [...]

  • 3

    [...] equipment and not even notice that has processor features that advance you in a lot, the same is worth running the app on a VM (whether site or app), the features help, of course understand they are not always accurate, but writing an application avoiding memory leakage or loops that don’t leave the processor at 100% would be a basic one that one has to understand... In the end what I mean is that there is a lot of service out there to "create app", "create website", but there are few who venture to create what comes under the table, these yes understand the need for knowledge. ;)

2 answers

10

Most of the time we are writing several lines of code that will be converted into machine language and thus give life to what we write

This happens with some programming languages, not all.

nowadays it doesn’t seem that the difference between knowing on which hardware the program will be running is so relevant

For programmers who go to page three of the program. It’s true that for many scenarios this is true and you don’t need to know details, but at least a superficial and generic basic understanding is required for any programmer who uses this word with a capital P, that is, is not only a creator doe of codes or reproducer of cake recipes.

i am meaning to say that it seems that the hardware does not have so much relevance to the point where this issue is discussed at the beginning of each project

It’s not easy to classify what you’re trying to say that way, but in fact details about the specific hardware are not very relevant to decisions in most projects. It can affect specific decisions and implementation details. In some cases it is clear that the hardware makes a fundamental difference, even if not speaking of the platform, but in fact the general platform makes more difference than the specific hardware.

to the point that another source code is made that adapts to a particular hardware

It is always possible to do this with a lot of power and flexibility, although it can complicate any development, as long as it is necessary to do this. It has several techniques to obtain this.

where is the limit that all this affects the programming

Depending on each case, you can’t answer universally.

A well-made code and using the right tools brings more performance and quality than state-of-the-art hardware?

Very generic respond like this, but it is very possible a well done code to be millions or billions of times faster than a poorly done, in essence no hardware gives such a big advantage.

If we had the freedom to dictate how the hardware would behave, even if it was more complicated or not, the quality of the program would increase?

I don’t know what this means. Quality would need to be better defined.

the extent to which hardware affects programming?

This is too generic.

what are the consequences of me not worrying about it?

Let me give you an example: if you’re going to program on something that doesn’t have mass storage, it deeply affects how you should program. If you need persistence you will have to use something network helper. Or give up persistence and know this. NVRAM can change quite the way to persist the desired data.

Another example in cases of heavy calculations if you have GPU can change the shape that will do everything to take advantage of this feature.

Depending on the hardware, you can’t do anything that requires real-time behavior.

If you know that the application will only run on very fast machines can take less care with certain implementation points that can not happen the same if you know that it will run in a worse corner. But the fact that you can be more lax doesn’t mean you should. Just remembering that today most programmers are negligent with this in almost everything they do. Most people aren’t even aware of it and they use examples of fast things that are really slow, they’ve lost track of.

Cloud enters this or counts as a platform? It makes a difference, in some cases fundamentally how the project should be done.

  • 1

    "People who are really Serious about software should make their Own hardware." Alan Kay - 20/07/1982

  • 1

    @Peter has a truth in it, despite the exaggeration, at least for hj days :)

  • Well unlike Maniero! This word was used by Steve Jobs in 2007 during the iPhone presentation!! Apple makes the software + hardware. If you try to develop on Android (which is my case) you will see that it is a hell because the software never fits nicely with the hardware. The hardware software connection seems less important, but today it is only hidden. :)

6


Nowadays a "common" programmer does not have the least hardware concern, in theory the limits of memory, processing and storage will not be the heel of Quiles in most projects, of course I am speaking in general, when I say programmer "common" I am referring to programmers working on projects and basic commercial systems...

It can be complex for a programmer to adapt their algorithms to literally milk stone from weak hardware, it will inevitably happen with more specific programs, want examples of how I deal with it on different platforms? and how to really make more hardware make life easier for a programmer, or even make the programmer more "lazy"?

I work with audio processing, so imagine that I have plenty of hardware, a desktop for example, imagine that I will create a simple audio player for windows, the player needs to open the audio file, decode in the format that the speakers understand and spit the data on the audio card

(with mt hardware) My life will be very easy, smiling and happy programmer

I simply don’t even care about memory (I will open the entire file at once in memory), I have no processing problem (I will be able to decode the file practically at once)I will be able to send the audio array or array to the audio interface without having to create loops for targeted sending. (mt easier, without a glaring impact to the user and leaving the life of the programmer infinitely simpler)

(with little hardware) it is dangerous I want to cut off the face of the first q me look crooked kkk

For example a decoded mp3 file will have on average some 40Mb I’m talking about a file with a 4min audio mp3 in 64kbits sampled in 44100hz, imagine making a player for an mp3 player... an embedded system like this..

inserir a descrição da imagem aqui

Imagine the headache, limited memory, processor at most 20 Khz, this algorithm will be infinitely more complex, I’ll need to tear the file apart and decode these little pieces, a looping that at the same time throw these pieces of audio decoded in a buffer to only then send to the headphones, I have no processing and nor memory to do everything at once, I will need to create a buffer storage routine that contains a specific delay so that it does not affect the audio output (you cannot plug the audio into the user’s headset, so I will use a buffer, a kind of FIFO with a small time lag, I will need this to consume the input data in the buffer used for output dump, as soon as the buffer fills in the size I specified I will be able to "play" the decoded audio for the Peakers).

The last algorithm is much more efficient than the first, practically forces the developer to think how to use the few resources available consciously for performance gain, this was widely used in desktops of the 90s, the amount of ram memory at the time was roughly equal to or less than the size of a decoded audio file, there was no other way but to think about how to get the most out of existing hardware....

In other words, I think that hj is a programmer who is aligned with Hardware, only for specific beemmmm things ....

  • 3

    In other words, I think that hj is a programmer who is aligned with Hardware, only for specific beemmmm things That is so sad. If you think about the home computer, the home of the guy who spends all day watching crap on facebook, don’t make a difference, but in a corporate environment, with virtualized machines or not, everything that takes advantage of the machine (within common sense) represents savings, not just hardware, as energy and resources for ventilation and cooling, and this is nothing cheap. There are many other issues besides this.

  • 3

    I really like some things that you put in several of your posts (to the point of specifically remembering your username), but at this end I think we missed macro vision of the snowball that we entered with "semi-programmers" who do not pay attention to the basic things (from understanding under the hood, which you understand much better than the average). I think it may be reality what I said, but I understand how a failure to imply that it is "normal" (at least the last paragraph sounded like this) - "programmer" who has no hardware base is doing MUCH more damage than it initially seems.

  • https://www.azquotes.com/picture-quotes/quote-one-bad-programmer-can-easily-create-two-new-jobs-a-year-david-parnas-72-10-42.jpg

Browser other questions tagged

You are not signed in. Login or sign up in order to post.