HNHacker News
TopNewBestAskShowJobs

sharpercoder

917 karma · joined November 17, 2014

rtimon@gmail.com
submissionscomments
sharpercoder··on How to implement strings
I personally think we should make a plentyfold of datastructures respresenting strings. Sure, I want a geenric fits-all structure to represent text as provided in many libraries and frameworks, such as .NET's String class. However, I have many situations where using that same String class is pure overkill and prone to security bugs. For instance, I want a DigitsOnlyString, representing only the numbers [0-9]. But I also want a NumbersOnlyString, representing the digits [0-9] but also all other number characters there are in Unicode. The same for e.g. emoji's, latin characters ([azAZ]), extended latin ([azAZ], plus a subset of diacritics) Chinese characters, and I can go on for quite some more examples (Password anyone? Don't allow a lot of Unicode edgecases). These classes will have the benefit of really efficient encoding in bits, being more secure, more clarity to programmers and most important of all clear reasoning. I bet 80% of String uses can be moved to a more constrained type.
sharpercoder··on The true power of regular expressions (2012)
As a lead developer, I frown upon every instance of regex used. If it's shorter then, say, 20 characters, it may be allowed. Longer then that will result in a negative advice and binding advice to refactor. You implement a language lexer & parser, or use plain string functions.
sharpercoder··on Anki Vector: The Home Robot
I have now spent a few minutes on the website. I'm confused on to what robot it is offering? And what utility that robot then offers? In the video I see multiple robots. I don't see the robot actually offering any value. I'd love to spend money on a robot, but I have no idea why I would spend money on this thing (things?)
sharpercoder··on How the Dutch created a casual biking culture
In which the cyclist is at fault, as the minivan is on the intersection before the cyclist and thus has right of way. Right of way only counts when arriving at the same time, often neglected in analysis.
sharpercoder··on Write – A word processor for handwriting
https://products.office.com/en-us/microsoft-whiteboard/digit... ?
sharpercoder··on Write – A word processor for handwriting
I bought a Surface3 specifically to write notes and draw with OneNote. OneNote has its own big problems, and I would love to spend a good amount of moneyfor software that gets writing, write recognition and draw recognition right. To document software, I draw diagrams a lot. It would be great when a lowlevel api would be exposed to recognize specific types of diagrams (e.g. sequence, class, ...).
sharpercoder··on Electric scooters are illegal in the UK because of 1835 law
Cities should have separated ways for power-to-6Km/h speed differences.

Pedestrian: 6KM/h bicycle: 18KM/h City scooters: 24 KM/h Fast city scooters: 42 KM/h Cars: 48 KM/h (50KM)

Unsure if 12, 30 and 36 must get a new category. For 12, niche electric vehicles usually are around that speed (e.g. mobility scooters, electric toys)

sharpercoder··on Show HN: A Rust macro that parses Java-like syntax and runs it as a Rust program
Would it be possible to write a compiler from Java to Rust? C# to rust? The goal then would be to get fast(er) execution times.
sharpercoder··on When is a nation not a nation? Somaliland’s dream of independence
Countries within nation states are not uncommon. For example, the Kingdom of The Netherlands consists of multiple countries: The Netherlands, Curacao, Sint Maarten and Aruba. The same can be said for example for the United Kingdom.
sharpercoder··on Munro Teardown Shows Tesla Model 3 Solidly Profitable [video]
Outsourcing stuff usually hurts in the longer term as company knowledge is not build up within the company itself. For many parts this is crucial in a car, for other parts it has no effect.
sharpercoder··on Why Use OpenStreetMap Instead of Google Maps?
What I miss is actual functionality that makes my life better as a user. I totally agree on all points made, but it is not going get me a better mapping experience in any way. For me to consider OSM, I need most features that are as good and some that are better. I don't like to say it, but OSM does not (yet?) offer this.
sharpercoder··on Simple, correct, fast: in that order
Make it work, make it good, make it fast.
sharpercoder··on Inside China’s Dystopian Dreams: A.I., Shame and Lots of Cameras
What happens when you request a loan? What happens when you apply for a job that involves kids, or requires trust? These are societal controls. China did not develop these the past centuries as much as the western world did, or they got destroyed in communist uprisings (e.g. Mao).

My parent comment is neutral, I'm only stating some facts and conclusions. I agree you need innovation, creativity and critical thinking to make a more diverse society. Success however is in the eye of the beholder; it's mostly a matter of what measure you use. Growth is not a panacea, while many western thinking seems it is. Neither is "amount of societal order", as China seems to think.

sharpercoder··on Inside China’s Dystopian Dreams: A.I., Shame and Lots of Cameras
I understand that most western countries have societal controls grown over the past centuries. The Chinese did not, and are catching up quickly by implementing similar controls as we have. But now, it's the digital age, and as such they are using any available technology to implement these societal controls. From this perspective, it's completely normal what the Chinese do. Seen from western eyes it does look a bit scary though. We must realize however that our society also has firm societal controls setup in many things we do.

China is now the dominant world player, this year it has surpassed the US on many areas (IT and military-industrial complex are the only US-dominant areas). Much more importantly, China is full-throttle developing it's trading strategy: The silk railway to Europe, trade dominance in Africa, footholds in Greece, Poland and other EU countries, large export deficit to the US. It won't be long before China will totally dominate trading in the world market. At that point, China can set the requirements. When that happens, traders are likely to need a WeChat account, too. No good rep? No trade.

sharpercoder··on Cargo bikes as symbolic markers of egalitarian gender roles
This bike trailer of my sister was with all that. My 3 year old niece managed to rip apart a cover and stuck her hands outside. The bike rode near some poles, causing potential hurt. My 4 year old nephew in the same trailer was close in "trying out what happened if I stick my finger there" (the wheel). I had to make a yell to impress him enough to stop. Luckily, I was cycling behind.

Likewise, if your kid gets acute illness (throwing up, dizzy, etc), you're not going to notice it right away.

I would go as far as outright banning these things for transport of living beings, with hefty fines for it. Please stop selling these things for living being transport, you will make the world a better place and have better margins on cargobikes.

sharpercoder··on Cargo bikes as symbolic markers of egalitarian gender roles
A bike trailer has the dangerous property of not being in your peripheral vision. I personally would never transport kids in a bike trailer; I have seen my sister (her daughters) get into hurtful situations and potentially dangerous situations. Whenever you can spend more for a front-load cargobike, I would highly advise to do so.
sharpercoder··on Utah voting system fending off 1B hacking attempts per day
Sorry to say this, but the US has bigger systemic problems to fix. Voting is a small one compared to the 2-party system. The US always boasts about how it is so democratic; while in reality there isn't much democracy. In fact, the 2-party system looks suspiciously a lot on the 1-party system in existence in many other countries. Sure, you have a choice, but what value is that choice?
sharpercoder··on How much is time wrong around the world? (2014)
https://en.wikipedia.org/wiki/Swatch_Internet_Time
sharpercoder··on Vue.js: the good, the meh, and the ugly
I would highly recommend against this setup. While Vue is already very challenging to get right with any build tool, it's especially terrible regarding typescript and much more so with typescript decorators. You need to enable hardly documented configuration switches in multiple dependencies. Then, you must wrestle through a plethora of error messages coming from a diverse set of build tools/libraries/scripts. After you've done that, the only options is praying to the gods a config will work.

I have worked with multiple Vue projects now. The time is spent about 50/50 in pure development and getting the build setup working correctly.

Better pick another tool to do the job which has mature integration with build tools.

sharpercoder··on Vue.js: the good, the meh, and the ugly
One particular weak point of Vue is it's dependency on build tools. I spend a few days buiding a great app, and then another few days on getting the build apps configured right with Vue. You google from one error message to another, where each message is unclear and no relation to any build tool/plugin/library/script is made.

I really like Vue for the many great strong points it offers. But I'm equally ready to completely ditch Vue for its complete and utter garbage with respect to build/debug configuration.

sharpercoder··on The Hidden Cost of Touchscreens
you confuse sales with UX.
sharpercoder··on JavaScript: Does It Mutate?
I have done quite some implementations now of things in an immutable way. Easy to test, easy to spot bugs, easy to work with. Come back a few months later, and purity is removed on many things despite clear comments on the why it is immutable.

I welcome any effort to make developers aware of immutability.

One simple thing to help here is to have the "mutability: flag marked on every method in MDN.

sharpercoder··on The Trouble with D3
Most likely, D3 should design a dsl that compiles to d3. This language should cover 80% of the usecases and vastly improve the debugging experience.
sharpercoder··on Modern C++ Features – std::optional
Optional is a typical feature that should be baked into the syntax. If used properly, it will be used throughout codebases, and when it is used, it adds simple, replaceable syntax.
sharpercoder··on [dead]
There is currently no non-niche application for cryptocurrency. Until the time that arrives, they are probably right.
sharpercoder··on Introduction to the Pony programming language
The website does not show any code in the first or second page. Only a cheatsheet after 3 clicks - which is a pdf.
sharpercoder··on APL deserves its renaissance too
The heart of my argument is mostly that integration in main languages should be pursued. F# can be mixed on assembly (project) level, but not on source level (like css in html or html in js/ts).
sharpercoder··on APL deserves its renaissance too
If you think about it, a decent stack is composed of languages. That's currently already often true, e.g. the use of IDL languages like protobuf/flatbuffers. Some languages offer integrated idl like Kotlin (data classes). Another example is html, where the UI is described using a dsl to specify elements and CSS for layout & appearance.

This fact caused me to think: should stack also not be made of other languages? Is there a place for a completely pure functional language? I mean, Haskell is nice, but get a bit awkward with I/O. Same for APL. C# has nicely integrated data querying, but from a distance is actually at least somewhat awkward. C# seems to be optimized for mutable domain objects; everything else can be nicely done but falls somewhat outside it's "identity".

I would love to be able to express functions, functors and math using a terse math-y language. Whether that be APL or some sort of blend of Haskell and APL (Haspell? spelling pun intended), I don't care, but it would be great if we can have nice integrations of these languages in a full stack. Sort-of like how TypeScript and JavaScript have dialects to enable React syntax to express HTML within it.

The same thought experiment can be applied to SQL. Can we have a data-querying language integrated right into, say, C# or Java?

sharpercoder··on Mint-lang: a language for the front-end web
The categories are subjective but at the same time driven by a plethora of factors. The fact that TypeScript is developed by a large company means that it can overcome many barriers. Another factor is that the same company develops a new IDE (editor) in tandem; this means one of the most important parts of a language (tooling) is covered. A third factor of TypeScript is the many language features it offers. Fourth, the development pace is very high compared to most other projects. The "innovation factor" of TypeScript is combined quite high, as the "compile-to-readable-js", language features and tooling support combination is not achieved by many competitors.

Flow is a nice comparison as it is also backed by a large company. They don't offer a developed IDE in tandem, development pace is a lot lower and language features are not that many compared to TypeScript. The "innovation factor" is a lot lower - of the level I think it's not worth pouring resources into it.

sharpercoder··on Mint-lang: a language for the front-end web
We do need better languages, but we should get rid of languages that marginally improve. Take CoffeeScript: it pushed EcmaScript forward, but does not offer enough feature today to justify pouring enourmous man-hour resources into it.

And this is true for many more languages (Flow, PureScript, LiveScript, IcedCoffeeScript, ...) which don't innovate on many aspects but just offer a slightly different - sometimes improved - syntax. I do recognize that many languages add value, but that must be offset to the cost of using these languages. Costs which are often quite high: Googleability, StackOverflowability, documentation, tooling, develop mindshare, library support, stability - these things don't come cheap and take years to mature.

Furthermore, these "innovate slightly" languages in the webspace take away resources from improving the current state of the art in mainstream (EcmaScript, TypeScript, Dart, C#, Java, ...). For instance, instead of improving some JS tool now resources go into e.g. writing a language server for aforementioned language.

A good example is Elm which does try to innovate on core concepts (builtin reactivity). That's a conceptual feature which can bring the state of the art of programming language design further.

Last, I do not mean that we should not write any more new languages; but we should stop trying to get large-audience adoption for "innovate-slightly" languages. It's a waste of braincycles and actually hurts the ecosystem.

← PreviousPage 3 of 11Next →