Questions tagged [language-concepts]

Use this tag to ask about how a particular idea (arrays, lists, tables, search, sort) is implemented in language X or how to understand a basic part of the language.

Often there is a particular concept that isn't quite grouped into any of the other tags, or it is just too embarrassing because it's a "newbie" idea. Or there isn't a concrete problem to solve and you were just wondering about how something works in language X.

If you wanted to ask about which version of the moot() function is used if class A is inherited from class B and implements C, tag it with inheritance..

But also use this tag to point out it's more of a "Hmm..." question than a "How do I solve this" question.

98 questions
224
votes
16 answers

What is Serialization?

I am getting started with Object-Oriented Programming (OOP) and would like to know: what is the meaning of serialization in OOP parlance?
107
votes
1 answer

What is the meaning of "dot parenthesis" syntax?

I am studying a sample Go application that stores data in mongodb. The code at this line (https://github.com/zeebo/gostbook/blob/master/context.go#L36) seems to access a user ID stored in a gorilla session: if uid, ok :=…
akonsu
  • 28,824
  • 33
  • 119
  • 194
52
votes
7 answers

Why aren't static methods considered good OO practice?

I'm reading Programming Scala. At the beginning of chapter 4, the author comments that Java supports static methods, which are "not-so-pure OO concepts." Why is this so?
Mike
  • 19,267
  • 11
  • 56
  • 72
18
votes
7 answers

What is a good common term for errors and warnings?

I'd like to build an OO hierarchy of errors and warnings returned to the client during a, let's say, pricing operation: interface PricingMessage {} interface PricingWarning extends PricingMessage {} interface PricingError extends PricingMessage…
sandris
  • 1,363
  • 13
  • 27
11
votes
2 answers

What is the difference between the const qualifier in C and the const qualifier in C++?

I´ve found a comment of user R..: C and C++ are not the same language. In particular, C const has nothing to do with C++ const. I know, that one difference between the const qualifier in C and the const qualifier in C++ is its default linkage. An…
10
votes
10 answers

Delphi - How can i improve

Ok, so ive been programming in Delphi for 3-4 years now and consider myself an intermediate level application designer with a sound understanding of concepts. But how do i get better? Ive just been looking at the source of a couple of components i…
Simon
  • 9,197
  • 13
  • 72
  • 115
10
votes
4 answers

Where are the 'elements' being stored in a generator?

The below code summarises all the numbers in the list held in all_numbers. This makes sense as all the numbers to be summarised are held in the list. def firstn(n): '''Returns list number range from 0 to n ''' num, nums = 0, [] while num…
David Ross
  • 1,087
  • 1
  • 14
  • 21
7
votes
2 answers

What Type should myCustomDictionary.Values return?

If you have the object Dictionary myDictionary, then myDictionary.Values will be of type Dictionary.ValueCollection and myDictionary.Keys will be of type Dictionary.KeyCollection. I don't understand why the type of…
Tipx
  • 7,367
  • 4
  • 37
  • 59
6
votes
3 answers

C's aversion to arrays

In introductory books on C it is often claimed that pointers more or less are arrays. Isn't this a vast simplification, at best? There is an array type in C and it can behave completely different from pointers, for example: #include int…
viuser
  • 953
  • 6
  • 19
6
votes
0 answers

Cannot figure out code execution order

I have the following code. class X { X(){ super(); System.out.println("X()"); } } class Y extends X { Y(){ super(); System.out.println("Y()"); } } class Z extends Y { Z(){ super(); …
Shamal Sandeep
  • 263
  • 1
  • 2
  • 9
5
votes
1 answer

What Is The Purpose Of A Record Struct?

C# 9 added the record type, which is a new reference type that uses value-based equality. C# 10 introduced the record struct syntax to define a value type with similar properties to record…
YungDeiza
  • 3,128
  • 1
  • 7
  • 32
5
votes
4 answers

Why Do We have unsigned and signed int type in C?

I am a beginner in C . I have recently learned about 2's Complement and other ways to represent negative number and why 2's complement was the most appropriate one. What i want to ask is for example, int a = -3; unsigned int b = -3; //This is the…
5
votes
2 answers

Correct way to construct a Java console program

I'm an old-time programmer from the 80s proficient with C and Pascal. I'm pretty new to Java and its concept. In trying to learn the new ways of Java using OOP techniques I'm rather confused about the right way of putting an application…
itsols
  • 5,406
  • 7
  • 51
  • 95
4
votes
1 answer

What is a language construct? How (theoreticaly) it is being implemented in C?

I am familiar with how PHP functions are mapped to functions in C in the C code beneath PHP. I know in C what a function means and what a MACRO() means. I do not understand what is a language construct, like echo, in PHP means.
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
4
votes
4 answers

How is a C array a “named variable in its own right”?

On page 103 in the book “Expert C Programming: Deep C Secrets” by Peter Van Der Linden there is a table about the difference between arrays and pointers. One issue I don't really understand – direct quote: Pointer: Typically points to anonymous…
viuser
  • 953
  • 6
  • 19
1
2 3 4 5 6 7