Better HN
topnewbestaskshowjobs
Log inSign up

slashdev

17,493 karma · joined May 14, 2013 (13y ago) · 5,497 submissions

Founder of revscope.co

Revenue focused web analytics to help you quickly identify where to focus your effort to best increase revenue.

And embersofvictory.com

Retro turn-based strategy game.

Submissions

comment 10y ago · link · parent

There's also ubsan:

http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

comment 10y ago · link · parent

Since this is likely to degenerate into a discussion on the merits and pitfalls of optimizing undefined behavior, how about a look at this thread on mechanicalsympathy where the topic was beat to death just a short while ago:

https://groups.google.com/forum/#!topic/mechanical-sympathy/...

One of the juicier replies discussing some of the undefined behavior in C (by Rajiv Kurian):

1. A program in a hosted environment does not define a function named main using one of the specified forms - not a compile time error, it's UB.

2. The arguments to certain operators are such that could produce a negative zero result, but the implementation does not support negative zeros.

3. Two declarations of the same object or function specify types that are not compatible - again not a compilation error, it's UB.

4. An unmatched ' or " character is encountered on a logical source line during tokenization. During tokenization!!

5. An exceptional condition occurs during the evaluation of an expression - how specific.

6. An exceptional condition occurs during the evaluation of an expression - hmmm

7. A structure or union is defined as containing no named members - ookay.

8. The value of an unnamed member of a structure or union is used - why is there a compiler at all!

9. The character sequence in an #include preprocessing directive does not start with a letter - lol

10. The program modifies the string pointed to by the value returned by the setlocale function - dear god.

11. The string set up by the getenv or strerror function is modified by the program .

12. The array being searched by the bsearch function does not have its elements in proper order - not a logical error just straight up UB.

This is the tip of the iceberg. How confident is any one now that their program doesn't invoke UB? Things many programmer would assume are compiler errors are actually UB. What would happen if gcc/clang exploited each one of these?

comment 10y ago · link · parent

May I refer you to the 13 pages of section J.2 Undefined behavior of the C standard[1]. I hope you don't have any other appointments after your "hour long" task...

[1]http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf

comment 10y ago · link · parent

I think you read the graphs wrong, they are % of players with better than 80ms ping. So going from 30% to 80% was an incredible improvement!

comment 10y ago · link · parent

The big cloud providers also do similar kinds of things to bring down latency on their networks, but I wonder how effective they are? I've never seen latency comparisons between cloud providers - but there must be differences. None of them seem to use latency as a selling point either. I'd add latency to one of the criteria when choosing between providers if there were a way to compare them. I'm not talking about their latency to me or any arbitrary point, but their latency to internet users in the US in general. Like 50% of users within 80ms RTT. Also packet-loss rates would be nice to know.

comment 10y ago · link · parent

Extraordinary claims require extraordinary evidence, not a study with a sample size of 32, including the control group. I remain super skeptical that the statistically significant result actually implies a real result (and the smaller the study, the lower the chances.)

comment 10y ago · link · parent

PayPal a sinking ship? Getting murdered by stripe? I call bullshit - do you have numbers to back you up?

comment 10y ago · link · parent

This ignores the fact that your odds of being eaten by a shark may be significantly higher in the open ocean than at the beach. See https://en.m.wikipedia.org/wiki/Oceanic_whitetip_shark

comment 10y ago · link · parent

That ticket was created by me, and yes, treating whitespace like that would obviously break plain text templates and anything else where whitespace is significant. Remember that Go templates are for more than just html. What about generating CSV files for example? Plaintext emails? I use it for generating Go code, so the whitespace is sometimes significant (to terminate a line of code) but moreover careful control of whitespace is necessary to get readable code.

comment 10y ago · link · parent

The idea they went with, which was one of the ones I proposed, is used in a variety of open source projects, so it had the advantage of being somewhat familiar and vetted. And what I meant to say is that they had to modify things in a backward compatible way, which means keep whitespace by default and trim with new syntax.

comment 10y ago · link · parent

The default behavior has to be backwards compatible, so there was only one serious option.

comment 10y ago · link · parent

Go doesn't use a generational GC AFAIK.

comment 10y ago · link · parent

You're practically coming out and saying that all humans are equal and the only productivity differences can be attributed to other factors. That's a ridiculous position to take.

comment 10y ago · link · parent

Now you're making some reasonable points, higher taxes on the rich and on corporations might help. It has to be weighed against the cost in lost innovation and investment. For example US corporate taxes are so high that companies don't repatriate their international profits - they invest the abroad when in many cases they would rather bring the money back to the US. The international "market" of countries and tax system also functions as a free market, and the money has a tendency to flow to where it will be taxed least. It's the the free market and competition (between countries) at work. Where the optimal point is for reducing the wealth gap while still maintaining optimal levels of innovation and investment is something nobody knows - the issue is very complex.

Removing (reducing to be more realistic) the influence of money on politics is a great idea. I'd love to see a system that leverages technology to provide a finer-grained representational democracy. One where you can vote for a representative on any given issue, or group of issues, or type of issues, etc and you can change that vote whenever you want. Google experimented with such a system internally at one point. Pure direct democracy is too dangerous, it's mob rule and would stomp all over minority rights and issues. Representational democracy is too far removed from the people. Something in between is likely the sweet spot. But it may never happen. Politicians have no incentive to dismantle the system that supports them.

I too disagree that alternative systems would work better in Africa, but it's clear that democracy doesn't work very well either compared to developed countries.

Well Gates might not be investing in things that people in the US would vote for, he's doing a great job in service of humanity. One could say that maybe the people he's actually trying to help, e.g. in Africa should vote on what to do, rather than him making the decisions - but would they make smart decision? These are uneducated people who don't know anything about economics, or science, or anything outside of their day to day struggle for survival. Well they might be better aware of the issues that they face, they almost certainly are not well equipped to solve them - democracy is of no help here.

Anyway it's all moot, the money is his, and it's his right to decide what to do with it. Good on him for using it to help humanity.

comment 10y ago · link · parent

Democracy is not some magic solution. It's often described as the best of a lot of bad options. It can only be as intelligent and effective as a mob of of its average citizenry - which if you look at democracies in the third-world and developing world where your average person is uneducated - doesn't lead to good results.

The best form of government has often been described as a benevolent dictatorship. This is closer to the form of governance of corporations and open-source projects. The problem is, there's no easy way to guarantee the benevolent part.

I see no problem with people like Bill Gates having amassed power, money, and influence, because he can use it far more effectively than a mob of your average citizens would - the average citizen being a lot less educated and less intelligent than Bill Gates. Now, among the wealthy and powerful you also get types like the Koch brothers, who use their power for dubious ends - that's inevitable in a capitalist system. There's no way to prevent that aside from very strict socialism - which has the same economic problems seen in any communist country past or present. So for better or worse, I think we have to accept the influence of the wealthy.

comment 10y ago · link · parent

You have a strangely socialistic way of looking at the world. I can't say I agree with any of your points.

comment 10y ago · link · parent

Yes, I think this is really unfair. In no way is Gates a part of the problem, the country would be in much better shape if there were more like him. He innovated, created tens (hundreds?) of thousands of jobs, and one of the biggest companies on the planet. To top it all off, he puts the majority of his personal wealth in a foundation that he and his wife run to the benefit of humanity in general. It has been my dream since I was a kid to do the same (on a much smaller scale, likely). I wish there were thousands more like Gates and Buffet.

comment 10y ago · link · parent

Is there ever a project of that size that's properly organized? We did our best under the constraints we had. There was always a long wishlist of things we would change if we had the time, and some of them we were able to do.

comment 10y ago · link · parent

There are diminishing returns with the type system. Having a super expressive/complex type system like Haskell can be good, but it also adds a lot to the overhead in keeping the type system happy. It can distract you from actually solving the problem at hand. I think Go strikes a happy balance between the two extremes of dynamic and super-powerful type systems.

comment 10y ago · link · parent

I used to be a huge dynamic languages fan, with python being my favorite language over the majority of my career. Then I worked on a large python project of ~100k LOC with a team of ten. That's when I realized that writing code faster isn't the problem. Reading it is, making changes to code someone else wrote is, and refactoring across dozens of modules is a problem. Static languages help a lot with all three. I still love dynamic languages for small tasks, but I'd rather use a static language like Go which still keeps much of the dynamic feel, and helps catch my mistakes at compile time. I actually just set it to watch the project directory for changes and recompile automatically in a terminal on another screen (actually to run the unit tests, which includes compiling.) That's constant feedback and comparable to dynamic languages speed for edit-compile-test runs. But the best part is the unit tests. They run so much faster with Go that I don't get distracted waiting for them to finish, and that keeps me in the zone and much more productive.

comment 10y ago · link · parent

Debian needs serious help to get the multiple monitors configured and working at full resolution. OpenSuse had that problem plus terribly ugly fonts. It took a lot of reading up online and trying things before I figured out how to fix that. Ubuntu actually had a broken apt-get for me on some recent installs, it turned out to be an issue with using the us subdomain repos, switching to de made apt-get painfully slow, but solved the problem. Luckily I haven't had this issue on my new VM install, so I'm hoping it was resolved. All of them had issues booting (black screen) with the default open-source display driver and required the proprietary drivers to be installed (this is not an issue in a VM.) Just to get Spotify to run on OpenSuse was a herculean effort that I eventually gave up on, but not before buggering up the system.

comment 10y ago · link · parent

I'm actually somewhat surprised at the number of people writing that Linux saves them time. Clearly not everyone has had the horrible experiences I have. I'm curious what distro you people use and on what hardware. I tried Ubuntu, OpenSuse, and Debian. All of them, excpting Ubuntu, needed so much work out of the box just to get to parity with a fresh windows install as to cost me more than a Windows license. Ubuntu was the least stable after install. Updates would frequently break it. I didn't even make it a week this time, and my past experience with it (LTS version) has been that every few months something new would break after updates.

comment 10y ago · link · parent

I use a desktop.

comment 10y ago · link · parent

On OpenSuse it was a software install that went bad. The much vaunted snapshot feature didn't work out of the box! It actually could not boot snapshots in that nice little grub menu. I had to reinstall after spending hours trying to rollback to a snapshot.

On Ubuntu it updated the kernel, which made it unbootable. I could still boot the old kernel, but after taking out a ticket and being asked to upgrade my BIOS, that became unbootable as well.

On Debian it was just too much work to get to a point where it supported the real resolution of my displays and my multi-monitor setup. I eventually just threw in the towel and went and installed Ubuntu in a VM, which at least got me up and running quickly.

I'm leaving out a variety of colorful failure stories, but the bottom line is very little worked out of the box, it was insanely time consuming and difficult to get things into a decent state, and then it didn't stay in that state for long.

comment 10y ago · link · parent

Yes, I remember the talk about total cost of ownership. But it's entirely valid in my experience. I wouldn't ever use desktop Linux again outside of a VM. The bottom line is that my experience with Windows is rock solid. It looks good out of the box (metro asside), works out of the box, even supports SLI, gaming, multiple monitors without any fight. Even "dist upgrades" work. I've never had an issue with malware because I know what to do and what not to. And it's so nice that third-party software runs and runs well on Windows. Many companies don't support Linux or only offer a stripped-down product that barely works.

comment 10y ago · link · parent

Nothing exotic: NVIDIA 970 graphics card, Gigabyte motherboard with Intel NIC, Haswell CPU, Samsung SSD and a couple HDDs.

comment 10y ago · link · parent

I went in the other direction. I used to use Linux (Ubuntu) but I got tired of essential things breaking after updates, like Nautilus, and the constant battle with getting the printer to work. Eventually I just got too frustrated, went out and bought Windows for $300 and considered it cheap.

Now I need Linux for work (software dev) again, so I gave dual-boot a try. I installed OpenSuse, Ubuntu, and Debian a total of 7 times since Christmas, each time ending up with something unbootable within days. And I spent a couple thousand dollars of my time getting them to work, fixing the horrible fonts on OpenSuse, etc. Eventually I gave up and bought VMWare where Ubuntu now sits happily isolated from real hardware, a configuration that it's somehow more stable in. And at least I have automatic snapshots on every reboot, so when something goes wrong I just roll back.

Honestly, desktop Linux is the most expensive OS out there if you count the value of your time. I really like Windows, not because it's a pleasure to use (Windows 8 with that metro crap was terrible!) but because it just works. If I can't get desktop Linux to work nicely as software engineer, what chance does your average person have? Unless some company does to Linux what Apple did to BSD (SteamOS?), I don't see any hope for it ever being anything but a niche desktop OS.

comment 10y ago · link · parent

Typically movie stars negotiate a tiny % of gross revenue in their contract. They used to negotiate for % of profit, but studios got very good at fiddling with the numbers for the film until a successful movie had nearly no profit.

I don't see why that can't be done for software engineers. That is essentially dividends though, and it's obvious why growth companies don't want to do that. But it's also not clear that stock options have the intended motivating effect (it's not even clear that increases in salary or some kind of profit sharing would have the intended effect either[1])

I think it's clear that stock options are sub-optimal for the intended purpose, but it's not obvious to me how to fix that.

[1] https://www.youtube.com/watch?v=u6XAPnuFjJc

comment 10y ago · link · parent

I'm a Canadian software engineer. I moved away long ago, as does anyone in the industry who realizes your pay can easily jump 50-100% just by crossing the border. Most with the talent who can leave do so, or work for a US company remotely. Very few talented engineers stay, because frankly it makes no economic sense.

So I think Canada has a long way to go before it can stop or reverse the brain drain in the software industry.

comment 10y ago · link · parent

I think this is short-sighted. Either way, the technology innovation will happen, and the jobs will be lost. The question is, does the innovation happen in your country, where some of the money sticks to your "fingers" through taxes and knock-on effects in the local economy? Or does it all go to SV.
1
169170171
184