A newcomer asks! - page 24

 
Dmitry Fedoseev:

Why write ENUM_POSITION_TYPE before PositionGetInteger? After all, you believe that the PositionGetInteger function with the identifier POSITION_TYPE already returns the type ENUM_POSITION_TYPE.

no it does not, the compiler generates a warning about type mismatch
 
Alexander Bereznyak:
No it doesn't, the compiler generates a type mismatch warning

Read the message you're replying to carefully, and in general, try to understand what you're talking about first.

 
Dmitry Fedoseev:
Read carefully the message to which you are responding, and in general, first try to understand what the conversation is about.

Why waste your time getting into a conversation that is about nothing. Why do you sit in this thread and troll Michael.

You don't like his programming style or his presentation style. Why don't you open your own training thread

and show me your programming and presentation style.

 
Alexander Bereznyak:

Why waste your time getting into a conversation that is about nothing. Why do you sit in this thread and troll Michael.

You don't like his programming style or his presentation style. Why don't you open your own training thread

and show him your programming and presentation style.

If you did, you shouldn't be writing here right now... and argue. Before you write and argue, understand what you're talking about. If you do not want to read and understand, do not get involved.

Also, trolling here Michael (trying, but failing). He is wiggling, slipping, twisting, back and forth. And you are Mikhail's defender?

 
A stupid and empty argument goes on and nothing more
 
Alexander Bereznyak:
A stupid and empty argument is going on and nothing more.
So don't get involved.
 
Alexander Bereznyak:

Why are you sitting in this thread and trolling Michael.

No trolling. I'll be the cap. Because Mikhail says the right code is wrong.
 
Комбинатор:
No trolling. I'm going to be a cap. Because Mikhail says that the correct code is wrong.

It's not about correctness, it's about style.

I've already written:

But I think PositionGetInteger() always returns a value of type LONG, and it doesn't matter what was "inside" INTRGER or LONG.

The developers did it to avoid writing two functions.

That's why to getthe position's type(which is INTEGER) we should do it in the way I've written:

ENUM_POSITION_TYPE pos_type = ENUM_POSITION_TYPE(PositionGetInteger(POSITION_TYPE));

It's silly to do it like this:

long type =PositionGetInteger(POSITION_TYPE);

if (type == long(POSITION_TYPE_BUY)) - THIS IS RIGHT in its essence, but its style is totally BAD!

Because the functionreturnsENUM_POSITION_TYPE (see documentation) with the argumentPOSITION_TYPE, hence the host variable

must be of the same type.

 
Михаил:

It's not about correctness, it's about style.

I've already written:

But I think PositionGetInteger() always returns a value of type LONG, and it doesn't matter what was "inside" INTRGER or LONG.

The developers did it to avoid writing two functions.

That's why to getthe position's type(which is INTEGER) we should do it in the way I've written:

It's silly to do it like this:

long type =PositionGetInteger(POSITION_TYPE);

if (type == long(POSITION_TYPE_BUY)) - THIS IS RIGHT in its essence, but its style is totally BAD!

Because the functionreturnsENUM_POSITION_TYPE with the argumentPOSITION_TYPE, consequently the receiving variable

must be of the same type.

long and lon instead ofENUM_POSITION_TYPE andENUM_POSITION_TYPE

8 characters (which you can type with your eyes closed) instead of 36 characters (and in uppercase)! On top of that there's all sorts of information that doesn't make sense. This is not a good programming style - unnecessary writing and superfluous information.

 
Dmitry Fedoseev:

long and lon instead ofENUM_POSITION_TYPE andENUM_POSITION_TYPE

8 characters (which you can type with your eyes closed) instead of 37 characters (and even in uppercase)! On top of that there's all sorts of information that doesn't make sense. This is not a good programming style - unnecessary writing and superfluous information.

it's not superfluous information, with your style you will get a lot of warnings, that's your good programming style