The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
204 views

Splitting and hiding headers in a static library

I am writing a static library for C/C++ (personal project). As my headers became rather large, I thought that splitting my headers would be a good idea. Right now a header looks like this: ...
6
votes
4answers
1k views

Ways to organize interface and implementation in C++

I've seen that there are several different paradigms in C++ concerning what goes into the header file and what to the cpp file. AFAIK, most people, especially those from a C background, do: foo.h ...
0
votes
2answers
357 views

Why are header files bad design? [duplicate]

this says header files are bad design, but I don't know why. The answers specified there are about the inefficiency of header file when building. Why it is bad design is not really touched upon. As ...
0
votes
1answer
45 views

How to POST CSV with XMLHttpRequest

I would like to send a CSV file via POST in a XMLHttpRequest, but I am unsure of two things. First is there anything to distinguish a CSV file from a string split up by comma's? And what sort of ...
0
votes
1answer
19 views

How to use specific Request Header [closed]

I am learning how to work with XMLHttpRequests. I know that request.setRequestHeader() is an important factor. I just don't understand why. It took me a while but I have at least found a list of ...
7
votes
5answers
8k views

What should and what shouldn't be in a header file? [closed]

What things should absolutely never be included in a header file? If for example I'm working with a documented industry standard format that has a lot of constants, is it a good practice to define ...
1
vote
3answers
188 views

Requiring a specific order of compilaiton

When designing a compiled programming language, is it a bad idea to require a specific order of compilation of separate units, according to their dependencies? To illustrate what I mean, consider C. ...
9
votes
2answers
635 views

Updating copyright headers each new year just because Jan 1st has passed? [duplicate]

I've seen some projects that - with each new year - start to change all files in their source-tree to update the copyright year. Isn't this just pushing hot air on a level of magnitude? AFAIK: ...
2
votes
1answer
276 views

PHP high traffic default page

I have a php website that will be experiencing high levels of traffic in a few weeks. We scaled the servers to accept the traffic, but want some sort of fallback page in the event that something ...
20
votes
3answers
5k views

Why do we need to put private members in headers?

Private variables are a way to hide complexity and implementation details to the user of a class. This is a rather nice feature. But I do not understand why in c++ we need to put them in the header of ...
2
votes
2answers
2k views

Is it safe to transmit access tokens via HTTP headers?

It's the first RESTful web service and I am concerned about security issues. Is it safe to transmit my access token via HTTP headers? For example: POST /v1/i/resource HTTP/1.1 Content-Type: ...
-1
votes
1answer
101 views

Take dynamic PHP array, package up as separate files inside a single zip file

I have this dynamic data in PHP, but for each array record, I want to allow a downloadable option to save a zip archive of all records (each as a separate file). These are actually DNS zone records ...
2
votes
0answers
126 views

Web revisioning and the Accept-Datetime header

I have been in the process of generating documentation for an upcoming project. One of the features of the data available in this project is that it will be revisioned (or at least large parts of it ...
2
votes
1answer
2k views

Custom use of Authorization header in a REST API

I'm building a REST api where clients are authenticated using client certificates. A client in this case is not an individual user, but some sort of a presentation layer. Users are authenticated using ...
15
votes
6answers
7k views

Is it better to document functions in the header file or the source file?

In languages that distinguish between a "source" and "header" file (mainly C and C++), is it better to document functions in the header file: (pilfered from CCAN) /** * time_now - return the ...
3
votes
1answer
92 views

Handling bugs, quirks, or annoyances in vendor-supplied headers

If the header file supplied by a vendor of something with whom one's code must interact is deficient in some way, in what cases is it better to: Work around the header's deficiencies in the main ...
0
votes
1answer
127 views

How do I parse a header with two different version [ID3] avoiding code duplication?

I really hope you can give me some interesting viewpoints for my situation, because I am not satisfied with my current approach. I am writing an MP3 parser, starting with an ID3v2 parser. Right now ...
1
vote
3answers
486 views

Common header file for C++ and JavaScipt

I have an app that runs a C++ server backend and Javascript on the client. I would like to define certain strings once only, for both pieces of code. For example, I might have a CSS class ...
1
vote
2answers
681 views

What's special in July 26th and why is it used in examples for Expires header so often?

I've noticed that July 26th (my birthday) is used really often in various PHP examples related to preventing http caching using Expires header, like: ...
2
votes
2answers
513 views

What is the purpose of including header files in the solution in Visual Studio?

So I have including the files to my projects by simply : #include "myheader.hpp" and adding the headers into the solution explorer. But recently I have realized that I may omit the step of adding the ...
20
votes
3answers
7k views

Copyright statements in source code [closed]

Ever since I started programming I've seen a header at the top of most code files indicating some sort of copyright: e.g. /* Copyright (c) 1998 Innotech */ or /* Copyright (c) 1998-2008 Innotech ...
1
vote
2answers
1k views

Finding header files

A C or C++ compiler looks for header files using a strict set of rules: relative to the directory of the including file (if "" was used), then along the specified and default include paths, fail if ...
1
vote
3answers
426 views

Should non-interface code be hidden from the client?

I am working on a library which had several headers that are meant to only be used by the library itself. I also have a few classes and functions in headers that I do not want the client to use. For ...
7
votes
5answers
5k views

Why do we need to write a header file?

Before you whip out your snarky comments, I know -- this is a nooby question. This is my first time using a C based language. I'm an undergrad student learning Objective C for a computer science ...
0
votes
1answer
130 views

What are the benefits of not including other header files in a header file?

Sometimes, a header file uses objects that are in declared in other header files. The user of this header file would have to include the dependency anyway and get the order correct too.
0
votes
2answers
369 views

Is it a good idea to use Header(“Content-Type […]”); in the core file of a CMS?

I have been working on content management systems for about 7 years. 2 years ago created my own. Currently building a newew, better and bigger version. However, fell into dilemma. I have a core file, ...
5
votes
1answer
4k views

Header comment format

I realize that the "header comment" format varies from programmer to programmer, but what would be an example of a "good" header comment?
8
votes
5answers
5k views

Why on C++ you can have the method definition inside the header file when in C you cannot?

In C, you cannot have the function definition/implementation inside the header file. However, in C++ you can have full method implementation inside the header file. Why is the behaviour different?
5
votes
7answers
558 views

Which languages use “paired” header/implementation files?

C is ubiquitous, and C++ nearly as much, but I'm curious which other languages follow a similar model of header files. Specifically, in which other languages is it idiomatic to edit pairs or groups ...