Better HN
topnewbestaskshowjobs
Log inSign up

SomeCallMeTim

4,107 karma · joined Feb 17, 2010 (16y ago) · 1,490 submissions

I'm a consulting software architect and freelance CTO. I come in and rescue small businesses from code disasters, and occasionally am given the chance to prevent the disasters to begin with. I also used to develop video games, and have pivoted that skill to gamification consulting.

https://coderescue.com

Submissions

comment 10y ago · link · parent

>Blizzard is not Google in size

It's the Google/Amazon/IBM/Apple size where you end up with endemic cross-licensing patent agreements. That's where they can't adhere to it: They have a license to a thousand patents that protects them from being sued, but they don't have the right to sublicense those same patents. (L)GPLv3 requires they sublicense any patents they have to anyone who's sued, IIRC, so since they can't, they lose the ability to distribute their software.

I'd be somewhat surprised if Blizzard were a party to such an agreement. They might be party to a "patent-troll-don't-sue-me" agreement, I guess? No idea. But if they are, depending on the terms of their agreement, someone could potentially sue them over it based on LGPLv3 terms.

I'm not planning to, so I haven't done the research, to be sure. The risk scenario that comes to mind is a stretch, but say I buy a Blizzard game with LGPLv3 code in it, which grants me the right to be protected against patent lawsuits relevant to that code, and then I ship my own game that uses the same LGPLv3 code -- and I'm sued by a patent troll over a patent that Blizzard has licensed through some agreement. Guess what? I can now demand that Blizzard protect my use of the same LGPLv3 code by sublicensing me that patent. Which they (probably) don't have the right to do. So they either pay for my license or they have to stop distributing their LGPLv3 code.

For Amazon, who distribute tons of code for people to use in AWS, and the fact that they're a much larger, more collectable company, the scenario is proportionally worse.

It's all beside the point, though: In no case is it the line-level developer making the call, it's someone in management. Not everyone can (or even wants to) work for Blizzard or equivalent.

In particular, not everyone wants to work at literally half the compensation or less just so they can have full software freedom, whatever that means. The Google/Amazon/Apple compensation can be that much better than start-ups for top developers. I didn't realize this myself until I got a job at one of them.

And I'd love to be able to use RethinkDB where ever I end up next, without having to worry about whether the company legal department has a problem with (A|L)GPLv3. It's a battle I wouldn't even bother taking on in most cases; too much work when I could use something else and get back to doing real work.

comment 10y ago · link · parent

Really? I saw it mostly in the Ruby community first, followed by Python and JavaScript. Looking at the WikiPedia page, it looks like it came from Extreme Programming and the C3 project [1], which was SmallTalk. And in case you aren't sure, SmallTalk is dynamically typed. [2]

Java has a huge enterprise presence as well, so I'm not too surprised that it's popular in Java circles. Enterprise developers aren't famously top-notch developers in general.

>It's usually the most simple functions that hide the most subtle bugs.

I can't remember the last time a type-checked simple function I wrote hid a subtle bug. But I'm admittedly a few sigmas above average, so my experience is probably not typical.

In studies, TDD is a wash: It neither improves overall programmer throughput nor makes it worse. So use it if it's what makes you happy. I've used it for more complex goals myself, so I understand the draw. I just usually don't need it.

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

[2] https://en.wikipedia.org/wiki/Smalltalk-80

comment 10y ago · link · parent

I think most unit testing is a waste because it duplicates what a good type checker would do for you. I'm using TypeScript now, and after a break from using typed languages, it's a huge breath of fresh air.

Much of the code I write doesn't get unit tests at all, because it's simple enough that it won't ever fail. Refactoring major blocks of code is safe, even without unit tests, because the type checker ensures that everything is wired up in a sane manner when you're done. Good design can obviate the need for many unit tests.

When people talk about test code coverage in JavaScript/Ruby/Python, I think the main reason they want close to 100% coverage is that many runtime failures in those languages occur because some line of code somewhere is accessing a type incorrectly. That doesn't happen if you're using static typing.

If you've got some complex logic, making sure it works using unit tests is fine. I still do that with anything I consider non-trivial. But if you've got a really simple function that obviously works, and TypeScript ensures the function will always get the types it's expecting, writing tests to ensure it will keep working forever is just a waste of time, unless it's to verify for your own sake that the "obvious" function does what you think it should. But in that "TDD" case, keeping the test around just makes the code base more brittle, since if you decide you need to change the way the function works you now have two functions to maintain instead of just one.

comment 10y ago · link · parent

>Sounds as good news for any competitor (if your company has any).

Actually thinking of Amazon.com. They have competitors, sure. But they also have the budget to write their own entire stacks internally when the license doesn't fit. And it's not like their decision to avoid GPL software is hurting them in the market in any relevant way.

When something is MIT licensed, they'll use it, and they can and do contribute changes upstream. GPLv2 code requires serious hoop jumping to use, and GPLv3 software is verboten (the patent clause can't be adhered to by large companies with cross-licensing agreements: Many of these licensed patents can't be sublicensed, and so they can't be in compliance with the license at all).

So all GPL does is prevent companies from using and supporting the software. For every instance of an MIT project that ends up modified in proprietary code there are probably 100 that either use it verbatim or contribute changes back upstream. It just makes sense so that you don't need to keep maintaining an increasingly divergent fork.

comment 10y ago · link · parent

Ummm...no. Won't implies you have a choice. Can't implies that it's not an option.

Working for one of those large companies, you simply don't have an option.

And the people without choices vastly outnumber the people who do have choices.

Frankly, most developers are probably happy using whatever code, under whatever license, that's available. It's the people who run the business who typically make the decisions about what's OK and what's not.

So it's developers who are punished by GPL, by and large, because many can't use the code. It's not helping those developers, and nothing zealots say or do will convince the legal department at those companies that they should change their position on (A)GPL.

comment 10y ago · link · parent

No, if I'm working at a company that has a blanket policy against using any (A)GPL software, then I can't use it.

What the lawyers decide in a company that has 10k+ employees has nothing to do with the fears of anyone but the lawyers and the top management. Everyone else is just following the rules.

comment 10y ago · link · parent

I can't find the benchmarks that I'd based my comments on to be honest, and I have to get back to work. :|

From what I remember, the final version of Angular 2 added a lot of performance, which pushed it ahead of the latest React in performance.

I did find this:

http://webscripts.softpedia.com/blog/recent-benchmark-shows-...

But the Auth0 benchmarks disagree and show React is faster:

https://auth0.com/blog/more-benchmarks-virtual-dom-vs-angula...

Angular 1 is terrible performance-wise; that much is certain.

comment 10y ago · link · parent

Good point!

Didn't say this explicitly, but TypeScript will, by default, prohibit unreachable code as well. [1]

[1] "allowUnreachableCode" defaults to false: https://www.typescriptlang.org/docs/handbook/compiler-option...

comment 10y ago · link · parent

I agree, and I consider TypeScript to be twice as fast to develop in as plain JavaScript just because you don't need to:

* Look up member names

* Look up object hierarchy structures

* Run code (or tests) to verify that you've done the above correctly

When the compiler knows the types, it can bring your code up to 90% correct. Half the time you don't even need to specify types: TypeScript can guess them from context.

You need to specify parameter types and return types; if you're declaring a variable without initializing it, or assigning it an empty array or object, you need to specify its type. Other than that you generally get type inference from TypeScript (at least as of 2.0).

comment 10y ago · link · parent

TypeScript gives you the benefits of dynamic typing without the drawbacks of a C++/Java restrictive-typing system.

It just makes the dynamic typing safer. It absolutely should be considered a best practice; anything that can accelerate development by 100% or more should be.

comment 10y ago · link · parent

The code output is really clean; I wouldn't call it obfuscated. Especially when source mapping works just about everywhere.

And having ES2015 features (+async/await) is very useful: var should be deprecated, arrow functions should be standard, etc.

Tiny projects? Sure, do whatever you want. But I've started switching even my one-file, 2-3 screens of code Node servers over to TypeScript, and it's not only useful, it accelerates development by 100% simply because you don't need to run your code to know that you've got the types correct.

I stand by "best practice."

comment 10y ago · link · parent

Exactly: Linting rules requiring semicolons should be considered a best practice.

But I think TypeScript should also be considered a best practice, and between the two that would solve pretty much all of his complaints.

Well, that and using "==" to compare to null, vs. "===" to compare to everything else. But the linters all can make that distinction as well.

But he explicitly hates on linters in the article as well. And dismisses TypeScript and Flow ... because his coworkers aren't being forced to use it? THAT is the real problem, I think...

comment 10y ago · link · parent

Angular 2 is pretty awesome and faster than React.

comment 10y ago · link · parent

Others have mentioned Xamarin is free and (mostly? entirely?) open source now. See also NativeScript [1].

And TypeScript solves 80% of his complaints. A good linter with ruleset hits most of the remaining 20%.

Cross-platform is the way to go in 2016. It's a waste to write in Swift and Java to cover two platforms.

[1] http://nativescript.com/

comment 10y ago · link · parent

TypeScript is a JavaScript best practice at this point. It's a type safety net on top of dynamic types, so you get the best of both worlds.

TypeScript has a flag that prohibits switch fallthrough, for instance, though that's an easy one to set up a linter to catch.

One reason I prefer NativeScript to React Native; they are embracing TypeScript and Angular vs. React. I find Angular 2 to be more flexible, but that I freely admit is a preference.

comment 10y ago · link · parent

>in a matter of hours

First, it doesn't need to be "hours" to ultimately kill millions in the US and billions worldwide.

Say it happens over a month. Where are those billions going to go? Think Katrina in slow motion, only with 100M+ people's homes under water in the US and ~3 billion people worldwide homeless, so pretty much no country anywhere is going to be able to send meaningful aid to anyone. The people won't drown, no. But where will they get food? Housing? Clean water?

At ~20', almost all coastal airports be submerged (they tend to be close to 0'). Much of the coastal transportation network will be submerged. Ports will (nearly) all be useless; container ships won't be able to deliver goods to the US because the infrastructure will need to be rebuilt. What if it happens in our winter (summer in Antarctica!)? How many on the East Coast will freeze just because the disaster response brought people tents and there aren't enough sleeping bags for 40M people?

Ice sheets sit on liquid water. The pressure is too great underneath a mile of ice for water to remain frozen. An earthquake a stress fracture that develops over time could easily get to the point where a large chunk of the shelf breaks off, and if it's big enough, the water will rise.

200 feet of potential sea level rise is bottled up in those ice sheets. "Several feet" could be in the small number of percentage points of that potential. And it could also have a cascading effect, where the higher sea level causes the remaining ice to calve more quickly. In fact the USGS called out at least one such scenario:

"The West Antarctic ice sheet is especially vulnerable, because much of it is grounded below sea level. Small changes in global sea level or a rise in ocean temperatures could cause a breakup of the two buttressing ice shelves (Ronne/Filchner and Ross). The resulting surge of the West Antarctic ice sheet would lead to a rapid rise in global sea level. " [1]

They don't define "rapid", and I don't expect they mean hours, but it could be over weeks. They're geologists, so they might mean years. I don't know. The Larsen-B ice shelf broke apart completely in just weeks, though [2]. Even if it happened over several weeks, it's hard to imagine any kind of response that doesn't involve a huge chunk of the population dead or dying over the course of the next few months and years.

Dismissing the result and claiming it can't happen feels like intentionally burying your head in the sand.

[1] http://pubs.usgs.gov/fs/fs2-00/

[2] http://www.slate.com/blogs/the_slatest/2015/05/15/antarctica...

comment 10y ago · link · parent

>mostly in poor countries

Ice shelf melting will be devastating to coastal areas worldwide if it happens quickly. How many cities along the coasts of the world's oceans are above 20' in altitude? Or above 200'? [1] A 20' rise is likely, possibly in "decades", and 200' is the rough estimate if we lost both the Greenland ice shelf and Antarctica's -- and every time a new report comes out it seems like things are happening faster than scientists were predicting. I've seen this movie, and it doesn't end well. And 20' is enough to put New York City underwater. Are they just going to build a 30' dike around the entire area? What if the oceans start really rising toward 200'? Build another 30' onto the dike every decade?

If things happen slowly enough, sure, you could evacuate New York City, and the people there wouldn't number among the casualties, but where would you move them? Or the rest of the Atlantic coastal cities? Or the people in the Los Angeles basin? Some areas may be easier to protect from rising oceans, but there are probably 100 million people in the US alone living in areas that would lose homes to flooding with just a 20' sea level rise. Twice that and you probably get half the population, since most of the biggest metro areas are coastal.

Worldwide? We're probably looking at billions of deaths from a 20' rise in sea level, not even counting other negative effects.

[1] https://thinkprogress.org/study-were-already-in-the-worst-ca...

comment 10y ago · link · parent

Trello and writing a line are great; I have one extra comment about the line.

Instead of just "not finishing" something, I will do a minor brain dump of what I'm trying to accomplish into a comment or a Trello item in the details field.

Usually when I'm stopping it's because there's a thing that isn't easy to finish, and I've done a lot of thinking about how to finish, but don't have the time to do it. So I write down all of my thoughts on the topic -- sometimes it can run to several paragraphs and sometimes a table or two.

But the next time I pick it back up, I can totally get back into the right mental space quickly. The best part? After a break, even if I have a plan outlined in the comment, I often can immediately see a better solution than the one I was working toward.

On a related point I've been keeping a journal with similar notes in it; I've found this to be extremely helpful for thinking through problems. You've heard of explaining your problem to a rubber duck? Having to not only put the problem into words, but writing those words down, is a great way to get the brain churning -- and a great way to leave a map for yourself later to get back into a project.

comment 10y ago · link · parent

>iOS's AppStore that has the most activity and/or money.

iOS AppStore has higher total sales so far, but the difference isn't that great, and Android is due to pass the AppStore in about 2018 [1].

I've seen a phone vs tablet breakdown that implied Android phone app sales actually surpassed iOS a few years ago, but I can't find it now. The huge difference was in iPad app sales which were much higher than Android, and it would be easy to believe that the difference in overall app revenues per store was made up by the difference in tablet revenues.

[1] http://www.androidauthority.com/play-store-revenue-growth-20...

comment 10y ago · link · parent

Saw a great talk recently that explained there is no such thing as a free market.

Any market needs government oversight and laws to exist. It needs government (courts) to enforce contractual obligations. It needs infrastructure to deliver goods (roads) and to run businesses (power; water; garbage; police).

All successful markets have rules. The so called "free market" proponents simply lobby for the rules to be changed in such a way that those at the top make more money; they are almost never lobbying for extra actual net freedom, but just a different skew to the rules so that they can take home still more of the profits.

comment 10y ago · link · parent

OK, but my point is that it's also a concept in most game engines.

comment 10y ago · link · parent

Agreed. Those are "games," certainly. They don't need a full game engine to write.

And that's also clearly not the target of React Game Kit, or why would there be a physics engine and a real time game loop?

comment 10y ago · link · parent

>Tons of games have been build declaratively.

[citation needed]

I'm assuming they mean instead of imperatively. And I'm also assuming they mean something more complicated than a solitaire/card game.

comment 10y ago · link · parent

> Collision and global state related AI planning not with standing.

You're excluding about 50-80% of the actual game logic here you realize?

Don't forget optimizations like memory locality [1] for time sensitive components like particle systems, direct messaging between various game elements, physics processing (which often needs to iterate on world state), and any other kinds of interaction where something (like a door) needs to know whether the player that's trying to unlock it has a certain item in their inventory (like a particular key). Or maybe the door only unlocks after a switch in another room has been thrown. Both are trivial in an OO design; a bit ugly in the functional approaches that come to mind. Possible; of course. But why put yourself to the extra effort?

Functional is great for UIs; you could probably code the HUD and game menu in Elm. I still think functional languages aren't ideal for predominantly imperative problems.

[1] https://en.wikipedia.org/wiki/Data-oriented_design

comment 10y ago · link · parent

>about using a functional programming approach to games in general

Games are predominantly imperative in structure. Using a functional approach for writing an entire game seems like a bad idea.

Can games be written functionally? Of course. Turing Completeness and all that.

>"A Worst Case for Functional Programming?"

I read the article. If the author didn't claim to have video game development experience I'd question whether he'd ever written a game; his examples imply the kind of AI that would be needed for a real-time game, but you don't just "move a tank" like 10 meters in a physics frame. Best practice has physics running at least 100FPS; probably higher rates like 1000FPS would be better. One tank being 1/1000 of a second farther along than another isn't going to mess with the AI.

If the AI is running at a lower frame rate (making decisions only about 5 times per second, or even once per second, could be totally fine) means that the decision will just affect the acceleration being applied -- and would naturally happen in its own phase, so the state of the world would be constant for all participants.

Actions like firing shells, if they can be dodged, are best batched as he suggested. But you still have huge problems like how to handle collisions, which is typically best done in some kind of object oriented way, though I've seen some clever pattern matching approaches as well that functional languages could support ("If a [VEHICLE] collides with a [SHELL], then do X; if [WALL] collides with a [SHELL], do Y..."), but even then each action needs to mutate something in the world.

Which brings me to the fact that, for any nontrivial game, you pretty much need mutable data in order to get even halfway decent performance; you might be able to get away with lazy modification of a "world" data structure (copying it N times for N interactions in the world is absolutely going to kill game performance), but then you're again passing a "world" around to every single operation that anything can ever do -- and unless I'm wrong, every single "shell" and "tank" in the world is going to need to dig into the structure to find "itself" or the object it's colliding with in order to actually do the thing it needs to do...

No, I stand by my assertion. Functional techniques can be useful in games, and I use them. Taking ideas from functional approaches to stabilize the game and simplify the code is an awesome idea. But trying to write a pure functional game is just a bad idea -- or an exercise in watching bears dance [1].

[1] "It's not about how well they can dance, but that they can dance at all"

comment 10y ago · link · parent

That is not mind blowing. Sorry. Also is pretty broken on Firefox, unfortunately, but even looking at it on Chrome, and looking at the far too verbose setup for, well, everything, compared to how things work in a game engine?

Maybe it's useful to React developers who have never seen game engine concepts. Most web developers have zero idea of how games are developed, after all, and teaching them a little bit about how to develop a game is going to expand their minds. Sure, that's a good thing.

But I haven't even scratched the surface of how many things are missing from React Game Kit, any of of which would be a showstopper. As another comment mentions, Pixi.js [1] is incredibly more useful in all ways.

It's a cute "Look at the bears dance!" demo, and criticizing the bears for not dancing well is possibly beside the point. But I also feel it needed to be said that no, one should not pick this up and try to use it as a game development platform. This is Hacker News, a site with lots of web developers who have never made a game or seen a game engine, and they may mistake the dancing bears for a ballet if they've never seen the latter.

[1] http://pixijs.com

comment 10y ago · link · parent

Trump makes bigoted statements. It's not a debate or a "view". It's just a fact.

comment 10y ago · link · parent

It's the rural countryside around here that put up gigantic Trump posters on their farms, so unless you're talking about some other definition of bigotry, I don't you can generalize "rural" as "not bigoted."

Also: I have never had trouble getting jobs in the Bay Area, though I moved before I turned 45. I did however work with people who were late 40s/early 50s and engineers, so I didn't see a huge age prejudice.

comment 10y ago · link · parent

> So in a way this is game programming without the concept of time.

A. You can't have a real time game without the concept of time. If you're making a turn based game, time is ignored equally in a traditional game engine.

B. Most game engines that have a built-in physics engine abstract away time to the exact same degree that React Game Kit does. Everything is about responding to collision events, applying forces, spawning animations, etc.

comment 10y ago · link · parent

I've been making games for ~30 years, and I'm always curious about how people like to apply functional concepts to game development...and yet, when I look at this, I think "Why?"

As far as I can tell, it just starts out with a React tree and then says "put the game in the middle part." Meaning that how you write the game is almost orthogonal to any of React's key concepts like one directional data flow. Except that things like collisions seem to be handled at the global level, meaning that you have to filter them back down to the individual objects involved -- which is strictly worse than letting objects respond to their own collisions, and encourages the creation of "god objects" at the top level that are completely opaque.

There are far more capable game engines out there, ones that give you sprites, canvas or WebGL rendering, and far more sophisticated control of game objects.

Basically all game engines work in a "display the current state" manner (except for old school "put your draw function here" engines like Love2d), and many have built in physics abstractions as well. Can't see any reason to use React for something it's clearly not well matched to.

1
141516
50