Objective-c training is better for understanding computer architecture

than higher-level languages ​​like Java C # ... is this argument valid? I am new to iPhone development and some people have told me this.

+4
source share
4 answers

You ask if you get a better idea of ​​auto mechanics if you drive a mechanical gearbox rather than automatic ones - you will feel a little what the engine is doing and you will get a terrible chopping mess if you do it wrong, but you won’t get any deep understanding of what is under the hood.

The semantics of the C language, of which objective-C is a superset, reflects the architecture of the machine for which it was created - PDP-11.

If you look at modern computer architectures - shared command and data memory, virtual memory, L1 and L2 cache, bus speed limits, north and south bridges, multi-core or multi-core processors, solid state drive, graphics processor, FPGA accelerators - then there is no language , which has semantics that will meet all the options, and the C language has nothing to do with them. The best place to study computer architecture is a text book or a lecture on computer architecture, or read about how modern architecture effects programs are in all languages .

C will provide you with portable assembler, so it is a few steps from the architecture - it is assumed that you have pointers (which can be implemented as addresses) in the area where you can store data, and they have keywords that imply that the data may change (mutably) and that the processor has registers, and is not based on the stack. But in reality, this will not tell you about the architecture of your machine, it will only tell you about the C memory model, which is an abstraction of machines 40 years ago.

+5
source

If you want to develop the Iphone, this is the only choice, you can not use Java or C # as one of the new policies of Apple

If you don't want to do Iphone dev, learning about C / Assembly is also good when you work closely with hardware.

+3
source

There is always an architecture above and below where you program. C # / Java allows you to program (and therefore learn) CLR / JVM virtual machines, while lower-level languages ​​let you learn about lower levels, as well as higher-level languages ​​(like SQL) let you program higher architecture. Depends on what you want to know.

As a rule, assembler will ground you on most processor processors, while things like microcoding will teach lower information (if you want to know about it). Believe me, the levels are lower.

Personally, I recommend C (and these are the children of C ++ and Objective-C), since a good middle ground can indicate what the basic architecture of the computer is , as well as the architecture of the iPhone.

+3
source

My teacher in a collage once said in a performance optimization lecture:

  • To write the OS - find out your car.
  • Are security holes used? Know your car.
  • Performance optimization? Know your car. etc...

To find out your car: study the assembly.

However, I believe that objective-c may be the best way to learn some programming basics, you need to think about memory management, which you do not need to think a lot about in Java. Although I have to agree with earlier speakers, C may be a better approach.

Side note. In the lecture, the same teacher also said: "Learn assembly: know your car." Got to love him.

+1
source

Source: https://habr.com/ru/post/1313745/


All Articles