Questions tagged [language-design]

A tag for questions related to the design of any aspect of programming languages.

1363 questions
-3
votes
1 answer

Could Implicit Topics be Implemented Cleanly in a Language?

I was getting bored, so I started cranking out my own HTML templating language in Perl 5.14 just because I could. This question is about parser implementation of a specific feature and the feasability of a specific language construct which is rare…
Louis
  • 2,442
  • 1
  • 18
  • 15
-3
votes
1 answer

What does Robert Martin mean by “Only function survive from early programming days, not routine”

Excerpt from book Clean Code authored by Robert Martin: In the early days of programming we composed our systems of routines and subroutines. Then, in the era of Fortran and PL/1 we composed our systems of programs, subprograms, and functions.…
-3
votes
1 answer

Why is the 'char' primitive in java necessary?

It has occurred to me that the char type in java can be entirely replaced with integer types (and leaving the character literals for programmers' convenience). This would allow for flexibility of storage size, as ASCII only takes one byte and…
Kentastophe
  • 17
  • 1
  • 4
-3
votes
2 answers

What is the use of the 'return' keyword

const menu = { _courses : { _appatizers: [], _mains: [], _deserts: [] }, get courses() { return { appatizers: this._courses._appatizers; mains: this._courses._mains; deserts: …
-3
votes
1 answer

import all functions vs. import specific function

In Python, import shutil, os allows me to call os.environ, os.path.exists(folder), os.listdir(pool), shutil.rmtree(folder) and shutil.copyree(). It seems that I call any function, defined in those modules. Nevertheless, I cannot call ctime() once I…
Val
  • 1
  • 8
  • 40
  • 64
-3
votes
2 answers

What programming language uses commands like mob/verb?

mob/verb/test(N as num) What language is this code from?
Fred
-4
votes
2 answers

Why does keyword struct in C++ differ from keyword struct in C?

From a design perspective, one could have added the class keyword to C++ to realize the desired OO principles like encapsulation, inheritance, polymorphism as well as constructors and destructors etc ... but at the same time leave the keyword struct…
Angle.Bracket
  • 1,438
  • 13
  • 29
-4
votes
1 answer

Why does C use asterisks to declare pointers and not carets like in Pascal?

Both languages have similar origins so I'm wondering where this difference comes from.
az-
  • 87
  • 6
-5
votes
2 answers

Why Does Java Require Variables to Be Initialized?

In Java, why doesn't the compiler simply assume that an uninitialised variable should have 0 as its value, like C does? Is this just BetterPractice in general, or is there another reason that is particular to Java?
wafflesausage
  • 295
  • 5
  • 14
-6
votes
4 answers

Explanation of the names of C++ std lib methods

I am a Python/Scala/Haskell coder, trying to learn C++ and I am having hard time remembering anything because so many of the names of methods or classes in C++ do not make any sense to me. This is possibly because I do not understand what they…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
-7
votes
1 answer

Reasoning behind swift's function notation?

Why does Swift use this function notation: func greet(person: String, day: String) -> String { return "Hello \(person), today is \(day)." } I don't get why it uses the small arrow -> notation to specify return type. func identifier() -> Type…
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
-9
votes
2 answers

Why do we need "try" keyword?

Today I wrote some Java which was structured something like this: if (someCondition) { try { doSomething(); } catch (SomeException e) { handleException(e); } } It looked somewhat ugly so I decided to remove excesss…
Mika Lammi
  • 1,278
  • 9
  • 21
1 2 3
90
91