News for hackers. Stuff that matters.

rubber_duck

Re:C++20 has been approved on Sunday September 06, 2020 @05:20PM (#24394769)
My point is that in a good code base types should be obvious from context. If you don't know the context then you will be slow (and make a lot of mistakes) no matter what the type say because you'll likely misunderstand the domain logic (context) unless it's something trivial. I would hate to work somewhere where I'm expected to randomly drop into micro services I didn't have anything to do with and debug/support them - sounds stressful.
Re:C++20 has been approved on Sunday September 06, 2020 @04:39PM (#24394476)
Pointless typing and verbose code has nothing to do with writing code - it's all about code being readable.

Java type declarations can be 20+ characers - just scanning through the code and having to skip all that junk makes my eyes more tired reading through. Types are implicitly deducible when you know the codebase 90% of the time (and should be added when they are not), and if you don't know the context you will be slow no matter what.

Re:C++20 has been approved on Sunday September 06, 2020 @06:57AM (#24390488)
I'm not saying Java should have introduced ground breaking features - I'm saying they made design mistakes that they should have corrected far sooner (var/type inference) and refused to add some basic features (lambdas) that would have made the code a lot better for it.

They did add those features eventually (Java 8) - about 8 years behind C# (since C# 3.0)

Re:C++20 has been approved on Sunday September 06, 2020 @06:53AM (#24390470)
Not really - Java designers were just plain wrong and it took forever to admit it - things like local type inference (var) made the language pointlessly verbose for ages, and simple features like lambdas made the standard libraries terrible.

There was a 8 year gap where C# users could use stuff like enumerable operators while Java users were stuck in the stone age of writing loops for collection manipulation in a high level language ...

Re:C++20 has been approved on Sunday September 06, 2020 @06:29AM (#24390364)
When you add those to the mix you're dealing with destructors, ownership, etc. so I don't see anything wrong with using stuff like unique_ptr/shared_ptr.

And C tends to reinvent object oriented programming with each library so you might as well use language defined classes.

So I don't really see the point.

You don't need to use stuff like concepts, or "showing off how smart I can be with template libraries" (looking at boost), but C++ has a lot of features that make it much more productive than C.

Re:C++20 has been approved on Sunday September 06, 2020 @06:23AM (#24390351)
>The Java strategy of being very conservative about what you add to the frontend would have done C++ a lot of good after C++11 (or even before that).

Java lost a lot of mindshare to C# and Kotlin due to that "strategy".

I'd guess there is there is too much money in it due to the fact that central banks killed interest rates and started buying government bonds as needed - where pension funds would hold those they now need to search positivie returns and there's just not enough good bets there - would explain why the valuations are sky high
> and someone brings up the fact that ISIS used one of them...

They used Facebook, Twitter and YT for propaganda and Gmail for coordination (that thing about saving a mail draft on gmail instead of sending it), it's obvious the other side isn't using logic to make the argument (but beliefs, feelings or simply pushing an agenda) so using logic to argue back is pointless.

>Yes, it gains you some of the economics of factory construction and that you can start small and scale a location, but on the other side you lose that again because you lose the economics of scale that traditional PWR gets.

You mean they lose operational efficiency ? Economies of scale come from the ability to mass produce.

You forgot to mention the largest differentiator - eliminates the possibility of a global catastrophe.

Thing is this kind of design benefits massively from economies of scale, same kind of thing that has drawn the price of PV down and other green energy.
>As I said in another thread, the problem is not writing the SQL. The problem is everything else after you have written it (applying on deploy, automating for other's dev envs, rollback, etc)

What's wrong with migration managers ? They handle all you mentioned just fine. The only problem I've seen with this approach were when working on a team that didn't have proper CI flow, then it was possible for people to check in bad migrations and screw up branches, etc.

I've worked with both approaches in multiple languages, and frankly I prefer the no-magic migration manager approach.

Migrations automatically generated from model also mean your DB is tied to your app, which I'm not a fan of, if anything the reverse should be true, and the fat model approaches of rails are terrible IMO (I haven't used Django for anything serious in over 10 years so I don't remember how fat their model layer is - I know it has enough metadata to generate the admin CRUD but don't remember if it also encourages having logic on models).

The best solution I've seen is F# which uses dynamic type providers (basically compiler plugin) to auto-generate models from DB/schema at compile time, and yesql in clojure (clojure being dynamic and built arround working with data using SQL results inside of it is natural and amazing).

Re:Nvidia Unveils GeForce RTX 30 Series GPUs on Tuesday September 01, 2020 @04:43PM (#24346841)
IMO watching a few sci-fi movies in 4k+ looks ridiculous - I start noticing the difference between CGI environment and actors and it kills the immersion completely, it goes from "that character is really there" to "this guy is larping in front of a green screen"
Re:Italian Ruby on Monday August 31, 2020 @10:11AM (#24331610)
> I am really stoked for the future of programming languages, when localization is just a matter of translating some words.

My experience with localised codebases (in my native language) have been horrifying - like it or not terminology is developed in EN, you either get unnatural sounding "borrow" words and the translation is pointless or worse you get people coining new terminology nobody but them understands. Not to mention fragmented communities, knowledge bases, etc.

IMO localised codebases would be a regression not progress and I dread every time I see Chinese in a codebase (simply because they are a large enough market to split the dev community)

>Simply, if a restaurant offers 20 different dishes, it means each dish gets 20x less attention than if you had only one choice. Less fresh ingredients, less time perfecting the recipe and preparation. Serving only one dish makes things simpler and the restaurant is going to spend more energy making sure it is worth it.

One of my favourite places has a decently sized menu (would say 40 items on there including starters/sides/deserts) while they aren't "the best" at anything, it's really good and I love the atmosphere.

I like the flexibility and that I can invite anyone there since the selection is varied and quality is reliable. I can't call my vegan sister to a smokehouse even if their ribs are the best I tried, can't take my wife to a fish restaurant but my friends could be in the mood for fish, I have no clue what my in-laws will want to eat when I have to take them somewhere, etc.

Re:Melancholy of obsolete futures: on Soviet Brutalism on Sunday August 30, 2020 @10:07PM (#24327858)
You make a good point !

The thing I would put on communism is reduction of wealth and standards, so when the west rebuilt and went forward we got stuck with concrete slabs.

It's just shocking to me how the architecture and aesthetics regressed and never really recovered.

Here's an example of a building from 30s that I would consider built for common folk but inspired : http://www.lokalpatrioti-rijeka.com/forum/download/file.php?...

It's not grandiose - but it follows the hill line and the corner perfectly, it has distinctive visual elements. Compare it to that concrete slab you see in the background which the city is full off.

Re:Multi-Tenant Architectures on Sunday August 30, 2020 @09:18PM (#24327572)
True, I'm just not sure that I'd trust the DB isolation once the user has SQL injection. I never saw a SQL injection report on a project (well since the PHP days) ORMs solved this for the most part, but I did see multiple instances of accidental data leaks from bugs on different projects.

It looks like you could also use SET SESSION AUTHORISATION for this but I haven't used it so I don't know how this works with data access/pooling

Re:Multi-Tenant Architectures on Sunday August 30, 2020 @07:08PM (#24326792)
Well if you have SQL injection bugs then you have bigger issues to worry about - I've used this to enforce multi-tenancy on database access level (like another poster said - preventing queries accessing wrong data by accident, which is far more common I think).
Re:Multi-Tenant Architectures on Sunday August 30, 2020 @05:50PM (#24326215)
>That makes connection pooling difficult and presents its own security issues on limiting the tenant to only their DB user.

Can you use SET LOCAL ROLE <user> on each transaction ?

My uneducated gut feeling is that the only way nuclear is going to be relevant is if they perfect micro-nuclear reactors.

I remember reading about these 10 years ago [1], and have seen a few more since. Basically they propose small "nuclear batteries" kin of design - this avoids catastrophic scenarios and benefits greatly from economies of scale.

The only issue I see with this approach is political - you would have a lot more nuclear material spread around, spreading this kind of teach where it's easily accessible and hard to protect doesn't sound reasonable with the political situation in the world.

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

Re:Remote Code Execution in Slack desktop apps on Saturday August 29, 2020 @01:39PM (#24317866)
That's kind bad - first of all 50$ can be really low depending on the region, but more importantly this disregards the time spend on looking for exploits that don't pan out.

So I would multiply that 50$ by at least 4.

But still like the other said bugs should pay by severity not by time spent.

Re:Melancholy of obsolete futures: on Soviet Brutalism on Friday August 28, 2020 @12:45PM (#24307004)
Not really true - there are plenty of buildings for the common folk from say 1920-1950, large apartment complexes where your middle class people would live. They aren't grandiose but the level of attention to detail, design and fitting into the landscape is unmatched by anything from the Communist era. I'll dig up some example photos when I get home.

The real problem is how uninspired everything from the Communist era is - dirty industrial buildings, concrete slabs randomly thrown all over the place, built with terrible quality control.

It really feels like it went from being a part of the civilized world (it was an important natural port for a long time in history for Austria) to a depressing city of old poor people slowly dying away - and there is so much potential there - the coastline is beautiful (industrial pollution can be cleaned up since the industry is also mostly dead), on a river bed and sunk in between hills (next to Opatija which was a summer place for monarchs). It has all hallmarks of a city and could be turned into an amazing place to live - but the people and the mentality left over from communism just make this impossible - there aren't enough quality people.

Re:Safari adopts the Chrome/Firefox extension model on Thursday August 27, 2020 @11:49PM (#24301177)
> it's such a huge improvement I can't imagine going back

In what way ?

Re:Melancholy of obsolete futures: on Soviet Brutalism on Wednesday August 26, 2020 @02:32PM (#24285657)
I find it funny that anyone would romanticises socialist architecture. I've grown up in a port town in former Yugoslavia (Rijeka) and if you walk throughout the city it's obvious the communist revolution was a regression in standards of living and cultural/technological sophistication.

A lot of the buildings from the early 1900s look impressive even today (despite being terribly maintained) - when you see the level of detail, luxury and attention to craftsmanship it's obvious that those people are not of the same kind that lived there later. Communism started by "socialising" the property of previous owners and exiling/killing them - the new owners were not fit to govern them.

This is also what happened post civil war - "privatisation" ended up with generals and people with political collections acquiring major companies and then running them to ground with incompetence, or zombifying them at the expense of public spending.

That's not much of a value gain it would just push the industry further away from ARM. x86 has a lot of legacy power and it enjoyed being the only relevant platform for a long time in a lot of markets so there's a lot of cost in making stuff that was architecture specific cross platform. ARM doesn't really have that, people that deal with ARM already have to worry about infrastructure set portability (all of them also have x86 support) once you add ARM the way is open for other ISA
Re:Automotive Grade Linux on Monday August 24, 2020 @10:36AM (#24261078)
>That said, no matter which way you skin it, if you increase complexity then you increase risk.

This isn't really true, for eg. if you add redundancy technically you increase the complexity but also reduce risk (point being complexity will also be introduced when making the system safer, simplification just makes analysing and screening for bugs more effective, but there are other risk factors)

I don't know enough about Excel but I highly doubt it's about the looks - I have Office installed on my MBP and the ribbon looks like I remember it from Windows.

I don't understand your point - non-native widgets are not a deal breaker and there are plenty of examples, Electron being the most common non-native cross platform framework recently (it has technical limitations but even the subpar performance doesn't make it a deal-breaker). So it's possible to create cross-platform UI frameworks and most of the the most successful apps I can think of are using some version.

Umm - a large group of most popular productivity apps are cross platform and look nothing like native - from dev tools like IDEA, VSCode over Slack, MS Office, to multimedia tools like Adobe tools, almost all 3D modeling software like maya, max, audio software like Ableton, FL. None of the apps I use on a day to day basis look native (ie. like the apps provided by Apple)

You are confusing cross platform UI with frameworks that have programmer art widgets and no cross platform polish - eg. GTK+, FLTK, and even to some extent QT widgets (and many more). When people say widgets don't look native they usually mean "the widgets suck", you can create beautiful cross platform apps - Electron has quite a few because it allows standard designer tools from web dev.

Flutter is another promising development, but the desktop port seems underwhelming - it's obvious the widgets were intended for mobile apps, they will probably need a custom widget set to cover desktop UI - but the approach is sound.

> a false sense of security

You mean placebo effect ?

Uber is a different story, competition is a lot easier and it already exists all over the place (Uber isn't even that profitable which proves this, meanwhile app store is printing cash)
The store should set it's policy, law just ensures equal rights and review process for developers

Older »