1

Topic: How to name paste operation in the beginning

Whether is any  a title of the function adding a new element in a list head / of dynamic array? While to a head comes only push_front, by analogy with std:: deque from standard library of a C ++. Perhaps it somehow in a word can be called elegantly?

2

Re: How to name paste operation in the beginning

Hello, b0r3d0m, you wrote: whether B> Is any  a title of the function adding a new element in a list head / of dynamic array? "cons" FTW!:D

3

Re: How to name paste operation in the beginning

CD> "cons" FTW!:D Couples did not understand.

4

Re: How to name paste operation in the beginning

Hello, b0r3d0m, you wrote: whether B> Is any  a title of the function adding a new element in a list head / of dynamic array? B> while to a head comes only push_front, by analogy with std:: deque from standard library of a C ++. Perhaps it somehow in a word can be called elegantly? prepend

5

Re: How to name paste operation in the beginning

Hello, b0r3d0m, you wrote: whether B> Is any  a title of the function adding a new element in a list head / of dynamic array? B> while to a head comes only push_front, by analogy with std:: deque from standard library of a C ++. Perhaps it somehow in a word can be called elegantly? prepend

6

Re: How to name paste operation in the beginning

Hello, b0r3d0m, you wrote: CD>> "cons" FTW!:D B> Couples did not understand. Probably, he meant it. The fan  detected, in general. Remaining hardly understand. P.S. push_front it is quite normal, if speech about pluses. Other possible variants: add_front, insert_front.

7

Re: How to name paste operation in the beginning

L> P.S. push_front it is quite normal, if speech about pluses. Other possible variants: add_front, insert_front. Was specific now speech about Lua, but I ask about the general case.

8

Re: How to name paste operation in the beginning

T> prepend Yes, too a variant,  push_front. Thanks!

9

Re: How to name paste operation in the beginning

Hello, b0r3d0m, you wrote: whether B> Is any  a title of the function adding a new element in a list head / of dynamic array? B> while to a head comes only push_front, by analogy with std:: deque from standard library of a C ++. Perhaps it somehow in a word can be called elegantly? At first "list" and "dynamic array" determination is necessary. Then looking at determinations, to invent "adapter" (a designing pattern). To look at methods of "adapter" and to give them convenient titles. And "list" should be the list, "dynamic array" - dynamic array. Also it is not necessary to think at their designing of existence of other containers and what methods at them is.

10

Re: How to name paste operation in the beginning

_> Also it is not necessary to think at their designing of existence of other containers and what methods at them is. From what?

11

Re: How to name paste operation in the beginning

Hello, b0r3d0m, you wrote: _>> Also it is not necessary to think at their designing of existence of other containers and what methods at them is. B> from what? If on determination the list does not depend in any way on dynamic array, what for at list designing to know about dynamic array existence? And here when you write "type generalized" the code to which can palm off both the list and dynamic array you write the necessary adapters under these containers. And here for this adapter also invent beautiful titles for a method "insertions in the beginning".

12

Re: How to name paste operation in the beginning

Hello, fin_81, you wrote: _> "list" and "dynamic array" determination At first is necessary. Then looking at determinations, to invent "adapter" (a designing pattern). To look at methods of "adapter" and to give them convenient titles. There is a judgement, it is necessary what to begin with the abstract factory.

13

Re: How to name paste operation in the beginning

DR> There is a judgement, it is necessary what to begin with the abstract factory. Such?

14

Re: How to name paste operation in the beginning

Hello, Don Reba, you wrote: DR> Hello, fin_81, you wrote: _>> "list" and "dynamic array" determination At first is necessary. Then looking at determinations, to invent "adapter" (a designing pattern). To look at methods of "adapter" and to give them convenient titles. DR> there is a judgement, it is necessary what to begin with the abstract factory. Well so, I also hint that at first it is necessary to implement the list and an array as it is written in their determinations. And then, if already  architecture does not allow to do without adapters with "an insertion in the beginning", to write these adapters. But it is not necessary to push functionality of this adapter in "list" and "array". It is a direct way to https://ru.wikipedia.org/wiki/%D0%91%D0 … 0%BA%D1%82

15

Re: How to name paste operation in the beginning

Hello, fin_81, you wrote: DR>> There is a judgement, it is necessary what to begin with the abstract factory. _> well so, I also hint that at first it is necessary to implement the list and an array as it is written in their determinations. And then, if already  architecture does not allow to do without adapters with "an insertion in the beginning", to write these adapters. But it is not necessary to push functionality of this adapter in "list" and "array". It is a direct way to https://ru.wikipedia.org/wiki/%D0%91%D0 … 0%BA%D1%82 It is time Sinix' in  to call. He quickly explains to you, it is necessary what to begin with usage scenarios. And under them to invent interfaces and implementation, instead of to mold at first something abstract, and then to do of it something really useful by any facades.

16

Re: How to name paste operation in the beginning

Hello, Lexey, you wrote: L> It is time Sinix' in  to call. He quickly explains to you, it is necessary what to begin with usage scenarios. And under them to invent interfaces and implementation, instead of to mold at first something abstract, and then to do of it something really useful by any facades. Scenarios of usage of that? The list and an array in one code? To me  here the scenario , as for me it  terms. The in itself pattern  is an attempt from useless/bad/divine object to make something useful. That is facade presence is a sign of the bad code. For the given specific case, most likely, the adapter turns to a facade.

17

Re: How to name paste operation in the beginning

Hello, fin_81, you wrote: _> Scenarios of usage of that? The list and an array in one code? The list and dynamic array. _> to me  here the scenario , as for me it  terms. The HARDWARE the scenarios did not result, and that you there imagined yourself, nobody knows. ArrayList (dynamic array) and LinkedList (list) in a toad, for example, implement the same interface List. And it strongly does not confuse anybody. _> the in itself pattern  is an attempt from useless/bad/divine object to make something useful. Well, it is finite: * make a software library easier to use, understand and test, since the facade has convenient methods for common tasks; * make the library more readable, for the same reason; * reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system Where here about useless/bad/divine? _> That is facade presence is a sign of the bad code. For the given specific case, most likely, the adapter turns to a facade. The sign of the bad code is  patterns everywhere where only it is possible. And creation simple API (facade) over difficult is a standard reception for the serious libraries, allowing without code duplication to give both idle time API for basic tasks, and expanded for the advanced. Generally, I do not see any sense to divide terms "facade" and "adapter". It only special cases .