if(true) - page 5

 
Igor Makanu:

I am not entirely wrong, there are C-like languages, but they are tied to specific compilers, mostly compilers that come with controllers

Visual Studio can easily compile in C
In the project settings you set the option to compile in C or C++

 
Roman:

Visual Studio can easily compile in C.
In the project settings you set the option to compile in C or C++

that's a different conversation, now it's more correct to talk about the compiler itself

 
и ...
 
Igor Makanu:

that's a different conversation, now it's more accurate to talk about the language features of the compiler itself

In visual studio for C, there is a BOOL define that extends into int
(a small softie's gimmick))

 
Igor Makanu:

Well not entirely wrong, C-like languages do exist, but they are tied to specific compilers, mostly compilers that come with controllers

but i'm a fan of mcrosoft software, if they have a bool then it's therehttps://docs.microsoft.com/ru-ru/cpp/cpp/bool-cpp?view=vs-2019

SZZ: google found C bool

well at least there is such a bool ))))

Of course C++ has a bool and C doesn't. I'm just studying it now and I have a C exam the day after tomorrow. So I'm into it.
Yes, that's right, C is used more for hardware now. You don't write applications for the visible world in it. But that doesn't make it any less in demand.

Surprisingly, it will soon overtake Java in popularity and come out on top

 
Nikolai Semko:

Of course C++ has a bool and C doesn't. I'm just studying it now and I have a C exam the day after tomorrow. So I'm into it.
Yes, that's right, C is used more for hardware now. You don't write applications for the visible world in it. But that doesn't make it any less in demand.

Surprisingly, it will soon overtake Java in popularity and come out on top

Good luck in the exam. With your pre-C level, you can easily pass the exam.
There is nothing complicated about C. The crispness of the language makes it easy to understand.
It's not like the interpreter languages not typed, which are written in the same C)) where everything is hidden from the developer.
The Python language is written in C. Carl! )) It's one more reason to write the integration library with Py.
Have you ever wondered why people write C for hardware? It is simply fast for this purpose.
And in our business speed is also very important. I do not exclude that the MQL language was written in C with assembler optimization.
Why do I think so, because the application's design hasn't changed virtually since birth.
There is a GUI library for C, coupled with windows windows from small languages.
There are GUI libraries for C, I looked it up once, and the terminal design is very similar to the C library.
This library doesn't give freedom to architects either, due to its Cish limitation.
But the priority here is speed, not beauty.

 
Roman:

Good luck with the exam. With your pre-C level, you can easily pass the exam.
There is nothing complicated about C. The crispness of the language makes it easy to understand.
It's not like the interpreter languages not typed, which are written in the same C)) where everything is hidden from the developer.
The Python language is written in C. Carl! )) It's one more reason to write the integration library with Py.
Have you ever wondered why people write C for hardware? It is simply fast for this purpose.
And in our business speed is also very important. I don't exclude that MT5 is written in C with assembler optimization.
Why do I think so? Because the application's design hasn't changed virtually from the very birth.
The application uses some GUI library for C in combination with the windows of little softwares. There are GUI libraries for C; I looked it up once.
This library doesn't give any freedom to architects, due to its C limitations.
But the priority here is speed, not beauty.

Thank you.
Yes, indeed, there is nothing complicated about C. No OOP, no classes. But there are pointers. Because of this, modern programmers who started with Python, Java, etc. think C is something very abstruse for nerds. And generally a shot in the foot.
I thought I could work well with pointers, but as I was learning, I realised that my level was very low. You can do such wonders with pointers. It's better than OOP.
Yeah, C is the fastest language. I think even Assembler would not be able to compete with it because of its powerful optimizing compiler.
But what has surprised me the most is the speed of Java. Java is faster than MQL5 and slower than C by 10-40%. In some cases it is even faster. And this despite the fact that Java is "sort of" interpreter (in fact it's not really an interpreter in the conventional sense). Yes, you need a Java-machine, but the executable java bytecode is very compact. I think that not many people know that many of the most advanced IDEs are written in Java (IntelliJ IDEA, NetBeans, Eclipse).
But I want to say that MQL5 is a very cool language. I feel more comfortable using no other language, than with it, as if it has taken the best from many languages. Yes, there are a lot of bugs, but this is just a sign of rapid development and this is manageable.

 
Igor Makanu:

The C language has not existed for a long time, C++ definitely had a bool

And the C language does not know it does not exist, it is actively developing - C99, C11, C18, C2x

C2x is an informal name for the next (after C18) major C language standard revision.

It is not expected to be voted on until 2021.


Not very idols elected, if they have microsoft specific on microsoft specific, don't use that g...... It's more likely to disappear for the little softies with their crooked crafts than it is, given the huge mass of Cish libraries.

You should use decent compilers - gcc, clang, they follow standards.

 

I don't know...

In my opinion, both such "empty" blocks and "infinite loops" (whether for or while) are a bad programming style, dangerous for potentially hard-to-calculate errors.

The loop's condition check operator should not be meaningless but bear some burden. If we have an "infinite loop", it means that there are some additional outputs and breaks inside the loop and they are not always obvious. By the way, I don't like break operator either - I always use continue operator in a loop.


And as was said here code obfuscation is just childish... Great programmers-copyists gathered here who are afraid that someone will sell their code or get millions of dollars in other ways... Pride is one of the deadly sins!

 

Vict:

More likely to disappear than him, given the vast array of Cish libraries.

One story:

there's a window manager called Way Cooler, and they started making it in the newfangled Rust. But having faced the C world, and having eaten a lot of cacti, it was decided to rewrite everything in C http://way-cooler.org/blog/2019/04/29/rewriting-way-cooler-in-c.html. His message was: "if you have to rewrite everything in the world to avoid writing in C, it's not worth it, you'd better spend your time on something else".

Giving up on wlroots-rs
  • 2019.04.29
  • way-cooler.org
Way Cooler is a Wayland compositor that was written in Rust using wlc. Since last April I’ve been rewriting it to use wlroots. In order to do that however I had to wrap the library so that it could be used in Rust. I worked on wlroots-rs and put Way Cooler on the back burner for a long time. After over 1,000 commits I’m giving up on it...