Questions tagged [concept]

Concept programming is a programming paradigm focusing on how concepts that live in the programmer's head translate into representations that are found in the code space. This approach was introduced in 2001 by Christophe de Dinechin with the XL Programming Language.

Concept programming is a programming paradigm focusing on how concepts that live in the programmer's head translate into representations that are found in the code space. This approach was introduced in 2001 by Christophe de Dinechin with the XL Programming Language.

For more, see Wikipedia.

300 questions
4
votes
7 answers

encapsulation and abstraction OOPs concept

Does Encapsulation is information Hiding or it leads to information hiding?? As we say that Encapsulation binds data and functions in a single entity thus it provides us control over data flow and we can access the data of an entity only through…
Mishthi
  • 1,947
  • 5
  • 16
  • 12
4
votes
3 answers

What does an interface in Java interface with?

I've been trying to learn some basic object oriented programming in Java. I was curious to know what the origin of the word interface is , if there is any documented description. Also I was trying to make sense of what it means by thinking of a…
Parapan
  • 151
  • 1
  • 8
4
votes
5 answers

Is there a concept name for a regular type for which comparisons doesn't compare the full object state?

I have a set of types which looks like this: struct MyFlag { SomeId source_id; // INVALID_ID by default SomeData data; // regular type friend bool operator==( const MyFlag& a, const MyFlag& b ) { return a.source_id == b.source_id; } …
Klaim
  • 67,274
  • 36
  • 133
  • 188
4
votes
1 answer

MvvmCross: ViewModel inside of another ViewModel scenario

I've got the following question: what's the expected scenario for the logic when I would want to bind some elements inside of ViewModel separatly. What I mean... http://slodge.blogspot.co.uk/2013/04/n3-kitten-cells-on-iphone-n1-days-of.html There is…
Agat
  • 4,577
  • 2
  • 34
  • 62
4
votes
3 answers

How exactly does minimax recursion work?

So I was looking up Mini-max for a Tic-Tac-Toe Game, but couldn't understand how the recursion worked? Okay, so basically here are my questions: How does minimax know whose turn is it? Whats the best way to indicate the player whose turn it is…
Rivasa
  • 6,510
  • 3
  • 35
  • 64
3
votes
2 answers

Good example of stateless and stateful components in React?

React - what is a good analogy to wrap my head around Stateful and Stateless Components? I had trouble going through this abstract concept during my bootcamp and I still struggle to comprehend that. Can you give exact moment when you went - 'a-ha,…
3
votes
2 answers

What are the benefits of using `and` instead of `&&` when defining concepts?

I found that some CppCon speakers used and instead of && to define concepts and used && in "normal" boolean expressions, but I can't figure out the benefits of doing so. The only material about naming convensions of concepts that I can found is…
FeignClaims
  • 193
  • 8
3
votes
1 answer

I don't understand the width field in pprint in python

I don't understand this concept clearly. Could somebody give me some examples to demonstrate the concept for width in pprint in python?
user188276
3
votes
2 answers

C++20 concept fails to compile when template class object instantiated with value

Please refer to the following C++20 code: template class Person { const bool own_pet; public: Person() : own_pet(op) {} consteval bool OwnPet() const { return own_pet; } consteval bool OwnPetC() const { return true; } …
Donotalo
  • 12,748
  • 25
  • 83
  • 121
3
votes
1 answer

C++ Concepts Compound Requirements without noexcept and return-type-requirement vs Simple Requirements

template concept C1 = requires(T a, T b) { a + b; }; template concept C2 = requires(T a, T b) { { a + b }; }; Would there be a difference between C1 vs C2 functionally? Edit: grammar
rencedm112
  • 397
  • 3
  • 11
3
votes
1 answer

How to use concept to restrict typename to numeric? C++20 features

I am learning some modern C++20 features. One of them is concept. I have read https://en.cppreference.com/w/cpp/language/constraints and https://www.modernescpp.com/index.php/defintion-of-concepts to get some examples to follow. For now, I want to…
Ethanabc
  • 311
  • 2
  • 7
3
votes
2 answers

UML - How to model either/or/both (union) concept?

In my business we have a "Data Store" where data is stored (e.g. database, flat file, etc) and a "Data Provider" who delivers the data (e.g. human, sensor, etc). To model this in UML is no problem for me. BUT, sometimes "instances" are both, a data…
3
votes
5 answers

Creating objects during runtime in Python

I have a problem grasping the OOP concept when it comes to creating objects during runtime. All the educational code that I have looked into yet defines specific variables e.g. 'Bob' and assigns them to a new object instance. Bob = Person() What I…
Daniel Richter
  • 303
  • 6
  • 19
3
votes
4 answers

Java - Given Interface with methods - how are parameters passed?

I tried to keep the code as generic as possible, this only represents the basic setup. I am a Java beginner trying to understand Interfaces, Classes and Methods. I did change the Interface name and Class names to make referencing them easier. I am…
CMA
  • 287
  • 1
  • 2
  • 11
3
votes
1 answer

Spark cartesian doesn't cause shuffle?

So, I tried to test on Spark operations that cause shuffling based on this stackoverflow post: LINK. However, it doesn't make sense for me when the cartesian operation doesn't cause shuffling in Spark since they need to move the partitions across…
Tim
  • 1,029
  • 2
  • 14
  • 23