Ask HN: jumping back into C++ after 4 years, what did I miss? - <AUTHOR>

For the last 4 years or so, I've been mainly using dynamic languages after coming from a solid C/C++ background. The last 4 years also have happened to be some of the most transformative years for C++. I'm starting a fresh project and want to know what people are using for their C++ ecosystem. In particular, I want to avoid re-inventing the wheel. Feel free to fill in the blanks below:<p>-- Compilers: g++, clang, anything else?<p>-- Build systems: do I still have to suffer through autotools?<p>-- C++11 features: which ones are production ready?<p>-- Package managers: anything decent at all yet?<p>-- Testing: unit tests, integration tests, profiling?<p>-- Debugging: still with gdb? Anything better than valgrind?<p>-- Threads: still with pthreads?<p>-- Documentation: anything better than doxygen?<p>-- Static analysis: anything FOSS out there?<p>-- RPC libraries: any de facto standard yet?<p>-- Async programming: still libuv?<p>-- HTTP client/server libs: I hate cgicc, but have used it. <comment><USER2> You're asking more specific questions that what I will cover, and they're good ones. It will be interesting to read how others reply.

For the other people looking, Stroustrup's A Tour of C++ [0] is the guide for getting quickly up to date with the "new C++", C++11 and onwards. It doesn't specifically cover C++14, but if you understand C++11, the few things coming in C++14 are for the most part minor enhancements to what is in C++11.

Scott Meyers should finish up the C++11/14 version of the Effective C++ series this year, and many are waiting for this. For now, his notes Overview of the New C++ (C++11/14) [1] are available for purchase.

If you like videos, there is a wealth of information from last years GoingNative conference [2]. More recently, at this years Build conferece, Herb Sutter gave a presentation on Modern C++: What You Need to Know [3].

Finally, come visit up over on reddit in /r/cpp [4]. Some heavyweights in the C++ world participate there, and the larger portion of participants are similarly knowledgeable in C++ as a whole.

[0] [http://www.amazon.com/Tour-In-Depth-Series-Bjarne- Stroustrup...](http://www.amazon.com/Tour-In-Depth-Series-Bjarne- Stroustrup/dp/0321958314)

[1] [http://www.aristeia.com/Licensing/personalUse.html](http://www.aristeia.com/Licensing/personalUse.html)

[2] [http://channel9.msdn.com/Events/GoingNative/2013?direction=a...](http://channel9.msdn.com/Events/GoingNative/2013?direction=asc#tab_sortBy_day)

[3] [http://channel9.msdn.com/Events/Build/2014/2-661](http://channel9.msdn.com/Events/Build/2014/2-661)

[4] [http://www.reddit.com/r/cpp](http://www.reddit.com/r/cpp)

<comment><USER3> Definitely take the time to watch the Herb Sutter video (number 3), the first half is mainly about how modern C++ differs from old C++, and the second half is all about how important control over the memory layout of your data is (spatial locality, CPU caches, linear arrays vs lists, etc...). This is one of the most interesting, and most relevant talks about C++ I've seen yet.

</comment></comment><comment><USER4> For most of your questions my answers are "I don't know" or "probably things haven't changed much (but I haven't gone looking very hard)". I'm still under the impression that valgrind, gdb, libuv, g++/clang, are tools of choice. You didn't mention allocators: maybe try linking with a better malloc: tcmalloc or jemalloc. But I think that was also true 4 years ago.

> C++11 features: which ones are production ready?

What compiler and which standard C++ library are you using?

Generally speaking, any your targeted compilers support. Rvalue references and move semantics are the best and most important C++11 feature. Variadic templates would be the second best, I'd say. Scoped enumerations are nice. And being able to say std:: instead of boost:: in places, with std::bind, std::unique_ptr<T> (not boost::scoped_ptr<T>), std::unique_ptr<T[]>. nullptr_t. Stuff in [http://en.cppreference.com/w/cpp/types](http://en.cppreference.com/w/cpp/types) . Other boring C++11 features like new uses of the "using" keyword.

> Threads: still with pthreads?

You could use C++11 threading stuff, but I'm not inclined to do so.

</comment><comment><USER5> On recent C++ projects, I used the TAP [0] test format. It's quite minimalistic and does the job.

Debugging tools have improved quite a bit. I suggest you take a look at asan [1] for memory related errors. Also, tsan [2] looks very promising for data races detection. I think both tools have been integrated within LLVM/Clang/GCC.

Also, you might want to take a look at tracing tools such as (shameless plug!) LTTng [3] for userspace.

Static analysis tools are quite "en vogue" right now. IMO, nothing comes close to Coverity Scan [4]. It's free for open source projects, but you will have to fork (quite) a bit of money to run this tool on proprietary applications. On the other hand, purely FOSS static-analyzer such as clang-analyzer and cppcheck can catch nasty errors. I would suggest using a mix of all these tools.

[0] - [http://testanything.org/testing-with-tap/c-plus- plus.html](http://testanything.org/testing-with-tap/c-plus-plus.html)

[1] - [https://code.google.com/p/address- sanitizer/](https://code.google.com/p/address-sanitizer/)

[2] - [https://code.google.com/p/data-race- test/wiki/ThreadSanitize...](https://code.google.com/p/data-race- test/wiki/ThreadSanitizer)

[3] - [http://lttng.org/ust](http://lttng.org/ust)

[4] - [https://scan.coverity.com/](https://scan.coverity.com/)

</comment><comment><USER3> Just to tick a few points off the list:

\- from my experience, gcc4.8, clang3.3 and VStudio2013 all have very solid C++11 support, and it is definitely production ready

\- (meta-) build systems: cmake, premake, scons or similar meta-build-systems; these create Makefiles or IDE project files and generally simplify managing the build system for large multiplatform projects

\- std::thread, std::atomic and std::chrono are really helpful for multi- platform development, since these areas hadn't been standardized before

\- clang/llvm has a nice static analyzer, which is also integrated into the Xcode IDE on OSX (with a funky visualization of the "reasoning flow"), VStudio2013 also has a static analyzer built in

\- I use UnitTest++ for unit testing, but I'm sure there are other choices, UnitTest++ has a nice IDE integration both in Xcode and VStudio (basically, the test failure messages are formatted so that they can be parsed by the IDE, and you can simply click on them)

\- you can even get C++11 support on somewhat exotic platform like emscripten, std::atomic and std::chronos work, std::thread not because of Javascript's limited threading model

\- the new move-semantic is really useful for dynamic container classes, and generally handing complex objects around, and you get these improvements "for free" when using the standard containers

[edit: chronos -> chrono]

</comment><comment><USER6> Compilers: visual studio is a very respectable C++ compiler nowadays. It lags slightly behind clang and g++, but is the compiler of choice on windows. clang is now the equal of g++. Unless you have a reason not to, use visual studio on windows, clang on mac os x, and either clang or g++ on linux.

Build systems: cmake seems increasingly popular nowadays, but doesn't solve all autotools related issues.

C++11: If you are willing to require a reasonably recent version of each compiler, you can happily use almost every C++11 feature. auto and decltype are the two which I use the most day to day, and greatly help simplify code. If you are willing to use the very most recent version of clang or g++ (by which I mean gcc 4.9, released a couple of days ago), there is almost complete C++14 support. C++14 is mostly a cleanup, the only significant thing I have been using is generic lambda functions (lambda functions are in C++11).

Debugging: on mac there is lldb, never tried running it on linux. clang and g++ now have 'sanitizers' built in. I haven't use the g++ one, the clang memory sanitizer catches several bugs which valgrind misses (as valgrind is poor at detecting stack related issues).

Threads: C++11 has std::thread. It works fine for me but I don't do anything super fancy.

<comment><USER7> > use visual studio on mac

If only :(

<comment><USER6> Typo fixed :) (which now makes this comment make nos sense. I agree Visual Studio is better than Xcode).

</comment></comment></comment><comment><USER8> For testing, I've used and like the googletest unit test framework: [https://code.google.com/p/googletest/](https://code.google.com/p/googletest/)

For C++ features, definitely check out lambda functions and the STL algorithms. With lambdas the standard algorithms are much, much easier to use. Herb Sutter in a talk said something to the effect of just forget the whole idea of function objects and use lambdas.

Will also be useful to familiarize yourself with the C++11 pointer types, unique_ptr and shared_ptr. I try to never write code that invokes new/free directly and instead just use those pointer types.

Also seconding picking up A Tour of C++ by Stroustrup. It's not a long read and will get you up to speed on all the important changes. I think it's a very exciting time to be using C++!

</comment><comment><USER9> Clang has static analysis [http://clang-analyzer.llvm.org](http://clang- analyzer.llvm.org)

Valgrind is still what I use and see recommended

Still using doxygen

C++11: lambdas

Kind of hoping people chime in on some of your questions.

</comment><comment><USER10> As for the core C++ language, rvalue references, lambdas and variadic templates are probably the biggest additions.

Lambdas and variadic templates are optional, but you need to be aware of rvalue references and move semantics, which enable optimizations previously unavailable. If you write functions for which it might be advantageous to move values rather than copy them, such as transferring ownership of dynamically allocated memory from one instance of a class to another, then you should consider using rvalue references.

</comment><comment><USER11> I use Doxygen.

C++11 Lambda's, threads, auto, smart_ptr

C++14 shared mutex's look interesting.

<comment><AUTHOR> I have to say Doxygen has matured _considerably_ in the last 4 years. Color me impressed.

<comment><USER11> Indeed. Coupled with "Dash" I have a lot of documentation at my finger tips...

</comment></comment></comment><comment><USER12> For HTTP, Microsoft recently opensourced a C++ Rest SDK called CasaBlanca [0].

For debugging, I'm still partial to the Visual Studio debugger when appropriate, though it doesn't seem to be able to debug lambdas very well.

Also possibly missed the hype train for "replacement" languages like D, Go, and Rust. We'll see where that goes. Some people are really excited.

[0]: [http://casablanca.codeplex.com/](http://casablanca.codeplex.com/)

</comment><comment><USER13> I'm also returning to C++ as well.

Throwing that out there - Will pay over $100 for books, videos, tutorials on cutting-edge C++ tutorials to get back in the game.

<comment><USER11> well, maybe we could form a simple mailing list and we could just do an ask/answer type situation. I spent the last year writing a game in C++ and ready to start my second.

I run my own mail server, I could set something up. There a lot of lists/forums out there but they all seem snooty and dont like obvious newb questions.

EDIT: Here is a new group. Lets use it to help each other out so we all become better: [https://groups.google.com/forum/#!forum/community-c-plus- plu...](https://groups.google.com/forum/#!forum/community-c-plus-plus/)

<comment><USER11> OK, Here it is: [https://groups.google.com/forum/#!forum/community-c-plus- plu...](https://groups.google.com/forum/#!forum/community-c-plus-plus/)

</comment></comment></comment><comment><USER14> Jason created a group where everyone from here can ask and share [https://groups.google.com/forum/#!forum/community-c-plus- plu...](https://groups.google.com/forum/#!forum/community-c-plus-plus)

</comment><comment><USER15> Maybe offtopic but did you try to look golang[1]?

[1] [http://golang.org](http://golang.org)</comment>


Dear Apple, why is my iPhone always full? - <AUTHOR> https://givemeicecream.com/dear-apple-why-is-my-iphone-always-full/ <comment><USER2> This article is ignorant in so many ways.

1) Apple did see this problem coming. See iCloud Photo Library.

2) Before smartphones, we had digital cameras, and what did we have to do with them? That's right, we took out the card and copied the photos to our computers. Just because your smartphone acts like a computer doesn't mean that you should treat it the same. Copy. Organize. Curate. Sync. Done.

3) What does one of your people's opinion of the iTunes logo have to do with the price of tea in China? Moreover, it cements the impetuous and immature tone of the article. Whining "look at me" is not how to get things done. Grow up and prove yourself.

Ladies and gentlemen, please think before you blog.

</comment><comment><USER3> If Antenna Gate served as a template for how they could respond, the Jobsian answer would be one of: "upgrade to a larger phone", "use iCloud", or "don't take so many photos".

</comment><comment><USER4> The 16/64/128 GB lineup for the iPhone 6 ensures this is only going to get worse. Why they didn't bump up to 32 GB as the base level is beyond me.

<comment><USER5> My cynical view is that this is a way to increase the price of the iPhone without it seeming like it.

For example, in the past I've always purchased the "base" model. First 8GB then 16GB. But now, for me, 16GB is probably 1/2 my ideal storage size, so I'd probably purchase the more expensive 64GB model.

The new "base" model is effectively $100 more expensive.

<comment><USER6> I think it's a huge hit to their brand image with consumers if this is true, because they haven't sold woefully underprovisioned current-model-year iPhones before, at least that I can recall.

I have heard the argument that they offer the smaller storage devices for institutional bulk purchase (think high school iPads with a narrower range of use cases and a managed and/or limited base of installed software), but if that's the case they should stop offering those models to consumers in general.

</comment></comment></comment><comment><USER7> You can turn on iCloud Photo Library (Beta) which does pretty much exactly this - keeps low-res images on the phone and keeps the high res original in iCloud. (Since it's an Apple cloud-based storage product I don't trust it completely, so I also have Dropbox Photo Sync).

Don't really understand what the Steve Jobs email is doing in there either.

<comment><USER8> Why don't you use Google+ photos? It really is the best thing ever and your photos never count against your storage.

You get unlimited photos backup on you can just delete any photos on your phone and just look them up on Google+ which has the best photo search ever and also has albums, edit and folders.

<comment><USER9> does it have an option not to make the photos public?

<comment><USER10> The default is to not make your photos public.

</comment></comment></comment></comment><comment><USER11> That survey seems entirely misleading. It doesn't even have an option for never running out of space. I don't own an iPhone, but i have an android device with 16GB of space and can manage my own space myself so I never run out.

</comment><comment><USER12> Dunno, I find that Photos aren't that hard to manage for me as I don't take too many and delete bad ones quickly (though only through a Windows File Explorer; hard to mount into other programs) but I ALWAYS appear to have a 3GB "Other" space in my phone (according to iTunes) that I can't seem to shrink. It's the only reason I want to jailbreak my phone, to get in there and see just what's in there.

I'm sure I'd fill up that space with apps and photos, and be right back where I started... but at least I could try to manage it, vs. just staring and wondering...

</comment><comment><USER13> The limitation on Apple storage is a bad business decision in my opinion. Once my storage got full I simply stopped buying apps unless absolutely necessary. Before that I purchased everything I could find that looked mildly interesting.

It also means I never buy movies from Apple because there is simply no space on the device to download to.

IMO bad business decision.

</comment><comment><USER14> An app that reduces photo memory requirements is a nice start, but the only long-lasting solution to this problem is by allowing the hardware to accept memory upgrades.

It's a pipe dream to expect Apple to allow external storage on their phones, so this is likely to be the last iPhone I own. It's simply not a tenable situation.

</comment><comment><USER15> Turning off Photo Stream helps bigtime. I'm surprised the article didn't mention that.

If there was some way to adjust the stream buffer down from 1,000 photos that would probably help a lot of people. But you (still) can't change the number.

</comment><comment><USER16> Dear Apple, please buy my startup.

</comment><comment><USER17> Epic whining.

</comment><comment><USER18> Why buy a product from a company that doesn't care about your choice? An example would be how just about every smartphone on the market is capable of MicroSD storage but the iphone is not. I have a 128GB SD card in my phone.

<comment><USER19> Well, my choice is a phone _without_ an SD card reader. So why would I buy "just about every smartphone on the market", which does not respect my choice?

Memory is not expensive. It would be far easier for Apple to simply put in 128GB by default, not an SD card reader.</comment></comment>


Ask HN: Inexpensive embeded CPU for a web server? - <AUTHOR> Hi all. I am developing a hardware product that I want to be able to configure via a web interface. I need to keep the costs and power consumption down, however. What kind of CPU would you recommend that can run a minimum stack necessary for a web admin interface. Maybe something like what routers use. Any suggestions for an inexpensive stack that's NOT Raspberry PI or similar. <comment><USER2> ESP32 is very good if you can work around 3.3v. The M5Stack [0] is particularly nice and modular.

C, Lua, and some Python works well. Supports WiFi including split AP and node mode. BLE on chip as well. Get cheap LoRa chip for mesh net.

[0] [https://m5stack.com/](https://m5stack.com/)</comment>


Building a Distributed Build System at Google Scale (Strangeloop 2016) - <AUTHOR> https://www.youtube.com/watch?v=K8YuavUy6Qc <comment><AUTHOR> Slides: [http://www.slideshare.net/aysylu/building-a-distributed- buil...](http://www.slideshare.net/aysylu/building-a-distributed-build-system- at-google-scale-66128701)

via @aysylu22 ([https://twitter.com/aysylu22](https://twitter.com/aysylu22))

For people who are inclined to check other strangeloop 2016 videos, here is the YT direct link - [https://www.youtube.com/channel/UC_QIfHvN9auy2CoOdSfMWDw/vid...](https://www.youtube.com/channel/UC_QIfHvN9auy2CoOdSfMWDw/videos)</comment>


Death to Teaching Cargo Programming - <AUTHOR> http://codebyjeff.com/blog/2013/05/death-to-teaching-cargo-programming

<comment><USER2> I remember during my degree, we were literally told to copy paste some javascript and change few variables. That was it for javascript... If it wasn't for SO, I would never have got the placement I did, nor understood the concepts I do now.</comment>


Ask HN: How do you compare CPM and magazine ad rates? - <AUTHOR>

I am looking at purchasing an ad in a magazine vs. a CPM button.
CPM button costs $400 (8 CPM - 160x150 pixels, top right) Magazine 1/4 page ad costs $410 (32k circulation)
I expect market variability, but would appreciate any insights on judging the best value when comparing these ad types.  Currently, running an ad in both isn't an option although doing so and tracking the results would be ideal.  I am hopeful that perhaps someone has already done this and noticed a significant result. <comment><USER2> If you go with CPM, you'll get 50,000 guaranteed impressions of a button that is in a fairly good position (top right is above the fold).

If you go with print, you'll get a circulation base of 32,000 which is already less and $10 more expensive. What body has audited those circulation figures? Have you asked the sales team what sort of pass-along rate that magazine gets? You must also consider whether it's a weekly/bi-weekly/monthly etc magazine. Did they guarantee you a right-hand page? Where in the magazine will it be placed?

Personally, I believe you have to evaluate who you're trying to reach and who can be reached with each of the above platforms. Bear in mind that a quarter page ad isn't usually effective without amazing creative, and if they're placing the ad at the back-end with the classifieds etc, don't expect it to perform too well.

<comment><AUTHOR> Thanks for the insights into the magazine ad. I hadn't considered a number of the factors that you mention (a case of not knowing, what you don't know). I am going to write them today.

How are you arriving at 50,000 impressions? I thought 8 CPM would mean 8,000 impression total.</comment></comment>


I used to lead tours at a plantation. You wont believe these slavery questions - <AUTHOR> http://www.vox.com/2015/6/29/8847385/what-i-learned-from-leading-tours-about-slavery-at-a-plantation

<comment><USER2> These people seem so mindmumbingly stupid. The racism I can at some level understand - xenophobia and hate doesn't really need any motivation.

But to imagine the life in slavery as something positive. Like being taken cared of, by a wellmeaning father figure. - That's just plain stupidity and self delusion.

I am surprised that the author never mentioned sexual abuse, though. Perhaps she (?) was uncomfortable talking/writing about it, or it was not well documented in this household. I imagine that would have carried the point across wuite effectively. Getting raped every day is hardly something you would call a comfortable life, with a benign mater.

<comment><USER3> It's an interesting sentiment really- you see the same thing in pro-slavery sentiments during the 1800s- "oh, the Irish immigrants in Britain have it so much worse, look at these slaves, they don't live in cold tenements! They have it so good!"

To my mind it's a failure of the education system trying to make things easier for students to understand or something. Middle/kindergarten schools do some really quite perverse stuff, like "slavery days" where the white kids are "slaves" to the black kids, or other weird stuff.

I don't know if I agree with the whole idea that it's guilt or something, I think it's more to do with people wanting to believe in a good, not a bad. History is harsh!</comment></comment>


What was the strangest coding standard rule that you were forced to follow? - <AUTHOR> http://stackoverflow.com/questions/218123/what-was-the-strangest-coding-standard-rule-that-you-were-forced-to-follow <comment><USER2> In my first job out from school I worked with a bunch of ex COBOL programmers who were re-writing the system in this new-fangled language called "C".

One convention was that all "procedures" should be prefixed with a name indicating where they were in the call graph of the program.

So the main method was always:

        int main()
        {
           a_initialize();
           b_process();
           c_shutdown();
        }

The first function called by a_initialize had to be called "aa_", then "ab_" and so on:

        void a_initialize()
        {
            aa_connect_database();
            ab_read_accounts();
            ac_read_ledger();
            ...
        }

and so on.

Of course, sometimes you had to write a function that had to be called from more than one place (strange I know!!)

For this, the naming convention "pzzDDDD" was used where D was a digit from 0-9. "p" for procedure and "zz" because these functions didn't belong to any one place in the hierarchy.

We had a print out of the "pzz"s because just the number was hard to remember. But I can still remember a few of them:

* pzz0030 was for looking up account information from the database (but also for maintaining this information).

* pzz0031 for contracts

* pzz0241 I think was for looking up fees and commissions.

Most of the "functions" had lots of parameters so that they could do different things (modify, update, delete accounts etc.). This soon became unwieldy so eventually you had:

* pzz0241_a_setupcharges()

* pzz0241_c_cleanup()

or something. I forget the details for this last bit.

This was in 1997.

Neat huh? ;-)

</comment><comment><USER3> Not so much strange, as Twilight Zone-esque insane: _All methods and properties must be commented with XML_.

Sounds like a good idea, until you see how this turns terse and readable code into a bag of chatty noise. Basically this:

        public enum ConnectionState {
            Disconnected, Connecting, Connected
        }

Was not compliant ("There's no comments! It's not readable!"), while this:

        /// <summary>
        /// The Connection State.
        /// </summary>
        public enum ConnectionState {
            /// <summary>
            /// The Connected State.
            /// </summary>
            Connected,

            /// <summary>
            /// The Disconnected State.
            /// </summary>
            Disconnected,

            /// <summary>
            /// The Connecting State.
            /// </summary>
            Connecting
        }

Was considered Compliant and Good. This example has not been simplified, by the way.

<comment><USER4> I too was forced to do that. I too found it ridiculous. But not for long. There was a utility for generating the documentation strings (it got them right most of the time) and there's a lot to be said for consistency, even if it produces the occasional pointless-looking artefact. The reason this requirement is in the C# style guidelines is because it gives a consistent way of commenting and, of course, allows extraction of documentation and intellisense. I am no drone by any means, but this isn't so insane if you give it some thought.

<comment><USER3> There wasn't "the occasional pointless-looking artifact"; I would have been fine with that. 95% of all code comments merely mimicked the type signature. People were using Visual Studio plugins to autogenerate the "documentation". Pressing SHIFT+ALT+J (or something) would read the function name and type signature and regurgutate some XML doc matching it.

> allows extraction of documentation and intellisense.

These _already give you_ type signature and function name. If intellisense already gives you "bool isValid", what possible gains do you get from an extra "boolean value indicating whether the value is valid"?

> I am no drone by any means, but this isn't so insane if you give it some > thought.

Trust me, I have given it plenty of thought. Some conclusions from these thoughts:

\- Code comments that merely mimic the type signature add nothing. Not for readability, not for intellisense, not for documentation extraction.

\- They increase the signal-to-noise ratio of the code immensely, making it harder to read. Comments with actual useful information will now drown in the sea of drivel.

\- Fuck it, I'm not working here anymore.

The main fallacy here is that More Process and More Rules can make bad programmers write good code.

<comment><USER4> Fair enough. I found that in a collaborative environment (people making and sharing code) the style guidelines had a net positive effect (and believe me, my first gut reaction was along the 'this is insane' lines). As process go, the degree of automation and strict automatic enforcement (and fixing) of rules felt lightweight after a bit.

We're neither of us going to convince the other, I just thought I'd add a datapoint. FWIW I now write Python and although PEP8 isn't as hard-line, I think it similarly does a lot of good.

</comment></comment></comment></comment><comment><USER5>
      > To NEVER remove any code when making changes. We were told
      > to comment all changes.

I'm afraid given this rule, I would abuse it horribly. My backspace key would no longer function and every typo I make would introduce a new set of /* */ comments. Every refactoring would have the old type, variable, line, function, or entire class commented out with the fixed code alongside it. Bonus points for interleaving the old code and replacement code.

<comment><USER6> I understand the rule, we have this rule in place with a caveat. The rule protects us from a few common events, first being that where some developers just love to tinker with code outside the scope of their project. The second is simply a bad design where the results affected other code in unexpected ways.

There have been a few times were code was reverted and having the code merely commented out saved time, time spent cut/pasting from archive. Even with a good CMS keeping commented out code can serve another purpose, knowing what was when and why. That way we can avoid the "well back in year X we had a rule" because we have the code readily accessible.

For large blocks (subroutines/procedures/etc) it is not uncommon to move the whole to the end of the source.

<comment><USER7> "saved time, time spent cut/pasting from archive"

Surely source control would be a nicer way than copy/pasting old code back in?

</comment></comment></comment><comment><USER8> The worst thing I've ever seen: [http://blog.jgc.org/2007/08/why-you-dont- want-to-code-for.ht...](http://blog.jgc.org/2007/08/why-you-dont-want-to-code- for.html)

<comment><USER9> Most amusing I've seen was Java code that was rather over zealous about DRY and no-string-literals in code (i.e. all strings had to be define as constants).

This resulted in code like:

       url = HTTP + COLON + SLASH + SLASH + WWW + DOMAIN_NAME + DOT + COM;

based on lots of definitions like:

       public final static String COLON = ":";
       public final static String SLASH = "/";
       public final static String DOT = ".";
       public final static String COM = "com";

[Apologies if this contains any Java syntax errors, I pretty much stopped using Java soon after this experience]

Also I've just realised that I'm _really_ glad Java doesn't have a standard pre-processor - truly evil things would then have been possible <shudder>

<comment><USER10> COLON + OPEN_BRACKET

</comment></comment></comment><comment><USER11> The strangest coding standards were imposed when I was working at an AS/400 shop a dozen years ago.

No indentation allowed. Even though the modern compilers supported it, it looked ugly to veterans who had worked with fixed-format compilers for 30 years.

No comments in the code allowed. The function had to be entirely clear by looking at the code. Any code that needed comments for clarification was considered too 'clever' and 'obfuscated' for production.

No new language features allowed. IBM maintained languages and tools always acquire large amounts of feature bloat over the decades. Only a small subset of these features was 'white listed' by the CTO.

<comment><USER12> > No comments in the code allowed.

That's not necessarily bad advice - at least as a starting point. If you use descriptive variable/function names, then a huge amount of your commenting usually needs go away.

The big advantage is that people are rarely very good at updating comments - at which point they become at best useless and often downright misleading, Whereas most coders will hopefully at least consider renaming a function or a variable when it's no longer accurate.

<comment><USER13> Normally I'd tend to agree with you, but if the gp was using an AS/400, I bet their software was written in RPG.

Now, let's play a game. :) I'm going to Gist the example RPG program from Wikipedia, but with all the comments stripped out. Take a guess as to what it does:

<https://gist.github.com/4204324>

(Note that the spacing shown here is _absolutely essential_. Keep this in mind if you ever feel like complaining about whitespace in Python.)

Answer:

<http://en.wikipedia.org/wiki/IBM_RPG#Example_code>

My company's entire internal business infrastructure is written in, perhaps, millions of lines of this (commented, thankfully).

"Right," you may say, "but this is surely easy enough to read for someone who's used RPG for a while." Now consider that (afaik) RPG hasn't been taught in schools since the 70s, and that this entire format is alien to folks reared on Java. Even a poor comment in this environment is like suddenly stumbling across a line of semi-cogent English scribbled in the margins of the Necronomicon. Which is to say, it might just hold the insanity at bay for a while longer. :)

Footnote: the Wikipedia article mentions a "FREE" mode that makes writing RPG much more similar to modern languages (what an old hand here might call "freeform" languages, a.k.a. languages that aren't column-based). But I get the feeling that the gp's company would regard such notions as heresy.

</comment></comment></comment><comment><USER14> I worked at a start-up whose engineering lead brought familiar coding style to a project that was inherited. We were imposed a combination of C89-esque and Microsoft kernel coding style on an Objective-C source code. Things like defining all variables at the beginning of the function definition in alphabetical order in CamelCase, having instance variables prefixed with the class abbreviation, and other inane rules. It went something like this:

      - (void)
      doSomethingOnObjectAndNumber:
        (NSObject *) MyObject :
        (NSInteger) MyNumber

      /*++
      Some unstandard doc format.
      --*/

      {

        ...
        return;
      }

Before I started, I was told that the project migrated from git to svn to "make branching easier". I do not work there any more.

</comment><comment><USER15> Maybe someone knows of a solution but it would be great if SVN/version control was able to store a standard formatted version of source code and then depending on client/user preferences could reformat the file accordingly on checkout and then also be able to factor in / unformat when doing diffs/checkins. I feel like if it could work like this it would mitigate a lot the inevitable battles that take place over small things like formatting/etc. There are obviously things like variable names that it wouldnt be able to solve but at least nobody would be complaining about where Joe put his curly bracket. I guess you can do something similar with an SVN hook but its hard to get a seamless process.

<comment><USER16> I know a solution: Agree on the broad points of formatting - ie. tabs/spaces, where the braces generally go. Make engaging in formatting battles a firing offense, but listen to anyone who can make substantial arguments in favour of a practise.

Automatic reformatting is evil - sometimes codes is more readable if formatted in a particular way. Readability and maintainability always trumps adhering to rules.

<comment><USER17> Automatic reformatting is the only solution, because you want to be able to make unreadable code readable without conscious effort. My preferred policy would be something like:

1\. There is an agreed autoformatting template, checked into version control.

2\. It is always ok to format the lines you are working on however you like, with the understanding that other people may run the autoformatter on the file.

3\. It is always ok to run the autoformatter on a file you are working on (autoformatters only really work at file granularity).

4\. It is not ok to format code you are not working on.

<comment><USER16> I mostly agree, although I'd like to enhance the bit in point 3 and 4 about only ever reformatting code _you're actually working on_ \- meaning, you take responsibility for any code that your autoformatter changes is just as readable as before.

Changing the name of a constant on line three doesn't give you license to autoformat the rest of the file.

<comment><USER17> I think it does. Carefully maintained manual formatting takes too much programmer effort. If you open a file to actually work on, you should be permitted to hit the autoformat button without thinking, because then formatting becomes something you just don't think about. It's not as good as good manual formatting, but it's good enough, and frees up mental resources for more important things.

<comment><USER18> I'd say this depends on the project and the developers. In some projects _reading_ code is done a lot more often (and by more people) than actually writing code, so then you might want to spend more time on e.g. formatting, documenting, etc..

</comment></comment></comment></comment></comment></comment><comment><USER19> The company must scale! Sysadmin and webdev must be split! Therefore all (junior, barely unix-aware) web developers must provide automated Freebsd- specific install, test, start and stop scripts in a custom and ill-considered package format with no inter-component runtime or instllation-time dependency support. For every project. Therefore the perlmonger in charge and sysadmin extraordinaire can automate their dabblings.

Needless to say, getting barely PHP capable people who'd heard of unix to automate dependency installation and maintenance on such a platform didn't work out well. Did I mention this was 2010?

</comment><comment><USER20> In one project, I had to use camelCase and cargo-cult-Hungarian prefixes in table objects: tblTableName, sVarcharColumn, iIntegerColumn, vViewName and so on. I actaully surprised myself with just how deeply and viscerally I hated this convention. I could no longer easily convert column names into human- readable headings on reports; and the prefixes were just redundant, completely missing the point [1] of Hungarian Notation.

[1] [http://msdn.microsoft.com/en- us/library/aa260976%28v=vs.60%2...](http://msdn.microsoft.com/en- us/library/aa260976%28v=vs.60%29.aspx)

</comment><comment><USER21> The strangest one was when I was a COBOL programmer in the mid 80's and was forced to learn and used the GOTO verb. Having learned COBOL JSP style I was unaware that goto even existed in COBOL until then.

There again same place made me retest a program I'd tested and was fully working as a full-stop was missing of a comment line.

Crazy days.

</comment><comment><USER22> Many answers show a common trend: absurd prefixing rules. They're not only useless, but also counterproductive, because they prevent the incremental searches that are present in so many parts of the development tools.

If you prefix every table name with "tbl", you can't search for them in the DB manager console, the IDE table listing, a directory list of the creation scripts, etc.

I suffered an extreme version of this: there was some prefix that was also the directory name. So the files were called "prefix/prefixBlah". Also the prefix was used as class name and the fields were also prefixed with it.

The result was that a reference could become "prefix/prefixBlah/prefixBlah.prefixDoh", an awful noise to signal rate.

I complained without success. That way was "a lot more orderly and tidy" <sigh>.

</comment><comment><USER23> For those who have not yet stumbled on it, thedailywtf.com is a treasure-store of such golden nuggets.

</comment><comment><USER24> I really feel bad for some people in this thread :( this is really painful to read...

</comment><comment><USER25> I was talking to someone today, and they commented:

"Good programmers eventually learn to misspell words like void or int so that they can name their variable names what they want to name them."

I of course told him that this was terrible advice, and would mess with the next person who had to maintain the code because you couldn't tell at a glance if a word was a keyword or a keyword mispelled. I asked him what language he was using.

FORTRAN.

Where did he work.

The United States Air Force.

For how long?

Six years.

When?

Before 2000.

Since he had more experience, he claimed I was de facto wrong.

I fought him on it some more.

He told me it was personal preference. I told him you'd have to make me do it.

It was at that moment I figured that someone, somewhere, had probably had to do this as part of a coding guideline.

<comment><USER23> klass for a variable of type Class is totally normal in Java.

<comment><USER26> Isn't it usually clazz?

But such things are quite annoying for automatic code generators, though, as they have to make sure that they won't ever emit an identifier that clashes with a keyword. The ability to just prepend @ in C# is quite helpful in that regard.

</comment></comment></comment><comment><USER27> On a vaguely related note, there was a project kicking around a month or so ago to store editor-neutral code formatting specs in the project root. Can anyone remember what it was? My google-fu is failing.

</comment><comment><USER28> None were strange. I agreed with all the coding standards I have been forced to follow. The key to not be annoyed by them is to not work at places enforcing stupid standards :)

<comment><USER29> (

<comment><USER25> Is there something clever I'm missing here?

</comment></comment></comment><comment><USER30> In my first job as part-time programmer at a bank back in 89, we were developing a large system in C, pretty advanced stuff compared to the usual 'buy from IBM' approach at the time. The 'systems analyst' broke down the design into modules and functions for the entire system, and everything was named something like 'ABM10EI00405'. Yeah, those were the actual names we had to use for .c files and functions.

</comment><comment><USER31> I've come to believe that coding standards always end up being either too simplistic to deal with every scenario or longer and just an inferior in-house implementation of Steve McConnell's "Code Complete". Either way you're wasting your time _.

_ Style guides are ok though, so long as they're short and not enforced too bluntly.

</comment><comment><USER32> No numerics permitted in function names.

Theory: It's prettier.

Reality: Just try to understand the hierarchical relationship between 247 functions in a 10,000 line Material Requirements Planning module of an ERP system when every function name must be all alpha.

<comment><USER9> Wouldn't that rule just end up with people writing:

       FloopTwentySeven

rather than

       Floop27

:-)

</comment></comment><comment><USER33> I'm not sure what's up with all the hate for reverse hungarian notation, but I personally think it is helpful when writing C/C++.

<comment><USER34> I think it is crazy. Especially today, when IDEs can show you the declaration of a variable or method while hovering over it, there is no need to encode the type of a variable into the name. Variable names need to be sensible to humans, the compiler doesn't do checking on them anyway: it's all too common for the type prefixes to become misleading when a program has been refactored and they don't match up anymore.

<comment><USER35> It is crazy if you misuse Hungarian Notation like 99% of the people out there

For the 1000th time

"there is no need to encode the type of a variable into the name"

It's not the data type (int, char, etc), it's the nature of the thing being counted!

Number of apples, height, distance, etc

But of course when saying "type" most people would think it's the data type when it's not

<comment><USER34> I'm not sure what you're referring to, but in all instances of Hungarian notation I've seen (especially in Windows programs) it was the data type (pointer to char, 8 bit int, 32 bit int etc) encoded and not "the nature of the thing".

I agree that adding the "nature of the thing being counted" makes sense, but then you don't have to call it Hungarian notation anymore, "number_of_apples" is just a sensible variable name...

<comment><USER36> Joel Spolsky wrote a good summary about the Hungarian notation, and how it got corrupted within Microsoft:

<http://www.joelonsoftware.com/articles/Wrong.html>

<comment><USER34> Thanks for the explanation. The original idea was pretty good. But I've only, ever, seen the corrupted variant in the wild. And coding standards that enforce it. Hence my annoyance.

<comment><USER37> Yeah, Hungarian Notation may have flowered in the Councils of Elrond, the mere sound of which would give men Knowledge, Wisdom and inflation-adjusted semi- annual raises, but out here on the edge of Mordor it's been horribly twisted into something only an Orc could love and look upon. If an Orc could love.

</comment></comment></comment></comment></comment></comment></comment><comment><USER38> One company where I worked decade ago have tables numbered, like tbl01_users or tbl14_places.

Still have no idea why they establish it this way.

<comment><USER39> Likely because it tied into a data dictionary from a documentation system.

The tbl01 makes it unique (so you can have a users and someone else can have theirs too), the data dictionary then tells you what fields exist in that particular table and how those fields relate to other tables.

</comment></comment><comment><USER40> I've been asked that I avoid using classes, because my boss didn't understand OOP (LAMP stack).

</comment><comment><USER41> put everything in a class!

</comment><comment><USER42> That is why _only_ products made by engineers for themselves should be re-used (nginx, redis, etc.) and those been "managed" by idiots should be avoided.)

Over-management is much more common and much worse problem than over- engineering.)</comment>


IP Accounting and Access Lists with Systemd - <AUTHOR> http://0pointer.net/blog/ip-accounting-and-access-lists-with-systemd.html <comment><USER3> Many moons ago, support for TCP wrappers was removed from systemd -- and, a bit later, OpenSSH, IIRC. Fine, I understand. Personally, I still like tcpd (it's an extra layer) and I still use it... but I realize that not very many others do. Okay, I can live with this decision.

Then, about two weeks ago, Red Hat decides they're gonna deprecate TCP wrappers, with a Red Hat employee saying:

> _TCP wrappers is a simple tool to block incoming connection on application > level. This was very useful 20 years ago, when there were no firewalls in > Linux. This is not the case for today and connection filtering should be > done in network level or completely in application scope if it makes sense._

Okay, fine. I still think it's useful as an extra layer but, nobody really uses it so, sure, let's get rid of it. I'm on board.

Now, all of a sudden, this functionality shows up in systemd (announced yesterday)?

Really!? This is (one of the) reason(s) why some of us greybeards loathe systemd (and just when I was starting to become "okay" with it, too).

<comment><USER4> > Really!? This is (one of the) reason(s) why some of us greybeards loathe > systemd (and just when I was starting to become "okay" with it, too).

I am not sure why you imply that there was some evil scheme behind all this. In reality, things are a bit different: one group at Red Hat decided to put an end to TCP wrappers (which btw is something other distros already did a while back, we are late at the party), and another group then offered to make a more modern replacement available, that could cover some of the uses, in order not leave users in the cold. I am not sure why you think that's an evil thing to do? Isn't it nicer to drop something with a suggestion how to replace it then to drop it without replacement?

Also, let's not forget: this functionality is implemented in the kernel, systemd merely adds knobs to expose this kernel functionality to the user. Hence, no, this functionality didn't really "show up in systemd". It showed up in the kernel, and systemd just wraps it to make it usable.

I mean, this is a dilemma, isn't it? Whatever we do you are unhappy, right? ;-)

Lennart

<comment><USER5> I do not think he is unhappy about this feature in systemd. He complains about the process and communication: removing a feature arguing it is useless then providing a replacement.

Personally, I am very pleased with systemd and thanks to its novelty, it puts me on a same level as all the "greybeards". Continue the good work and please, take special care of the man pages.

</comment></comment></comment><comment><USER6> Another great sandboxing capability added to systemd, and as easily employed as a single flag:

      IPAddressDeny=any

What I enjoy about systemd is the fact that I can employ capabilities like this with any process on the system using only a line of configuration. FTA:

> It's a simple way to lock down distribution/vendor supplied system services > by default. For example, if you ship a service that you know never needs to > access the network, then simply set IPAddressDeny=any (possibly combined > with IPAddressAllow=localhost) for it, and it will live in a very tight > networking sand-box it cannot escape from. systemd itself makes use of this > for a number of its services by default now. For example, the logging > service systemd-journald.service, the login manager systemd-logind or the > core-dump processing unit systemd-coredump@.service all have such a rule set > out-of-the-box, because we know that neither of these services should be > able to access the network, under any circumstances.

<comment><USER7> If you want to use this for sandboxing, it may be a good idea to also include

      RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6

to block non-IP sockets.

</comment></comment><comment><USER8> Another systemd release, another bloating of the attack surface of the now- standard init system.

I'm sure this is useful but init is absolutely the wrong place for it.

</comment><comment><USER9> What is the general direction of packet filtering in Linux - it seems that it is nftables vs ebpf/XDP at this point. In fact [https://lwn.net/Articles/609571/](https://lwn.net/Articles/609571/)

> _There was "a brawl" at the workshop about possibly replacing the nftables > virtual machine with eBPF, but there is one major show-stopper in any such > plan: nftables allows partial replacement of a firewall configuration, while > eBPF, in its current form, would not. _

Cloudflare, Netflix, Facebook, etc are all using eBPF via XDP [https://www.iovisor.org/technology/ebpf](https://www.iovisor.org/technology/ebpf)

eBPF and XDP are supported seamlessly on kernel 4.12 and later.

</comment><comment><USER10> This is really nice. It'd be nice to see port/protocol filtering included in this functionality some time in the future as well since it would fit the theme of sandboxing around processes - i.e. start a daemon up and have the kernel enforce which ports inbound/outbound can be accessed. This is something Docker accidentally provides that's fairly useful.

</comment><comment><USER11> The clarity and depth that Lennart writes with is always impressive to me. Another highly educational post from a master.

</comment><comment><USER12> Fuck this. freebsd is now the way forward. Linux has been compromised and in a way that is understandable to anyone conversant with the design philosophy of the underlying userspace tools.

</comment><comment><USER13> What does the init system have to do with this?

<comment><USER14> It is useful for sandboxing processes

<comment><USER15> One can certainly make that argument. But now you have two ways to run executables; via the shell / fork - and through the init system (with various capabilities etc).

I guess I'd prefer a single api, so I could sandbox (or not) netcat and Firefox the same way as samba and openssh.

It might not be a _major_ point - but it would be nice if there was a single way to "run in env/with configuration" that didn't involve an extra (and somewhat opinionated and opaque) wrapper.

It's a little like the dot.desktop-file approach to dress up cli tools/interfaces in a desktop gui - it's brittle and doesn't really work all that well. And the cross-platform story isn't great.

On the other hand: attaching capabilities to process trees seems better that text-based matching etc. I suppose I think the bsd jail approach looks better - even though that to involves a "wrapper" \- but it's a wrapper that's not artificially limited to "services".

[ed: the fact that any kind of name lookup is left out is also a bit odd - <USER2> demonstrated by the curl example, for many uses of whitelisting name resolution is essential. And for ldap/kerberos/ad being able to work with named resources seems to be the only sane idea. That's why we use dns and catalog services in the first place! This even more clear in an ipv6 environment, as the addresses are generally longer, and auto-assignment is somewhat better than ipv6/DHCP.]

</comment></comment></comment><comment><USER16> systemd should have a "whitelist" mode, where everything is locked down by default. Or at least, some /usr/share/doc/systemd/locked-down-example.service file with all of the relevant options set to "secure mode". It can be hard to follow all of the new features :)</comment>


Idaho Inmates Hacked Prison Service for $225,000 in Credit - <AUTHOR> https://www.nytimes.com/2018/07/27/us/idaho-prison-hack-jpay-nyt.html <comment><USER2> Sparse on details of what the exploit was - given that so many people took advantage of it, it must either have been an obvious bug, or something that was communicated widely among inmates.</comment>


Wikileaks: How are they staying on the Internet? - <AUTHOR> http://www.renesys.com/blog/2010/12/wikileaks-moving-target.shtml

<comment><AUTHOR> _If you ask for the authoritative servers for wikileaks.ch today, you'll find no fewer than 14 different authoritative nameservers, spread across eleven different autonomous systems, in eight different countries, from Switzerland to Canada to Malaysia. And if you ask any of those 14 servers where to find wikileaks.ch, they'll point you to one of three differently routed IP blocks, containing web server IP addresses with diverse geolocation: 188.8.131.52/21 (originated by Serverius, in the Netherlands), 22.214.171.124/17 (originated by Bahnhof, in Sweden), and 22.214.171.124/18 (originated by OVH in France)._</comment>


Luxury hotels are being inundated with requests from self-described influencers - <AUTHOR> https://www.theatlantic.com/technology/archive/2018/06/instagram-influencers-are-driving-luxury-hotels-crazy/562679/?single_page=true <comment><USER3> I've seen something which I think is even more interesting.

Second tier influencers (100k followers) paying expensive hotels and private plane trips of first tier influences (1 mil followers), so that they can appear on their feeds, and gain new followers.

<comment><USER4> This is straight up Black Mirror (season 3, episode 1: _Nosedive_ ) Obviously the whole point of that episode was to imagine Instagram in its darkest future, but it's scary how much of it is becoming real, and separately with the roll-out of social credit scores in China. Scary stuff.

\---

Hansen: So in terms of quality, you could use a punch up right there. Ideally, that's up votes from quality people.

Lacie: Quality people?

Hansen: High fours. Impress those up-scale folks, you'll gain velocity on your arc and there's your boost.

<comment><USER5> > the roll-out of social credit scores in China

The thing is, these all aren't enforced by governments, but through social media and organizations. The popular one sesame credit in China is from the Alibaba group, not the Chinese government. In the same vein, Instagram is it's own platform, people can determine how much they think "followers" are worth and businesses can use their own discretion to decide how much to enforce their own policies based on others "social credit" or "followers"

<comment><USER6> Except that if the "social "companies keep growing and merging eventually they will have more power than governments and if you are not signed up you may as well don't exist.

<comment><USER7> Which is explored (in a _decent_ but not brilliant way) in the Emma Watson movie "The Circle". It's ending was somewhat chilling, if a little naff. I enjoyed it though, and provoked some interesting thoughts, even if it doesn't dive quite as deep as I'd like into this topic.

</comment></comment></comment></comment></comment><comment><USER8> I wonder why the strategy of these "brand personalities" has to be limited to "luxury" type branding.

For example, could you build a following traveling the country by interstate in a Fiesta, staying at Motel 6 and eating at Waffle House? It wouldn't cost Motel 6 and Waffle House almost anything to comp a few waffles and otherwise- unoccupied rooms as an experiment, if they aren't doing similar things already.

<comment><USER9> Pot bellied middle-aged bald white man drives to his Motel 6 in his Ford Fiesta, crosses the street to a Waffle House, gorges himself on waffles and syrup, and returns to his hotel room to cry and wonder where it all went wrong?

Sounds great.

<comment><USER10> I would create an Instagram account just to follow this guy.

<comment><USER11> Obviously you wouldn't or you would have done this already.

<comment><USER12> As if Instagram lets you search a pot bellied middle-aged bald white man travel blogger, especially without creating an account first.

</comment></comment></comment></comment></comment><comment><USER13> I just want to know who the heck takes recommendations of 'influencers' seriously? Gullible teens with no money?

<comment><USER14> My thoughts exactly.

It seems to me that the target market of these "influencers" is teens with little to no money that spend hours looking at these "influencers" exactly because these pictures are as close as they're gonna get to that luxury lifestyle.

People who can actually afford this will just go on holidays by themselves with no thoughts about the "influencers" whatsoever, also because by the time you can afford such lifestyles you widen up to the obvious commercial intents of these influencer "recommendations", making their "review" purpose moot.

In my social circle people who spend days & nights looking and sharing the influencer pictures can't actually afford any of that even if they wanted to. Those that can afford it don't give a damn about the influencers.

<comment><USER15> > People who can actually afford this will just go on holidays by themselves > with no thoughts about the "influencers" whatsoever, also because by the > time you can afford such lifestyles you widen up to the obvious commercial > intents of these influencer "recommendations", making their "review" purpose > moot.

Isn't the idea to follow people who, for example, travel to cool places that you might not have considered?

Perhaps seeing one of those pictures pop up where influencer X spends a while in a Maldives resort might actually get you interested to go check it out yourself?

<comment><USER16> To my knowledge influencers rarely travel to "cool" places. They travel to family friendly, safe places. And safe in multiple meanings in both "people are safe here" and "this place is safe for me as influencer since noone will be offended".

My family used to travel a lot and we went to a lot of family-unsafe places at times (like in-the-wilderniss campsites in southern africa where you can't leave the RV because there is snakes and wild animals outside or climbing up several vulcanoes in iceland and I mean 'climb' not 'walk up a slope')

Those are actually cool places.

<comment><USER15> I'm not disagreeing with what you say, because I too think the places you describe are often cool. However, they're also very much outside of the comfort zone of most people.

For example, on average I would assume most women prefer a romantic getaway to the Maldives over climbing a volcano in Iceland. And most people with kids likely won't be going on a month long roadtrip through Africa or South- America.

<comment><USER17> > For example, on average I would assume most women prefer a romantic getaway > to the Maldives over climbing a volcano in Iceland. And most people with > kids likely won't be going on a month long roadtrip through Africa or South- > America.

Because a romantic getaway is far cheaper than Iceland or Africa. It's not because it's outside their comfort zone, it's because they can't afford it. The average woman (or man) can barely take enough vacation days, let alone pay for it.

</comment></comment></comment></comment></comment></comment><comment><USER18> In almost every field and industry, companies get requests like this go something along the same lines as mentioned in this post: "Hey, I have access to XYZ audience and we will be doing event ABC next month. It would be great to showcase/use your product and share that with the group. Your company and your product would be front and center for this group of people. All we need is your product for free."

In the end, all this is is just ad sales: I have alleged access to customers who want your product but don't know yet. I can share your company or product w/ them. They trust me. It will influence them to become your customer. Give me X."

And worse than that, many times those requests come with a price tag on top of providing the company's product or service for free.

And really it's no surprise given how social media works. Now any "idiot" can gain a following or an audience over some set of topics, or philosophy, or style, and gain a following that tunes. I say "idiot" less as a derogatory thing and more as a "every Joe or Jane" kind of thing who persists and is focused. Any following of people that tunes into something, anything, can often be cajoled into seeing or experiencing some mention or ad about an unrelated thing and that causes some %-age of that group to pay attention and some %-age of those that pay attention to potentially investigate further and possibly become paying customers of some company or product they didn't know about before. Certainly not rocket science and definitely not new.

What we're seeing here is merely a temporary fashion/trend that tends to focus heavily on luxury hotels and envious-appearing travel experiences.

<comment><USER19> I still see influencer advertising in a better light than a brand's own ads.

Influencers, especially the more popular ones, help inform consumers about a product/service/experience.

The _only thing_ an influencer has is their followers and most influencers really are careful to not advertise products that they don't believe in themselves.

<comment><USER20> I explicitly don't trust influencers because all they have are their followers. They often have no credentials or real achievements or original thoughts, so why should I trust them? Especially given that their entire goal is to get people to follow and like them?

I see this pattern a lot in coder twitter. The people with big follower counts that are always tweeting about their amazing coding and love of software development are not the ones building stuff. Even if their feelings are genuine, the excessive self promotion is quite ugly and makes me doubt everything they say. They are not people I want to trust or follow or listen to

<comment><USER21> Simply put, influencers who don't have credentials or achievements may not be the right influencers for your business.

Finding people who are well-respected in their space, actively create high- value content for their audiences, and can find ways to organically share a brands message are where the real value lies. Combined with trackable promotions, this can be very effective when executed properly.

</comment></comment></comment></comment><comment><USER22> Almost all of these 'influencers' have fake followers. If they didn't buy them, the majority of their followers are auto following bots or people using bots to auto-follow to get more followers. Working inside this industry it's remarkable how little reach 99% of these people have.

Who wouldn't want to get luxury hotel stays for free, have brands send you free stuff, or get paid to promote something? It's an incredible deception and many are falling for it.

<comment><USER23> From the article:

> "We have to filter out influencers who have basically bought bots. There's a > lot of those these days."

</comment></comment><comment><USER24> Wow, 10% of unsolicited requests are worth looking at? That seems remarkably high.

<comment><USER25> I'm guessing most people realize it's ridiculous to even send such requests when they have 2k followers.

<comment><USER26> That would not have been my first guess.

</comment></comment></comment><comment><USER27> In "the hitchhiker's guide to the galaxy" there is a story about a society that shipped out all its useless members (hairdressers and telephone sanitizers) off planet. If Douglas Adams was writing the book now he may have replaced sanitizers with influencers.

<comment><USER28> _In "the hitchhiker's guide to the galaxy" there is a story about a society that shipped out all its useless members (hairdressers and telephone sanitizers) off planet._

Stanford is doing that with their new Redwood City "campus", an office park five miles from the main campus. No professors. No students. No researchers. No labs. All administrators. _" Stanford units that will have at least some employees at Stanford Redwood City include Business Affairs; Land, Buildings and Real Estate; School of Medicine administration; Office of Development; University Human Resources; University Libraries; Office of the Vice Provost for Teaching and Learning; and Residential & Dining Enterprises."_

 _" The first phase of construction at Stanford Redwood City will include four office buildings, indoor and outdoor dining areas and plazas, a child care center, a glass-atrium fitness center, a parking garage, a landscaped greenway, a 2.4-acre park and a sustainable central energy facility."_

It's Stanford's version of a luxury center for influencers.

(As a Stanford alum, I consider this embarrassing.)

[1] [https://redwoodcity.stanford.edu/](https://redwoodcity.stanford.edu/)

<comment><USER21> Genuine question--what would make this not embarrassing for you? Is it the separation from the main campus? How they are segmenting orgs?

<comment><USER28> It's the sheer number of administrators. Stanford has only 1,761 instructional employees, of which 834 are tenured faculty. The Redwood City facility will have 2,700 administrative employees in the first phase alone.

<comment><USER29> Maybe I'm not surprised by this because I work in higher ed, but that ratio of administrative staff vs faculty is not really anything to write home about. I work at a top 10 business school, and our staff/teaching ratio is about 5/1, and at schools like HBS or INSEAD in France, the ratio skews quite a bit higher.

</comment></comment></comment></comment></comment><comment><USER30> I use Instagram and other social media. But I just don't get how this works. Perhaps someone can give me and others an overview. I only see the posts from my friends, so how would posts from these "influencers" influence me or other's like me? Why would I follow some random person I don't even know? Really, I'm looking for some enlightenment here. I assume that I'm not the only one.

<comment><USER31> I'm in the same boat, but what I've found from talking with many people is that they use Instagram to discover places and get an inside look, with what they see on Instagram determining whether they go or not. This leads to reviews on Google like "they run a really good Instagram, but things don't measure up in-person" (I saw this exact review the other day).

<comment> gm-conspiracy Ha. I just checked into a Marriott about an hour ago.

In the lobby, there was a giant touchscreen and one of the icons was "social media".

I tapped it, and it said "Our Instagram account is currently offline."

<comment><USER32> I chuckle to myself every time I see a superfluous piece of technology like this being out of service. Then, I realise the probable reality is that no one cares. All they care about is that the core business is still operating (for better or worse).

I've never managed to get free WiFi properly working on a plane or train.

</comment></comment></comment></comment><comment><USER33> _People want an authority to tell them how to value things, and they choose this authority not based on facts or results, they choose it because it seems authoritative and familiar._

\-- Michael Burry (The Big Short)

</comment><comment><USER34> I think this goes along with the (perhaps perceived) increase in self- centeredness in society.

<comment><USER35> Or just a general idea of mooching off of someone for free for very little in return. Apparently, it's a bit of a con with most influencers, but for a select few who actually do move the dial.

<comment><USER36> This is the entire advertising industry in a nutshell, and that funds Google.

<comment><USER37> > and that funds Google.

... and the atlantic and most newspapers, media companies and even this site. Welcome to the consumer economy where trying to "influence" consumers to consume is the name of the game.

Advertising is at the heart of everything in our society from technology to politics to news. We don't even realize it most of the time because it's all around us like air.

<comment><USER38> I think there needs to be some new word for this ill. Advertising is only necessary because of the breakdown of social trust that comes with fungible living in this individualized, modern world of ours. I think this nebulous ill of "advertising" extends far beyond ad tech, ad agencies, and media and right into the structure of society and the human condition itself.

</comment></comment></comment></comment></comment><comment><USER39> Maybe I could become a chip industry influencer. Especially if I could wear a suitably chic factory floor bunny suit.

<comment><USER40> #metrology is awesome! #quadruplepatterning #FinFETastic!

I'm really happy that I don't work on consumer products.

</comment></comment><comment><USER41> Every reputable travel publication/blog I know of have strict editorial policies against accepting freebies/discounts/gifts in exchange for reviews/coverage.

Those so-called "influencers" aren't really about serving their audience -- they strike me as just a scammy way to travel "for free".

<comment><USER42> The "influencers" reek of "I'm young, female, and attractive, and therefore i am worthy of attention and lavish gifts."

Thing is, it works.

<comment><USER43> To be fair on them, despite what their instagrams show it is a lot of work. My girlfriend follows Alexis Ren and showed me her workout routine, it's easily 3 hours a day. Which combined with reaching out to brands, dealing with advertisers, scheduling, photoshoots etc I could easily see it being a full time job. Plus the constant dieting on top of all that which I can't remember the details of, but I know is hugely restrictive: no eating after 5pm and zero alcohol for example.

For sure a lot of them are pretty low effort and just do it as a side job, but I don't think it's as simple as just being attractive and I don't think a lot of them are as entitled as they seem.

<comment><USER44> It seems a lot like managing your own modeling and PR business. I am not by any means saying that all influencers are attractive (or that it's the source of their popularity when they are!) but the line between being an influencer and an "instagram model" seems very wide and grey.

<comment><USER32> It's a term that I only see the media industry using.

It's all cut from the same cloth but at the end of the day, advertising works.

</comment></comment></comment></comment></comment><comment><USER45> This is such a downer on holidays, when you want to rest at luxury place, but some young people ruin it for you with their obnoxious behavior. I hope there will be hotels that ban such Instagram addicts from premises.

<comment><USER32> This was not my experience with my last holiday. But then again, I did not go for luxury.

</comment></comment><comment><USER46> My GF has 18000 followers and gas worked hard for her brand to be meaningful as an influencer. She isnt just posting a picture sitting next to the pool. As a result she gets a number of things comped at hotels and restaurants, sometimes without even asking.

<comment><USER11> > sometimes without even asking.

How do they know who she is then?

<comment><USER47> I believe a number of brands use software to monitor social channels for tags/locations related to their brand. This happens, of course, in near realtime and then it becomes fairly simple to identify them and start manufacturing instagrammable circumstances - comp'd bottle of wine, pretty amenities sent up to the room, etc.

</comment></comment></comment><comment><USER48> Make them pay upfront for the hotel and then if they can directly attribute 25 guest stays in the future they can a refund. Problem somewhat solved :)

</comment><comment><USER49> Influencers... Probably the same kind of people who reviews Amazon product for free and ends their review with "I've written this review with my own unbiased opinion". We all know it's biased. Thanks but no thanks.

Ironically everyone of those followers wants to travel to that special unknown destination, only after somebody with one million followers posts about it.

</comment><comment><USER50> The only answer to these people should be "literally, not figuratively, go fuck yourself"

</comment><comment><USER51> This phenomenon is well known among boro glass artists, or artists in general. Paying with 'exposure'. People frequently contact us on Instagram, asking for free merchandise, ostensibly to review. If they have 20,000 followers, that may be worth it... for 50,000, it probably is. Often, however, it someone with no significant following who therefore has little to offer. Businesses similarly ask for our time to be donated or traded when we do public demonstrations, though typically they would pay other entertainers such as musicians or comedians.

This definitely is not limited to my niche of glass artists. There's a twitter account about the wider world of people who think artists have vast advertising budgets and lots of free time: [https://mobile.twitter.com/forexposure_txt](https://mobile.twitter.com/forexposure_txt)

I think these hotels are in a similar spot - it may be worthwhile advertising, or it may be a worthless request.

</comment><comment><USER52> I really think theres an opportunity for a startup here, some intermediary between the influencers and the clients (hotels, brands etc).

I think this will be another _huge_ market for facebook when they eventually solve this. Proper tracking of influencer posts, verification of audience demographics, filtering out of time wasters would solve a lot of these issues.

<comment><USER53> I've seen multiple successful (ish) startups doing this already

</comment></comment><comment><USER54> Sounds to me like this is a big opportunity for an intermediary to connect useful social media influencers with various brands.

<comment><USER55> funny thing is, there are also tons of influencer marketplaces and agencies, it's a space with incredibly low barrier to entry. Thing about the marketplace is, there is little incentive on either side for the influencers or clients not to skip over the marketplace altogether after using it for window shopping

<comment><USER32> This sounds like Marketing.

</comment></comment></comment><comment><USER56> What hypothetical scenario do you guys think could possibly result in the termination of this trend? I think it would be interesting to figure out what could cause social media to die out in the future.

<comment><USER57> I can think of two directions we could go from where we are - <USER2> Authorative Media: a return to the government telling us everything we need to know? Very dark, but a "government influencer" could still work..

And perhaps more positive - Truthful Media: Information generated by people, in the 'open source' way that you can fully trust. Hard to believe, but almost necessary. A blockchain of real information sources and trusted information processors (aka influencers), who give opinions that can be traced back to facts.

I think that perhaps glamour and fantasy will always win out - reality is boring and human nature wont get us to choose facts when fantasy gets our attention much more

<comment><USER58> Another worse case scenario for the future of social media could be one outlined in the movie The Circle with Tom Hanks and Emma Watson. Soon, the "influencers" will be available live, all the time. If you have no job prospects or useful skills, why not just sell your privacy for brand promotion? [https://www.imdb.com/title/tt4287320/](https://www.imdb.com/title/tt4287320/)

</comment></comment></comment><comment><USER59> I personally have 100,000 people following me on YouTube. My daughter at one point had over 100k people following her on Instagram.

It's much more difficult to get subscribers than followers on Instagram. In addition, a lot of followers are typically on Instagram just to creep on young women and provide no monetary value except for just being another creep in their followers.

Basically, 100k followers on Instagram is a joke and is about equivalent to 25k subscribers on YouTube, only it earns less cash.

</comment><comment><USER60> I have never had the self-{confidence,absorption,righteousness,worth} to think that I could "influence" people in such a way.

</comment><comment><USER61> "Influencer". From browsing the influencers in the article, the formula appears to be a) expensive clothes b) expensive hotels c) trailing photographer, d) regurgitation of corny "I am so cool" lines like "It takes cool people to do epic shit", "No one here gives a fuck".

Do you think we could design an AI, maybe GANs and caption generation, to generate influencers like these? The hotels could pay the AI makers to use their images, and would solve their problem of actually having to host them.

<comment><USER62> Believe it or not, really realistic looking computer generated Instagram influencers already exist.

Example: [https://www.instagram.com/lilmiquela/](https://www.instagram.com/lilmiquela/) \- 1.2m followers

<comment><USER63> Does this account have followers because its computer generated or in spite of that. Seems like the former.

</comment></comment></comment><comment><USER64> > "The vast majority of cold-call approaches are really badly written"

I think he means, "poorly written".

<comment><USER65> Badly and poorly are synonyms.

<comment><USER64> Yes, of course. However, "badly written" is poor grammar.

<comment><USER65> No it's not. They're equally correct.

</comment></comment></comment></comment><comment><USER66> By the time we pivot to EVs the travel industry will be sure to prevent any dip in CO2 emissions thanks to social media and its hoardes of mindless consumers.</comment>


BusinessWeek: CEOs on Twitter (but they spelled my name wrong) - <AUTHOR> http://images.businessweek.com/ss/08/09/0908_microblogceo/index.htm

<comment><USER2> Are there no female CEOs or are there no women on twitter? I know the answer to both. 18 CEOs and business week can only find males.

<comment><USER3> There are three in the slides (Christine Perkett, Kel Kelly and Lois Paul)... That's higher than average than the number of female CEOs in business, especially tech.

</comment></comment><comment><USER4> Er, Johnathan Schwartz has 12 updates (says 11 in the article) and we're supposed to think he's an actual Twitter user?

Some of the inclusions in the article seemed like kind of a stretch. A few of the people on this list are only barely "on Twitter."

</comment><comment><USER5> This is a pretty weak batch of CEOs.

<comment><AUTHOR> Thanks tptacek ;-) (no offense taken).

<comment><USER5> I'm sorry. You're right, I didn't mean to be an asshole (this time). I was thinking, "this is a list of CEOs of tech companies who of course will say they like Twitter; it would have been interesting instead to see a list of executives from mainstream companies who found it useful."

<comment><AUTHOR> Hey no apology needed - I count all the regulars on HN as friends, so everything taken with a grain of salt!</comment></comment></comment></comment>


iCracked's ad has a typo - <AUTHOR>

    8.		Engineers Wanted: iCracked (YC W12) to double it's staff size this year (wwwicracked.com)

 s/it's/its/ <comment><USER2> trolling is a art</comment>


Skip grep, use awk - <AUTHOR> http://blog.jpalardy.com/posts/skip-grep-use-awk/ <comment><USER2> > But "grep -v" is OK…

> It's possible to emulate grep -v with awk, but it's not a good idea:

      $ [data is generated] | awk '/something/ {next} 1'

Ever heard of logical operator of negation?

      awk '!/something/'</comment>


Apple now valued at over $100 billion - <AUTHOR> http://www.appleinsider.com/articles/07/05/30/apple_now_valued_at_over_100_billion.html <comment><USER2> Small FYI: Analysts' price targets are usually bullshit.</comment>


WWLLN – The World Wide Lightning Location Network - <AUTHOR> http://wwlln.net/ <comment><USER2> There's also [https://www.lightningmaps.org](https://www.lightningmaps.org) / [http://blitzortung.org](http://blitzortung.org) . It uses the same TOGA method and you can be a part of the network.</comment>


How to Talk to Someone Whose Opinions You Can't Stand - <AUTHOR> https://forge.medium.com/how-to-talk-to-someone-whose-opinions-you-cant-stand-365c880993d1 <comment><USER2> > Remember there's a time and place

What is the time and place to discuss politics? Apparently I can only discuss it in my head, with myself.

Why don't politicians, activists, media, celebs and other propaganda tools just stop discussing politics in public? That'd help to resolve some tensions.

<comment><USER3> Honestly, I wish we would see celebs less frequently. For some reason, the media props them up as experts when they definitely aren't.

I agree though, discussing politics shouldn't be a taboo, but I also don't think it belongs at the workplace or most family/friend functions. The problem is that it's often emotionally charged, and I think that's because it's only discussed in informal circumstances. Ideally, people would watch debates and discuss the points afterward to decide what to do.

Unfortunately, there doesn't seem to be a place for that, so I'll nominate libraries since they're intended to be places of learning. Our library hosts debates for city offices, so why not host debate watching sessions? Libraries draw intellectuals and people who want to become intellectuals, so it makes a ton of sense. Those who want to participate may, and those who don't aren't obligated to listen.</comment></comment>


Ask HN: Are most of Redis server really infected? - <AUTHOR> I stumbled on this article: https://www.imperva.com/blog/2018/06/new-research-shows-75-of-open-redis-servers-infected/ from a security firm that claims that a large number of redis server they scanned where infected. I am seeking for external opinion since I am not knowledgeable on security things. Do you think this is as serious as they say? <comment><USER2> Keyword being "open" redis servers. Redis is not made to be run publicly accessible, and scanning the entire internet for open services is easy nowadays, so yes, if you leave your server freely accessible it probably gets compromised.

</comment><comment><USER3> If one open redis instance is compromised, then they probably all are. Attackers scan the open internet for vulnerable hosts and then deploy their payloads to any they find.

If you go searching for open mongo databases in shodan, you'll see the same thing. Most of them have been pwned and have a single table with instructions on where to send bitcoin to get their data back.

</comment><comment><USER4> "Clarifications on the Incapsula Redis security report" [http://antirez.com/news/118](http://antirez.com/news/118) > antirez 17 days ago

</comment><comment><USER5> The article talks about PUBLIC or OPEN Redis instances. Redis should never be publicly visible or availbale, so the people running them are really bringing this onto themselves.</comment>