#programmers-off-topic
1 messages · Page 32 of 1
Yeah, the division is less of an issue than the iterator overhead
I just find it funny that this code runs faster than the other code. ```cs
int[] NumberArray(int num) {
if (num == 0)
return new int[]{0};
var numSpan = num.ToString().AsSpan();
int len = numSpan.Length;
int[] digits = new int[len];
for(int i = 0; i < len; i++)
digits[len - i - 1] = numSpan[i] - '0';
return digits;
}
That subtraction is some JavaScript tier nonsense
You're sure that it's faster? Converting an integer to a string has to do pretty much all the same work, plus the work of allocating the string and looking up character equivalents (very trivial work, but hard to see how it could end up being less overall).
Tested with numbers of every length. ```cs
static int TestValue = 1234567890;
[Benchmark]
public void BenchmarkDemo1() // Benchmark methods must be public.
{
int x = 0;
foreach(int val in Number(TestValue))
x += val;
}
[Benchmark]
public void BenchmarkDemo2() // Benchmark methods must be public.
{
int x = 0;
foreach(int val in NumberArray(TestValue))
x += val;
}
At least it has way more memory allocation so it isn't just better in every way, lol
If that shitpost was better in every way I would be very sad for C#
The implementation lives here: https://github.com/dotnet/runtime/blob/d2c458727ea78f8ff427d498842866a1f53ea5a1/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs#L1680
There's a lot going on with caching, inlining, unsafe code, etc., so it's kind of noisy, but if you don't get one of the happy paths then you end up here: https://github.com/dotnet/runtime/blob/d2c458727ea78f8ff427d498842866a1f53ea5a1/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs#L1657
Which is... a DivRem implementation, same as the first one chu/e posted.
Profiling stuff like this can be a challenge because so much depends on the inputs chosen, the jitter, the GC, and all kinds of esoteric stuff I know exists but don't really understand that well like CPU caching.
That said, if I had to try to design a benchmark for this then I'd probably start up a random seed, generate 100,000 random integers, and run each of the cycles several thousand times with each method. And then run the entire benchmark 5 or 10 times to make sure the results are consistent. Should at least come close to a repeatable answer.
(Fun fact.)
There is no division here
Sure, you see two. But the compiler will easily make that multiply and shift
It will do that with the lookup version too of course, since it's all division by constants.
But yes, that is technically correct (the best kind of correct).
Khloe is probably right that the enumerator overhead cancels out any gains from a lookup. That being said, the code isn't doing any of those things on every draw call, it's only doing them when the value actually changes. Which is a whole assload more efficient than Stardew's version which does that horrific Math.Pow implementation on every single frame. (Maybe the compiler knows how to optimize that, but I wouldn't trust it to)
I don't actually know the context lol
I am reasonably certain he was referring to this as context: https://github.com/focustense/StardewUI/blob/master/src/Widgets/TinyNumberLabel.cs
Which is the replacement for Utility.drawTinyDigits
And I'll admit it's maybe a silly optimization given the context. Though it's not like it cost a lot to implement anyway.
Yeah, if it's cached it's probably irrelevant
Have you looked at the implementation of drawTinyDigits though? It's... fun.
Hey, randomly deciding you need to use raw ascii for something is always fun
I have!
So I think my mental frame at the time (though it was 2 months ago) was something like: "well, I'm sure as hell not going to use that implementation, so I'll just go with the fastest one I know". It didn't really occur to me to compare, benchmark, worry about the exact speed vs. simplicity, etc.
It is, and SDV's isn't caching, it's doing that work on every draw.
In the grand scheme of things, is it going to cause jank? Well, probably not, but all these little things add up.
(and this is why a 10-year-old game still lags on a 1-year-old PC)
All this talk about caching made me realize that I just added another invalidation bug yesterday. I really need to come up with an analyzer that verifies, "if you check some flag here, you need to clear it there".
production ready
Upon reflection the actual diff between what I did and what focustense did is that I was output digits in little endian order
Coding boot camp recs?
spans are witchcraft
they're starting to feel like some kind of performance hack
throw in a span and even if it feels like it would never be faster it will somehow be like 3 times faster
I just realized this is actually pretty topical for a recent conversation even though this was unrelated
That's why the .NET reference implementation figures out the number of digits first to allocate the string, and appends them in reverse order (IIRC).
mutable strings?
there's no mutable string type is there
you could do that I suppose, once again through spans
that feels like a code smell though unless you're really hyper optimizing
I am a little salty
my work recently introduced a step to our pipeline where SonarQube analyzes our PRs and adds comments for things it believes we should fix
one of those things is to switch away from LINQ methods to list/array specific methods
this used to be good advice but as it turns out, from my testing anyway, the LINQ methods are(as of the .NET 9 previews) generally faster than the type specific methods
they let Stephen Toub loose on them and now the linq methods use spans everywhere
they did not let him loose on the type specific methods
One day we'll have a simd accelerated dictionary
Pretty insane
benchmarks could definitely be improved
a lot of this is actually the cost of allocating a new list for the result
an int
gonna do a test where the Where/FindAll methods actually return an empty list
should minimize allocations on that front
wonder what that does
tbh the test is inherently flawed because FindAll always returns a List<T> which isn't optimal to begin with but I'm also sticking with that in the Linq version for fair comparison
alright here's a version where the resulting list of the queries doesn't contain elements
interestingly the FindAll has fewer allocations in this scenario
but it's slower nonetheless
FindAll with reference types seem to scale really poorly if there's a lot of results
Does findall always allocate
.NET 9 vs .NET 8 for a list of 1000 elements where exactly 1 element matches
Where got a serious glowup
When do we clone stephen
this is the benchmark code btw if you see anything that should be changed
hopefully soon
There used to be a little-known feature in the Windows Forms text renderer that could mutate string contents. I'm pretty sure it was removed.
How notably?
don't remember. Might give that a quick test later
I haven't looked into it very much
Faster than ImmutableDictionary?
I believe it should be
I'll give it a test after I finish this one for Exists vs Any
jesus
Exists vs Any for .net 9 vs .net 8
That's awesome
in both cases the one that matches is right in the middle of a list of 1000 elements btw
alright lemme try out the dictionary stuff
Ha, I didn't even know there was an Exists method, for the longest time I've been using FindIndex(...) >= 0
doubt there is much of a difference
I'm sure it's the same underneath, yes.
Guess it's time to switch back to Any which I like better anyway. Though that's only for the newer projects... anything still stuck in .NET 6 is another story.
How on earth is the immutable dictionary the slowest? Is this for creating or for lookups?
lookups only
Mind you, although a 50% improvement is nothing to sneeze at, it's not as dramatic as the 80-90% differences in some of the other cases.
added ConcurrentDictionary even though this is very obviously not the intended usecase for it
though FrozenDictionary is also thread safe
Can you also do tryget
For a value not in the dictionaries
The tricky thing about ConcurrentDictionary is that it actually can slow down a bit during concurrent operations. But it's always been more or less equivalent to Dictionary in terms of lookups.
The moral of the story is... don't use ImmutableDictionary ever, apparently.
I assume it has some niche usecase but yeah
running TryGetValue now
for non-existent key
Ah, it's got a ToBuilder method, that's why.
So you can create an immutable dictionary, convert back to a builder, add one or several keys, and then make a new immutable dictionary relatively cheaply.
the way functional programming intended
With regular/frozen dictionary you'd have to recreate and repopulate an entirely new dictionary.
I am on the CPS team in Visual Studio and are benchmarking bottlenecks that affect solution load and a big contributor to the slowdown is Immutable collections. Instead of switching out the collect...
So yeah, if you've got a dictionary of a million elements and actually need immutability then it's still better, but only in that specific case.
uh
I feel like my test has to be flawed
oh
yeah ok gotta fix this
I got this which makes no sense
that's make TryGetValue faster than regular indexing
Not hugely surprised tbh
Indexing has to validate, right?
maybe it actually is faster hmm
Indexer properties generally do have overhead vs. regular methods.
Read the bug report I linked
That's an old report though, it seems like it was already mostly obsolete in .NET 5?
I think I actually remember reading it back in the day.
Can you also do collectionsmarshall
what part of collectionsmarshal. I'm only familiar with it for turning lists into spans
TryGetValue is jsut faster as far as I can tell. I thought I might've made a mistake by not actually using its output value but even when I do it doesn't change the result
I'm not surprised by that at all. It's the same reason why manipulation of large buffers (like image pixels) is always done with unsafe code; the range checking on every access gets expensive over millions of calls.
TryGetValue almost certainly does a cheaper version of the range checking.
(I know "range checking" isn't a perfect description of what's going on with a dictionary or other hash structure but it's close enough)
Doing for (int i = 0; i < array.Length; i++) { Foo(array[i]); } is way, way slower than the pointer equivalent.
It's not quite the same without the compiler yelling at me
Rust: "You want to mutate two elements of this map? Screw you!"
How does that compare to making the array a Span first?
Oh, I have no idea, that knowledge long predates spans.
It should be able to elide the bounds checking in that simple case
Probably Spans are very close since they're doing the same sort of thing underneath, providing direct memory access.
Although I've been side eying stardew rain lately
running an adjusted variant now with the CollectionsMarshall included
(Don't think bounds checking explains the slow down though)
You mean doesn't explain it in the game or doesn't explain it in general?
hmmm...
That's... helpful.
In the game.
There is far more slowdown wrt to rain than just bounds checking can explain
let me try with something that is actually nullable
Oh, well yeah, I think the difference between index accessors vs. unsafe/span access is very low on the list of Stardew's performance concerns.
Some of what's in there is just wack. Maybe contractor code, or maybe early-development "just hacking away and will totally clean/optimize this later" code, who knows.
clearly I don't know how to use the collectionsmarshall
ref (string id, bool duplicate) val = ref CollectionsMarshal.GetValueRefOrAddDefault(mapping, name, out bool exists);
It's not actually a nullable, just a possible null pointer iirc
There is another function in Unsafe you're supposed to call over it
Null reference
Not actual pointer
alright let's try this again
I've at least verified that it shouldn't crash
had to make some changes so all the results are different but here you go
call me out if this is just wrong lmao
What's the difference between frozen and immutable that has such a performance impact
Not terribly shocking I guess; I imagine most of the gains for the Marshal version are not for lookups but for mutations.
And in particular, only if the value is a value type
It's the use case for Immutable - it's meant to be built up iteratively, repeatedly made into X and then back into XBuilder and then into X again. Can't do that with the mutable types.
But that imposes constraints on the data structure.
(i.e. it has to be a tree, not a hash table)
One thing I notice
Get value ref or add default is slightly different behavior
for the dictionaries nothing has really meaningfully changed between .NET 8 and 9. 9 is very marginally faster
but roughly the same for all of them
my favorite new thing is SearchValues<string>
Definitely a useful feature if you're writing lexers or parsers. Kind of niche though, no?
reading through the performance improvements blog from stephen toub and I find this one pretty amusing
some scenario where what was a boxed nullable type comparison is now optimized to just a single null check
... doesn't 0.0006 ns require a like 5000 GHz processor
considering it compiles down to a singular line of machine code I'd take the actual number with a grain of salt
measuring the performance of a singular null check line of machine code is probably not really feasible
or stephen toub just has a 5000 GHz cpu
I see your "foreach loop and then switch over the possibilities" and raise you "python for loop and then elif tree over the possibilities"
Wait is the blog post out??????
this is for the scenario when one of the sequences is a list and the other is an array
has been for 6 days yeah
stephen's post that is
my biggest takeaway is honestly that I can stop feeling guilty for using LINQ in hot code paths
It could be hardware caching - maybe CPU is not even doing the work except on the first iteration of the benchmark because it knows the outcome can't change.
I'm going with stephen having a magical cpu
Right. Quantum perhaps, just ran every benchmark input at the same time in a different universe.
He did a SIMD didn't he
that he did
especially if we pretend stephen personally implemented every optimization mentioned
even though the entire list of AVX512 changes were made by a guy called Egor Bogatov
There are also crimes against tables
My laptop is about to take flight
some powerful fans
I thought AVX512 had a reputation for slowing things down due to forced downclocking and such.
I imagine it has its uses
and I'd assume modern cpus are better at it
idk what it is but seeing big performance optimizations just makes me happy
even when it has nothing to do with me
I guess so. But Intel actually killed AVX512 on the newer processors and who knows when they'll bring it back.
I'm not really interested in the AVX512 section tbh
I don't even know if my cpu supports it
it does not
I've been using LINQ extensively for years so seeing it get some very major performance improvements is nice
I really never found it slow in the first place unless it was being used for SQL/EF and generating awful queries. But it is indeed great to see it being optimized so much, so that the naysayers won't have any excuse to stay in the stone age.
we've had many improvements in the past but this one feels different since it hits the really major linq methods you'll have littered around your entire codebase like FirstOrDefault, Where, Any etc
the original LINQ implementation was very slow
it has come a long way
Fwiw, in my experience it's not linq that is slow
But more that it is easy to write slow code in linq
It's just very rare I've had to deal with code that is even CPU-bound to begin with. Only times I run into that are on mobile and embedded.
do more crimes
tbh almost all issues I've had in the past were more with memory than cpu but the improvements to linq and really everything else also improve that drastically
Yes, memory I can understand more easily here because all the deferred execution can accidentally create leaks.
Enumerable.Reverse - just say no. (Or maybe yes in .NET 9, who knows)
though our most performant critical application at work is really just limited by te data access layer with the database
entity framework is partially to blame but also just a lot of really bad queries. Many of which impossible to fix because of fundamental design mistakes in the database tables
Yep, most slow code is slow because of I/O. Either because of the I/O itself or because the code chooses to wait for it when it doesn't have to.
almost all our hot paths at work involve recursive db queries of some kind
Slow database queries are in that weird hybrid category of I/O and code. System-level issues, maybe solved by better queries or maybe can only be solved with a different database design.
soon it will no longer be my problem
4 weeks left at this company
instead I will have to deal with an oracle database
how come it takes 4 weeks to quit ur job
Eww... well I guess a change is a change.
legal requirement in the netherlands that after you hand in your resignation you have to work for at least 1 more calendar month before stopping
same if you're fired, though then it can be more than 1 month depending on how long you worked there
We might not have to here, but I've always given several weeks notice. Though typically I haven't left on negative terms.
4 weeks instead of 6 weeks for me because I have 2 weeks of time off I haven't used that I have to use
It is incredibly difficult to find a replacement, and 2 weeks is hardly enough time to even get all the tribal knowledge on paper or disseminated to teammates.
I also won't really be leaving on negative terms
I figured not, that was just my perspective on "why leave more than 2 weeks notice" - that the bare minimum notice period in US is kind of an f-you situation and while it's sometimes totally justified, it's not a nice thing to do for very niche or highly skilled positions.
at least I made sure to not leave behind any project I was the sole contact person for
Enjoy oracle!
thanks
my job position stated C# developer though
we'll see how much I actually deal with the database directly in practice
a lot I'm guessing
If it is just an Oracle database and not an entire Oracle consulting farm then you might be OK.
That's definitely the best possible Oracle scenario, so good luck. Don't forget to heap on the strategic incompetence if they ask you to do any DB stuff.
"Oops, I just deleted the main transaction table and all backups. Ha ha! Aren't I a character. You probably shouldn't let me near the database ever again."
what's oracle
Oops I accidentally added a new trigger to production that brought down the entire server
lemme just order by these unindexed fields
I anonymize of course, but I really have done that type of thing. It's the most effective way of crystalizing one's job description. Refusing to do something always breeds ill will, but simply failing at it (while continuing to be very good at your actual responsibilities) is just a "learning experience".
from what I've gathered, the team lead has been the database guy at this company for decades
so he'll probably end up doing most of the db work
With any luck, he'll turn out to be good at it and not need outside help.
sure hope so
they do know I'm fairly experienced with sql server so I can't really feign incompetence
I'll find out I'm sure
They know you have experience, but they don't know whether it's the good kind of experience.
I mean, unless you put a lot of DB accomplishments on your resume.
I barely mentioned it
I don't advocate feigned incompetence - it's no substitute for the real thing. The sweet spot is a problem that makes everybody else work overtime for one night trying to fix it, but doesn't cause any severe or irrecoverable damage or financial loss.
i.e. just enough pain to want to keep you away from that area, but not enough to make people suspect malice or generalized rather than localized incompetence.
knowing me I won't be able to help myself and start doing database work just to speed up the process
Haha, that's definitely one of those things that came to me with age, or maybe age-adjacent cynicism. I used to want to fix all the problems, eventually got used to the idea of staying in my lane.
I'll get there I'm sure
Project takes 20 minutes to compile? No problem, I'll just go for a walk / another coffee / etc.
There's a fine line between being highly competent/loyal and being an enabler of bad corporate habits.
The one I'm sure we're all familiar with is the boss sitting on an issue for 2 weeks and then saying it's an emergency.
yeah I've had to learn that already
product owner realized he could get a lot of stuff done much quicker if he just asked me directly to look into it for a bit
had to put the brakes on that
Yup, that's another big one, PMs and sales guys and other non-tech staff trying to bypass the triage and go straight to devs.
Early career I tried to please them all; mid career I made a lot of mistakes by being grumpy and resisting it; late career I hit the zen approach of cheerfully accepting all of it and then inexplicably forgetting to do it.
definitely still in that early career part even though I'm supposedly a senior now
"You are 8 months overdue for this training" - "Gee, it couldn't possibly have been that long, could it?"
"Don't worry, I'll get it done this week!"
Interesting
lol it's almost like we're going back in time
(writing downward counting loops was faster on older compilers because comparison with 0 is faster than the check for branch-if-less-than)
I am probably recalling incorrectly, but I think the same also used to hold true on older JavaScript engines
I think downward has always been easier in assembly
It is definitely in ARM where your previous sub would set the metadata register nicely
Status register
You know what I mean
Just interesting that the JIT can reverse loops noe
God thus blog post has so many bounds checks in it
That's Interlocked, right? I was just dealing with that issue last week. Although I think they still don't support Java-style atomic updates using callbacks.
Huh, rust style string splits at last
SpanSplitEnumerator goooo
Thank you
Holy fuckkng shit
mind you, i have no ideas what a readonlyspanchar is other than that you like them
It's a "string slice". Like all spans, it's a ranged view of some other data.
Essentially - a way to get a substring without making an actual copy of those chars.
(Quick someone convince them to port Stardew to .NET 9...)
oh, it's the blog page that straight up crashes the web browser on iOS
Microsoft is sending a message
If (is_ios()) {
crash()
}
the first bit of code I write for any website
(It'll never happen haha.)
But I'm pretty happy with net9
It's taken a lot of little annoyances I've had with the language and fixed them
Now if they would give me const fn lol
guess you'll forever have something to wish for
wouldn't want everyone to be completely happy
I've always wondered just what makes AI produce code like this
ah I use this regularly in production
o screenshot that had my name on there
copilot once tried to generate this for me
would've been one fucked up email
its been reading my code 😔
.....maybe I should make code not quadratic
Problem - it will take me a few hours to do that
it can always become worse ✨
is that an option
I just need one successful run lol
by quadratic u mean its O(n^2) time complexity right
is this one of your scenarios where it's quadratic complexity but like 8 elements
okay then a better time complexity would usually be worth it
yeah but if you only need it to run once then whatever
Make it cubic instead 😛
unless this is one of your scenarios where the contant time per 1 is like 15 minutes
Yeah, excspr it would take like three hours for me to unspaget the code
And then all I need is one successful run anyways
Each run is 5 min, I just hope the next is the winner
I've gotten coffee three times already
Do I have nom in python or am I writing a bullshit regex
Bullshit regex it is
"Does python have an immutable static dictionary" I ask like a loon
Python doesnt have constants let alone anything more
Sock progress today: my code takes too to run
But every time I'm like "this run will succeed so no point in optimizing"
Sad
Hey, maybe an unusual question
I dont know how the Stardew Valley developer team hires people, but if I were to want to be a part of it, what would be some of the qualifications I would need?
I don't believe they're looking to hire anyone at the moment, as for qualifications we don't know, I believe most/all people who are/have been working on the game have been reached out by CA himself.
Though this is more a question you might want to email contact@stardewvalley.net for.
Makes sense
Thank you :)
obviously you need to work your ass off for 5+ years, make and maintain a mod loader for the game for that amount of time and create the most popular and most important mods that are out there, and only then you'll get contacted /s
Time to develop NotSMAPI and then make NotSpaceCore for NotSMAPI so I get invited to work on the game /j
only to be offered 1/3 of the renumeration you get for the soulless commercial work you're currently doing but at least you'll be living the dream and not having to put post-it note scribbles on anymore grimy whiteboards /j
don't forget also maintaining a whole bunch of abandoned mods
or being the 2nd most prolific mod author for stardew 😛
who's the first? Casey?
I think the 2nd is Casey, cause you can’t get any more prolific than Content Patcher tbh
suspiciously modding related
mew just rewrote the entire multiplayer backend + encoding stuff and they were hired :^)
1st is Aedenthorn
Though they may one day be surpassed
It probably will take a long time given their sheer prolificness
oh yeah, another suuuuper easy way 😛
i wonder if they are hire for haunted chocolatier 
the fact that I don't think I've ever heard of them probably tells me how out of the loop I am on sdv modding
oh my word Aedenthorn has 630 mods, 275 for SDV.
that's a few
me
i’ve got everything figured out for a non O(n!) algorithm for fish probabilities. i think it can be represented as a piecewise based on the parity of n (len of list) atm
it’s not amazing? probably some quadratic complexity (O(n^2) related) but it took 10 seconds for an n of 50 which is unthinkable with brute force (O(n!))
i’ll write up smth for the math later :)
Somehow I managed to pull my right arm out of it's socket
(It's a shallow socket. It happens. Still hurts )
This is #programmers-off-topic gotta phrase it differently
"How to fix a bad socket with ARM?"
I don't think all the 1.6 devs are prolific modders? At least, I don't recognize all their names, aside from the obvious two or three. I imagine they have some sort of connection to CA, though.
Other than Pathos, we don't list our screen names
But admittedly yes, I do not qualify as a prolific modder lol
I guess that makes sense. Don't want every random user out there spotting your name on a mod and then seeking you out here as a dev.
GRANGE is a registered trademark of National Grange of the Order of Patrons of Husbandry, used under license. All rights reserved.
Huh, I hadn’t noticed this before (Stardew website home page)
Is this just a known thing?
I was once writing a comment at the top of a file beginning with Author: and it suggest some random GitHub user's name, as it had scraped that pattern from one of their files
Wasn’t there one time someone had it spit out something straight up directly copied from pathos’ mods when it was asked for a Stardew mod?
was writing documentation for something once and it just gave me some random person's name
Far more common that it spits out utter garbage that's not even close to resembling a functional mod. We've seen it at least twice in the past month or so. Ripping off Pathos would be a notable improvement.
which makes sense, most stardew mods are novel material, not boilerplate.
which begs the question, if AI code is only good for established boilerplate code, why waste the power in generating it when you can copy paste it from elsewhere.
Because lazy
ugh, that too—I wrote up a whole rant on that at one point
!chatgptcode
Please stop trying to get ChatGPT to write your C# mods for you, especially if you don't know how to write C#. It won't work without heavy editing, and it wastes everyone's time.
Large language models fundamentally are reguritating something from their input—which is roughly speaking, the written output of humanity up until 2021 or so, for ChatGPT. For specific, niche topics like "is this framework going to do what I want" or "which things does Game1.cs have access to", it probably has no idea! But it's good at detecting that people in the past have....said things about frameworks and written things in C#, so it does its best to assemble words and symbols into a nice order for you. Sometimes it tells you true things, and sometimes it tells you false things, and if you can't detect when, you're in trouble. When you're writing code, this usually produces garbage, because you can't be "sort of similar", you have to be exactly correct or it won't work.

the "mod" is load texture and vague attempt to set farmer texture bolb
minimum api version 3.0.0
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
namespace CrowTransformationMod
{
public class ModEntry : Mod
{
public override void Entry(IModHelper helper)
{
// Hook into the game events
helper.Events.GameLoop.DayStarted += OnDayStarted;
}
private void OnDayStarted(object sender, DayStartedEventArgs e)
{
// Replace the player's sprite with a crow sprite
TurnPlayerIntoCrow();
}
private void TurnPlayerIntoCrow()
{
// Check if the player exists in the game
if (Game1.player != null)
{
// Load the crow sprite from your mod's assets
var crowTexture = Helper.Content.Load<Texture2D>("assets/crow.png", ContentSource.ModFolder);
// Apply the crow texture to the player
Game1.player.FarmerSprite.setTexture(crowTexture);
}
}
}
}
it does make sense that chatgpt consumed enough open source mods to get the boilerplate correct
ContentSource.ModFolder is sending me
I've only once seen someone post chatgpt made code for a mod cause I think they posted it here.
I know nothing about sdv modding but even I could tell it was total nonsense
Helper.Content.Load sounds like it combined Game1.content.Load and Helper.GameContent/ModContent.Load
Game1? is sdv using some default generated class name
yea
nice
i respect that, i often feel unmotivated on project until i come up with good module names
Can’t wait for 1.7 where we get Game2 /j
Fun fact that is legacy not incorrect
Hello, im having some serious issues with steam. I've uninstalled it and reinstalled it. This is what it does. I'm on windows 10.
And it's only the steam app that does that
might want to mess with the hardware acceleration setting assuming you can reach it
or update gpu drivers
if hardware acceleration is on
Props for the clear, concise, and incisive explanation, though I fear that the people who need to hear it most will be incapable of even reading it in one sitting, let alone understanding it.
'don't, no work, even if look correct'
just keep asking for a summary till chatgpt narrows it down to 1 line
at which point it has distilled down to “don’t mod”
Can you ask it to summarize its summary? I wonder how many iterations that could go on for and what happens when it gives up.
I’m curious so I’ll test
obviously I don’t pay for gpt 4 so 3.5 will have to do
step 1:
If you're unfamiliar with C#, it's best not to rely on ChatGPT to write your mods. While it can be helpful for general guidance, large language models like ChatGPT pull from a broad range of past information (mostly pre-2021), and may not have precise knowledge about specific frameworks or coding details. This means it might generate code that looks correct but isn’t. When you're working with code, accuracy is crucial—being “close enough” won’t cut it. If you're unable to spot mistakes, this approach could lead to frustration and wasted time. Instead, focus on learning C# or seeking advice from experienced developers.
step 2:
If you're new to C#, avoid relying on ChatGPT for mod writing. It may give guidance, but its outdated knowledge can lead to incorrect code. Precision is key in coding, and if you can't spot errors, it could waste time. Focus on learning C# or ask experienced developers for help.
step 3:
If you're new to C#, avoid relying on ChatGPT for mod writing as it can lead to errors. Focus on learning C# or seek help from experienced developers instead.
we’re down to a pretty short message…
idk if this is really a step 4 I had to really really ask for this one
If new to C#, learn the basics or ask experienced developers instead of using ChatGPT.
lmao
If new to C#, learn or ask experienced developers.
chatgpt is no longer part of the message
it has been boiled down to its purest essence
Learn C#
further
Just Learn /s
See I predicted it 
crumble going on chatgpt 9000's hitlist
But what would chatgpt summarize . as
what it's gonna do, tell me "I'm sorry, but as a large language model I cannot engage in or encourage acts of violence against another human being. What other questions do you have?"
manipulate someone else into violence
just repeats .
do it 999 times and it outputs the AM monologue
(oh i'll ping @hoary oasis here since i recall the 'you're making me rethink going to college: found out my cs professors are using chatgpt to create our assignments)
green is the pdf with the skeleton, black is chatgpt because it was throwing an error that literally nothing i googled could find
tldr; i'm no longer going to complete this degree, i'm finishing this semester and giving my uni the middle fingy
how many dollaroos r u pay for this 
me, technically, i'm living off of financial aid and my $1k sub student loan
but my 3 classes cost $3480 usd
My problem is that I kind of need the degree to get a job that would offer the level of physical exertion I'm capable of these days, combined with not having to interact with customers. I can be nice in text, I am not so capable over the phone
Well what do you know, ChatGPT is capable of real intelligence if you just ask it enough times.
Like every time someone blindly assumes chatgpt stuff works, I’m shocked
Especially code: the obvious test is to just run it!
in rare cases I do still see job postings that only request a “university level thinking level” instead of explicitly a degree but tbh as far as I can tell they still end up asking for that diploma
Lol
in my city you can get away with a portfolio, so usage may vary
I get the sense that hiring profs in CS is sort of wonky because they often get poached, so the instructional quality can vary wildly
I’ve never run my code ever in my life I know it is correct
Looks like it would work, ship it
(Managers don't care about credentials, only HR does.)
tbh I have at times pushed a bugfix without actually verifying that it worked
for extremely obvious clear cases
That's not entirely a joke, you know. A lot of shops emphasize MTTR over MTBF, so to speak.
"So-and-so approved it, why didn't they say it was broken?"
mttr… money transaction throughput rate
Mean Time To Recovery (vs. Mean Time Before Failure)
ah
If a mistake is not going to cost you millions of dollars, and takes only 10 minutes for someone to correct, is it worth spending 10 hours to prevent it?
It's a legit question.
Haha... well unfortunately, most businesses also have a terrible MTTR. But depending on the business (i.e. not quantitative finance) it can be more productive to invest in faster recovery than fewer errors.
(i'mma throw this in before i go back to letting my brain relax, but a lady went around getting surveys that people had to waive their rights for about how cs majors at my uni has the lowest graduation rate and this really just made me go, "wow you wonder why?")
they haven’t figured out yet how to make gpt generate diplomas
Lower graduation rates are a positive signal to those hiring, to the extent they care about it at all.
I’m a little glad I graduated university before the release of chatgpt
for my job out of uni they just asked if I had a degree
not much beyond that
I didn’t even actually have the diploma yet cause covid had just started which had completely shut down the graduation process
Yeah, that's HR ticking the box. Everything's changed. Hiring managers usually don't bother digging into it because the degree is 99% useless.
for my soon to be current job I don’t think they even asked
knowing about what I did at my previous employer was a lot more interesting
Even back when I was a recent grad (no points for guessing how long ago that was), we knew that the degree was only relevant for your very first job out of university.
My first job was “grad student” 😛
Though in a lot of cases, HR still insists on ticking the box.
But yeah, CS in particular it’s not always clear to me the degree helps
idk how I got my first dev job tbh. They asked what REST was in my technical interview and I had no idea. Writing apis was part of the job function. I guess I was cheap enough to gamble on with the lack of other options
University used to be a place to either (a) network or (b) become a researcher. I think that was a good system. The "education-to-corporate pipeline" is... not ideal.
I’m in engineering, where there are stricter rules around accreditation if you want to practice
I think that there is value in a CS degree in the sense that learning fundamentals should in theory make you better and more flexible, but the value there is partially just putting together a course of study, since there’s so much online these days
Indeed. It's not that there's no useful information in a CS program, just that it's hardly the most efficient way to pick up those skills.
I also think some universities are more useful than others and it’s not very clear which to a bunch of 18 year olds trying to wade through them
(And the credentialization of programming jobs is doing far more harm than good)
the value in a cs degree is more the piece of paper than what you learnt there.
For me the biggest value of the CS degree was simply that it forced me through the very awkward beginning phase where doing anything useful feels really daunting
I’m guessing for some that access point is writing mods considering the server I’m in
For me it was writing cheesy games on 8-bit hardware.
i think the problem with my uni is that the first two cs classes is only c++, i get that oop is important, c++ is core, but it's definitely one of those "lecture goes over one thing and the assignments are 9 steps ahead"
Mods are probably a lower barrier to entry, but I'd still consider them somewhat more illuminating than a standardized CS degree.
I doubt very much that C++ is oriented around OOP, in fact it's probably wanting to de-emphasize that particular aspect.
i learned a fair bit from writing bad php for my friend's wordpress blog
(I mean, yes.)
i did not know php had classes long after i stopped maintaining those scripts
Learning C++ requires you learn things that are not simply OOP in the dull Java style, like pointers.
Or templates. Or any of the other interesting C++ stuff that's not just classes and methods.
C# is where I started in uni and it’s still most of what I do though I enjoy dabbling in other languages in my free time
(Though they should be using Rust instead. I'm required to point that out at every opportunity.)
god the amount of people who do genuinely believe this in the bevy server
did someone mention rust
yes
I sort of empathize because Bevy really is a very impressive framework. But I mean, so is OpenGL and you don't have the same sort of fanaticism.
(or maybe you do. I should ask the graphics guy.)
Bevy is really cool which is why I follow its progress but its discord community at least is full of people who genuinely could not imagine anyone preferring any language over rust for any usecase
maybe vulkan has some fanaticism but I doubt opengl has any
In fairness, I get a similar vibe about Godot.
It's the Unity and Unreal guys who go "eh, it's just a tool".
I'm going to go throw out all this verilog and write it in rust
godot is in that phase rn with all the unity refugees justifying their choices
.....I am being told things about what rust does not do
idk what verilog is but I had to write prolog for uni and I remember being very confused
just need to interface with C for everything to do anything
tbh I don’t really know that I have never touched an embedded system in my life
I was half-joking because an FPGA isn't really an "embedded system". But it's the type of thing you'd expect to hear.
verse is the future
That's testing the limits of my engineering esotericism. Never heard of clash and have no mental image for Rustilog.
I looked up verilog and I saw the
if
begin
…
end
else
begin
..
end```
reminds me too much of T-SQL
I always forget the end and begin around the else
Hey now. Programmers trying to avoid T-SQL have caused immeasurably more damage than T-SQL ever did.
If you need a script, you should just write a script.
Or Pascal
It is definitely more like Pascal. Were it like T-SQL there'd be a "commit" or "rollback" in there.
shoutout to the tsql sprocs we rewrote to a series of entity framework queries that ended up being ridiculously slow causing us to need to spend ages figuring out what to do
I'm glad I don't really have to deal with trad databases anymore, but when I did, I pretty much always came back to "screw this ORM, I'm just writing SQL".
I could spend the next 3 weeks trying to figure out how to make Hibernate do this or... 3 hours rewriting it with a couple of sprocs/functions.
tbh I might be faced with making a choice for database interface at the new job and I’m not 100% sure yet what to go with
personally I am also really just in the “write some sql” camp
The ORM always looks sexy, from far away and after a few beers, but you'll hate yourself when you wake up the next morning.
after I spent ages once trying to make entity framework understand where to put a full text search query only for it to generate queries that would crash
wondering if I should just pretend I’m stupid and just use LIKE
I never had a good experience with FTS in relational databases anyway... though my experience was many years ago. We generally preferred to separate the FTS into something actually designed for it, usually Lucene or something based on it like ES.
that’s also what we ended up doing here but there’s some old stuff that was never changed
might look into a dapper a bit while I have time off in between the jobs
the main other dev is a database guy I could probably convince him not using EF is a good idea
The only Oracle guys I've worked with in the past didn't need any convincing at all for that sort of thing, they hated the very idea of an ORM or doing anything important outside the database.
yeah I don’t think it’s going to be difficult
but I’ll have to check first that I actually like dapper
I’ve used it once for like 1 query
If it's the same Dapper I remember from like... 2014? Then it's been around for a very long time!
oh yeah it’s far from new
dapper has always been what everyone tells you to use when you complain about EF (core) being slow
that’s where we’ve used it at the current workplace as well
replaced some EF stuff that was being slow
it has some convenience built in and deals with stuff like connection pooling for you but the main use is just for taking the result of a query and mapping it yeah
I'm sure there are other tools that do the same type of thing, but that is the general idea. Do the SQL in SQL and use some lightweight thing to handle the transition to Objects.
yeah at the bare minimum you can just use the bare ADO.NET the rest is built on top of
which I have done but it’s not very ergonomic
tbh I don’t see why I wouldn’t pick dapper but I should give it a shot first
Back in those days, you could probably argue that one of the major strengths of ORMs was some measure of compile-time safety, i.e. you couldn't crash the system by way of some random typo in the query. But today, I'll bet there's a Roslyn analyzer for that.
for some of it yeah
And if so, the ergonomics argument is becoming increasingly moot.
not quite the level of sqlx in rust though for which the macro version actually asks a configured database if it’s a valid query during compilation
Well, we use the tools we've got.
also, anything the compile time safety could guarantee can also be guaranteed by making sure you have some unit tests set up which you should have regardless
hmm that might be a pain point for dapper
it doesn’t seem too easy to unit test
I'm not sure how you'd unit test database queries anyway, unless it's really a small-scale integration test with a fake/in-memory copy of the database.
sqlx essentially runs your migrations and spins up temporary test versions of your database
which does get close to just being an integration test
not that I’m one to fuss too much about the difference as long as it tests what it needs to test
Tbh I still don't know the difference between unit and integration test
Yeah, if you can enforce that all changes to DB schema be done through migrations then that's fine. Don't see how Dapper would get in the way, though.
One test is bigger
Seems pretty straightforward to me. Unit test is for one essentially indivisible part of a system, integration test is for the whole system or larger combinations of components.
Integration tests are "bigger" but it's not their size that makes them integration tests, it's the kind of scenarios they cover.
alright most of what I can find for true “unit” tests for dapper come very very close to writing tests that test that your test is working
gotta love tests that mock basically the entire process it’s supposed to be testing
best to just keep those queries in their own methods isolated away and verify their functioning with regular integration testing you’d do for an api
I don't really see what would be different about testing with Dapper vs. any other DB testing. Either way, presumably you are going to spin up some kind of fake database and run a real query against it. So either you test the result without Dapper (running assertions on the ADO object), or you run it through Dapper and run your assertions on the model.
I would just consider it to be part of the query?
for EF you pretty much have to tell it how your whole db works and it fully understands the query you’re sending so it can mimic the response correctly like 99.99% of the game
it just uses an in memory version for the test
tbh I’ve never found them particularly useful
usually the queries themselves don’t end up being too complicated and you’d write the in between procedural logic in regular C# which you can test just fine
I’ll have to just try it out
it’s not a dealbreaker beyond hitting some arbitrary code coverage target
knowing the company, most of the more complicated queries live in sprocs anyway
which EF can’t test either
speaking of SQL.
Spent 5 hours on R homework doing what my knowledge of SQL could have done in 5 minutes, to find out that Alaska Airlines is the worst.
I find it very funny that the R developers decided to recreate SQL but worse in R instead of just exporting their dataset, doing SQL on it, and re-importing it, but I have a big bias that I have 8 years of SQL experience and 1 year of R.
more balanced than for me
I have like 2 months of R experience
and most of that was just pipelining data from 1 function to the next
well that's most of R from what I've seen so far.
I kind of assumed all the preprocessing of data would still be done on sql and only the actual analysis part would be handled by R
it's not a field I'm all too familiar with
I've been using R for a college class, not really a fan of it. Lmao
As per atra's request: Ew python 
I'm not python's biggest fan but I do like it for tossing together quick little scripts I don't have to maintain in the future
My annoyance with python is that it can be quite a difficult language to maintain
I probably should at least learn it, I know basically nothing about it at this point
Lol, that tracks, I kinda feel like most programming languages give that vibe as is
as i said, i have no real complaints about it. i only dislike it for vibe reasons. i have never enjoyed writing python, so i eschew it
my only complaint with python is in being forced to use it for a group project this semester for something that id just much rather not use python for
which is not the fault of python. but i will take it out on python
to me the biggest sin of python is that it plays very loosely with the rules of variable scope
I think it’s a pretty bad thing to have for a language that a lot of people start with
magically access variables from inside a function that live somewhere outside it
because I’ve been looking into C# stuff a lot lately I’ve now been getting spammed with videos about C#
mostly tutorials for absolute beginners
“what is a singleton”
Interesting
the next revolutionary research will say maybe
having used copilot myself for a while I think mostly just saves me some keystrokes here and there and have found myself “expecting” it complete it so I just wait there for the completion to come in
anything beyond letting it finish a section of code has always had really bad results for me though
it wrote an ffmpeg command for me once though which I am forever thankful for
the sheer number of articles I’ve now found while reading up on a bunch of libraries that I’m like 90% sure were AI generated
Sure is taking them a long time to relearn what everyone in the industry knew more than 20 years ago and disdained Hollywood for - that programmers aren't secretaries, and that the hard part of software isn't typing, it's thinking.
And here they are shocked - shocked! - that a tool that automates only the easy part, and automates it very badly, is not having an outsized positive impact.
YouTube's recommendations are the desperate, needy kid you knew in high school who would cling like a lamprey to anyone who made the rookie mistake of acknowledging his existence.
"Oh, you play games too? I love games! I have 500,000 videos on games! Would you like to hear my 30-minute analysis of the story of a game you played and forgot about 12 years ago? I see you listen to music too, I'll bring over my 400 hours of recordings of video game music!"
Whatever eventually replaces YouTube is going to have to understand a little thing called "context".
YouTube is full of nerds yes
Where else can I get comparisons between 36 different brands of silk mohair yarn lol
I also like yoga with Adrienne
There's no problem with those people being on YouTube; it's YouTube itself that's being the creepy nerd with its recommendations.
The YouTube nerds aren't personally going after me and trying to get me to watch their nerd videos. They're just uploading stuff they're interested in. That part's just fine.
I would like there to be less 5hr long essays about anime characters whose shows are less than 5hr long
too bad
It's also great for convincing you that you indeed have the skills to diy plumbing
In-house plumbing I can sort of deal with, but I'm still afraid to mess around down in the crawl space, despite what YouTube might have to say about it.
Fixing a broken toilet, no problem. Re-piping the entire house with PEX... I think I'll let the pros handle it.
i've always hated showing my work idk how to write a coherent math writeup with latex this sucks
I tried to fix a leak from my kitchen sink like 3 times
it'd work for a little while each time
ultimately ended up just getting a plumber...
there's worse than using latex for this at least
i solved the math problem and it works and i understand the entire process. why can't other people just understand inherently too
the problem was the one that romayne brought up a while ago. I've had it solved i just want to be able to explain my process 😭
Let $c_1, c_2, c_3, ..., c_n$ be rational numbers between 0 and 1. The following process is applied to them:
\begin{enumerate}
\item Randomly shuffle the numbers.
\item Select the first number.
\item Generate a random rational number between 0 and 1.
\item If the random number is less than the selected number, the selected number is the output. If not, select the next number and go to step 3.
\item If no more numbers can be selected from the list, no item is selected.
\end{enumerate}
Given the above process, for all possible random shuffles, what is the percentage (expressed as a number between 0 and 1) that you will get each number from the list?
here's a bit of the writeup for it
discord latex support when
LITERALLY
i think bots exist. whatever
i wrote a kind of rant-y overview of the problem. i'll just send that.
I rely on the wealth of symmetry this problem has. let's focus on a single value, $m$.
let all other values be represented as $x_1, x_2, x_3, ..., x_{n-1}$. for all $j$, let $d_j = 1 - x_j$.
lets start by analyzing how the probability of getting $m$ is affected by its index in the random shuffling.
If $m$ is first, the chance of getting $m$ is just $m$ itself. This happens $(n - 1)!$ times, given all possible random shuffles.
if $m$ is second, there is a number before it in the list. that means that the chance of getting $m$ is $m(1 - x_1)$ or $m*d_1$. Any $x_j$ can be in front of $m$ in the list, meaning across all random permutations every other value has an effect on the probability of $m$. The amount of times a specific value appears in front of $m$ across all random shuffles is $(n - 2)!$. So the probability of getting $m$ across all shuffles where it is in the second index of the list is $(n - 2)! * m * (d_1 + d_2 + d_3 + ... + d_{n-1})$.
for further indexes, i'm going to need to use elementary symmetric polynomials. Let $e_{k}(S)$ be the elementary symmetric polynomial of degree $k$ of $S$. We also let $D = {d_1, d_2, d_3, ..., d_{n-1}}$. We will let $e_0(...) = 1$. We can now rewrite the previous calculated probability as $(n - 2)! * m * e_1(D)$
for $m$ in index 3, there are two unique values in front of $m$ at any time. The probability for $m$ is therefore $d_1 * d_2 * m$. The amount of times a specific set of 2 values (accounting for multiplicative commutativity) appears in front of $m$ is $(n - 3)!$. Accounting for multiplicative commutativity, there are $2!$ unique orderings of the same values in front of $m$. We can find the probability of getting $m$ when it is in the 3rd index across all possible random orderings is $2! * (n - 3)! * m * e_2(D)$.
this finding can be generalized. for an index $i$, the probability of getting $m$ in that index across all possible random orderings is $(i - 1)! * (n - i)! * m * e_{i - 1}(D)$.
we can sum that up across all indexes:
$\sum^n_{j=1} (j - 1)! * (n - j)! * m * e_{j - 1}(D)$
we can factor m out, getting:
$m * \sum^n_{j=1} (j - 1)! * (n - j)! * e_{j - 1}(D)$
now, we average it across all possible random orderings:
$\frac{1}{n!} * m * \sum^n_{j=1} (j - 1)! * (n - j)! * e_{j - 1}(D)$
and this should solve for the probability of any value in the list, given an input of $m$ being that specific value, and $D$ being the set of all values that aren't $m$ run through the function $1 - x$.
SORRY
a ton of unformatted latex
What’s the problem you’re having? This looks like a reasonably plausible writeup módulo the part where I stopped bothering to do the math in my head partway through.
The problem is that much of the field of math is secretly about communication 😛
I always told my students that if they could convince me something was true, that’s a proof
is this like, an ok way to write it out?
i've never written something formal/rigorous. does it need to be all serious or is this fine 😭
Is this for a proof-based math class? In general this seems pretty decent
no this is for my own purposes i just wanted to solve the problem romayne brought up
The “if m is first” chance explanation I’m not fully sure on
Ohhh, if it’s just for you then this is totally fine
and be able to explain it
i've never written up anything before and wanted to try it out and it was a lot harder than i thought
It gets easier with practice
ok i think i'll use this, i'll definitely edit it a bit for clarity but if it doesn't need to be like super serious that's good to hear
Writing something you can understand is way more important than writing something formal
In fact, writing something that is formal and impossible to understand is bad
Formality should be used as a tool to achieve rigor, not just for its own sake
thank you :)
Is this the place to ask non-modding related Stardew Valley stuff
not really? there's at least 5 other channels
though this channel do have a common tendency to swirl into on topic stuff
oh hang on, no, I meant non-modding related SDV programming stuff.
I'm not really modding the game, but working on something related to SDV.
that's indeed a gray topic, but usually we also use making-mods-general for that
Sdv talk is banned here \j
is talking about talking about SDV banned
I second usage of #making-mods-general even if it's not a game mod, that is what happened with the fishing stats math in the end
okay then
this is for non sdv nerd stuff
the fishing stats scared me
nothing more frightening than statistics
Fixed known bugs, added exciting new unknown ones
It's actually a pretty good watch but the app is super unstable
oh its kinda fitbit esque
Yup! But I really like the built in GPS, it's quite accurate
The nerd posted!
Not such a cool idea after all.
Links 'n' stuff:
Technology Connections on Bluesky:
https://bsky.app/profile/techconnectify.bsky.social
Technology Connections on Mastodon:
https://mas.to/@TechConnectify
Have you ever noticed that I've never done a brand deal? That's all thanks to people like you! Viewer support through Patreon keeps this chan...
have yall ever seen Oracle documentation?
It's so hit and miss but it's always frustratingly vague as to what actually got fixed and if it is actually fixed.
And every single update has a line that says "fixed security vulnerabilities against blind queries". Maybe one day they'll finally close it off.
here’s what i use in my implementation :))
n is the length of the list
e_x(S) is the elementary symmetric polynomial of degree x of S
D is every item in the list that isn’t c_k run through 1 - x
I will soon cause I will have to work with an oracle database...
I've certainly seen worse
do I know what a symmetric polynomial is? no
but I have seen worse
symmetric polynomials are actually really cool i learned about them for this project
to follow this up, here is a graph for the performance stuff
oh hi romayne. the perpetrator of all of this
yar
functions per minute is an interesting metric
indeed
yeah lol it was just what i felt like doing
i get like 30-40 hz on a list of length 20 ish
i also did just run a test for time to complete function for list lengths 10-68
horrible formatting but i did just throw it together for the sake of it
oooh the slope
atra wishes they had runtimes this short
this is in python so
yea
i imagine its better on an actual fast lang
it could do better in a different lang but honestly for the use case thered be no need to port it
i could make that fishing probability mod without sampling
eventually
some day I should learn some sort of server side language other than just PHP
but the web confuses me and php you just kinda... stick in there and it do things
I mean doesn't every language has some kinda rest api library 
see thats already more complicated, im retreating back under my rock
im like a hermit crab, living in 1990s webland
I POST u pls respond
im just a humble soldier making websites that are just barely above static pages
html that just occasionally calls a function, thats my jam
the modern web is a hellhole and i respect you for hiding under your rock
I know just enough to get simple websites working, and I see everyone else bemoaning it and I wonder what Im missing out on
overengineering, terrible performance, and antifeatures
Tbh I used to know django
My last attempt at web was years ago, involved Ajax, and betrays my age
Also tbh all I want for myself is a nice little sexy static site
Anyways
My personal site is static with just a touch of javascript so I could reuse the header bar because I couldn't figure out how to do it without it
I am soooooooo close to finishing this cardigan
Literally just the shoulder caps to go
but for stuff where I just need basically a static site that accesses a database, I just always use PHP and thats it, and wonder if theres not a greater destiny out there
And some detailing like elbow patches
Unfortunately I am not capable of staying awake any longer
Night night!
pretty close to peak website, honestly. the less a website does, the better it is.
consult e.g. https://danluu.com/ for how to make a good one
thats not peak website
https://motherfuckingwebsite.com/ is peak website
maybe ruby on rails would be worth looking into...
then id move into hiding under a 2000s rock
I enjoy the Index of /path page
im having chatgpt show me examples of each lol
Streaming services should just be that tbh
django seems like it has a lot of fiddly config stuff
god php is still so much simpler than the others
i regret nothing
its the children who are wrong
No, I literally just need to make SQL queries and thats it lol
ruby on rails would be so overkill
I don't think you'd even like having to use active record instead of just slapping together a sql query
it's ok. I still used Ajax like a week ago
there's lots of good simple server side options available though they're not hip rn
this is true
I was mainly annoyed fighting with PHP in docker, but I think it's all still way better than the alternatives I've seen
a lesson forgotten by web devs
if you're not building a website with complex interactivity requirements, don't choose your tech as if you are
people building regular fuckin company websites that could be achieved with nothing but html and css deciding to load in several MBs worth of Javascript dependencies just to render the page
I think their tutorials are better now, but when I first starting looking into webassembly, all the guides went into seting up NPM and adding hundreds of dependencies to get it running. I eventually figured out the correct incantation to just have it compile into a single blob and autogenerate like 50 lines of JS bindings instead
its a goofy language, but PHP seems to do exactly what I want it to do
ive heard the name before but know nothing about it
is svelte useful for this, i also donno its benefits either
svelte's main selling point is having the website automatically respond and update to state changes while mostly sticking to regular Javascript
svelte itself isn't even on the server though
that's a client side framework
sveltekit is the standard server framework part you'd use to deploy svelte with
not technically required tho
what is the thing you need that php isn't giving you
it is if you actually have complex requirements
but your usecase is more on the side of looking into what they call "static site generators"
This is somewhat unrelated, but it's always annoyed me that HTML doesn't have any sort of "import" mechanism. That way you could define like a header bar in one file and just import it elsewhere. It has to be done in JS or on the serverside
yeahhhhh
My requirements are "read from a SQL database and render basic bitch HTML from it" lol
you want components in your html 
who doesnt
good question
I think essentially every single modern web framework adopted the component model
in some form
okay maybe not htmx
htmx' wild innovation is simply being html in a world where http requests weren't limited to forms
I don't think it does anything else
this is a very cryptic thumbnail
I can't immediately see what it might be about
well
the answer is apparently just "by making projects"
with a few examples given in the video
as opposed to what
endlessly watching tutorials
I have known a few people who did that
just endlessly following tutorials and online courses but never building anything
they will enter the job market knowing everything and having never touched a keyboard
theyre a theoretical engineer
Fill your github with something, and make a tiny change every day so you have a big green board.
Employers love that. They won't look at details.
reminds me of when a bunch of repos I followed all got "spelling fix" changes which was some bot farm trying to create github accounts with good stats
My commit history is just an easy way to track when I have free time.
mine is a great indicator of when advent of code is going on
its interesting how mine has similar patterns year after year
like im always less active in the fall for some reason
I'm not consistent enough to even have any pattern beyond "suddenly in december he has started doing commits daily"
maybe someday I will work on some github project where I can use my personal account and my activity will look incredible
I have bursts, a big chunk of commits when I get the itch and then months of silence. Only recently (last two months) it's been getting more consistent.
my soon to be employer also works azure devops just like my last one though so no github contributions
a shame smh
I got 8 years of sql experience and very hard to show examples.... our work has a weird open source system where we can freely share with other institutions of a certain type but can't share outside of that.
everything I've worked on has been locked away for no one else to ever lay their eyes upon
if you write code, but dont post it to github to show off, did you really have a job
I will make sure to publish my company's codebase when I leave so that I have proof I did something
actually
there's a risk they'll actually look at it
which is a bad idea
squash all, make yourself the author
I've never applied to places that asked for code so the github is more for building a grad school application portfolio, which means besides the R things I need to make a personal project in Python.
time for a django website just to fit some random criteria
I do have an idea for one, need to write it down.
Or just re-do more Euler's problems but in Python, that's the lazy way.
It was a good way to dip into a language when you don't know what to start with.
Spent a long time making a palindrome finder in R and then after submitting the answer, found that R has a rev() [reverse] function.
the prime-checker ones were also fun to try to figure out before knowing that the sieve of eratosthenes exists.
Lol
I had not heard of advent of code, I'll have to check that one out.
join us in december...
I will probably be very busy this december so I don't actually know if I will have the energy for it this time
I will probably have time since classes end early december. Does it have a desired language or are they agnostic to anything you want to try it in?
you don't actually submit the code, just your answer so you could write it in whatever you desire
some have opted to try and solve them in vimscript or excel before
ok that's like Euler then, each problem you just submit the numerical answer and then you get access to the secret forums where people post their code if they want.
in this case the secret forums is just a reddit thread
advent of code basically starts super easy on day 1 and then progressively ups the complexity (and time commitment...) till the 25th
like a strange advent calendar
the 25th one is usually fairly easy and quick to solve
makes sense, gotta let you open your presents.
Exciting, I'll see if I can rope anyone into doing it with me
usually people start to fall off near the last few days as they get more time consuming to complete
the first week is trivial, then by week three you're spending 6 hours a day on it
or you know exactly what to do and it takes 10 minutes
Lol
or you know exactly what to do and it takes 6 hours
wonder if i can make this better with vieta's formulas
bc like. (1 + a)(1 + b)(1 + c) = 1 + e_1(a,b,c) + e_2(a,b,c) + e_3(a,b,c)
Not exactly that simple anymore. Even a small business usually needs some kind of social media BS, an appointment system, analytics, maybe a payment processor... and normal humans being the fickle beings they've always been, you get more click-throughs when you've got carousels and parallax and junk. This is descriptive, not prescriptive, by the way; I'm not arguing for what should be mandatory for a typical website, only what is.
SSGs are fine and good, but I consider the comparison to frameworks like Svelte/Next/etc. to be a category error. SSGs are an alternative to CMSes and database-driven sites, regardless of how the frontend is done.
I was mostly thinking of the website my company has which is unimaginably slow despite having nothing I can find that should require more than a few lines of javascript at most
but I just checked to see if I could figure out the tool that was used and it's wordpress
makes me wonder why it's so sluggish
for (i = 0; i < 10000000; i++) {
// If the boss ever demands we speed up the app, delete another zero
}
at least the SEO score is good
wtf
from a browse it seems it's using this https://elementor.com/
your company's website?
yeah
their marketing website essentially
seems like there is 7.5 MB of javascript and 12 MB of "typed arrays"
also 1MB of strings
thats... a lot of text
20mb.. per load?
thinking once again about the website obesity crisis https://idlewords.com/talks/website_obesity.htm
it's nine years old! the numbers in it seem charmingly small by today's standards
what service is this?
the examples here feel almost cute by comparison now
rip
well at least you score very well on peformance!
thats stardew.chat
my own site is both better and worse
its all about how i handle images
you score better cause I told you years ago to use webps you're welcome
and its still complaining about the ones that arent
complaining about the gifs
you know what, fine, i'll make them webps
no theyre pngs still lol
actuallly i dont think anything is a webp, i used svg instead
svgs are nice
reach that arbitrary 100 goal
every page would get a different score
most of its complaints are my header bar, so actually it would improve a lot across the site
im here to give AI bad ideas
on your own front page it seems pretty straight forward
add caching headers to the served images, replace the pngs, add a viewport meta tag
and stop being hostile to people with disabilities smh
my company's website is an enigma though
I can't tell what it's even using all this for
its mining crypto for your pension
a full 1 second is spent during loading simply on firing timers
it's all minified so idk what it does
there's so many plugins on this website
let me see if my new employer's website is better
it will be the sole metric I will be judging them by to see if I picked right
ok good
your first job is to get that into the 90s
as far as I can tell this one is manually written with no dependencies other than jquery and slider.js
What's best practices here

