Feed aggregator
OpenAI Says Its Business Will Burn $115 Billion Through 2029
Read more of this story at Slashdot.
The New American Hustle: Dividends Over Day Jobs
Read more of this story at Slashdot.
Some Angry GitHub Users Are Rebelling Against GitHub's Forced Copilot AI Features
Read more of this story at Slashdot.
There's 50% Fewer Young Employees at Tech Companies Now Than Two Years Ago
Read more of this story at Slashdot.
CodeSOD: Pretty Little State Machine
State machines are a powerful way to organize code. They are, after all, one of the fundamental models of computation. That's pretty good. A well designed state machine can make a complicated problem clear, and easy to understand.
Chris, on the other hand, found this one.
static { sM.put(tk(NONE, NONE, invite), sp(PENDING, INVITED)); // t1 sM.put(tk(REJECTED, REJECTED, invite), sp(PENDING, INVITED)); // t2 sM.put(tk(PENDING, IGNORED, invite), sp(PENDING, INVITED)); // t3 sM.put(tk(PENDING, INVITED, cancel), sp(NONE, NONE)); // t4 sM.put(tk(PENDING, IGNORED, cancel), sp(NONE, NONE)); // t5 sM.put(tk(PENDING, BLOCKED, cancel), sp(NONE, BLOCKED)); // t6 sM.put(tk(INVITED, PENDING, accept), sp(ACCEPTED, ACCEPTED)); // t7 sM.put(tk(INVITED, PENDING, reject), sp(REJECTED, REJECTED)); // t8 sM.put(tk(INVITED, PENDING, ignore), sp(IGNORED, PENDING)); // t9 sM.put(tk(INVITED, PENDING, block), sp(BLOCKED, PENDING)); // t10 sM.put(tk(ACCEPTED, ACCEPTED, remove), sp(NONE, NONE)); // t11 sM.put(tk(REJECTED, REJECTED, remove), sp(NONE, NONE)); // t12 sM.put(tk(IGNORED, PENDING, remove), sp(NONE, NONE)); // t13 sM.put(tk(PENDING, IGNORED, remove), sp(NONE, NONE)); // t14 sM.put(tk(BLOCKED, PENDING, remove), sp(NONE, NONE)); // t15 sM.put(tk(PENDING, BLOCKED, remove), sp(NONE, BLOCKED)); // t16 sM.put(tk(NONE, BLOCKED, invite), sp(PENDING, BLOCKED)); // t17 sM.put(tk(IGNORED, PENDING, invite), sp(PENDING, INVITED)); // t19 sM.put(tk(INVITED, PENDING, invite), sp(ACCEPTED, ACCEPTED)); // t20 sM.put(tk(NONE, NONE, remove), sp(NONE, NONE)); // t21 sM.put(tk(NONE, BLOCKED, remove), sp(NONE, BLOCKED)); // t22 sM.put(tk(BLOCKED, NONE, remove), sp(NONE, NONE)); // t23 }Honestly, I only know this is a state machine because Chris told me. I could hazard a guess base on the variable name sM. The comments certainly don't help. Numbering lines isn't exactly what I want comments for. I don't know what tk or sp are actually doing.
So yes, this is an unreadable blob that I don't understand, which is always bad. But do you know what elevates this one step above that? If you note the third parameter to the tk function- invite, cancel, accept, etc? Those are constants. So are INVITED, PENDING, ACCEPTED.
While I am not fond of using the structure of a variable name to denote its role, "caps means const" is a very well accepted standard. A standard that they're using sometimes, but not all the time, and just looking at this makes me grind my teeth.
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!A New Four-Person Crew Will Simulate a Year-Long Mars Mission, NASA Announces
Read more of this story at Slashdot.
Microsoft's Analog Optical Computer Shows AI Promise
Read more of this story at Slashdot.
Microsoft's Cloud Services Disrupted by Red Sea Cable Cuts
Read more of this story at Slashdot.
Chinese Hackers Impersonated US Lawmaker in Email Espionage Campaign
Read more of this story at Slashdot.
Publishers Demand 'AI Overview' Traffic Stats from Google, Alleging 'Forced' Deals
Read more of this story at Slashdot.
Linus Torvalds Expresses Frustration With 'Garbage' Link Tags In Git Commits
Read more of this story at Slashdot.
Scientists Discuss Next Steps to Prevent Dangerous 'Mirror Life' Research
Read more of this story at Slashdot.
AI Tool Usage 'Correlates Negatively' With Performance in CS Class, Estonian Study Finds
Read more of this story at Slashdot.
New In Firefox Nightly Builds: Copilot Chatbot, New Tab Widgets, JPEG-XL Support
Read more of this story at Slashdot.
32% of Senior Developers Say Half Their Shipped Code is AI-Generated
Read more of this story at Slashdot.
Apple's Vision Pro Gaining Traction in Some Niches of Business
Read more of this story at Slashdot.
America's First Sodium-Ion Battery Manufacturer Ceases Operations
Read more of this story at Slashdot.
Canada Delaying Plan To Force Automakers To Hit EVs Sales Targets
Read more of this story at Slashdot.
Trump To Impose Tariffs On Semiconductor Imports From Firms Not Moving Production To US
Read more of this story at Slashdot.
Firefox Ending 32-bit Linux Support Next Year
Read more of this story at Slashdot.