Questions tagged [semantics]

76 questions
208
votes
12 answers

What's the difference between an API and an SDK?

I was looking through various APIs and SDKs, when I realized that I couldn't really tell the difference between something called an API and something called an SDK. Both of them are, conceptually, a way for your program to interface with and control…
KeithS
  • 21,994
  • 6
  • 52
  • 79
101
votes
9 answers

Is putting general-use functions in a "helpers" file an anti-pattern or code smell?

Is it an anti-pattern or code smell to put "general use" functions (examples below) into a catch-all file named "helpers" or "utils"? It's a pattern I've seen quite a lot in the JavaScript world, which I've also seen with other languages. By…
old greg
  • 909
  • 2
  • 4
  • 6
95
votes
13 answers

What's the difference between syntax and semantics?

I've always thought that referring to the syntax of a language was the same as referring to the semantics of a language. But I've been informed that apparently that's not the case. What's the difference?
gsgx
  • 1,767
  • 2
  • 16
  • 17
72
votes
10 answers

Never use Strings in Java?

I stumbled upon a blog entry discouraging the use of Strings in Java for making your code lack semantics, suggesting that you should use thin wrapper classes instead. This is the before and after examples the said entry provides to illustrate the…
DPM
  • 1,713
  • 1
  • 16
  • 24
71
votes
6 answers

What is a helper? Is it a design pattern? Is it an algorithm?

Maybe a little tongue-in-cheek, but as I can't find this answer anywhere through Google, so to ensure Software Engineering has the answer: What is a helper? I have seen the name being used everywhere (module names, class names, method names), as if…
Aaron Hall
  • 5,895
  • 4
  • 25
  • 47
55
votes
8 answers

Why would one bother marking up properly and semantically?

Note that I (try) to mark up as semantically as possible because I like they way it looks and feels, but not because I'm aware of any other stunning advantages. The point of my question is to be able to educate others Well, I've seen a lot of…
Madara's Ghost
  • 8,787
  • 9
  • 25
  • 33
54
votes
9 answers

Is immutability very worthwhile when there is no concurrency?

It seems that thread-safety is always/often mentioned as the main benefit of using immutable types and especially collections. I have a situation where I would like to make sure that a method will not modify a dictionary of strings (which are…
Den
  • 4,827
  • 2
  • 32
  • 48
44
votes
6 answers

Why do we call it "production"?

A coworker was wondering this today: "Why is it that in our industry 'production' means 'final, deliverable product'? You know, like if a movie is 'in production', it means they're currently filming it, not that that it's done and audiences are…
joshjs
  • 551
  • 1
  • 4
  • 9
22
votes
3 answers

Which are the alternatives to using a stack to represent function call semantics?

We all know and love that function calls are usually implemented using the stack; there are frames, return addresses, parameters, the whole lot. However, the stack is an implementation detail: calling conventions may do different things (i.e. x86…
18
votes
4 answers

Is there a difference between iterable and enumerable?

Many languages seem to have structures that are very similar called iterable or enumerable. These are structures that can be iterated or enumerated over, which seem to me extremely similar things. Are these words synonymous or is there a subtle…
AlexC
  • 1,337
  • 1
  • 11
  • 18
13
votes
3 answers

Does one method overload an other, or are both methods "overloaded"

If I create this method public void foo() And then I create an overloaded version like this public void foo( string bar ) Do we say that the second functions overloads the first, or are both methods equally "overloaded"? This would imply (I…
12
votes
22 answers

Which useful alternative control structures do you know?

Similar question was closed on SO. Sometimes when we're programming, we find that some particular control structure would be very useful to us, but is not directly available in our programming language. What alternative control structures do you…
Maniero
  • 10,826
  • 14
  • 80
  • 133
9
votes
2 answers

RESTful reference representations - semantic link vs uri

We're designing a RESTful API to open up our customer's account information. We have representations that contain references to other resources related to the current resource. This is from a number of best practices we were able to find in public…
Paul
  • 191
  • 4
9
votes
5 answers

Is it correct to say that a variable is an instance of a data type?

(that can change its value over the course of the program) Or is 'instance of something' strictly related to classes and objects? If so, how would you define the concept of 'variable' when it comes to C++?
Zakkor
  • 103
  • 4
8
votes
5 answers

Where do I store user-defined business rules?

Let's say I have an application that works around departments and employees. Each department has a set of rules that defines which employee is assigned to each department. For instance the system will auto assign the employee to a specific…
masber
  • 327
  • 1
  • 5
  • 9
1
2 3 4 5 6