Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Crismon2363yThis is not a discussion. Any application that is bigger than you and me will fail given time without a rigorous type system.
The thing I like about Typescript most is that you can opt out. In the case you use that power very wisely you can ignore where the type system causes problems but you know what you are doing.
If you have some self discipline its the perfect match between a eloquent type system and DX.
I am freelancing on a fullstack JS project and its like building a house with unprocessed rocks instead of bricks. -
@hobblin Indeed. Developers should be left with bare minimum number of rules to certainly follow, and leave everything else in care of automated tools.
-
jassole18393ythis is the thing I have been bitching about. A sane type system and functional approach. Watch my other rants, and the plebs coming to protect their jobs.
-
Crismon2363y@hobblin I think it does. Take a code guideline, peer reviews who give a fuck and a strict TS compiler and you are set.
Dont leave broken windows and trust your colleagues. Of cause anything that can be automated should be. I just wanted to say that you can get the benefits that JS provides and there are many but still build big stable FE & BE applications with it as TS. You just have to want to leave the type system better than you found it and not throw „any“ or bad type castings on anything red. -
@Crismon why yes, I think that's what he meant: don't trust one's self-discipline, it's a trap 🤥
-
hobblin2083y@Crismon i get what you mean, in my experience it does not work out as soon as you have any amount of new developers being on boarded and start loosing the old ones.
-
Shhhh, let the whole node react cominity think they actually CAN make maintanable apps.
Spoiler : no, they can't. -
@homo-lorens
It only fixes a part of the problem. (Using it in a current app and moving to abandon it too)
First, it’s fucking slow (The compile part, there are solution to make it better tho, like don’t put everything in public).
Second, the notation obj[“prop”] is still valid, even with strict (never tested my self) I think.
I’m all team Blazor now. C# with 0 lines of JavaScript. And the ONLY JS in app should be auto generated and not even committed to git.
I’m pretty sure other frameworks will catch up fast. -
@NoToJavaScript obj['prop'] is only valid if 'prop' is a known key of obj.
const k: string
obj[k]
is only valid if obj is defined to be { [P in string]: ... } or synonymously Record<string, ...> -
@NoToJavaScript C# suggests to fall back to dictionaries of preferably simple types if you don't know the exact set. With Typescript's conditionals and property expressions it's much easier to express complex conditions, which would be an uncheckable runtime null reference in C#. Oh, and Typescript is null safe. It forces you to null check if you define the variable to be a type to which you can assign null or undefined.
-
@homo-lorens
Not any more.
We now have switch on types and conditional checkings.
Like check this line (From current project, wrote like 5 days ago) :
if (line.FormatParams is {Length: > 0})
It does not matter what type FormatParams is (line was checked for null before) , as long as it has length property. -
@NoToJavaScript That's really cool, I should check out C# again. And yeah, TS without --strict is more like a typo detector, with it it's a statically typed null safe language with more powerful type descriptions than I've ever seen.
-
@homo-lorens
Oh you should check c# 10 (Coming in about 7 month)
No more name spaces (well, sotty, no more wasting 1 tab/4space each line for a namespace)
Global usings
Properties with auto generated backing field
And more
No, I’m not being paied by Microsoft, I just find they will FINALLY get it almost perfect with c# 10. Ok, records are still fuzzy and difficult to use, but it will come -
jassole18393yEntire software industry is doing a disservice to itself, by trying to hire low cheap skilled devs to someone who writes maintainable code.
When everyone creating the mess leaves, they can't replace easily. Nobody wants to maintain your horrible codebase, you fucking company, get over it. -
jassole18393y@iiii not really. Just cheap bastards.
Thankfully capitalism also pushes these companies out of competition in favour of someone more innovative. -
hobblin2083y@jassole yes actually. Capitalism (as is practiced) thrive on those willing to make short term profit and then pivot. Long term investments and/or companies that are profitable over long time (>15 years) are the exceptions, not the norm. A majority of business focus on becoming profitable year by year.
This is the process that makes the cyberpunk dystopic mega corps way too likely btw 🤷♂️ -
hobblin2083yAnd logically, if you need to make a profit this year you can't really focus too much on building something to be maintainable in 10 years.
-
hobblin2083y@iiii cyberpunk-adjecent more like it 😜 i think there are still ways for the situation to become worse...
-
jassole18393yYou are not telling me communism, socialism is the solution?
Companies need to focus on both long term and short term.
Middle managers are the problem as their incentive structures are focused on short term gains. -
@jassole I don't think anyone is suggesting a solution. If we go with the capitalist ideal of governing by incentive rather than enforcing a mindset then what we need is to reward long term success or make short term cashgrabs unprofitable. This is inherently difficult because users and investors will flock to anything new and shiny and you don't need anything besides users and investors to make profit.
-
jassole18393y@homo-lorens and that is fine. What we need is companies to be allowed to fail. Be bankrupt. Do shit work = bankrupt
-
@jassole Are we really going to allow a decade to filter out unsustainable companies for each individual market?
-
jassole18393y@homo-lorens I am libertarian believing in free markets. As you soon as you start to dictate how you reward others, and police it you become the new asshole
-
jassole18393y@iiii Not true. Some rich people become richer, and then they start influencing the government and bend the rules to their favour, lobbying (Corporate capitalism, this is the problem).
Don't confuse the idea of libertarianism. It is simple at its core. Free markets, free society, government functions to only provide judiciary, uphold rights. Not influence markets, capital flows. -
jassole18393y@iiii no you are convoluting different things. Free markets simply means ability to fulfil a demand with supply without restrictions in exchange for something. You have the freedom not to buy if you don't like what someone else is selling.
Simple market dynamics. -
@jassole So your flavor of libertarianism considers consumers supporting small businesses despite subideal deals an appropriate strategy to put an end to the wealth accumulation that is a natural property of all free markets?
-
iiii92263y@jassole and that free and unrestricted dynamics devolves into rich being the sole owners of everything. It's fancy and rainbowy only verbally but further analysis and empirical simulations show that it's not a utopia but quite an opposite.
In a free market strong eats weak. Regulations of the market are there exactly to prevent that.
And if you wanna have a live example: USA. The most free market in the world. Dominated by big corps. -
jassole18393y@homo-lorens only if they make good product. If they make shitty product for high price, no use to me.
-
jassole18393y@iiii Whatever, nobody is forcing nobody to buy their goods. If they won fairly, they won. You need brains and efficiency to be better than them. You can't blame the game.
-
jassole18393yThe moment you force me to use a shitty product just for the sake of business alive, thats no different than communism to me. I don't want to live that country.
-
hobblin2083y@jassole libertarianism always means the person with the, proverbial, biggest gun owning the land you stand on. It's fundamentally a pay to play game and if you can't pay you don't deserve to participate.
Late game libertarianism means that it's either taken over by fascists who use the ideals to avoid being criticized or that it's taken over by feudal lord's who in everything but name owns their workers.
Please look at your political view from a historical view and rethink it! -
jassole18393y@iiii Thats you small mind, producing useless thing nobody wants. And then bitching and moaning about not a fair game and a handout.
-
jassole18393y@hobblin I take it you are probably from US. US is not a centre of the world. Whatever shit US produces or associates it with, its not the truth.
-
jassole18393y@iiii Imagine using a product of free market, and complaining about it. Your example of government controlled market:
Housing subsidies -> Biggest financial crisis in 2008
Federally backed student loans -> More indebted students now crying out to cancel out loans lol.
If it were competitive from the start, you would never had this problem. Government distorts market. -
hobblin2083y@jassole what do you base that assumption on? (It's very wrong but it would be interesting to know why you would think it would work to dismiss my perspective)
-
hobblin2083y@jassole the free market only works if you fully incorporate the fact that people who can't afford something has no right to it. That's why libertarianism is fundamentally opposed to human rights 🤷♂️
Personally I believe that every human being should have the right to housing, sustenance and education. That is the only way for humans to be actually free. -
jassole18393y@hobblin under a capitalistic and competitive market, You would have contractors trying to provide the best service for a cheaper price.
What is currently happening right now, is government thinks it knows market best and is giving handouts to construction industry, which is one reason you have high property prices in the western world.
Same with telecommunications industry, their lobbying of government barricades other competition from participating in the market. You have associated entirety of free market to be bad, because you associate the monopolistic behaviour with capitalism.
Think of Elon musk. If he didn't receive any money, he would have not done SpaceX and let alone make Tesla cars. The vehicle/oil industry was very much against him, that is monopolistic behaviour not true capitalism.
Mandating market policies never works and any such society has ended badly and favoured capitalism. Hong kong, Russia, Korea to name a few. -
jassole18393yI have lived through half my life in the third world under different government (king monarchy, communism, but never a capitalist society), and migrated to a western country about 15 years ago now and there are endless opportunities for me.
But some reasons locals always complain about not having opportunity in the land of opportunity, whereas I pretty much started from scratch, supported myself through uni working different odd jobs.
Trust me neither you or I would want to go back, lol. If you want to know what slavery really means you should probably. Your hard work is meaningless there. You will enjoy it because "Kumbaya" and everybody is so much nicer outside US. -
hobblin2083y@jassole it's funny how you don't realize that capitalism is creating its own nobility and a pseudo-feudal society even as you claim that is not what you want to get back to.
The important thing to remember when defending "free markets" is that musk didn't do shit, he got colonial blood money from his family that he invested in others businesses, and in some cases he bought him self a "founder" status but he isn't the brain behind neither Tesla nor space x. His contributions is mostly money and PR. If anything he did was about creating a superior product he would be out on the streets. -
jassole18393y@hobblin Oh, CEO is so easy just throw just "colonial" money at random engineers and it works viola. This is the most retarded comment I have seen here. Bahahaha, lol. I am outta here. Got a startup to build, so I can create slaves ofcourse according to you.
-
hobblin2083y@jassole wielding a title and actually performing valuable work isn't necessarily correlated and if you can't figure that out I'm sure people will just love working for your enterprise 👌
Have fun and just ping me whenever you're interested in talking about all the topics in this discussion that you just ignored... Those where actually the important ones 😉
Related Rants
One of the most infuriating ideas in software development culture is that you can build maintainable applications without a strictly enforced type system and structured data.
Sure, it's more fun to wack around a dynamically typed system until it works or to write a major application with mutable datastructures... It's a least fun until a few years in and you have to debug an unexpected overwrite or a inconsistent use of an object property or whatever.
Anyone who writes maintainable code eventually figures out that you need rules and procedures, the issue with JavaScript, python, ruby, lisp, etc developers is that they think it's us developers that needs to enforce these rules instead of the compiler (which is infinitely better at it).
rant
software engineering
software development
immutability
dynamic-typed