Better HN
topnewbestaskshowjobs
Log inSign up

developer2

2,010 karma · joined Dec 27, 2015 (10y ago) · 785 submissions

Submissions

comment 9y ago · link · parent

>> functional and imperative languages are both often used in a procedural fashion

Exactly.

The most common ELI5 definition of functional programming I get from other developers is that you're piping multiple statements together into a single chain of processing [input(s) > multiple levels of processing > output(s)], without having to explicitly declare variables to hold the temporary inputs and outputs between each sub-statement within the chain. I know just enough to understand that this isn't the "proper definition", but that workflow is true enough that it's what many people associate functional programming with.

The problem with that particular definition is that it tries to make the primary benefit of functional languages seem to be this piping/chaining mechanism. Yet these languages are still written procedurally, executing multiple such pipes in sequence. You still have variables holding the inputs and outputs of each chain, so you can pass them to other unrelated chains. It reduces the overall number of statements and the manual variable/memory management required, but each statement is simply a compressed version of multiple statements merged into one, enforcing "fake immutable" variables for the inputs/outputs within the chain. You don't really have "immutability"; you simply have automatic variable management between sub-statements in a chain.

Now, show me a functional language where the entire program is written as a single piped chain, and I would classify that as its own genre. Literally, the entire program would have to be written top-down as a single block of code that chains every single required input from the top-level, all the way down to a single output, without using a single explicitly declared variable. Only the first line of code would be unindented at the first column, with all other lines having to be indented as part of that primary block. Now that would satisfy me as being "unique" or "different than procedural".

What is the primary metric of a functional language? Is it to write write golf code[1] that folds 10 "procedural statements" into a single 3-line "functional block"? To me that's not "functional programming"; that's just writing less code by chaining multiple operations into smaller blocks, reducing the complexity of having to explicitly declare more global or widely scoped variables.

Random thought association: is perl's well-known Schwartzian transform (@sorted = map { ... } sort { ... } map { ... } @unsorted), applied as a concept to an entire language, what makes a "functional language"? To me, that doesn't seem like enough of a scope change to warrant a different language "type".

[1] https://en.wikipedia.org/wiki/Code_golf

comment 9y ago · link · parent

Because there are no valid objective qualities as to why functional programming is any "better" or "worse" than the alternatives. At the end of the day, you're instructing the machine to do the same work, regardless as to the structure of the code you're writing.

Functional vs. an alternative is nothing more than visually different styles that result in developers having a personal preference. Some languages offer optimizations for certain constructs, but even those depend on the implementation found in each language. A functional language doesn't automatically grant objectively better qualities, whereas a specific functional language might provide advantages that have everything to do with that specific language rather than the fact it happens to be functional.

Functional languages are interesting and the right tool for the job for many people. But they are not better, and when you have developers fighting hard to defend their language as "better", recognize that has a lot more to do with their ego than anything based on facts.

comment 9y ago · link · parent

I followed the same chain of logic as you; certainly looks like gmpg.org has been compromised. The entire root domain that the cert is signed for (fotomateo.com) is on Chrome's phishing block list too.

Odds are that gmpg.org never set up https for themselves. Someone hacked their web server and installed a new Apache instance or VirtualHost config for port 443 without them having noticed.

In any case, no danger in loading the OP's article.

comment 9y ago · link · parent

>> It's too hard to get placed in anything significantly above your grade level, especially if your brilliance is restricted to a single subject

This. Once past maybe grade 2-3, classes should be per-subject with mixed ages. Throw the 7 year olds together with the 12 year olds who are on the same level for any given subject. At some point, we need to find a way to tailor education to each individual student. Lumping kids together based solely on their age is ridiculous. Letting only very few children skip entire grades across all subjects rather than by level per subject is not the right solution.

I would have given anything to have been 3-5 years ahead in math while at school. I dropped out in grade 11 because the subjects I cared about were so mind-numbingly unchallenging that I lost all interest in what education had to offer me. I make as much today as a software developer as I would with a degree at most companies, so any incentive to go for a Bachelor's or Master's would be for purely personal growth. Of course my high school transcripts are incomplete, so I couldn't even register for university without going back and doing the prerequisite high school equivalency classes.

comment 9y ago · link · parent

Hijacking these controls as a way to prevent copying/inspecting used to be far more prevalent. For the most part these days it's not done to intentionally interfere with these actions, but rather as a misguided attempt to replace core functionality with something supposedly more "user friendly / beneficial".

The worst offender now is the applying of click event handlers for links that simply navigate to a URL. The inability to open a link in a new tab only because the developer chose to use a <span>/<div>/<li> that triggers a javascript framework routing action, instead of using an <a> tag pointing at that route... sigh.

comment 9y ago · link · parent

The most critical element for survival with any diet - particularly with low calorie intake - is protein. Eggs just happen to be the easiest form factor. Personally when I'm on a weight loss regimen, I take in more canned Wild Pacific Salmon than eggs. Salmon, containing less mercury than many other fish, is a fairly safe bet for frequent consumption.

I'm curious how someone with a constant diet of something like eggs and biscuits for 5+ years fares regarding severe deficiencies in truly necessary vitamins and minerals. I do think the body is a miraculous machine that will successfully adapt to many diets that experts would otherwise claim as being dangerously deficient.

comment 9y ago · link · parent

Consider exactly what you are proposing. One table to store the entire history (one billion or more rows). A second denormalized table, whether updated at the application layer or via triggers, to store the most recent update to each of the one million cells (1000x1000 pixel grid = one million data points).

The simple fact of introducing a one-million-row read for the latest data of each "pixel cell" is fairly insane. You must have a cache for such data. "I'd still have have Redis cache, though" is not even debatable. It doesn't have to be Redis, but is definitely has to be a cache of one kind or another.

comment 9y ago · link · parent

Your parent commenter seems to have no idea as to the true scale you planned for. Most of the criticism I've read here on HN and on Reddit threads regarding your implementation seems to have come from people who have never had to code something that has real-world scaling requirements. This wasn't some pet project initially launched to 100 concurrent users, with the ability to slowly and incrementally scale to millions of users over a period of weeks or months. You had one shot to get it right. A majority of those criticizing would have crashed their entire production stack upon deploying. Hundreds, possibly thousands, of queries per second returning one million rows each? Not going to happen, no matter which database backend you choose. The foresight you had to get it right the first time was well played on your part.

Ideally, you would have also used redis to limit the per-user activity without having to hit Cassandra. Also not sure why you hit Cassandra instead of redis for the single-pixel fetch endpoint (redis GETBIT operation rather than a database hit); if you already conceded to not-quite-atomic operations across the entire map, a GETBIT would have rarely returned a stale data point. But these are minor nice-to-have criticisms that would have pushed the scaling capabilities even further beyond your expected requirements. All in all, again I highly commend your results. You had one minor snafu, and managed to overcome it. Well done!

Aside: my brain is spinning as to how I would provide a 100% guaranteed atomic version of /r/place - without any point of failure such as a redis server not failing/restarting, or a single-server in-memory nodejs data structure. Really tough to do so without any point of failure or concession to atomicity. :)

Second aside: more than anything, I am surprised you have a CDN that allows 1-second expiries. While perfect for this kind of project, too many CDNs find a 1-second expiry as a risk to permit, as they tend to expect too much abuse/churn. ie: How is a CDN supposed to trust you enough to use a 1-second expiry for reasonably high traffic, rather than cycling so much caching effort for something that could have used a 5 minute expiration? I can't imagine being the developer of a CDN that trusts its users to use a 1-second expiry that wastes an insane number of CPU cycles for an origin that is not legitimately sustainable.

tldr (still long, but on point): You guys did an amazing job for something that lasted, what was it, 3 days? Great job! Many of your critical audience members would not have managed any better, let alone being viable and functional. I would submit my résumé to work for you, but I fear my personality is far too... um... abrasive... to get along with the organisation as a whole. In any case, your team as a cohesive unit - design, backend, and frontend (especially the mobile support) - did an incredible job. +1 to the Reddit team here, you should be immensely proud of yourselves for pulling this off.

comment 9y ago · link · parent

With all due disrespect, you're wrong. Go ahead and implement your solution, and you will find it falls apart. So tired of people pretending to know better, without any data or real details to back it up. A "proper database" would not scale, regardless of whether it is Cassandra or Postgres.

You're completely ignoring, or completely oblivious of the fact, that the entire 1000x1000 grid must be provided to every connected client. You're not going to read out one million aggregated rows by most recent timestamp per cell, from a billion rows of history, in a scalable amount of time.

Please post your GitHub link that proves your solution as superior, or even viable. Make sure it includes database triggers, for which you don't explain how they would help scale the app whatsoever. Are you going to have a denormalized table containing each of the one million cells' most recent rows? All you are doing is eliminating a GROUP BY on the indexed cell+timestamp columns. It's still a million rows returned per query. Please explain how that scales. Eagerly awaiting your proven solution that defies common sense scaling logic.

comment 9y ago · link · parent

Not to be disrespectful - I know that cPanel and similar have their place - but no real business that expects to have a presence is using cPanel or any other "easy setup".

comment 9y ago · link · parent

Upvoted you. I'm a very cynical person, and thus I focused on the "weekend" aspect as being more of an attempt to refute the claim that Reddit had to put in quite a bit of effort to accomplish what they did, rather than you simply limiting how much time you're willing to sink into it.

If anything, this only increases my motivation to replicate the project myself, whether it's during a weekend or two full weeks. It's interesting enough and at the right level of complexity - kind of simple, but not too simple - to make it a fun side project.

comment 9y ago · link · parent

>> I won't implement mobile support

Mobile support was a huge factor for /r/place. To reimplement the project while completely ignoring mobile is basically taking out maybe 30% of the effort required. It's a bit of a copout to claim "can implement in a weekend", while discounting one of the main reasons why it is nearly impossible to hammer out solo in a single weekend.

The other "big ticket item" is integrating such a system into an existing live stack. It's very convenient that you get to pick the tools you think are most efficient for the job from scratch; it's quite another to restrict yourself to an existing set of tech.

>> an architecture that can scale to 100k simultaneous users (although that part will be hard to actually test)

Also this. Reddit had a single opportunity to deploy live. You can't throw out many days of required dev/staging benchmarking for a system that must work on first deploy. You're not "done" after a weekend unless your first deploy both works 100% and scales as required.

tldr; Were I to do what you are doing, it would be out of interest and to put it live for others to use. What seems disingenuous is to do so with the primary goal of proving that "see, child's play - it's not difficult at all!". The goal should be to build something that works, not to rush the job as some way to show off and take something away from Reddit's efforts.

comment 9y ago · link · parent

The first link is about PHP-PM, which is not mod_php, and is a new and unproven stack. The second link is a completely bullshit "echo 'Hello World';" with 100 concurrent requests - that benchmark is offering the stereotypical, utterly meaningless, metric.

The fact is that Apache + mod_php will keep an instance of the PHP interpreter active in every single child httpd process. With nginx+fpm, your static assets are served directly from nginx without the overhead of an unnecessary PHP interpreter loaded into that process, while only your PHP requests are funneled to FPM. The performance overhead of having a PHP interpreter loaded into the process that is only serving a static asset is astronomical.

At the end of the day, benchmark your shippable product. Never try to benchmark a "Hello World" or a Wordpress installation if you're not shipping a Hello World or Wordpress codebase. Purely based off professional experience, I have never seen a real-world app perform better on Apache+mod_php than on nginx+fpm.

The only thing PHP 7 gave us was essentially the ability to ignore HHVM as a "required performance booster". 90% of companies were already able to ignore HHVM; with the improvements made to PHP 7, it's now 95-99%+ of products that don't need to evaluate HHVM as a mandatory alternative. And yes, nginx+fpm is still the defacto standard for PHP 7; the links you have provided do not say any different.

comment 9y ago · link · parent

VRML was amazing. I distinctly remember the hours upon hours upon hours I spent playing on CyberTown[1]. It was based on an Internet Explorer ActiveX plugin for VRML (named Blaxxun), providing a full 3D environment... and this was in the late 90's / early 2000's.

For its time it was incredible, far beyond the graphics for any multiplayer world I'd seen up til then - especially considering it was in the browser. It was essentially 3D chat in common map areas, with your own home like Geocities. You could upload your own assets for your avatar, including your appearance and the somewhat annoying but awesome and little-known functionality to have a sound (wav file if I recall correctly) to play to other players based on your proximity to them. I went all-in with a ghost avatar, and a funny/spooky ghost sound. The hours I spent roaming just to get the "what was that sound?!" reaction from other players was priceless.

I will remember that experience fondly for as long as I live. I was a gentle phantasm gleefully haunting a 3D world. Great memories, though more specific details are a faint whisper.

[1] https://en.wikipedia.org/wiki/CyberTown

comment 9y ago · link · parent

>> you can't really prepare yourself for the sudden loss of a close relationship

I wholeheartedly agree. I didn't mean to sound like you can prepare yourself so far as to avoid any mourning when someone close to you kicks the bucket. I do believe that once you've been through 1-3 such rounds of death, an average person will finally "understand" and take future deaths with a grain of salt.

As an aside, I personally find it frustrating when a family decides to hold a closed-casket funeral. Actually seeing death up front and personal is the only way to truly become acquainted. The number of times I've heard "think of the children"... which is really just adults being in denial about their own eventual death, and perpetuating that fear into their children. Death is a natural eventuality for all; the younger someone can figure that out, the better off they'll be.

comment 9y ago · link · parent

That is actually insane. The day their MySQL cluster experiences a severe downtime incident, it is likely going to take an enormous amount of time to recover.

That is my intuition. If you know of a video or blog post (conference, talk, article, etc.) where someone explains the benefits of a 2 TB MySQL server and how it is not a crazy bad idea, I would love to see it. Because my 15 years of professional experience screams "NO WAY IN HELL" at that one.

comment 9y ago · link · parent

PHP is definitely a huge chunk of the reason why nginx has taken over Apache. php-fpm with nginx is the defacto standard, and PHP is far more prevalent than a lot of people think. Apache's mod_php(X) vs. nginx+php-fpm isn't even a debate. If someone is currently using Apache+mod_php, they probably have a smaller product that will eventually have to switch to nginx+fpm in order to scale.

While I imagine PHP is the single largest reason, other languages that support or expect the use of fastcgi are also very easy to configure with nginx, whereas I can count on one hand the number of businesses I've seen using Apache's mod_fcgid.

comment 9y ago · link · parent

>> My family and I have had very frank discussion about death earlier than we would have otherwise.

It would benefit any family to have that discussion, even if both parents are in their 20s and there has been no "scare scenario". Many people die every single day due to unpredictable events, with no warning whatsoever. Unfortunately, too many people have never really pondered their mortality, leading them to be incapable of even considering what it would mean if man/woman/child died tomorrow. Having a sit-down meeting is likely to be brushed off as a "meh, it'll never actually happen to us".

Any one of us could be dead in the next 5 minutes. That's more reality than paranoia. The trick is to get to the point where you understand just how fleeting life is (you or a loved one might be gone any day now), but without letting it negatively control your life.

>> I did make peace with the fact that I have a much higher probability of dying from it than the average American

You should stop thinking that way. A decade past the initial scare, you're likely no more at risk than anyone else. You weren't given the disease, you were exposed to a small possibility of it. It's still the responsible thing to not donate blood or be an organ donor, but as far as your day-to-day life goes you should consider yourself squarely in the "average" category.

comment 9y ago · link · parent

>> You can do a lot with 244 GB RAM machines

Is this a typo of "244 GB" instead of "24 GB"? Nearly any company that has a single machine provisioned with 244 GB of RAM is doing something severely wrong, likely putting the company's ability to grow at risk. Such a machine screams of trying to vertically scale a poorly performing legacy product instead of figuring out to horizontally scale out with 16-64 GB servers.

That much memory on a single server is a huge red flag for 95-99%+ of companies. It takes a very specialized system (ie: you probably don't fit the mold, no matter what your excuses are) to require such a server.

comment 9y ago · link · parent

The "Official list of phoned-home info revealed by Microsoft" is the subheading from the article, and offers a neutral tone compared to the biased headline of "The sheer amount of data Windows 10 Creators Update will slurp from your PC".

While general consensus will likely be that that it is too much data collection, it's more ethical - from a journalism standpoint - to allow each reader to decide that for themselves based on the facts. I find it odd that The Register used a biased headline, while delegating the unbiased phrase to the role of a subheading. I suspect the neutral subheading was provided by the author of the article, while the headline was manufactured by someone whose job it is to drive traffic/views.

comment 9y ago · link · parent

I think the issue with a plugin ecosystem is that far too many 3rd party plugins do not respect the workflow of the core system that users expect to encounter - the UI appearance and functionality can easily confuse users, or even completely destroy the experience. Plugin integrations are often so poor that they ruin the product as a whole; particularly whenever a "top 10" plugin has serious bugs or flaws that prevent it from providing what a user really needs. Half-baked plugins that users depend on as a necessary evil are rarely a good thing. There is a reason that important functionality must be officially integrated into the platform: the core system must be presented as a unified and consistent interface.

Community plugins can be a godsend, but they can also be the exact reason why a software service falls apart.

comment 9y ago · link · parent

You may have missed it, but my grandparent's comment - and my reply - were regarding driverless cars. There is no driver making $7/hour in an autonomous driverless car. (Off-topic aside: no taxi driver makes $7/hour). There's a reason an easy trip costs $50-80 in a taxi, and it has nothing to do with human labor or maintenance of the car. A driverless vehicle will not have to make $100+/hour to make up for maintenance costs.

Nor do driverless cars have to make up for "idle time". The only legitimate counter argument as to why a taxi should earn as much as they do is that they sit around not making any money for 10-60 minutes at a time. However, that goes away with driverless cars, and any excuse to charge exorbitant prices the way taxis do completely vanishes.

comment 9y ago · link · parent

Except that you are not paying for "gas, wear and tear & depreciation" when you call a taxi. You're not even paying for the human driver. You are paying for the monopoly.

Even if calling a driverless car cost more for remote areas, it would (or at least could) still cost a fraction of the cost of a taxi. $30 instead of $120 for a long distance drive is totally reasonable.

comment 9y ago · link · parent

Of the four people I know who make < $120k/year who are paying $1,000+/month to finance a > $60k car, only one of them is a real "car enthusiast" who does it for himself. The other three are trying way too hard to prove that they are living the rich life. They don't give a single damn about the car; their only concern in the world is that other people notice they have an expensive car.

If owning an expensive car is what brings someone personal joy, I'm all for that. When a friend tells me he can't come watch a movie with me or come on a cheap local road trip because he's behind on his car payments, and he says it with a depressed facial expression that clearly shows regret for the car... yeah. I don't know how else to take that other than "stupid life decisions". And no, I don't drop my jaw in awe over their car - I just see them as a moron who has misplaced priorities.

comment 9y ago · link · parent

Points of note from your comment:

>> stupid shit like getting into more debt

>> The more money u earn, the more money u spend, the more stress u have

The key to more happiness for anyone who is not dirt poor is to live with the means of someone 1-3 tax brackets below. If you make $100k/year, live as though you only make $60-70k. If you make $300k, live like you make $120k. It really is that simple. Stop trying to attain the "next lifestyle bracket", because it will NEVER "be enough". You will be miserable your entire life, trying to scrape your way to the "next level". "Unfulfilling" does not begin to describe that path.

I used to pay $1300/month rent, with a $700/month car financing, a $120 internet package, etc. I now live in a cheaper neighborhood with $640 rent, gave up the car (ie: $0/month financing), with $40 internet, etc. I went from $40k in debt and $0 savings account 3 years ago to $0 debt and 5-digit savings today. The difference in quality of life that makes on a day-to-day basis is enormous.

Forget the white picket fence and the $50k+ car. Nobody gives a crap where you live or what you drive - including yourself, whether you believe that or not. Live somewhere with great public transit or, if you really need - not want - a car, buy used for $500-$2,000 that gets you from point A to point B. Stop trying to impress people with your lifesteal. Live cheap, and use the incredible amount of disposable income to lead a happier life.

comment 9y ago · link · parent

Oh give me a break. The primary rule for being an adult: do not take on debt you may not be able to reliably pay back. No lender owes any borrower favors to help with their debt. If you can't afford the debt, don't borrow it. Debt isn't some magical tool to obtain free money. You're taking money from someone, with a straightforward contract to pay it back. If you can't pay it back, you shouldn't be borrowing.

The level of entitlement people have when borrowing money is insane. You're not borrowing from a family member that can be manipulated into forgiving you for being a freeloader who never pays back. Every single loan and line of credit is a serious matter - stop treating it like an externality where you get money now, completely pushing the eventuality of paying it back as "something that will magically happen". You need a plan to pay back debt. If you do not have an actionable plan to pay off debt, you have no business taking it on to begin with.

Why is debt considered "normal" in the 21st century? People are living beyond their means, trying to offload the blame on lenders, while the real fault lies entirely with the borrowers. Far too many people think that loans are just fake numbers on paper or a digital screen. No, loans are real money that you need to account for. Debt is not abstract concept that can be willed away.

comment 9y ago · link · parent

Exactly. Quote from the article:

>> Ron Deibert has led a team of counterespionage hackers—he prefers “researchers”—...

It's explicitly stated that his preferred term is "researchers", and yet the Globe and Mail appears to go out of their way to sensationalize by first introducing the word "hackers". Upon reading the full article, the use of the term "hacker(s)" is minimal, and used appropriately for what we self-identifying hackers would use it for.

I've become so accustomed to the word being used negatively that it takes a lot of mental effort to notice when it is used in a neutral or positive tone. I still find it fairly annoying that they included the word in the headline, as though to attract more views with a "controversial buzzword". It's true: the word "hacker" has long since been poisoned by the media. They cannot get away with using the term anymore, even with no ill intent. They spent over a decade using the term to rip people and communities apart. The damage is done, and no amount of effort on their part is going to allow them to sound sincere.

comment 9y ago · link · parent

This is great, this comment deserves to be at the top. Let's not criticize the original article, and instead celebrate that its publication resulted in a crowdsourced solution. I love to see the community coming together to provide knowledge to us all. :)
1
111213
27