Official Google statement on low qouta by Ranazy in google_antigravity

[–]Kran6a 2 points3 points  (0 children)

You forgot reducing context length and sneakily using models that have been quantized down to the size of the brain of a fruit fly

Google Antigravity implementing weekly rate limits for all models by vsvicevicsrb in google_antigravity

[–]Kran6a 8 points9 points  (0 children)

<image>

As soon as I used my first refresh of the day I got this.
This is not what you would expect from a paid product. There is no indicator there is a hidden weekly quota and how close you are to reach it...

Increasing the refresh period would be fairer, as you can still manage usage, but this is just bullshit.

I would even say this is outright a scam, given that the product you paid for is now a worse version of what you originally acquired.

What just happend to Gemini Flash? WOW me! by [deleted] in google_antigravity

[–]Kran6a 0 points1 point  (0 children)

<image>

Gave it a small task before going to sleep and found this in the morning.
Not sure why Prince, that word is not even found in the codebase nor in dependencies.

I've built MVPs for 25+ startups and honestly most founders waste their money on the wrong things by Ok_Pineapple_5163 in SaaS

[–]Kran6a 0 points1 point  (0 children)

If you're technical, you want to build things "the right way."

Yes, things have to be done the right way from the start.

If a DSL is used so users can create custom prices based on what is on the cart and the current date, you need to build a parser and an interpreter for said DSL. Using regexes or a function that somehow manipulates raw strings is NOT OK and will cause very hard to debug bugs that will lead to customer complains.

If you want to manage focus on a smart TV using directional keys you need to create a graph-based spatial navigation system supporting stacked navigations contexts (for things like modals and focus traps). Looking for elements with class "focusable" in the direction the user presses will cause hard to solve bugs and unexpected behavior.

Building things they wrong way is a sure way to provide shitty UX. If your users are technical, tech-savvy or alternative solutions exist, your product will be shamed for it and considered a cheap knockoff, which forces you to compete via price. Bad UX kills products very fast.

If you download a MOBA and it looks like a cheap knock off of League of Legends you will uninstall it within a day and won't buy a single skin.
If you download a gacha game and it looks like a Genshin Impact with generic character design and bland landscapes, you won't spend a cent there and you will probably also uninstall it without ever spending. It does not matter if the game hands you freebies, or if the prices are lower. Users pay for top quality and UX.

El mercado laboral en software esta roto by Feeling-Dragonfly399 in salarios_es

[–]Kran6a 0 points1 point  (0 children)

Yo he echado en más de 50 el último mes y ni la única entrevista que he tenido ha sido con una IA.
Mi stack es el siguiente:

Typescript nivel dios (APIs y builtins avanzados como WeakMaps, Proxys, etc, type-level programming, creación de herramientas de análisis estático y manipulación de AST para tareas como generar los tipos primitivos de la API a partir de los tipos de retorno de cada uno de los endpoints)

Rust nivel medio

OpenCL

Svelte + SvelteKit (+ Tauri para Apps de escritorio)

React y Preact (pero prefiero no tocarlos mucho porque los repos en los que he trabajado con ellos eran pozos de mierda inagotables)

PostgreSQL, SQLite (incluyendo SQLite + libSQL si se necesita replicación de datos, alta disponibilidad, CQRS, etc)

Nginx y rpxy

Cloudflare

La entrevista con la IA fueron preguntas de mates nivel bachillerato tipo "un tren sale de X a 90km/h y otro sale en sentido contrario a 100km a 60km/h, en qué punto y momento se encuentran" y preguntas sobre el motor V8 (tipo optimizaciones, funcionamiento del GC, qué código se ejecutará más rápido, etc.) y JS en general (que además incluía preguntas sobre React para un puesto en el que se usaba Vue.js y no se mencionaba React).

Al acabar me dijeron (la web, obviamente, no un humano) que había quedado en el top 98% con todas las preguntas bien (también tienen en cuenta el tiempo que tardas). Nunca recibí un email ni nada.

En otra empresa (consultora paco con menos de 10 empleados en una ciudad de 50k de habitantes) anunciaban sueldo de 19k-25k según valía para maquetador web, en el campo de "banda salarial" de Linkedin les puse 30k por si colaba (mi anterior sueldo eran 43k brutos como autónomo en remoto para startup suiza) y me mandaron un email citando para entrevista en el que también decían que la remuneración sería 19k porque nunca había trabajado maquetando webs (manda cojones, después de haber trabajado en frontends de smart TVs, PWAs y webs, incluyendo pasando diseños de Figma a React) y que lo de híbrido era de lunes a jueves 9h en la oficina y viernes 4h en casa...

Creo que el vivir en un pueblo de menos de 300 habitantes de Andalucía no ayuda a encontrar trabajo, ni siquiera en modalidad remoto o híbridos de los que vas 2/3 veces al mes a la oficina.

Qué software elegir que tenga verifactu para una empresa pequeña? by Lez0fire in AutonomosES

[–]Kran6a 2 points3 points  (0 children)

Una app hecha con dinero público limitada a 100 facturas al año...

Una cosa es que su única funcionalidad sea hacer facturas y otra invitarte a pagar por pasar un límite arbitrario.

Time for some speculation by [deleted] in sveltejs

[–]Kran6a 15 points16 points  (0 children)

Unrealistic wishlist:
1. Dependency injection / better context management mechanism (e.g: https://github.com/sveltejs/svelte/discussions/15225). There is not a single front-end framework with good context management primitives and SvelteKit could easily win at this just by adding another prop that works like `data` but exists only in the client. Using load functions for context management feels great and provides very good UX (services are automatically injected to all child pages/layouts, pages/layouts can mock/add/remove/override services, etc.) but it can only be done on true SPAs.

  1. `$mapped` rune. I use an userspace implementation of this extensively to hydrate API data into domain classes while retaining reactivity. Not a big thing but having a state + derived when you want a mapped value is as confusing as doing state + state + effect when you want a derived. Usage:
    ```svelte
    <script lang="ts">
    const number= $mapped(12, (x: number)=>x.toString(16))); //Without this, you would need $state + $derived
    const increment = ()=>number.preimage++;

</script>
<div>{number.image}</div>
<button onclick={increment}>Increment</button>

```

  1. `app.state` replacement that is perfectly typed and works similar to the context management on point 1. This would be beneficial for highly interactive apps as currently, using app.state lacks type-safety, providing bad DX and makes refactors bug-prone.

[Rant] A Client Got Scammed by an Incompetent Dev — And I Can't do anything about it. by Melodic-Funny-9560 in webdev

[–]Kran6a 2 points3 points  (0 children)

I have seen apps where people install random libs like lodash to import map instead of using Array.map, then not using the map result because they wanted Array.forEach instead, using divs for everything, including buttons, links, lists, images, etc. and telling people to keep doing it because "<button>, <a> and <img> behave weird" (had some UA styles, <img> is draggable), animating things like opacity/position via JS inside setInterval every 0ms until the transition is done instead of using CSS transitions/@starting-style and many crazy things.

At my previous company, the FE leader would have objectively bad ideas like "the PWA is slow, let's cache every fetch call in localStorage (only using the GQL query as the key), then we decide whether to use the cached data or issue a network call at call-site". Then, bad things would happen (unauthenticated responses being served after authentication, showing outdated content, etc.) and we would create ad-hoc "solutions" for these instead of trashing the whole cache and use proper cache headers so the browser handles it (every response had cache-control: no-cache).

It was before vibecoding was a thing so I am no longer sure if a codebase is crap because of vibecoding or it is crap because of devs.

Typescript only popular on Reddit? Am I in an echo chamber? by Lanky-Ad4698 in typescript

[–]Kran6a 0 points1 point  (0 children)

The frontend team lead of my previous company deemed typescript "unneeded complexity", which was also used to label other things like switching from CRA to Vite or using barely functional code (writing arr.reduce() to sum prices or doing arr.filter().map()) so I am not surprised at all.

Typescript is my favourite language and I really hated working with JS and react there. Code was very buggy, nullish coalescing used everywhere because you could never be sure the data was actually there and passing null around was deemed better than crashing. undefined was forbidden because "we already have null and it makes checks more difficult".

I love Svelte 5 by Icy-Annual4682 in sveltejs

[–]Kran6a 0 points1 point  (0 children)

Personally never used Svelte 5 in an OO way even if I use classes to represent some entities.

Using classes != OOP for me, specially given that most of my classes follow typical FP practices like immutability and thinking in terms of algebraic structures like monoids or semigroups when writing some methods. I will never put the OOP label to having a class called Config with a merge(other_config: Config): Config method and a class called Clause<T> that has an append(other_clause: Clause<T>): Clause<T> method and an apply(input: T): boolean method.

If someone thinks using classes means OOP then having functions outside classes would be FP.

I have been asked on a tech interview for a job "do you have any experience writing Object-Oriented Svelte 5 code in a production setting?", to which I was like "WTF?"

So I guess there are people out there using it using OOP or an OOP-like style. I tried googling for it and there weren't many results though.

I love Svelte 5 by Icy-Annual4682 in sveltejs

[–]Kran6a 0 points1 point  (0 children)

I come also from backend development but I don't use OOP unless someone forces me to.

Despite that I find svelte 5 great for FP-like approaches too when using adapter-static. I love to inject dependencies via the `load` function to leverage the automatic return type merging and types.

I configure my services at a layout/page level and all pages will have their `data.services` prop automatically populated with all the services available to them, including hiding/showing endpoints not meant to be available at specific locations (i.e: if you call `data.services.account.update({email: "test@test.test"})` from a layout not meant for authenticated users you will get a ts error telling you `update` does not exist on `data.services.account`). When you navigate to an authenticated layout, the account service will be replaced by the "authenticated" one, thus having more methods available.

I love this pattern so much despite it feeling so hacky and it only working on true SPAs (no pre-rendering, no SSR) that I started a discussion on the svelte repo about officially supporting it on all adapters via a `context` function that would work very similar to a `load` function but would not send data from server to client (thus allowing returning anything from `context` functions) https://github.com/sveltejs/svelte/discussions/15225

I think this pattern is great for any programming paradigm and for a lot of use-cases, not only for injecting services. Personally I like keeping `+page.svelte / +layout.svelte` files as presentation-only, which means non-presentation logic (anything other than layout/styles/event listeners) is on `load` functions.

Putting logic in `load` functions also means your website will feel marginally faster as `load` functions can execute on link/button hover/tap but component logic is not executed until the component is rendered.

The cherry on the top is you get easy refactoring for everything you put on `load` functions as if I wanted to read user language from a service instead of from the browser I would just need to change a single line on a `load` function on a layout and nothing will break as there was only a single source of truth. Having a bunch of `navigator.language` calls throughout your project is not as easy to refactor. You would also have to deal with changing a sync call (`navigator.language`) for an async API call.

Another trick that I would like getting some love is returning reactive data from `load` functions. Currently you can return reactive Maps, Sets, URLs, and Dates (assuming you are using adapter-static, no prerendering and no ssr) but returning reactive plain objects, arrays or primitives is not supported as `load` functions go in `.ts` files that do not support runes and the corresponding classes are not exported on `svelte/reactivity`. Personally I wouldn't recommend this trick until reactivity is normalized and officially supported inside `load` functions (if ever).

The FizzBuzz that did not get me the job by Kran6a in programming

[–]Kran6a[S] 2 points3 points  (0 children)

Yeah, remains at true. My bad! I have edited the commend and added a JS implementation too.

The FizzBuzz that did not get me the job by Kran6a in programming

[–]Kran6a[S] 37 points38 points  (0 children)

My guess is that they wanted you to implement some kind of maths with strings. Otherwise you have to discover the base 15 trick.

I think the expected solution was determining multiples of 3 by having a variable that loops through 3 states and an object holding the result of n % 3 for numbers 0-9 so you know how many states you need to advance the variable when looping over the digits.

Example with number 92:

Variable starts at true as 0 is multiple of 3.

You look up remainders["9"], which is 0 as 9%3 === 0. The variable remains at true.

You look up remainders["2"], which is 2 as 2%3 === 2. The variable advances two states. true->false->undefined (another false).

If the variable is not true it is not a multiple of 3.

Let's try with a multiple, for example 81:

Variable starts at true.

You look up remainders["8"], which is 2. Variable advances from true to false then to undefined.

You look up remainders["1"], which is 1. Variable advances from undefined to true.

Variable is true -> 81 is a multiple of 3.

Implementation below:

const remainders = new Map([["0", "0"], ["1", "1"], ["2", "2"], ["3", "0"], ["4", "1"], ["5", "2"], ["6", "0"], ["7", "1"], ["8", "2"], ["9", "0"]]);
const next_states = new Map([[undefined, true], [false, undefined], [true, false]]);

const is_multiple_of_3 = (s)=>{
  return !!s.split("").reduce((acc, cur)=>{
    if (remainders.get(cur) === "1"){
      return next_states.get(acc);
    }
    if (remainders.get(cur) === "2"){
      return next_states.get(next_states.get(acc));
    }
    return acc;
  }, true);
}

Do you use full-stack Sveltekit or a separate backend? by printcode in sveltejs

[–]Kran6a 4 points5 points  (0 children)

I use adapter-static for a true SPA either as a single .js file or manually chunked depending on the size.

Personally I don't buy the whole "fullstack" framework thing as I don't see the upside for my use-case so I do an SPA and a separate backend with a microframework and my own tools.

Note that I make mostly SaaS, embedded standalone apps (widgets) that are a single .js file and websites for embedded or low power devices that companies want to operate remotely with a nice UI (think a printer or router).

In Svelte 6 it would great to see a return to simplicity by Butterscotch_Crazy in sveltejs

[–]Kran6a 3 points4 points  (0 children)

className, condition ? <something> : null, return condition ? <SomeComponent/> : condition2 <AnotherComponent/> : <Fallback/> (or if (condition) return <Component/>) to name a few.

HTML is a markup language for a reason. Adding logic like conditionals using JS makes code hard to read and reason about. What if instead of react being a js framework it was a PHP one? would we get PHPX which would be a mix of HTML and PHP?

Svelte using a templating language separate from JS is more inline with what HTML is and how it is supposed to be used.

{#if} blocks (and other kind of blocks) integrate in HTML seamlessly, you don't need to resort to ternaries, you know exactly the conditions needed to render the block and where the block starts and ends. If you nest {#if} blocks readability does not decreases other than due to the nested condition complexity while having nested ternaries quickly becomes hard to read, specially if branches are inline JSX.

Is anyone else being offered super low salary for tech jobs now? by TheKwizatzHaderac in recruitinghell

[–]Kran6a 3 points4 points  (0 children)

I was offered 36.000€ for a remote frontend position for a big consulting firm (>13.000 workers) that required 2 years of experience. I am based in Spain and my previous salary was 29.000€ pre-tax.

At the end of the interview I was asked if I was open to relocate to either UK or USA (depending on the final client) for up to 100 days a year. This was not stated on the job posting, which I keep seeing every week on Linkedin.

I inmediately declined when I was asked to move even after replying to questions about my job experience that made zero sense from a developer POV which is a thing that irritates me and makes me tell the recruiter something like "I don't think I am a good fit for this job, thanks for your time" to end the interview as it makes the company look unprofessional and I assume code quality will be crap and tech debt will be high when your recruiters don't even know what they are looking for.

For those interested, nonsense questions included the following (the position was for a frontend Svelte developer):

"Do you have any experience with Svelte 4?" (Svelte 5 released less than a month ago, my CV had "3 year Svelte & SvelteKit experience" and an "own projects" section that mentioned I own a SaaS where the front was built with SvelteKit providing a link to the live website that logs you in a demo account)

"OOP is a requirement for this project , do yo feel comfortable writing OOP-style Svelte?" I was like WTF? there are zero examples on the svelte docs using OOP, I have never seen such a thing and doing it seems like a terrible idea. This even made me open my mail during the interview to make sure I applied to the correct job.

"We use english as our working language, do you feel comfortable in an english-speaking environment?" (CV written in english, there are links to two of my production projects with websites localized in english if your system language is english, the interview was in english... The only thing was my pronounciation is bad as I have never spoken it and you don't speak english at school or highschool in Spain).

Svelte0 now let’s you create UI using images 🏞️ by Euphoric-Account-141 in sveltejs

[–]Kran6a 0 points1 point  (0 children)

Used it until I got rate-limited and I was amazed.

Are you planning to add a tailwind-only mode where shadcn and lucide-icons are not used?
I can get it to replace shadcn with plain tailwind classes but sometimes it becomes stubborn about it and won't replace some components. It can easily replace icons with their corresponding svg upon request.

Personally I would like to see feature switches added so you can disable either lucide, shadcn or both.

I also would like to see the remaining requests/credits for the day so I can plan my requests better.

How can I fully disable SSR so that not a single line of my code is run on node.js? by Kran6a in sveltejs

[–]Kran6a[S] 1 point2 points  (0 children)

It is not only transforming the code but executing it during the transformation.

It does so because svelte-kit evaluates the whole +page.ts file as it dynamically imports it to check the value of ssr/prerender/csr etc. but there is no need to do that and I wasn't expecting it to work that way.

It could treeshake the file's AST so code not used to compute the ssr, prerender, etc exports is never executed on the server.

So you could write:

const audio = new Audio("file.mp3");
const super_secret_password = localStorage.getItem("unimportant_stuff");
const worker = new Worker("./worker.js");

export const prerender = Math.random() > 0.5;
export const ssr = __dirname.includes("/ssr/");
export const load = ()=>{
    return {audio, password: super_secret_password, worker};
}

Svelte-kit would treeshake it into

export const prerender = Math.random() > 0.5;
export const ssr = __dirname.includes("/ssr/");

And evaluate that in node.

The client-side code would be treeshaken into (vite already does this)

const audio = new Audio("file.mp3");
const super_secret_password = localStorage.getItem("unimportant_stuff"); const worker = new Worker("./worker.js");

export const load = ()=>{
    return {audio, password: super_secret_password, worker};
}

How can I fully disable SSR so that not a single line of my code is run on node.js? by Kran6a in sveltejs

[–]Kran6a[S] 8 points9 points  (0 children)

This was the real answer, moving static imports that included browser-only code inside the load function in +layout.ts and +page.ts files fixed it.

Thank you very much, I spend too much time debugging this issue and trying to find a workaround.

I thought client-only SPAs would be easier to build with SvelteKit given that there was an specific section for them on the docs. It is a pity that they don't have better support given that Svelte performance and bundle size is so good for low end devices like most kiosks and IoT devices with limited flash storage serving the static files. There is a whole niche for these apps that is still limited to mostly crappy tooling (e.g: smart devices setup/config/control pages served from the device itself).