Do people not like...

Pages: 123
closed account (z05DSL3A)
most of the loops in Unreal Tournament Engine could be replaced easily by higher-level, more readable and less error-prone abstractions, if only C++ allowed this.
If only C++ was a different language it could have done things differently.
I wonder why someone thinks that a functional paradigm is more high-level than imperative, when actually are different ways to express the same thing
This is my favourite bad use of for cycle in my code:

 
for (; parabolicsCounter<StartingNilradicalsNoRepetition.size; parabolicsCounter++, owner.flagNilradicalComputationInitialized=false)
closed account (EzwRko23)
I wonder why someone thinks that a functional paradigm is more high-level than imperative, when actually are different ways to express the same thing


Because you tell the machine less how to achieve some task, and more what to achieve.

Compare:
 
persons filter (_ uses "C++") map (_.name) foreach println



to:

1
2
3
for (std::vector<person>::const_iterator i = persons.begin(); i != persons.end(); ++i)
  if (*i.uses("C++"))
     cout << i -> name;



The second one is overspecified, and you can't do much about it. You can't abstract away "looping" as a separate concern, while in functional paradigm you can. That is why most functional programs are much shorter than their imperative counterparts, and therefore - higher level.


There is no need to complicate a language with such things you say Scala does.The beauty of c++ is that it is both simple and powerful at the same time


WTF? LOL. Language with 3 semantics of parameter passing, ambiguous grammar, redundant and conflicting features, lack of automatic memory management you call simple? It is neither simple, nor powerful. The language with the best power-to-complexity ratio is probably LISP. Then go all the hybrid functional languages like F#, OCaml, Scala etc. C++ is far, far away, even behind Java in this regard. If you think it is simple, you don't know it well enough.
Last edited on
Because you tell the machine less how to achieve some task, and more what to achieve.


Any language that separates the two I automatically put in the category "languages I will never use".
I don't get it. You set owner.flagNilradicalComputationInitialized to false each iteration? Is it to check that the flow entered the loop?
I actually do not remember why I did it (it was months ago). After your comment, I looked at it, and it looks damn stupid.

I should check for initialization *before* the loop.

[Edit:] Umm, surely what I did is weird, but the remainder of the code is:
1
2
3
4
5
6
    for (; parabolicsCounter<StartingNilradicalsNoRepetition.size; parabolicsCounter++, owner.flagNilradicalComputationInitialized=false)
    { if (!owner.flagNilradicalComputationInitialized)
      { /*initialization that doesn't flip the owner.flagNilradicalComputationInitialized*/
      }
      functionthatDoesTheWork(owner); //this function uses the fact that the flag is not flipped
    }


I think I actually did it the right way: note that the if condition doesn't flip the initialization flag.
Last edited on
Ah, I see. You want to execute the true if block only after the first iteration.
closed account (EzwRko23)

Any language that separates the two I automatically put in the category "languages I will never use".


Oh, so you are the kind of person that sorts 1GB of data by handcoded quicksort, instead of firing up a database system and issuing a simple SQL. But if your ego is satisfied with it... Why not?
Last edited on
Get a life.Seriously.All you do is make 100 big statements and when people start replying you change the topic,try to back your statement up using another 100 big statements with no evidence,or reply someone else.Your arguments proof nothing.c++ is indeed simple and powerful,that is one of the quotes you will find in any serious c++ textbook.But i doubt you understand the language,since your life in this forum is just trolling.You are either 13 yr old kid or a 40 yr basement dweller still living with his mum.BTW,i enjoy c++ parameter-passing semantics.It gives a lot of freedom and choice when designing a system.If c++ lacked them you would probably said it is a crappy language because of that.Guys like you can never be wrong.I give you a hint: join the church of Scientology or go see a psychiatrist.Cheers.
*yawn* Not getting along is so last year. Can't we all just drink our cans of TrollBGone and be happy even when someone tries to burst our bubbles? Or do we have to spray our cans of TrollBGone?

-Albie
The second one is overspecified, and you can't do much about it. You can't abstract away "looping" as a separate concern, while in functional paradigm you can. That is why most functional programs are much shorter than their imperative counterparts, and therefore - higher level


No offense, but duh. Have you even read the rationale for creating C++?? "To be as close to assembly as possible, but no closer." Hence why we have raw pointers, access to memory, etc, that other languages don't.
closed account (EzwRko23)

Hence why we have raw pointers, access to memory, etc, that other languages don't.

Nice. So please don't call it a high level language, ok? Anyway, why you are again starting a language flame-war? Let's discuss the while loop.
you
LOL
Bazzy wrote:
LOL
It is funny, isn't it?
I don't get what's so funny...
closed account (z05DSL3A)
xorebxebx wrote:
why you are again starting a language flame-war?

Pot...kettle...black.
Oh, so you are the kind of person that sorts 1GB of data by handcoded quicksort, instead of firing up a database system and issuing a simple SQL. But if your ego is satisfied with it... Why not?


I was generating all possible nilradicals that can be attached to a root subalgebra up to isomorphism of the ambient Lie algebra and ran a simplex algorithm for each possibility.

To compute whether two root subalgebras are isomorphic, you gotta run a group action, which, for the cases I needed, meant a cycle of tops 51 840 elements. Each action of a group element in turn less than or equal to Constant*7*126 operations. The total number of subalgebras computed in the end was 73834.

If I wasn't able to abort my "for" cycles whenever I wanted however I wanted, I would end up doing ~ 7*126*51 840* 73834 operations, which is not desired.


***

I am not aware of a database server that can enumerate root subalgebras of Lie algebras.
@Grey Wofl,
Oh, right, it was that.
closed account (EzwRko23)

To compute whether two root subalgebras are isomorphic, you gotta run a group action, which, for the cases I needed, meant a cycle of tops 51 840 elements. (...)


Seems like an ideal application for logical or functional programming, without loops.
The more complex is the algorithm, the higher level language you usually need.


If I wasn't able to abort my "for" cycles whenever I wanted however I wanted


But how is that related to my post?


I am not aware of a database server that can enumerate root subalgebras of Lie algebras

Any Turing complete system can do this. Database systems are usually Turing complete.


You are either 13 yr old kid or a 40 yr basement dweller still living with his mum


Yeah! Argument ad personam! I won! :D Do you feel better now? Oh, and I'm really looking forward to seeing any quote from serious publication or any scientist, saying C++ is simple and powerful. Even BS is very conservative at making such claims.
Last edited on
Pages: 123