Better HN
topnewbestaskshowjobs
Log inSign up

chrisguitarguy

540 karma · joined Oct 12, 2011 (15y ago) · 101 submissions

Lots of PHP, JS, Infrastructure, and Python. https://chrisguitarguy.com

Also run a site about classical guitar, my instrument: http://www.classicalguitar.org/

Email: chris {AT} classicalguitar.org

Submissions

comment 4y ago · link · parent

> Most mature languages have a logging system which allows the internal logging of a library or module to be silenced, redirected or almost any other action. I think there is a lot of value in libraries doing appropriate logging which can't easily be replicated in application code.

Info/debug level logs sure, I don't disagree. As long as there is some built in or community standard logger and not the libraries own custom thing.

Errors, I'd rather they throw and my own app's logging facilities kick in that can provide more context: which server, which container, request info (method, path, request ID), etc. Granted some of that could come from configuring a logger with it.

comment 4y ago · link · parent

Log (and presumably) deal with errors if you _can deal with them_ close to where they occur. Otherwise just let them throw and/or propagate them up. An application should have some sort of top level error handling to log the error and actually return a response (HTTP 500 or otherwise) to the client.

For something like a library: no logging, that's not a library's job -- unless it's a logging library! If the language has exceptions, then throwing only subclasses or implementations of a single exception parent/interface from the entire library is nice for clients of the library.

comment 6y ago · link · parent

Same for me. Kids are 1.5 and 4. I used to do so much just hacking around, and now it's non-existent.

As far as bedtime/sleep stuff: I pretty much just wind down after the kids go to bed. Meditate if I haven't got that in yet (or maybe do a shorter session if I have and am feeling stressed). Read. Then try to get to bed early enough to give myself an 8-ish hour sleep window.

comment 7y ago · link · parent

Seconded, this is a great book.

I think all non-managers should read it as well as it will give you some clarity on what you should expect from your manager and what their day-to-day is like.

comment 7y ago · link · parent

I tend to write test cases that re-produce bugs first, then fix the bug. Other than that, I don't stick too hard to test driven development. I did for a while, but you start to get a sense of the sort of design pressure tests create and end up build more modular, testable code from the get go anyway.

> Can you describe the practical benefit?

For a test case that produces a bug, you might find the bug manually. Getting that manual process into a test case is often a chore, but in doing so you'll better understand how the system with the bug failed. Did it call collaborators wrong? Did something unexpected get returned? Etc. In those cases, I think the benefit really is a better understanding of the system.

> Do you happen to rewrite the tests completely while doing the implementation?

A TDD practicioner will probably tell you taht you're doing it wrong if you do this. You write the minimum viable test that fails first. It might be something simple like "does the function/method exist". You add to your tests just in time to make the change in the real code.

comment 9y ago · link · parent

Though it may have started as a, "parasite upon reddit," imgur does stand pretty well on its own now. Try out their mobile app and you'll see a pretty active community.

comment 9y ago · link · parent

That's advertisers themselves doing a bad job of retargeting. First-party data is probably not going to change that. In fact, it may mean you'll just get those ads across all your devices.

comment 9y ago · link · parent

Advertising. Definitely first party data for targeting. An advertiser takes some data from its CRM, sends it to the big social sites and google, and then uses the list to target those folks specifically or create look-a-likes. Actual cross device targeting (because people are logged in), extremely personalized and relevant.

This is coupled with a move away from cookies[0].

0. https://adwords.googleblog.com/2017/01/making-youtube-better...

comment 9y ago · link · parent

PMG | Senior Backend or Frontend Engineers | Fort Worth, TX | https://www.pmg.com/ Onsite or Remote, Full-Time

PMG is looking for some senior-level engineers to help us build in house advertising tools. These are usually more than just web apps and tend to be fairly interesting to work on. PMG works with a lot of high end fashion/retail and travel clients (https://www.pmg.com/clients/).

Lots of freedom to choose your own technologies, but we use a lot of PHP (Symfony, Doctrine), Python, JavaScript, and Go currently along with the usual mix of databases (Elasticsearch, MongoDB, MySQL, PostgreSQL, Redis).

- https://www.pmg.com/careers/positions/#job/05bbd107-30fc-4fa...

- https://www.pmg.com/careers/positions/#job/ce0c5068-3625-479...

- https://www.pmg.com/careers/positions/#job/bc07d1f3-46dc-4d3...

comment 9y ago · link · parent

This is how I came to work remotely. When my wife and I had to move for her job, I had built quite a bit of the software my company relied on. Had leverage to go remote and the trust of my boss to do so.

11.

On the Myth of the 10X Engineer and the Reality of the Distinguished Engineer(redmonk.com ↗)

1 points · by chrisguitarguy · 9y ago · discuss

comment 11y ago · link · parent

I suspect it's because WhatsApp's backend can be turned into a platform that will run WhatsApp itself as well as Facebook Messenger.

There's a lot more opportunity to do messaging between businesses and individuals (eg. customer service) as well -- see messenger for business.

Not saying Facebook isn't out to sell ads, just that there's probably a lot of reasons that Facebook might want WhatsApp's technology and team. Especially as they try to move more conversations onto their platform and reach out into other markets.

comment 11y ago · link · parent

If your objects require dependencies to do their jobs, it should be impossible to create objects without those dependencies. The objects' constructors should require them. Having setters is, arguably, fine (but probably unnecessary) as long as invalid objects can't be created.

comment 12y ago · link · parent

That's more along the lines of what a lot of TDD literature says.

Write adapters or facades that wrap external libraries, use those in your own code's unit tests. This makes you less bound to a specific library as well. Don't mock the outside world [0] for testing your adapters/facades/whatever, but do integration tests that cover your adapters using the real outside world.

You'd also do complete end to end tests where the entire system is used as if it were in production (acceptance testing). TDD makes a lot more sense if you think of it in those three layers: acceptance, integration, unit.

[0] Outside world means anything that's not your code -- networking, filesystem, external libraries, etc.

comment 12y ago · link · parent

http://morepypy.blogspot.com/2012/07/hello-everyone.html

> I'm proud to release the result of a Facebook-sponsored study on the feasibility of using the RPython toolchain to produce a PHP interpreter. The rules were simple: two months; one person; get as close to PHP as possible, implementing enough warts and corner cases to be reasonably sure that it answers hard problems in the PHP language. The outcome is called Hippy VM and implements most of the PHP 1.0 language (functions, arrays, ints, floats and strings).

comment 12y ago · link · parent

https://github.com/gollum/gollum

Named after the software that powers the wiki.

comment 12y ago · link · parent

I have a Bachelors and Masters in Music Performance (classical guitar). Did one year of a doctoral program too before I figured out I liked building things more.

comment 13y ago · link · parent

It's easy to turn off:

    remove_action('init', 'wp_cron');
Then just set up your own real cron job to run the `wp-cron.php` script however often you'd like.

> If your site gets a large influx in traffic the server runs wp-cron for every page hit and further slows things down.

Which involves a single database hit and a `foreach` loop. Or, if you're using an external object cache (memcached, APC, etc), no DB hits.

Probably not as dire a situation as it seems. This...

> If your site gets no traffic then it doesn't run at all.

...is a huge problem.

comment 13y ago · link · parent

> Most of the CMS's that claim to use PHPass actually use the "portable" option

This is true for WordPress, which uses PHPass. You have to replace `wp_hash_password` to get WP to use bcrypt: http://wptip.me/wordpress-bcrypt

comment 13y ago · link · parent

There's also a library for PHP >= 5.3.7 that provides the same API if PHP 5.5 isn't an option yet.

https://github.com/ircmaxell/password_compat

Written by Anthony Ferrara, the same guy behind the `password_*` API in PHP 5.5

comment 13y ago · link · parent

> So it's like PHP where I need to pass in `function modify(&$foo) {` to modify a variable passed by reference.

If you're thinking in terms of PHP's primitive types, then yes: that's probably the best equivalent. PHP has the whole objects always being "passed by reference" [0] thing going on too.

0. http://php.net/manual/en/language.oop5.references.php

comment 13y ago · link · parent

I would recommend Doctrine DBAL[0] over Meekro.

0. http://www.doctrine-project.org/projects/dbal.html

comment 13y ago · link · parent

The settings API [0] is really bad. That said, you can still use parts of it without the `add_settings_field` and `add_settings_section` bits.

Or you can build reasonably powerful abstractions over top of it that let you get a lot of stuff done quickly.

The power of the settings API is users can go in and remove fields. This plugin I installed has a field I don't want to show to my client? Let's just remove it. And we can do that without editing the plugins files directly and keep it safe for upgrading.

0. http://codex.wordpress.org/Settings_API

comment 13y ago · link · parent

The theme replaced jQuery bundled with WordPress with some external version (eg. Google hosted or otherwise) and did it so on both the admin and front end. That's usually the cause of those sort of issues. 3.4 -> 3.5 brought up a lot of JS compatibility.

Look in the theme's directory for `wp_deregister_script` and see if anything was deregistered and re-registered (`wp_register_script`).

> Wordpress hasn't adequately documented which APIs are stable and not

If it's it in a major release, it's stable. When you buy any piece of software you're relying on its author knowing "the right thing to do (tm)". The author of the commercial theme thought it was okay to replace some bit of core javascript and din't bother to check on it. Or they didn't bother to be specific about it -- only do custom JS stuff on their theme's options page or on the front end. It's easy to do that, but you have to know how to do it (it's not documented in the Codex).

comment 13y ago · link · parent

    location ~ "(^#.*#|~|\.sw[op])$" {
        return 401;
    }
Or something along those lines.

Nodesocket's answer is good as well: http://news.ycombinator.com/item?id=5164017

comment 13y ago · link · parent

Here you go: https://gist.github.com/4477015

Replaces and error page in WordPress with a search for the request URI. Now we just need someone at jQuery HQ to use it.

Still uses WP's built in search functionality, which is less than great.

comment 13y ago · link · parent

"Show up and get to work" is a large part of Steven Pressfield's The War of Art [0] as well.

0. http://www.stevenpressfield.com/the-war-of-art/

comment 13y ago · link · parent

There's also a book in a similar vein called "Nickel and Dimed: On (Not) Getting By in America" [1]. Fairly good read.

[1] http://en.wikipedia.org/wiki/Nickel_and_Dimed

comment 13y ago · link · parent

http://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Table_o...

Ubuntu 12.04 uses version 3.2, 12.10 is on kernel 3.5.

1234