HNHacker News
TopNewBestAskShowJobs

nostalgeek

488 karma · joined March 9, 2018

submissionscomments
nostalgeek··on Removing jQuery from GitHub.com frontend
> That polyfill relies on a third party which can then effectively gain analytics for your site. They store and keep the referring URLs and user agent combinations.

That polyfill relies on nothing since you can run your own custom 'polyfill' server, or just download the bundle and serve it from your website. It's completely open source.

https://github.com/Financial-Times/polyfill-service

You're complaining that a public CDN runs some analytics. But they all do that, and this project doesn't mandate that you use their CDN.

nostalgeek··on Portable Cloud Programming with Go Cloud
> For me, the go threading model is easier. I just can't stand DOM and web programming in general.

Because you didn't take the time to learn the DOM, that's all. I doubt learning a simple composite API made of dumb nodes is more difficult than writing thread safe programs in Go. I'm not talking about tastes or interests, I'm talking about ease of learning.

Go isn't 'easy to pick up'. For loops, if statements and co are basic, and they are in all languages, that's my point. There is nothing particularly easy with Go.

nostalgeek··on Removing jQuery from GitHub.com frontend
> Many functions such as closest() and remove() have no equivalents in IE11, and other things such as replaceWith() and before() are not available even in Edge.

Many of these can be polyfilled, Going the polyfill route IMHO is a bit better. I use this now : https://polyfill.io .

nostalgeek··on Facebook stock drops more than 20% after revenue forecast misses
To me that award goes to Twitter, not Facebook. Facebook is actually useful to stay in touch with friends and family in a private fashion. Twitter on the other hand is constant pettiness, aggressiveness and bickering 24/7 from people looking for validation and internet points. The worst internet mobs came out of Twitter and my statement doesn't discriminate between political sides.
nostalgeek··on Portable Cloud Programming with Go Cloud
> but I'm sure that takes much longer?

Your people can pick up go reflect package or go routines/channels and co in 1-2 weeks and start contributing? impressive... most people can pick up for loops, if,switch statements, variable and function declaration in a week in any language as well...

In fact, a lot of non programmers use JS regularly to write scripts in the browser. I imagine your people know how to program before hand... So what do you think takes longer to learn? mastering go threading model or being able to add interactivity to the DOM?

nostalgeek··on Be Nice and Write Stable Code
> It depends. I have a friend who used to work on banking systems. They had full test coverage of every dependency. Even standard lib functions and language features.

these are not dependencies anymore then, they are part of your code source and should be vendored with it. I don't know what language your friend is using but I'm pretty sure most std libs and languages already have tests with very good coverage.

> One time they found a bug in the md5 implementation in a minor version of a popular database.

Every piece of code can have bugs. 100% code coverage doesn't eliminate bugs, it just says all code path are tested, an algorithm can still be wrong for some values even if 100% code path are tested.

nostalgeek··on It’s called vomit fraud. And it could make your Uber trip really expensive
One of the most comment article on HN in recent history

https://news.ycombinator.com/item?id=13682022

nostalgeek··on Go 1.11 Beta 2 is Released
> You could argue that you should add the JS / browser runtime to those libraries too, then.

No, since they are already in the browser at first place. That's the point. I don't need any extra runtime to run JS in the browser.

nostalgeek··on Go 1.11 Beta 2 is Released
You are comparing some MVC frameworks that brings a lot of functionalities with basically a runtime that does nothing on its own. Compare functionalities AND weight instead, otherwise it makes little sense.
nostalgeek··on REST was never about CRUD
It seems to me that REST "was never meant to solve web developers problems" at first place and that dissertation wasn't addressed to them. I'm glad we are getting out of REST. Devs need protocols and specifications, not vague architectural ideas that leads to "you're doing it wrong" blog posts. There is no "you're doing it wrong" with GraphQL, or SOAP, or JSON-RPC, you either follow the spec or you don't.
nostalgeek··on Parcel: Fast, zero configuration web application bundler
This is both an education issue and a std lib issue. There is no need for packages such as "is-number" or "is-odd" when the language already provides the facilities it check if a value is a number or is even/odd, yet these packages are downloaded a thousand times a a day because they are dependencies in this or that popular package.

For some the first reflex is to add a dependency instead of spending 5 minutes thinking of simple solutions for their use case. But the latter isn't restricted to the node ecosystem.

The avalanche of useless modules profits mainly to NPM, a for profit organisation operating a closed source package repository which imposed itself on the node project in dubious ways. Even nodejs creator regrets it.

nostalgeek··on Where is the money for mobile app developers in blockchain?
You are mistaken, these aren't fads but buzzwords. Web 2.0 is the web of API, NoSQL existed well before the term was invented and microservices are a valid software architecture since it's not a question of size but an organizational concern. Even "severless" is just the good old worker queue system. And yes, buzzwords come and go but nothing behind these are fads.
nostalgeek··on Ask HN: What is the current state of web frameworks in Golang?
There is no real good framework and anybody can write a trie based router in 2 hours:

https://vluxe.io/golang-router.html

However, Go ecosystem is starting to look interesting library-wise, as long as your project doesn't involve enterprise integration with legacy XML services or SOAP, because Go sucks at mostly anything XML.

For templating I use Jet because the standard templating library is too basic for professional use https://github.com/CloudyKit/jet .

I don't use ORM, I use https://github.com/Masterminds/squirrel for query building and https://github.com/jmoiron/sqlx which helps deals with row<=>struct conversion. For database migrations, I use https://github.com/rubenv/sql-migrate , but if you need an ORM gorm https://github.com/jinzhu/gorm is OK if you do code first and sqlboiler https://github.com/volatiletech/sqlboiler is OK if you do database first.

For session handling I use scs github.com/alexedwards/scs , for converting form encoded data to go structs I use github.com/gorilla/schema, for logging I use zap https://github.com/uber-go/zap. For managing roles in an app I use either the voter pattern https://symfony.com/doc/current/security/voters.html in simple cases or casbin github.com/casbin/casbin . For background jobs I used https://github.com/gocraft/work and https://github.com/gocelery/gocelery , for caching i just use redis https://github.com/go-redis/redis , for data validation I used https://github.com/asaskevich/govalidator or https://github.com/go-ozzo/ozzo-validation . For sending mails to customers I used https://github.com/go-gomail/gomail

If i need html forms, I first describe form elements as a struct then write form helpers in jet templating to display them like that:

    type LoginForm struct {
            Login, Password string
            Form
    }

    func (form *LoginForm) validate(r *http.Request) error {
            r.ParseForm()
            form.Decoder().Decode(form, r.Form)
            form.Errors = map[string][]string{}
            if err := (requiredValidator{}).validate(form.Login); err != nil {
                    form.Errors["Login"] = append(form.Errors["Login"], err.Error())
            }
            if err := (requiredValidator{}).validate(form.Password); err != nil {
                    form.Errors["Password"] = append(form.Errors["Password"], err.Error())
            }
            return form.getErrors()
    }
    func (form LoginForm) LoginFormView() LoginFormView {
            return LoginFormView{Fields: []Field{
                    {Name: "Login", Label: "Email", Type: "text", Value: form.Login, Required: true, Errors: form.Errors["Login"]},
                    {Name: "Password", Label: "Password", Type: "password", Value: form.Password, Required: true, Errors: form.Errors["Password"]},
                    {Type: "submit", Value: "Submit", Required: true},
                    {Type: "reset", Value: "Reset", Required: true},
            }, Method: "POST", Name: "LoginForm"}
    }
Then I can just write an helper in jet to display the the form view:

    {* tag attributes *}
    {{ block attributes() }}
        {{range .}}
            {{.Key}}="{{.Value}}"
        {{end}}
    {{ end }}
    {* form field *}
    {{block field()}}
    <label>
        {{.Label}}
        <br/>
        {{if .Type == "textarea" }}
        {* textarea *}
        <textarea  name="{{.Name}}" {{ yield attributes() .Attributes }} >{{.Value}}</textarea>
        {{ else if .Type == "select" }}
        {* select *}
        <select name="{{.Name}}" {{yield attributes() .Attributes }}>
            {{ range .Options }}
            <option value="{{.Value}}" {{ if .Selected }} selected {{ end }}>{{.Label}}</option>
            {{ end }}
        </select>
        {{ else }}
        {* basic input *}
        <input type="{{.Type}}" name="{{.Name}}" {{ if isset(.Value) }} value="{{.Value}}" {{ end }}
        {{ yield attributes() .Attributes }} {{ if .Checked == true }} checked {{end}} />
        {{ end }}
    </label>
    {{end}}
    {* form template *}
    {{block form()}}
    <form action="{{.Action}}" name="{{.Name}}" method="{{.Method}}">
        <fieldset>
            {{ range .Fields }} {{yield field() .}} {{end}}
        </fieldset>
    </form>
    {{end}}
This is the exact app structure I use to deal with dependencies and filters :

https://medium.com/statuscode/how-i-write-go-http-services-a...

nostalgeek··on WebAssembly is more than the web
> WebAssembly isn't just a cross platform technology, it's also a way to target platforms that are currently walled gardens. Being able to run software on e.g., the iPad without paying Apple's 30% fee and being able to ship features / bug fixes without added delays is a big deal.

Apple still control what API you can use in their mobile browser, and it's not like they are at the forefront when it comes to implementing Web API today, especially when they also forbid any alternative browser on IOS. Ultimately WebAssembly is limited by the API it has access to in the context of the browser (and the resources that are granted by the browser). All the promises of the "web as an app platform" have not been fulfilled yet.

IMHO WebAssembly will play a bigger role on the server, with nodejs for instance as it will allow portable native code distribution.

nostalgeek··on How to build an NPM worm
> They are all very popular “open source” ecosystem tools beholden to a for-profit corporation.

NPM server is not open source to begin with. Its client shouldn't be bundled with node, an open source project. I don't use Wordpress but pretty sure I don't have to pay a license to Wordpress to install its CMS on a server. And github server IS NOT open source.

nostalgeek··on Adobe will bring the full Photoshop to the iPad
You need to load the app at first place. Launch Photoshop CC and check how much memory it takes. Then open a 200 MB psd.
nostalgeek··on Adobe will bring the full Photoshop to the iPad
You can't really load giga bytes of data in a web page without that page dying. The issue isn't really what Javascript can or cannot do (though speed is obviously a concern). Even if you manage to stream the data somehow you still need to persist it locally, and I'm pretty sure no browser allows that kind of quota. Photoshop feature complete is not going to run in the browser soon.

If what you said was true we would already have late Xbox 360 and PS3 like games running in the browser...with acceptable performances on high end hardware, which is clearly not the case.

nostalgeek··on How NoSQL forced the evolution of a scalable relational database
JSON type is JSON type, EAV isn't a data type, it's a data modelling pattern.
nostalgeek··on How to build an NPM worm
Now please explain me what it has to do with anything I say, since I do not use any of these services.
nostalgeek··on How NoSQL forced the evolution of a scalable relational database
Well, this is exactly why competition is good, in every domain. That's why PostgreSQL got its column mode and JSON type, because there was a clear use case for performance for the former and schema-less data for the latter. EAV pattern is a plague and I'm glad documents are replacing it.
nostalgeek··on How to build an NPM worm
> It bothers me greatly that npm is a private company. It bothers me that npm is closed-source (the registry and server). It bothers me because I can't contribute. I can only inform the community of the problems.

NPM the repository is not open source? How does a non open source platform ended up being the default package repository for an open source project is a complete mystery (since NPM client IS bundled with node distribution). People should be allowed to run their own NPM mirror ... for without having to pay for a license. I don't have to pay for packagist or pip server, I can only if I want professional support, so what is this?

nostalgeek··on Building the Google Photos Web UI
You shouldn't. I wish all these apps had a dumb basic mode (like gmail html mode) that would just show the photos in a static fashion so it's not a pain to browse on low end mobile. The article is interesting, but just like onedrive photo galleries, these UI are often slow to scroll in and even reset randomly so when you're in the middle of a 100 photo gallery and it happens it's a bit frustrating.

Remember the old picasa UI? it just showed the photos, that's it, nothing fancy, on complicated calculations in js...

Also off topic ... but medium UI is getting worse and worse, on a laptop, fixed heading + fixed message on the bottom (that can't be dismissed), really? not much real estate left for the actual content. And don't get me started on the pictures that take 10 seconds to load, because of "lazy loading" bound to the scroll position...

nostalgeek··on How scammers get away with fraud
While customers victim of online scams and identity theft are more or less protected by big vendors or banks because of regulations, provided they act swiftly, small merchants are often on hook when a scam happens with very little options to recoup the money lost. What are the solutions for merchants? insurances? anti-fraud detection services? What could you recommend to a merchant that is starting to do business online? restrict with whom one does business with? use bigger merchants to do transactions? what works, what doesn't to mitigate risk?
nostalgeek··on Guidelines for Brutalist Web Design
> The term brutalism is derived from the French betón brut

it's "béton", not "betón". And I'm pretty sure the term comes from the word "brutal" because the style was deemed as such, figuratively, and not the use of concrete "brut", which makes no sense to begin with as buildings would be built with "béton armé" or "béton fibré".

nostalgeek··on Pointers Are More Abstract Than You Might Expect in C
The following is purely my opinion.

Rust might have gone too far the other way. Yes it strives to be a modern language, with a lot of functional programming features and "OOP" done right (aka no inheritance, simply method polymorphism). To me Rust is more a C++ replacement than a C replacement.

A replacement for C should try to be as simple as possible while fixing C weak typing mess with strong typing for instance, including when it comes to pointers (for instance like in Ada where you can't just take the address of anything you want, you need to declare it as aliased to begin with). In fact Ada tries hard to make pointers redundant which is a great thing. This and range types and bound check arrays( Ada has a lot lot of great ideas, and "C style" Ada is a treat to use).

So a C replacement should keep the procedural nature of C, with closures perhaps, but not go further in terms of paradigm. C aficionados often claim they love C because it's "simple"(it isn't) That's what they mean, they love C because you can't really do OO with it.

On the other hand, Rust macros are exemplary of what a good macro system should be.

nostalgeek··on How to make MongoDB not suck for analytics
> Right tool for the right job.

I would argue that since both Mysql and PostgreSQL are JSON document stores with mostly the same capabilities when it comes to querying and aggregation I don't see the advantage of using MongoDB at all.

I wouldn't even use MongoDB for caching when redis does a better job at it. Logs? I don't see why logs cannot be shoved into a RDBMS. Prototyping? create a table with a JSON field and a primary key. Distributed file system? I don't know any business which uses gridFS as a CDN, full text search? PostgreSQL does it better. So what is the job your are talking about? PostgreSQL is so much powerful for analytics because of the power of SQL.

nostalgeek··on Should every programmer learn C as their first programming language?
Nah. I started with Flash and would never have had a programming career if I had to start with C, gcc, make and all that bullshit.

Learning C by itself is interesting because obviously a professional programmer needs to know how memory is managed and laid out at a lower level in a computer, and how higher programming languages themselves are implemented.

But you don't need to start with C to actually teach programming, what is a function, what is a loop or a variable, or to teach algorithms, data structure, or problem solving.

People often complain about "the lack of diversity" in tech, well I can tell you people who think C should be the first programming language of any CS student are a severe hindrance to bring that diversity to tech.

Teach Processing or Python, make students create interactive apps on mobile phones with a visual or audio feedback thanks to a simple environment or language. They will be no less of a programmer if they succeed in creating a multiplayer mobile game in the space of a few month because you didn't burden them with malloc, pointers or null terminated strings and macros.

nostalgeek··on Apple Engineers Its Own Downfall with the Macbook Pro Keyboard
> What marketing studies? I'm talking about marketing results. Their ever thinner laptops remained at the top of best selling laptops in their price class -- selling several times more than the closest competitor ever since Jobs came back to Apple in 1999.

we're talking about phones here, not laptops and correlation is not causation, you didn't demonstrate what you state as a fact.

nostalgeek··on Apple Engineers Its Own Downfall with the Macbook Pro Keyboard
> It's easy: every time people had the chance to buy thinner or thicker products, they flocked to the thinner ones.

You'll need to back up that statement with factual sources, because clearly all Apple decisions aren't always backed by marketing studies because all their products are not always that successful.

I personally don't believe what you just said.

Counter example: bigger screens.

nostalgeek··on Our Vision for Rust and WebAssembly
> I would love to do frontend web development but the current high-churn Javascript ecosystem makes me dizzy; this is probably a naive question but will it be possible to do web-development without integrating in the Javascript ecosystem using WebAssembly and Rust someday?

there are 2 different things, there is the DOM/Web API and the language, Javascript.

Nobody forces you to use anything from the JavaScript ecosystem, not even node.js, in order to use the DOM. This complexity is totally unnecessary.

I personally settled on Typescript, nothing more. Its compiler gives me Javascript WITH static typing, and converts my code to a version of JavaScript that will run on the majority of the browsers, even internet explorer 8/9 or old Android browsers. No need for React,Angular, Webpack, Babel and all that stuff...

As I'm not writing games or photoshop in the browser I see no need to use Rust,C,C++ and the SDL just to write web apps.

IMHO some people ultimately miss the true usefulness and use case for WASM: making existing C,C++,... libraries available to Javascript developers, not replacing JS with language X or Z.

← PreviousPage 2 of 5Next →